diff --git a/Classes/AdvancedPhoneViewController.h b/Classes/AdvancedPhoneViewController.h deleted file mode 100644 index 411c90615..000000000 --- a/Classes/AdvancedPhoneViewController.h +++ /dev/null @@ -1,28 +0,0 @@ -/* AdvancedPhoneViewController.h - * - * Copyright (C) 2009 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import -#import "PhoneViewController.h" - - -@interface AdvancedPhoneViewController : PhoneViewController { - IncallViewController* mIncallViewController; -} - -@end diff --git a/Classes/AdvancedPhoneViewController.m b/Classes/AdvancedPhoneViewController.m deleted file mode 100644 index 6cc2a0eb6..000000000 --- a/Classes/AdvancedPhoneViewController.m +++ /dev/null @@ -1,92 +0,0 @@ -/* AdvancedPhoneViewController.m - * - * Copyright (C) 2009 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import "AdvancedPhoneViewController.h" -#import "IncallViewController.h" - -@implementation AdvancedPhoneViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - mIncallViewController = [[IncallViewController alloc] initWithNibName:@"IncallViewController" - bundle:[NSBundle mainBundle]]; -} - --(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [super displayDialerFromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - - [mIncallViewController displayDialerFromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - -} --(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - /*[super displayCallInProgressFromUI:viewCtrl - forUser:username - withDisplayName:displayName];*/ - - [self presentModalViewController:mIncallViewController animated:true]; - - [mIncallViewController displayCall:call InProgressFromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - -} - --(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - if (self.presentedViewController != mIncallViewController && (call == 0x0 || - linphone_call_get_dir(call)==LinphoneCallIncoming)){ - [self presentModalViewController:mIncallViewController animated:true]; - } - - [super displayInCall:call FromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - - [mIncallViewController displayInCall:call FromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - -} --(void) displayStatus:(NSString*) message { - [super displayStatus:message]; - [mIncallViewController displayStatus:message]; -} - --(void) updateUIFromLinphoneState:(UIViewController*) viewCtrl { - [super updateUIFromLinphoneState:viewCtrl]; - - [mIncallViewController updateUIFromLinphoneState:viewCtrl]; -} - --(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [mIncallViewController displayVideoCall:call FromUI:viewCtrl - forUser:username - withDisplayName:displayName]; -} -- (void)dealloc { - [mIncallViewController release]; - [super dealloc]; - -} - - -@end diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h index 55b5fe2eb..f50953aeb 100644 --- a/Classes/IncallViewController.h +++ b/Classes/IncallViewController.h @@ -66,7 +66,7 @@ ABPeoplePickerNavigationController* myPeoplePickerController; - LinphoneCall* selectedCall; + VideoViewController* mVideoViewController; BOOL mVideoShown; BOOL mVideoIsPending; diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index 8c7cbcc39..cb589b6fb 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -111,7 +111,7 @@ int callCount(LinphoneCore* lc) { [addCall addTarget:self action:@selector(addCallPressed) forControlEvents:UIControlEventTouchDown]; [mergeCalls addTarget:self action:@selector(mergeCallsPressed) forControlEvents:UIControlEventTouchDown]; - [endCtrl addTarget:self action:@selector(endCallPressed) forControlEvents:UIControlEventTouchUpInside]; + //[endCtrl addTarget:self action:@selector(endCallPressed) forControlEvents:UIControlEventTouchUpInside]; [addToConf addTarget:self action:@selector(addToConfCallPressed) forControlEvents:UIControlEventTouchUpInside]; [pause addTarget:self action:@selector(pauseCallPressed) forControlEvents:UIControlEventTouchUpInside]; [mergeCalls setHidden:YES]; @@ -134,13 +134,15 @@ int callCount(LinphoneCore* lc) { } -(void) addToConfCallPressed { - if (!selectedCall) + LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]); + if (!selectedCall) return; linphone_core_add_to_conference([LinphoneManager getLc], selectedCall); } -(void) pauseCallPressed { - if (!selectedCall) + LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]); + if (!selectedCall) return; if (linphone_call_get_state(selectedCall) == LinphoneCallPaused) { [pause setSelected:NO]; @@ -223,7 +225,7 @@ int callCount(LinphoneCore* lc) { -(void) displayStatus:(NSString*) message; { - [self updateUIFromLinphoneState: nil]; + } -(void) displayPad:(bool) enable { @@ -236,9 +238,10 @@ int callCount(LinphoneCore* lc) { //restaure view [self displayPad:false]; dismissed = false; - - if (call) - selectedCall = call; + UIDevice *device = [UIDevice currentDevice]; + device.proximityMonitoringEnabled = YES; + if ([speaker isOn]) + [speaker toggle]; [self updateUIFromLinphoneState: nil]; } @@ -246,15 +249,27 @@ int callCount(LinphoneCore* lc) { } +-(void) dismissVideoView { + [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO]; + [self dismissModalViewControllerAnimated:FALSE];//just in case + mVideoShown=FALSE; +} -(void) displayInCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { dismissed = false; - if (call) - selectedCall = call; - [self updateUIFromLinphoneState: nil]; + UIDevice *device = [UIDevice currentDevice]; + device.proximityMonitoringEnabled = YES; + if (call !=nil && linphone_call_get_dir(call)==LinphoneCallIncoming) { + if ([speaker isOn]) [speaker toggle]; + } + [self updateUIFromLinphoneState: nil]; + if (self.presentedViewController == (UIViewController*)mVideoViewController) { + [self dismissVideoView]; + } } -(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { UIViewController* modalVC = self.modalViewController; - + UIDevice *device = [UIDevice currentDevice]; + device.proximityMonitoringEnabled = NO; if (modalVC != nil) { // clear previous native window ids if (modalVC == mVideoViewController) { @@ -282,7 +297,6 @@ int callCount(LinphoneCore* lc) { } -(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl { [mute reset]; - // if ( // [pause reset]; @@ -304,7 +318,7 @@ int callCount(LinphoneCore* lc) { } @catch (NSException* exc) { return; } - + LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]); // hide call control subview if no call selected [callControlSubView setHidden:(selectedCall == NULL)]; // hide add to conf if no conf exist @@ -320,13 +334,11 @@ int callCount(LinphoneCore* lc) { else if (linphone_call_get_state(selectedCall)==LinphoneCallPaused) { [pause setHidden:NO]; //[pause setTitle:@"Resume" forState:UIControlStateNormal]; - // pause.selected = YES; - pause.highlighted = NO; + pause.selected = YES; } else if (callCount(lc) == callsCount && callsCount == 1) { [pause setHidden:NO]; //[pause setTitle:@"Pause" forState:UIControlStateNormal]; - // pause.selected = NO; - pause.highlighted = NO; + pause.selected = NO; } else { [pause setHidden:YES]; } @@ -480,8 +492,7 @@ int callCount(LinphoneCore* lc) { }*/ - - + LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]); if (call == selectedCall) { [cell setSelected:YES animated:NO]; [callTableView selectRowAtIndexPath:path animated:NO scrollPosition:UITableViewScrollPositionNone]; @@ -519,6 +530,7 @@ int callCount(LinphoneCore* lc) { //if (call == selectedCall) // [self updateActive:YES cell:cell]; + LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]); if (call == selectedCall) { [callTableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; cell.selected = YES; @@ -625,7 +637,7 @@ int callCount(LinphoneCore* lc) { bool inConf = (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0); - selectedCall = [self retrieveCallAtIndex:indexPath.row inConference:inConf]; + LinphoneCall* selectedCall = [self retrieveCallAtIndex:indexPath.row inConference:inConf]; if (inConf) { if (linphone_core_is_in_conference(lc)) @@ -644,24 +656,5 @@ int callCount(LinphoneCore* lc) { [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 f04038910..3e1b63885 100644 --- a/Classes/IncallViewController.xib +++ b/Classes/IncallViewController.xib @@ -241,7 +241,7 @@ {{213, 70}, {107, 66}} - + NO NO @@ -264,7 +264,7 @@ - + -2147483356 {{213, 70}, {107, 66}} @@ -277,13 +277,18 @@ IBCocoaTouchFramework 0 0 + 1 video 1 MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - + + + NSImage + clavier-01-160px.png + @@ -935,7 +940,7 @@ addVideo - + 125 @@ -1158,7 +1163,7 @@ - + controls @@ -1207,7 +1212,7 @@ 123 - + video @@ -1239,6 +1244,7 @@ 16.IBPluginDependency 16.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 17.IBPluginDependency + 18.CustomClassName 18.IBPluginDependency 2.IBPluginDependency 26.IBPluginDependency @@ -1283,18 +1289,19 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIAddVideoButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UISpeakerButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIMuteButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIHangUpButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1784,6 +1791,7 @@ HP_inverse.png ajouter.png clavier-01-106px.png + clavier-01-160px.png clavier.png conf_merge.png contact.png @@ -1801,6 +1809,7 @@ {164, 104} {164, 104} {106, 60} + {160, 60} {164, 104} {82, 75} {164, 104} diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 4de33f114..48515e956 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -206,7 +206,12 @@ extern void libmssilk_init(); [callDelegate displayDialerFromUI:mCurrentViewController forUser:@"" withDisplayName:@""]; - } + } else { + [callDelegate displayInCall:call + FromUI:mCurrentViewController + forUser:lUserName + withDisplayName:lDisplayName]; + } break; default: break; @@ -816,7 +821,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach linphone_core_resume_call(theLinphoneCore, (LinphoneCall*) c->data); } - [callDelegate updateUIFromLinphoneState:mCurrentViewController]; } diff --git a/Classes/LinphoneUI/LinphoneUIDelegates.h b/Classes/LinphoneUI/LinphoneUIDelegates.h index 47e28ebd6..1f2938cfe 100644 --- a/Classes/LinphoneUI/LinphoneUIDelegates.h +++ b/Classes/LinphoneUI/LinphoneUIDelegates.h @@ -26,7 +26,6 @@ -(void) displayIncomingCall: (LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; -(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; -(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) updateUIFromLinphoneState:(UIViewController*) viewCtrl; //status reporting -(void) displayStatus:(NSString*) message; @end diff --git a/Classes/LinphoneUI/UIHangUpButton.m b/Classes/LinphoneUI/UIHangUpButton.m index ffb57a87f..a7a291e61 100644 --- a/Classes/LinphoneUI/UIHangUpButton.m +++ b/Classes/LinphoneUI/UIHangUpButton.m @@ -30,6 +30,18 @@ if (call) linphone_core_terminate_call(lc,call); + else if (linphone_core_is_in_conference(lc)) { + linphone_core_terminate_conference(lc); + } else { + const MSList* calls = linphone_core_get_calls(lc); + if (ms_list_size(calls) == 1 + && !linphone_call_params_local_conference_mode(linphone_call_get_current_params((LinphoneCall*)(calls->data)))) { + //Only one call in the list, hangin up! + linphone_core_terminate_call(lc,(LinphoneCall*)(calls->data)); + } else { + ms_message("Cannot make a decision on which call to terminate"); + } + } } - (id)initWithFrame:(CGRect)frame { diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index a9bd56576..b9f5f09e2 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -35,18 +35,9 @@ UITextField* address; UILabel* mDisplayName; UIEraseButton* erase; + UICallButton* callShort; + UICallButton* callLarge; - UIView* incallView; - UIButton* backToCallView; - UIDuration* callDuration; - UIMuteButton* mute; - UISpeakerButton* speaker; - UILabel* peerLabel; - - - UICallButton* __call; - UIHangUpButton* hangup; - UILabel* status; //key pad @@ -64,30 +55,24 @@ UIDigitButton* hash; UIButton* back; + UIButton* backToCallView; UITabBarController* myTabBarController; UIActionSheet *mIncomingCallActionSheet; FirstLoginViewController* myFirstLoginViewController; - + IncallViewController* mIncallViewController; } @property (nonatomic, retain) IBOutlet UIView* dialerView; @property (nonatomic, retain) IBOutlet UITextField* address; -@property (nonatomic, retain) IBOutlet UIButton* __call; +@property (nonatomic, retain) IBOutlet UIButton* callShort; +@property (nonatomic, retain) IBOutlet UIButton* callLarge; @property (nonatomic, retain) IBOutlet UIButton* hangup; @property (nonatomic, retain) IBOutlet UILabel* status; @property (nonatomic, retain) IBOutlet UIEraseButton* erase; -@property (nonatomic, retain) IBOutlet UIView* incallView; -@property (nonatomic, retain) IBOutlet UILabel* callDuration; -@property (nonatomic, retain) IBOutlet UIButton* mute; -@property (nonatomic, retain) IBOutlet UIButton* speaker; -@property (nonatomic, retain) IBOutlet UILabel* peerLabel; - -@property (nonatomic, retain) IBOutlet UIButton* backToCallView; - @property (nonatomic, retain) IBOutlet UIButton* one; @property (nonatomic, retain) IBOutlet UIButton* two; @property (nonatomic, retain) IBOutlet UIButton* three; @@ -102,7 +87,7 @@ @property (nonatomic, retain) IBOutlet UIButton* hash; @property (nonatomic, retain) IBOutlet UIButton* back; - +@property (nonatomic, retain) IBOutlet UIButton* backToCallView; // method to handle keypad event diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index ba8654af1..52a28a922 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -28,17 +28,11 @@ @implementation PhoneViewController @synthesize dialerView ; @synthesize address ; -@synthesize __call; +@synthesize callShort; +@synthesize callLarge; @synthesize hangup; @synthesize status; @synthesize erase; -@synthesize backToCallView; - -@synthesize incallView; -@synthesize callDuration; -@synthesize mute; -@synthesize speaker; -@synthesize peerLabel; @synthesize one; @synthesize two; @@ -55,7 +49,7 @@ @synthesize back; @synthesize myTabBarController; - +@synthesize backToCallView; //implements keypad behavior @@ -72,7 +66,6 @@ - (void)viewDidAppear:(BOOL)animated { [[UIApplication sharedApplication] setIdleTimerDisabled:true]; - [mute reset]; if ([[NSUserDefaults standardUserDefaults] boolForKey:@"enable_first_login_view_preference"] == true) { myFirstLoginViewController = [[FirstLoginViewController alloc] initWithNibName:@"FirstLoginViewController" bundle:[NSBundle mainBundle]]; @@ -81,10 +74,6 @@ }; } -- (void)viewDidDisappear:(BOOL)animated { - -} - // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { @@ -103,21 +92,16 @@ [nine initWithNumber:'9' addressField:address dtmf:false]; [star initWithNumber:'*' addressField:address dtmf:false]; [hash initWithNumber:'#' addressField:address dtmf:false]; - [__call initWithAddress:address withDisplayName:mDisplayName]; - [mute initWithOnImage:[UIImage imageNamed:@"mic_muted.png"] offImage:[UIImage imageNamed:@"mic_active.png"] ]; - [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; + [callShort initWithAddress:address withDisplayName:mDisplayName]; + [callLarge initWithAddress:address withDisplayName:mDisplayName]; [erase initWithAddressField:address]; - [backToCallView addTarget:self action:@selector(backToCallViewPressed) forControlEvents:UIControlEventTouchUpInside]; + mIncallViewController = [[IncallViewController alloc] initWithNibName:@"IncallViewController" + bundle:[NSBundle mainBundle]]; } --(void) backToCallViewPressed { - [self displayInCall: nil - FromUI:nil - forUser:nil - withDisplayName:nil]; -} + /* @@ -139,9 +123,6 @@ // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } -- (void) viewWillAppear:(BOOL)animated { - -} - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { if (theTextField == address) { @@ -167,79 +148,32 @@ } } - [address setHidden:false]; if (username) { [address setText:username]; } //else keep previous [mDisplayName setText:displayName]; - [incallView setHidden:true]; - [dialerView setHidden:false]; - - [__call setEnabled:true]; - [hangup setEnabled:false]; - - [callDuration stop]; - UIDevice *device = [UIDevice currentDevice]; - device.proximityMonitoringEnabled = NO; + [callLarge setHidden:FALSE]; + [callShort setHidden:TRUE]; + [backToCallView setHidden:TRUE]; - [peerLabel setText:@""]; if ([[NSUserDefaults standardUserDefaults] boolForKey:@"firstlogindone_preference" ] == true) { //first login case, dismmis first login view [self dismissModalViewControllerAnimated:true]; }; + [mIncallViewController displayDialerFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; } --(void) displayInCall: (LinphoneCall*) call ViewforUser:(NSString*) username withDisplayName:(NSString*) displayName { - UIDevice *device = [UIDevice currentDevice]; - device.proximityMonitoringEnabled = YES; - if (device.proximityMonitoringEnabled == YES) { - ms_message("Ok this device support proximity, and I just enabled it"); - } - [hangup setEnabled:true]; - if (displayName && [displayName length]>0) { - [peerLabel setText:displayName]; - } else { - [peerLabel setText:username?username:@""]; - } - [incallView setHidden:NO]; -} --(void) displayCall:(LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [self displayInCall: call ViewforUser:username - withDisplayName:displayName]; - //[__call setEnabled:false]; - [callDuration setText:NSLocalizedString(@"Calling...",nil)]; - if ([speaker isOn]) [speaker toggle] ; //preset to off - - [incallView setHidden:NO]; -} - --(void) displayInCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [callDuration start]; - [callDuration setHidden:false]; - - if (linphone_call_get_dir(linphone_core_get_current_call([LinphoneManager getLc])) == LinphoneCallIncoming) { - [self displayInCall: call ViewforUser:username - withDisplayName:displayName]; - if ([speaker isOn]) [speaker toggle] ; //preset to off; - } - - [incallView setHidden:NO]; -} - --(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - ms_message("basic phone view does not support video"); -} //status reporting -(void) displayStatus:(NSString*) message { [status setText:message]; -} - --(void) updateUIFromLinphoneState:(UIViewController*) viewCtrl { - [mute reset]; + [mIncallViewController displayStatus:message]; } @@ -277,6 +211,51 @@ } } + +-(void) backToCallViewPressed { + [self displayInCall: nil + FromUI:nil + forUser:nil + withDisplayName:nil]; +} + +-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + if (self.presentedViewController != (UIViewController*)mIncallViewController) { + [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; + } + [mIncallViewController displayCall:call InProgressFromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + +} + +-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 || + linphone_call_get_dir(call)==LinphoneCallIncoming)){ + [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; + + } + + + + [mIncallViewController displayInCall:call FromUI:viewCtrl + forUser:username + withDisplayName:displayName]; + [callLarge setHidden:TRUE]; + [callShort setHidden:FALSE]; + [backToCallView setHidden:FALSE]; + +} + + +-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + [mIncallViewController displayVideoCall:call FromUI:viewCtrl + forUser:username + withDisplayName:displayName]; +} + + + - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas{ LinphoneCall* call = (LinphoneCall*)datas; if (buttonIndex == 0 ) { @@ -290,13 +269,9 @@ - (void)dealloc { [address dealloc]; [ mDisplayName dealloc]; - [incallView dealloc]; [dialerView dealloc]; - [callDuration dealloc]; - [mute dealloc]; - [speaker dealloc]; - [peerLabel dealloc]; - [__call dealloc]; + [callShort dealloc]; + [callLarge dealloc]; [hangup dealloc]; [status dealloc]; [one dealloc]; @@ -313,6 +288,7 @@ [hash dealloc]; [back dealloc]; [myTabBarController release]; + [mIncallViewController release]; [super dealloc]; } diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index be02b22e2..d3eba61df 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -138,42 +138,13 @@ IBCocoaTouchFramework - - - 292 - {{0, 328}, {160, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - startcall-green.png - - - NSImage - clavier-01-160px.png - - - - 292 {{9, 390}, {304, 21}} - + NO YES NO @@ -300,7 +271,7 @@ {{0, 196}, {107, 66}} - + NO NO IBCocoaTouchFramework @@ -482,17 +453,49 @@ - + 292 {{160, 328}, {160, 66}} - NO NO IBCocoaTouchFramework - NO + 0 + 0 + 1 + Back + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + clavier-01-160px.png + + + 2 + 2 + + + Helvetica-Bold + 18 + 16 + + + + + 292 + {{0, 328}, {160, 66}} + + + + NO + NO + IBCocoaTouchFramework 0 0 @@ -501,61 +504,36 @@ MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - + NSImage - stopcall-red.png + startcall-green.png - + - + - -2147483356 - - YES - - - 292 - {160, 66} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - Back - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - 2 - 2 - - - Helvetica-Bold - 18 - 16 - - - - {{160, 328}, {160, 66}} + 292 + {{0, 328}, {320, 66}} - - - 1 - MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA - + + NO NO IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + {{0, 20}, {320, 460}} @@ -701,22 +679,6 @@ 54 - - - hangup - - - - 109 - - - - incallView - - - - 119 - erase @@ -733,14 +695,6 @@ 158 - - - __call - - - - 159 - backToCallView @@ -749,6 +703,22 @@ 161 + + + callShort + + + + 163 + + + + callLarge + + + + 164 + delegate @@ -807,10 +777,7 @@ - - - @@ -818,8 +785,11 @@ - + + + + @@ -838,32 +808,16 @@ - - 114 - - - YES - - - - inCall - 39 - - 107 - - - hangup - 5 - Call + Call-short 7 @@ -936,9 +890,15 @@ 160 - + back + + 162 + + + Call-large + @@ -951,14 +911,12 @@ -2.IBPluginDependency 1.IBPluginDependency 1.IBUserGuides - 107.CustomClassName - 107.IBPluginDependency - 114.IBPluginDependency - 114.IBUserGuides 150.CustomClassName 150.IBPluginDependency 157.IBPluginDependency 160.IBPluginDependency + 162.CustomClassName + 162.IBPluginDependency 29.CustomClassName 29.IBPluginDependency 30.CustomClassName @@ -1009,21 +967,12 @@ 1 - UIHangUpButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - 90 - 1 - - UIEraseButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UICallButton + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton @@ -1067,7 +1016,7 @@ - 161 + 164 @@ -1090,11 +1039,11 @@ YES YES - __call address back backToCallView - callDuration + callLarge + callShort dialerView eight erase @@ -1102,15 +1051,11 @@ four hangup hash - incallView - mute myTabBarController nine one - peerLabel seven six - speaker star status three @@ -1119,11 +1064,11 @@ YES - UIButton UITextField UIButton UIButton - UILabel + UIButton + UIButton UIView UIButton UIEraseButton @@ -1131,13 +1076,9 @@ UIButton UIButton UIButton - UIView - UIButton UITabBarController UIButton UIButton - UILabel - UIButton UIButton UIButton UIButton @@ -1151,11 +1092,11 @@ YES YES - __call address back backToCallView - callDuration + callLarge + callShort dialerView eight erase @@ -1163,15 +1104,11 @@ four hangup hash - incallView - mute myTabBarController nine one - peerLabel seven six - speaker star status three @@ -1180,10 +1117,6 @@ YES - - __call - UIButton - address UITextField @@ -1197,8 +1130,12 @@ UIButton - callDuration - UILabel + callLarge + UIButton + + + callShort + UIButton dialerView @@ -1228,14 +1165,6 @@ hash UIButton - - incallView - UIView - - - mute - UIButton - myTabBarController UITabBarController @@ -1248,10 +1177,6 @@ one UIButton - - peerLabel - UILabel - seven UIButton @@ -1260,10 +1185,6 @@ six UIButton - - speaker - UIButton - star UIButton @@ -1315,14 +1236,6 @@ ./Classes/UIEraseButton.h - - UIHangUpButton - UIButton - - IBProjectSource - ./Classes/UIHangUpButton.h - - 0 @@ -1331,10 +1244,6 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -1350,7 +1259,6 @@ clavier-01-160px.png effacer.png startcall-green.png - stopcall-red.png YES @@ -1359,7 +1267,6 @@ {160, 60} {164, 104} {60, 52} - {62, 54} 933 diff --git a/PhoneMainView.xib b/PhoneMainView.xib index 8f1c9a54f..f7b3253b1 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -47,6 +47,7 @@ {320, 480} + 1 MSAxIDEAA @@ -65,17 +66,17 @@ IBCocoaTouchFramework NO - - History - - History + + + Dialer NSImage - history-orange.png + dialer-orange.png IBCocoaTouchFramework + PhoneViewController 1 @@ -86,18 +87,17 @@ YES - - - - Dialer + + History + + History NSImage - dialer-orange.png + history-orange.png IBCocoaTouchFramework - PhoneViewController 1 @@ -106,6 +106,7 @@ IBCocoaTouchFramework NO + IBCocoaTouchFramework @@ -140,6 +141,7 @@ 266 {{0, 431}, {320, 49}} + 3 MCAwAA @@ -330,7 +332,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AdvancedPhoneViewController + PhoneViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin linphoneAppDelegate diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 0d073c3ba..68ec64abc 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -20,8 +20,6 @@ 220FAD3910765B400068D98F /* libspeexdsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD3010765B400068D98F /* libspeexdsp.a */; }; 220FAE4B10767A6A0068D98F /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 220FAE4A10767A6A0068D98F /* PhoneMainView.xib */; }; 2211DB95147564B400DEE054 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2211DB94147564B400DEE054 /* Settings.bundle */; }; - 2211DBBC14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */; }; - 2211DBBD14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */; }; 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBB14769C8200DEE054 /* CallDelegate.m */; }; 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBB14769C8200DEE054 /* CallDelegate.m */; }; 2211DBC014769CB200DEE054 /* IncallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 222A483212F7176F0075F07F /* IncallViewController.m */; }; @@ -379,7 +377,6 @@ 2211DB8F147555C800DEE054 /* libmediastreamer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer.a"; sourceTree = ""; }; 2211DB911475562600DEE054 /* liblinphone.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblinphone.a; path = "liblinphone-sdk/apple-darwin/lib/liblinphone.a"; sourceTree = ""; }; 2211DB94147564B400DEE054 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Settings.bundle; path = nogpl/Settings.bundle; sourceTree = ""; }; - 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvancedPhoneViewController.m; sourceTree = ""; }; 2211DBBB14769C8200DEE054 /* CallDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallDelegate.m; sourceTree = ""; }; 2211DBCA1476BE7300DEE054 /* ajouter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ajouter.png; path = Resources/ajouter.png; sourceTree = ""; }; 2211DBCB1476BE7300DEE054 /* clavier.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = clavier.png; path = Resources/clavier.png; sourceTree = ""; }; @@ -682,7 +679,6 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */, 2211DBBB14769C8200DEE054 /* CallDelegate.m */, 2214EB7012F84668002A5394 /* LinphoneUI */, 2218A92212FBE1340088A667 /* FirstLoginViewController.h */, @@ -1360,7 +1356,6 @@ 223963171393CFAF001DE689 /* FastAddressBook.m in Sources */, 22E028B713B4CCBD0068A713 /* VideoViewController.m in Sources */, 22AA8B0113D83F6300B30535 /* UICamSwitch.m in Sources */, - 2211DBBC14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */, 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */, 2211DBC014769CB200DEE054 /* IncallViewController.m in Sources */, 22D817AD147A9F33001CFB9C /* UIAddVideoButton.m in Sources */, @@ -1393,7 +1388,6 @@ 22D8F157147548E2008C97DB /* FastAddressBook.m in Sources */, 22D8F158147548E2008C97DB /* VideoViewController.m in Sources */, 22D8F159147548E2008C97DB /* UICamSwitch.m in Sources */, - 2211DBBD14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */, 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */, 2211DBC114769CB300DEE054 /* IncallViewController.m in Sources */, 22D817AE147A9F33001CFB9C /* UIAddVideoButton.m in Sources */,