diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h index 9f5b6e613..a7c99288e 100644 --- a/Classes/IncallViewController.h +++ b/Classes/IncallViewController.h @@ -26,20 +26,16 @@ @interface IncallViewController : UIViewController { - UIView* controlSubView; + UIView* controlSubView, *callControlSubView; - UILabel* peerName; - UILabel* peerNumber; - UIDuration* callDuration; - UILabel* status; - UIHangUpButton* endCtrl; + UIButton* endCtrl; UIButton* dialer; UIMuteButton* mute; UIPauseResumeButton* pause; UISpeakerButton* speaker; UIButton* contacts; UITableView* callTableView; - UIButton* addCall, *mergeCalls; + UIButton* addCall, *mergeCalls, *addToConf; //key pad @@ -57,7 +53,6 @@ UIDigitButton* star; UIDigitButton* zero; UIDigitButton* hash; - UIHangUpButton* endPad; UIButton* close; bool dismissed; @@ -66,20 +61,18 @@ ABPeoplePickerNavigationController* myPeoplePickerController; - UITableViewCell* selectedCell; + LinphoneCall* selectedCall; } -(void)displayStatus:(NSString*) message; - (IBAction)doAction:(id)sender; + @property (nonatomic, retain) IBOutlet UIView* controlSubView; +@property (nonatomic, retain) IBOutlet UIView* callControlSubView; @property (nonatomic, retain) IBOutlet UIView* padSubView; -@property (nonatomic, retain) IBOutlet UILabel* peerName; -@property (nonatomic, retain) IBOutlet UILabel* peerNumber; -@property (nonatomic, retain) IBOutlet UILabel* callDuration; -@property (nonatomic, retain) IBOutlet UILabel* status; @property (nonatomic, retain) IBOutlet UIButton* endCtrl; @property (nonatomic, retain) IBOutlet UIButton* dialer; @property (nonatomic, retain) IBOutlet UIButton* mute; @@ -89,7 +82,7 @@ @property (nonatomic, retain) IBOutlet UITableView* callTableView; @property (nonatomic, retain) IBOutlet UIButton* addCall; @property (nonatomic, retain) IBOutlet UIButton* mergeCalls; - +@property (nonatomic, retain) IBOutlet UIButton* addToConf; @property (nonatomic, retain) IBOutlet UIButton* one; @property (nonatomic, retain) IBOutlet UIButton* two; @@ -104,5 +97,4 @@ @property (nonatomic, retain) IBOutlet UIButton* zero; @property (nonatomic, retain) IBOutlet UIButton* hash; @property (nonatomic, retain) IBOutlet UIButton* close; -@property (nonatomic, retain) IBOutlet UIButton* endPad; @end diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index 5e46d5aad..96b339ef2 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -26,12 +26,10 @@ @synthesize controlSubView; +@synthesize callControlSubView; @synthesize padSubView; -@synthesize peerName; -@synthesize peerNumber; -@synthesize callDuration; -@synthesize status; +@synthesize addToConf; @synthesize endCtrl; @synthesize close; @synthesize mute; @@ -55,7 +53,6 @@ @synthesize star; @synthesize zero; @synthesize hash; -@synthesize endPad; /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. @@ -112,9 +109,13 @@ int callCount(LinphoneCore* lc) { [hash initWithNumber:'#']; [addCall addTarget:self action:@selector(addCallPressed) forControlEvents:UIControlEventTouchDown]; - [mergeCalls addTarget:self action:@selector(mergeCallsPressed) forControlEvents:UIControlEventTouchDown]; + [mergeCalls addTarget:self action:@selector(mergeCallsPressed) forControlEvents:UIControlEventTouchDown]; + [endCtrl addTarget:self action:@selector(endCallPressed) forControlEvents:UIControlEventTouchUpInside]; + [addToConf addTarget:self action:@selector(addToConfCallPressed) forControlEvents:UIControlEventTouchUpInside]; [mergeCalls setHidden:YES]; + + selectedCall = nil; } -(void) addCallPressed { @@ -123,19 +124,20 @@ int callCount(LinphoneCore* lc) { -(void) mergeCallsPressed { LinphoneCore* lc = [LinphoneManager getLc]; - const MSList* calls = linphone_core_get_calls(lc); - while (calls != 0) { - LinphoneCall* call = (LinphoneCall*)calls->data; - if (!isInConference(call)) { - linphone_core_add_to_conference(lc, call); - } - calls = calls->next; - } + linphone_core_add_all_to_conference(lc); } +-(void) addToConfCallPressed { + if (!selectedCall) + return; + linphone_core_add_to_conference([LinphoneManager getLc], selectedCall); +} + + + -(void)updateCallsDurations { - [callTableView reloadData]; + [self updateUIFromLinphoneState: nil]; } -(void)viewDidAppear:(BOOL)animated { @@ -148,7 +150,6 @@ int callCount(LinphoneCore* lc) { selector:@selector(updateCallsDurations) userInfo:nil repeats:YES]; - selectedCell = nil; } } @@ -156,7 +157,7 @@ int callCount(LinphoneCore* lc) { if (durationRefreasher != nil) { [durationRefreasher invalidate]; durationRefreasher=nil; - selectedCell = nil; + selectedCall = nil; } } @@ -166,9 +167,7 @@ int callCount(LinphoneCore* lc) { } -(void) displayStatus:(NSString*) message; { - [status setText:message]; - - [callTableView reloadData]; + [self updateUIFromLinphoneState: nil]; } -(void) displayPad:(bool) enable { @@ -178,18 +177,9 @@ int callCount(LinphoneCore* lc) { -(void) displayCall:(LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { //restaure view [self displayPad:false]; - - if (displayName && [displayName length]>0) { - [peerName setText:displayName]; - [peerNumber setText:username]; - } else { - [peerName setText:username]; - [peerNumber setText:@""]; - } - [callDuration setText:@"Calling"]; - dismissed = false; + dismissed = false; - [callTableView reloadData]; + [self updateUIFromLinphoneState: nil]; } -(void) displayIncomingCall:(LinphoneCall *)call NotificationFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName { @@ -198,27 +188,45 @@ int callCount(LinphoneCore* lc) { -(void) displayInCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { dismissed = false; - [callTableView reloadData]; + selectedCall = call; + [self updateUIFromLinphoneState: nil]; } -(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [callDuration stop]; [self dismissModalViewControllerAnimated:true]; dismissed = true; - [callTableView reloadData]; + [self updateUIFromLinphoneState: nil]; } -(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl { [mute reset]; [pause reset]; - if (callCount([LinphoneManager getLc]) > 1) { - [pause setHidden:YES]; - [mergeCalls setHidden:NO]; - } else { - [pause setHidden:NO]; - [mergeCalls setHidden:YES]; + LinphoneCore* lc; + + @try { + lc = [LinphoneManager getLc]; + + if (callCount([LinphoneManager getLc]) > 1) { + [pause setHidden:YES]; + [mergeCalls setHidden:NO]; + } else { + [pause setHidden:NO]; + [mergeCalls setHidden:YES]; + } + + [callTableView reloadData]; + } @catch (NSException* exc) { + return; } - [callTableView reloadData]; + // hide call control subview if no call selected + [callControlSubView setHidden:(selectedCall == NULL)]; + // hide add to conf if no conf exist + if (!callControlSubView.hidden) { + [addToConf setHidden:(linphone_core_get_conference_size(lc) == 0 || + isInConference(selectedCall))]; + } + // hide pause/resume if in conference + [pause setHidden:linphone_core_is_in_conference(lc)]; } - (IBAction)doAction:(id)sender { @@ -261,14 +269,19 @@ int callCount(LinphoneCore* lc) { - (void)dealloc { - [super dealloc]; + [super dealloc]; } -(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf{ const MSList* calls = linphone_core_get_calls([LinphoneManager getLc]); - while (calls != 0 && index > 0) { + if (!conf && linphone_core_get_conference_size([LinphoneManager getLc])) + index--; + + while (calls != 0) { if (isInConference((LinphoneCall*)calls->data) == conf) { + if (index == 0) + break; index--; } calls = calls->next; @@ -284,7 +297,7 @@ int callCount(LinphoneCore* lc) { -- (void) updateCell:(UITableViewCell*)cell withCall:(LinphoneCall*) call conferenceActive:(bool)confActive{ +- (void) updateCell:(UITableViewCell*)cell at:(NSIndexPath*) path withCall:(LinphoneCall*) call conferenceActive:(bool)confActive{ if (call == NULL) { ms_error("UpdateCell called with null call"); [cell.textLabel setText:@"BUG IN APP - call is null"]; @@ -314,20 +327,57 @@ int callCount(LinphoneCore* lc) { [ms appendFormat:@"%s", linphone_call_state_to_string(linphone_call_get_state(call)), nil]; } [cell.detailTextLabel setText:ms]; + - - if (linphone_core_get_current_call([LinphoneManager getLc]) == call) + if (linphone_core_get_current_call([LinphoneManager getLc]) == call) { cell.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:0.5]; - else if (confActive && isInConference(call)) - cell.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:0.5]; - else - cell.backgroundColor = [UIColor colorWithRed:1 green:0.5 blue:0 alpha:0.5]; - + } else if (confActive && isInConference(call)) { + cell.backgroundColor = [UIColor colorWithRed:0 green:0 blue:1 alpha:0.5]; + } else{ + cell.backgroundColor = [UIColor colorWithRed:1 green:0.5 blue:0 alpha:0.5]; + } - /*if (cell == selectedCell) + if (call == selectedCall) { + // [cell setSelected:YES animated:NO]; cell.accessoryType = UITableViewCellAccessoryCheckmark; + }else{ + //[cell setSelected:NO animated:NO]; + cell.accessoryType = UITableViewCellAccessoryNone; + } +} + +-(void) updateConferenceCell:(UITableViewCell*) cell at:(NSIndexPath*)indexPath { + [cell.textLabel setText:@"Conference"]; + + LinphoneCore* lc = [LinphoneManager getLc]; + + cell.accessoryType = UITableViewCellAccessoryNone; + + NSMutableString* ms = [[NSMutableString alloc] init ]; + const MSList* calls = linphone_core_get_calls(lc); + while (calls) { + LinphoneCall* call = (LinphoneCall*)calls->data; + if (isInConference(call)) { + const LinphoneAddress* addr = linphone_call_get_remote_address(call); + + const char* n = linphone_address_get_display_name(addr); + if (n) + [ms appendFormat:@"%s ", n, nil]; + else + [ms appendFormat:@"%s ", linphone_address_get_username(addr), nil]; + + + if (call == selectedCall) + cell.accessoryType = UITableViewCellAccessoryCheckmark; + } + calls = calls->next; + } + [cell.detailTextLabel setText:ms]; + + if (linphone_core_is_in_conference(lc)) + cell.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:0.5]; else - cell.accessoryType = UITableViewCellAccessoryNone;*/ + cell.backgroundColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:0.5]; } @@ -340,12 +390,17 @@ int callCount(LinphoneCore* lc) { } LinphoneCore* lc = [LinphoneManager getLc]; - if (indexPath.section == 0 && linphone_core_get_conference_size(lc) > 0) - [self updateCell:cell withCall: [self retrieveCallAtIndex:indexPath.row inConference:true] conferenceActive:linphone_core_is_in_conference(lc)]; + if (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0) + [self updateConferenceCell:cell at:indexPath]; else - [self updateCell:cell withCall: [self retrieveCallAtIndex:indexPath.row inConference:false] + [self updateCell:cell at:indexPath withCall: [self retrieveCallAtIndex:indexPath.row inConference:NO] conferenceActive:linphone_core_is_in_conference(lc)]; + cell.userInteractionEnabled = YES; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + cell.selectionStyle = UITableViewCellSelectionStyleBlue; + + /*NSString *path = [[NSBundle mainBundle] pathForResource:[item objectForKey:@"imageKey"] ofType:@"png"]; UIImage *theImage = [UIImage imageWithContentsOfFile:path]; @@ -359,6 +414,8 @@ int callCount(LinphoneCore* lc) { { LinphoneCore* lc = [LinphoneManager getLc]; + return callCount(lc) + (int)(linphone_core_get_conference_size(lc) > 0); + if (section == 0 && linphone_core_get_conference_size(lc) > 0) return linphone_core_get_conference_size(lc) - linphone_core_is_in_conference(lc); @@ -367,6 +424,7 @@ int callCount(LinphoneCore* lc) { // UITableViewDataSource - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { + return 1; LinphoneCore* lc = [LinphoneManager getLc]; int count = 0; @@ -387,10 +445,11 @@ int callCount(LinphoneCore* lc) { // UITableViewDataSource - (NSString*) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { + return @"Calls"; if (section == 0 && linphone_core_get_conference_size([LinphoneManager getLc]) > 0) - return @"CONF"; + return @"Conference"; else - return @"CALLS"; + return @"Calls"; } // UITableViewDataSource @@ -401,18 +460,51 @@ int callCount(LinphoneCore* lc) { - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - //selectedCell = [tableView cellForRowAtIndexPath:indexPath]; + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + + LinphoneCore* lc = [LinphoneManager getLc]; - bool inConf = (indexPath.section == 0 && linphone_core_get_conference_size([LinphoneManager getLc]) > 0); + [[callTableView cellForRowAtIndexPath:indexPath] setSelected:YES animated:NO]; + + bool inConf = (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0); + + selectedCall = [self retrieveCallAtIndex:indexPath.row inConference:inConf]; if (inConf) { + if (linphone_core_is_in_conference(lc)) + return; + LinphoneCall* current = linphone_core_get_current_call(lc); + if (current) + linphone_core_pause_call(lc, current); linphone_core_enter_conference([LinphoneManager getLc]); - } else { - LinphoneCall* call = [self retrieveCallAtIndex:indexPath.row inConference:NO]; - linphone_core_resume_call([LinphoneManager getLc], call); + } else if (selectedCall) { + if (linphone_core_is_in_conference(lc)) { + linphone_core_leave_conference(lc); + } + linphone_core_resume_call([LinphoneManager getLc], selectedCall); } [self updateUIFromLinphoneState: nil]; } +-(void) endCallPressed { + if (selectedCall == NULL) { + ms_error("No selected call"); + return; + } + + LinphoneCore* lc = [LinphoneManager getLc]; + if (isInConference(selectedCall)) { + linphone_core_terminate_conference(lc); + /* + linphone_core_remove_from_conference(lc, selectedCall); + if ((linphone_core_get_conference_size(lc) - (int)linphone_core_is_in_conference(lc)) == 0) + linphone_core_terminate_conference(lc); + */ + } else { + linphone_core_terminate_call(lc, selectedCall); + } + selectedCall = NULL; +} + @end diff --git a/Classes/IncallViewController.xib b/Classes/IncallViewController.xib index 56393e2cd..ee5b5db69 100644 --- a/Classes/IncallViewController.xib +++ b/Classes/IncallViewController.xib @@ -12,11 +12,10 @@ YES - IBUIButton IBUIViewController IBUITableView IBUIView - IBUILabel + IBUIButton IBProxyObject @@ -49,177 +48,513 @@ {320, 182} - + _NS:418 - - 10 - - 549453824 - {512, 1} - - YES - - YES - - - - TU0AKgAACAjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ -y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P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LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ -xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ -xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ -xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ -xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ -xczS/8vS2P/L0tj/xczU/wANAQAAAwAAAAECAAAAAQEAAwAAAAEAAQAAAQIAAwAAAAQAAAiqAQMAAwAA -AAEAAQAAAQYAAwAAAAEAAgAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEABAAAARYAAwAA -AAEAAQAAARcABAAAAAEAAAgAARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAQAAAiyAAAAAAAI -AAgACAAIAAEAAQABAAE - - - - - - 3 - MCAwAA - - - groupTableViewBackgroundColor + + 3 + MQA YES IBCocoaTouchFramework YES NO - 1 - 2 + 1 0 + YES YES 44 - 10 - 10 + 22 + 22 - + - -2147483356 - {320, 55} - - - - NO - YES - NO - IBCocoaTouchFramework - Caller - - 1 - MCAwIDAAA + 292 + + YES + + + 292 + {{119, -4}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Pau. Res. + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + 3 + MC41AA + + + NSImage + mic_active.png + + + NSImage + pausecall.png + + + NSImage + mic_muted.png + + + + 2 + 10 + + + Helvetica-Bold + 10 + 16 + + + + + 292 + {{26, -4}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Add to conf + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + + + 2 + 14 + + + Helvetica-Bold + 14 + 16 + + + + + 292 + {{27, 56}, {262, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + NSImage + stopcall-red.png + + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + - - 1 - 17 - 1 - - 1 - 17 + {{0, 312}, {320, 148}} + + + + _NS:196 + + 3 + MC42NjY2NjY2NjY3AA - - Helvetica - 17 - 16 + NO + NO + IBCocoaTouchFramework + + + + -2147483356 + + YES + + + 292 + {{95, 244}, {82, 37}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + hide + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{95, 184}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 0 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{5, 9}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 1 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{95, 9}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 2 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{185, 9}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 3 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{5, 69}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 4 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{95, 69}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 5 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{185, 69}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 6 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{5, 124}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 7 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{95, 124}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 8 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{185, 124}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + 9 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{5, 184}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + * + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + + + 292 + {{185, 184}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + # + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + - - - - -2147483356 - {{31, 63}, {61, 21}} + {{24, 72}, {272, 317}} - + + NO - YES - NO + NO IBCocoaTouchFramework - Number - - - 1 - 10 - - - - - - -2147483356 - {{239, 63}, {65, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - Duration - - - 1 - 10 - - - - - - -2147483356 - {{31, 347}, {258, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - status - - - 1 - 10 - - 292 YES + + + 292 + {{119, 55}, {82, 52}} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Merge + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + + + 2 + 17 + + + Helvetica-Bold + 17 + 16 + + 292 - {{0, 68}, {82, 52}} + {{25, 0}, {82, 52}} @@ -230,42 +565,30 @@ AAgACAAIAAEAAQABAAE 0 1 Mute - - 3 - MQA - + 1 MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - 3 - MC41AA - - - NSImage - mic_active.png - - - - NSImage - mic_muted.png - - - + + + + + + 2 2 - + Helvetica-Bold 18 16 - + 292 - {{0, 122}, {82, 52}} + {{25, 54}, {82, 52}} @@ -282,128 +605,23 @@ AAgACAAIAAEAAQABAAE MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - + NSImage startcall-green.png - - - - - - - - 292 - {{94, 133}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Pau. Res. - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - NSImage - pausecall.png - - - - - 2 - 10 - - - Helvetica-Bold - 10 - 16 - - - - - 292 - {{90, 122}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Merge - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - - - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - - - - 292 - {{6, 261}, {258, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - stopcall-red.png - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 - + + + + 292 - {{181, 122}, {82, 52}} + {{206, 54}, {82, 52}} - + NO NO IBCocoaTouchFramework @@ -421,13 +639,13 @@ AAgACAAIAAEAAQABAAE NSImage contact-orange.png - - + + 292 - {{91, 68}, {82, 52}} + {{116, 0}, {82, 52}} @@ -448,16 +666,16 @@ AAgACAAIAAEAAQABAAE NSImage dialer-orange.png - - + + 292 - {{181, 68}, {82, 52}} + {{206, 0}, {82, 52}} - + NO NO IBCocoaTouchFramework @@ -475,361 +693,15 @@ AAgACAAIAAEAAQABAAE NSImage Speaker-32-off.png - - + + - {{25, 110}, {270, 317}} + {{0, 191}, {320, 113}} - - 3 - MSAwAA - - 2 - - - NO - NO - IBCocoaTouchFramework - - - - -2147483356 - - YES - - - 292 - {{30, 258}, {80, 65}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - - 292 - {{170, 266}, {72, 37}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - close - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{90, 184}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{0, 9}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{90, 9}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 2 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{180, 9}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 3 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{0, 69}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 4 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{90, 69}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 5 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{180, 69}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 6 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{0, 124}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 7 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{90, 124}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 8 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{180, 124}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - 9 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{0, 184}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - * - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - 292 - {{180, 184}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - # - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - {{25, 110}, {270, 317}} - - - - - 3 - MSAwAA - - + NO NO IBCocoaTouchFramework @@ -866,38 +738,6 @@ AAgACAAIAAEAAQABAAE 23 - - - peerName - - - - 89 - - - - peerNumber - - - - 90 - - - - callDuration - - - - 91 - - - - status - - - - 94 - callTableView @@ -908,51 +748,11 @@ AAgACAAIAAEAAQABAAE - contacts + eight - + - 84 - - - - speaker - - - - 82 - - - - dialer - - - - 49 - - - - mute - - - - 80 - - - - endCtrl - - - - 99 - - - - controlSubView - - - - 44 + 75 @@ -962,14 +762,6 @@ AAgACAAIAAEAAQABAAE 58 - - - eight - - - - 75 - seven @@ -1058,14 +850,6 @@ AAgACAAIAAEAAQABAAE 51 - - - endPad - - - - 98 - padSubView @@ -1076,11 +860,27 @@ AAgACAAIAAEAAQABAAE - addCall + callControlSubView - + - 112 + 117 + + + + endCtrl + + + + 99 + + + + pause + + + + 115 @@ -1092,11 +892,59 @@ AAgACAAIAAEAAQABAAE - pause + addCall - + - 115 + 112 + + + + contacts + + + + 84 + + + + speaker + + + + 82 + + + + dialer + + + + 49 + + + + mute + + + + 80 + + + + controlSubView + + + + 44 + + + + addToConf + + + + 119 @@ -1178,110 +1026,23 @@ AAgACAAIAAEAAQABAAE YES - - - - - + + - - 10 - - - peerName - - - 11 - - - peerNumber - - - 12 - - - duration - - - 93 - - - status - 106 - - 26 - - - YES - - - - - - - - - - - controls - - - 111 - - - addcall - - - 104 - - - merge - - - 15 - - - contacts - - - 13 - - - speaker - - - 17 - - - dialer - - - 16 - - - mute - - - 18 - - - end - 27 YES - @@ -1299,18 +1060,18 @@ AAgACAAIAAEAAQABAAE pad - - 32 - - - 9 - 33 8 + + 32 + + + 9 + 34 @@ -1378,17 +1139,86 @@ AAgACAAIAAEAAQABAAE close - 28 - - + 116 + + + YES + + + + + + callcontrols + + + 18 + + end 113 - - + + pauseresume + + 118 + + + addtoconf + + + 26 + + + YES + + + + + + + + + controls + + + 104 + + + merge + + + 111 + + + addcall + + + 15 + + + contacts + + + 13 + + + speaker + + + 17 + + + dialer + + + 16 + + + mute + @@ -1399,28 +1229,23 @@ AAgACAAIAAEAAQABAAE -1.IBPluginDependency -2.CustomClassName -2.IBPluginDependency - 10.IBPluginDependency 104.IBPluginDependency 106.IBPluginDependency - 11.IBPluginDependency 111.IBPluginDependency 113.CustomClassName 113.IBPluginDependency - 12.CustomClassName - 12.IBPluginDependency + 116.IBPluginDependency + 118.IBPluginDependency 13.CustomClassName 13.IBPluginDependency 15.IBPluginDependency 16.CustomClassName 16.IBPluginDependency 17.IBPluginDependency - 18.CustomClassName 18.IBPluginDependency 2.IBPluginDependency 26.IBPluginDependency 27.IBPluginDependency - 28.CustomClassName - 28.IBPluginDependency 29.IBPluginDependency 30.CustomClassName 30.IBPluginDependency @@ -1447,7 +1272,6 @@ AAgACAAIAAEAAQABAAE 41.CustomClassName 41.IBPluginDependency 9.IBPluginDependency - 93.IBPluginDependency YES @@ -1458,11 +1282,9 @@ AAgACAAIAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIPauseResumeButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIDuration + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin UISpeakerButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1470,13 +1292,10 @@ AAgACAAIAAEAAQABAAE UIMuteButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIHangUpButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIHangUpButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1503,7 +1322,6 @@ AAgACAAIAAEAAQABAAE UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1518,7 +1336,7 @@ AAgACAAIAAEAAQABAAE - 115 + 119 @@ -1542,7 +1360,8 @@ AAgACAAIAAEAAQABAAE YES addCall - callDuration + addToConf + callControlSubView callTableView close contacts @@ -1550,7 +1369,6 @@ AAgACAAIAAEAAQABAAE dialer eight endCtrl - endPad five four hash @@ -1560,13 +1378,10 @@ AAgACAAIAAEAAQABAAE one padSubView pause - peerName - peerNumber seven six speaker star - status three two zero @@ -1574,7 +1389,8 @@ AAgACAAIAAEAAQABAAE YES UIButton - UILabel + UIButton + UIView UITableView UIButton UIButton @@ -1589,16 +1405,12 @@ AAgACAAIAAEAAQABAAE UIButton UIButton UIButton - UIButton UIView UIButton - UILabel - UILabel UIButton UIButton UIButton UIButton - UILabel UIButton UIButton UIButton @@ -1609,7 +1421,8 @@ AAgACAAIAAEAAQABAAE YES addCall - callDuration + addToConf + callControlSubView callTableView close contacts @@ -1617,7 +1430,6 @@ AAgACAAIAAEAAQABAAE dialer eight endCtrl - endPad five four hash @@ -1627,13 +1439,10 @@ AAgACAAIAAEAAQABAAE one padSubView pause - peerName - peerNumber seven six speaker star - status three two zero @@ -1645,8 +1454,12 @@ AAgACAAIAAEAAQABAAE UIButton - callDuration - UILabel + addToConf + UIButton + + + callControlSubView + UIView callTableView @@ -1676,10 +1489,6 @@ AAgACAAIAAEAAQABAAE endCtrl UIButton - - endPad - UIButton - five UIButton @@ -1716,14 +1525,6 @@ AAgACAAIAAEAAQABAAE pause UIButton - - peerName - UILabel - - - peerNumber - UILabel - seven UIButton @@ -1740,10 +1541,6 @@ AAgACAAIAAEAAQABAAE star UIButton - - status - UILabel - three UIButton @@ -1771,22 +1568,6 @@ AAgACAAIAAEAAQABAAE ./Classes/UIDigitButton.h - - UIDuration - UILabel - - IBProjectSource - ./Classes/UIDuration.h - - - - UIHangUpButton - UIButton - - IBProjectSource - ./Classes/UIHangUpButton.h - - UIMuteButton UIToggleButton diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 0b02bf203..a5fe0a59c 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -694,7 +694,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach libmsilbc_init(); #if defined (HAVE_SILK) - libmssilk_init(); + //libmssilk_init(); #endif #ifdef HAVE_AMR libmsamr_init(); //load amr plugin if present from the liblinphone sdk diff --git a/Classes/LinphoneUI/UIHangUpButton.m b/Classes/LinphoneUI/UIHangUpButton.m index 879276338..ffb57a87f 100644 --- a/Classes/LinphoneUI/UIHangUpButton.m +++ b/Classes/LinphoneUI/UIHangUpButton.m @@ -23,7 +23,13 @@ @implementation UIHangUpButton -(void) touchUp:(id) sender { - linphone_core_terminate_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); + LinphoneCore* lc = [LinphoneManager getLc]; + if (!lc) + return; + LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); + + if (call) + linphone_core_terminate_call(lc,call); } - (id)initWithFrame:(CGRect)frame { diff --git a/Classes/LinphoneUI/UIPauseResumeButton.m b/Classes/LinphoneUI/UIPauseResumeButton.m index 9cd47f8ac..22f7db8b3 100644 --- a/Classes/LinphoneUI/UIPauseResumeButton.m +++ b/Classes/LinphoneUI/UIPauseResumeButton.m @@ -38,13 +38,13 @@ } -(bool) isInitialStateOn { @try { - const MSList* c = linphone_core_get_calls([LinphoneManager getLc]); + LinphoneCall* c = linphone_core_get_current_call([LinphoneManager getLc]); if (c) { - return linphone_call_get_state((LinphoneCall*)c->data) == LinphoneCallPaused; + return linphone_call_get_state(c) == LinphoneCallPaused; } else { - - return false; + /* if current call is paused -> c == null */ + return true; } } @catch(NSException* e) { //not ready yet