diff --git a/Classes/CallHistoryTableViewController.m b/Classes/CallHistoryTableViewController.m index a55c5ffd6..def9679e0 100644 --- a/Classes/CallHistoryTableViewController.m +++ b/Classes/CallHistoryTableViewController.m @@ -185,9 +185,13 @@ NSString* dispName = [[NSString alloc] initWithCString:displayName encoding:[NSString defaultCStringEncoding]]; - [[LinphoneManager instance].callDelegate displayDialerFromUI:self + + [[LinphoneManager instance] changeView:PhoneView_Dialer]; + + //TODO + /*[[LinphoneManager instance].callDelegate displayDialerFromUI:self forUser:phoneNumber - withDisplayName:dispName]; + withDisplayName:dispName];*/ [phoneNumber release]; [dispName release]; } diff --git a/Classes/ConferenceCallDetailView.h b/Classes/ConferenceCallDetailView.h index b6bb27fe7..1c0ff02c0 100644 --- a/Classes/ConferenceCallDetailView.h +++ b/Classes/ConferenceCallDetailView.h @@ -17,12 +17,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import -#import "LinphoneUI/UIMuteButton.h" +#import "LinphoneUI/UIMicroButton.h" #import "LinphoneUI/UISpeakerButton.h" @interface ConferenceCallDetailView : UIViewController { - UIMuteButton* mute; + UIMicroButton* mute; UISpeakerButton* speaker; UIButton* back; UIButton* hangup; diff --git a/Classes/ConferenceCallDetailView.m b/Classes/ConferenceCallDetailView.m index 7ae8a4d6d..d31b9cf57 100644 --- a/Classes/ConferenceCallDetailView.m +++ b/Classes/ConferenceCallDetailView.m @@ -62,8 +62,9 @@ NSTimer *callQualityRefresher; table.rowHeight = 80; - [mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"]; + /*[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"]; [speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] debugName:"SPEAKER button"]; + */ } -(void) backButtonPressed { diff --git a/Classes/ContactPickerDelegate.h b/Classes/ContactPickerDelegate.h deleted file mode 100644 index 623ccd1f7..000000000 --- a/Classes/ContactPickerDelegate.h +++ /dev/null @@ -1,30 +0,0 @@ -/* ContactPickerDelegate.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 -#import "PhoneViewController.h" -#import "linphoneAppDelegate.h" - - -@interface ContactPickerDelegate : NSObject { - -} - - -@end diff --git a/Classes/ContactPickerDelegate.m b/Classes/ContactPickerDelegate.m deleted file mode 100644 index 00d53e489..000000000 --- a/Classes/ContactPickerDelegate.m +++ /dev/null @@ -1,53 +0,0 @@ -/* ContactPickerDelegate.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 "ContactPickerDelegate.h" -#import "LinphoneManager.h" - -@implementation ContactPickerDelegate - - -- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker - shouldContinueAfterSelectingPerson:(ABRecordRef)person { - return true; - -} - -- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker - shouldContinueAfterSelectingPerson:(ABRecordRef)person - property:(ABPropertyID)property - identifier:(ABMultiValueIdentifier)identifier { - - CFTypeRef multiValue = ABRecordCopyValue(person, property); - CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue,identifier); - NSString *phoneNumber = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx); - [[LinphoneManager instance].callDelegate displayDialerFromUI:nil - forUser:phoneNumber - withDisplayName:[(NSString*)ABRecordCopyCompositeName(person) autorelease]]; - [phoneNumber release]; - CFRelease(multiValue); - return false; -} - -- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker { - [[LinphoneManager instance].callDelegate displayDialerFromUI:nil - forUser:nil - withDisplayName:@""]; -} - -@end diff --git a/Classes/ContactTableViewController.m b/Classes/ContactTableViewController.m index 885a8a9d6..03383d73b 100644 --- a/Classes/ContactTableViewController.m +++ b/Classes/ContactTableViewController.m @@ -90,6 +90,7 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { OrderedDictionary *subDic = [addressBookMap objectForKey: [addressBookMap keyAtIndex: [indexPath section]]]; ABRecordRef lPerson = [subDic objectForKey: [subDic keyAtIndex:[indexPath row]]]; + // TODO } - (void)dealloc { diff --git a/Classes/FirstLoginViewController.h b/Classes/FirstLoginViewController.h index 58d6db011..bd0d646fe 100644 --- a/Classes/FirstLoginViewController.h +++ b/Classes/FirstLoginViewController.h @@ -19,17 +19,14 @@ #import #import "LinphoneAppDelegate.h" -#import "LinphoneUIDelegates.h" - @interface FirstLoginViewController : UIViewController { UIButton* ok; UIButton* site; UITextField* username; UIView* activityIndicator; - - } + -(void) doOk:(id)sender; @property (nonatomic, retain) IBOutlet UIButton* ok; @@ -37,4 +34,5 @@ @property (nonatomic, retain) IBOutlet UITextField* username; @property (nonatomic, retain) IBOutlet UITextField* passwd; @property (nonatomic, retain) IBOutlet UIView* activityIndicator; + @end diff --git a/Classes/InCallViewController.h b/Classes/InCallViewController.h index 63388ce90..fa5006ced 100644 --- a/Classes/InCallViewController.h +++ b/Classes/InCallViewController.h @@ -1,4 +1,4 @@ -/* IncallViewController.h +/* InCallViewController.h * * Copyright (C) 2009 Belledonne Comunications, Grenoble, France * @@ -16,24 +16,28 @@ * 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 + #import "linphonecore.h" #import "PhoneViewController.h" #import "ConferenceCallDetailView.h" -#import -#include "UILinphone.h" #import "UIToggleVideoButton.h" #import "VideoZoomHandler.h" + +#include "UILinphone.h" + @class VideoViewController; -@interface InCallViewController : UIViewController { +@interface InCallViewController : UIViewController { UIView* controlSubView, *hangUpView; UIButton* endCtrl; UIButton* dialer; - UIMuteButton* mute; + UIMicroButton* mute; UIButton* pause; UISpeakerButton* speaker; UIButton* contacts; @@ -97,8 +101,6 @@ VideoZoomHandler* videoZoomHandler; } --(void)displayStatus:(NSString*) message; - - (IBAction)doAction:(id)sender; +(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf; diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index ae809015f..f2de7fd9b 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -1,4 +1,4 @@ -/* IncallViewController.h +/* InCallViewController.h * * Copyright (C) 2009 Belledonne Comunications, Grenoble, France * @@ -15,20 +15,21 @@ * 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 "IncallViewController.h" #import "VideoViewController.h" +#import "LinphoneManager.h" #import #import -#import "linphonecore.h" -#include "LinphoneManager.h" -#include "private.h" -#import "ContactPickerDelegate.h" #import #import #import #import +#include "linphonecore.h" +#include "private.h" + #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #define AT __FILE__ ":" TOSTRING(__LINE__) @@ -397,10 +398,14 @@ void addAnimationFadeTransition(UIView* view, float duration) { // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; - //Controls - [mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"]; - [speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] debugName:"SPEAKER button"]; + // Set observer + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil]; + + //Controls + /*[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"]; + [speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] debugName:"SPEAKER button"]; + */ verified = [[UIImage imageNamed:@"secured.png"] retain]; unverified = [[UIImage imageNamed:@"unverified.png"] retain]; @@ -420,7 +425,6 @@ void addAnimationFadeTransition(UIView* view, float duration) { [addCall addTarget:self action:@selector(addCallPressed) forControlEvents:UIControlEventTouchUpInside]; [mergeCalls addTarget:self action:@selector(mergeCallsPressed) forControlEvents:UIControlEventTouchUpInside]; - [pause addTarget:self action:@selector(pauseCallPressed) forControlEvents:UIControlEventTouchUpInside]; [LinphoneManager set:mergeCalls hidden:YES withName:"MERGE button" andReason:"initialisation"]; if ([LinphoneManager runningOnIpad]) { @@ -517,7 +521,7 @@ void addAnimationFadeTransition(UIView* view, float duration) { visibleActionSheet = nil; [UICallButton enableTransforMode:YES]; - [[LinphoneManager instance] displayDialer]; + [[LinphoneManager instance] changeView:PhoneView_Dialer]; } else { // add 'Other' option [visibleActionSheet addButtonWithTitle:NSLocalizedString(@"Other...",nil)]; @@ -537,46 +541,15 @@ void addAnimationFadeTransition(UIView* view, float duration) { -(void) addCallPressed { [LinphoneManager logUIElementPressed:"CALL button"]; - [[LinphoneManager instance] displayDialer]; + [[LinphoneManager instance] changeView:PhoneView_Dialer]; } - -(void) mergeCallsPressed { [LinphoneManager logUIElementPressed:"MERGE button"]; LinphoneCore* lc = [LinphoneManager getLc]; linphone_core_add_all_to_conference(lc); } --(void) pauseCallPressed { - [LinphoneManager logUIElementPressed:"PAUSE button"]; - LinphoneCore* lc = [LinphoneManager getLc]; - - LinphoneCall* currentCall = linphone_core_get_current_call(lc); - if (currentCall) { - if (linphone_call_get_state(currentCall) == LinphoneCallStreamsRunning) { - [pause setSelected:NO]; - linphone_core_pause_call(lc, currentCall); - - // hide video view - [self disableVideoDisplay]; - } - } else { - if (linphone_core_get_calls_nb(lc) == 1) { - LinphoneCall* c = (LinphoneCall*) linphone_core_get_calls(lc)->data; - if (linphone_call_get_state(c) == LinphoneCallPaused) { - linphone_core_resume_call(lc, c); - [pause setSelected:YES]; - - const LinphoneCallParams* p = linphone_call_get_current_params(c); - if (linphone_call_params_video_enabled(p)) { - [self enableVideoDisplay]; - } - } - } - } -} - - -(void)updateCallsDurations { [self updateUIFromLinphoneState: NO]; } @@ -646,12 +619,7 @@ void addAnimationFadeTransition(UIView* view, float duration) { - (void)viewDidUnload { [verified release]; [unverified release]; -} - - - --(void) displayStatus:(NSString*) message; { - + [[NSNotificationCenter defaultCenter] removeObserver:self]; } -(void) displayPad:(bool) enable { @@ -719,6 +687,108 @@ static void hideSpinner(LinphoneCall* lc, void* user_data); }*/ } + +- (void)callUpdate: (NSNotification*) notif { + LinphoneCallWrapper *callWrapper = [notif.userInfo objectForKey: @"call"]; + LinphoneCall *call = callWrapper->call; + LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue]; + + const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); + NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); + const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); + NSString* lDisplayName = [lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@"" autorelease]; + + bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL); + + switch (state) { + case LinphoneCallIncomingReceived: + [self displayIncomingCall:call + NotificationFromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + break; + + case LinphoneCallOutgoingInit: + [self displayCall:call + InProgressFromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + break; + case LinphoneCallPausedByRemote: + case LinphoneCallConnected: + [self displayInCall: call + FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + break; + case LinphoneCallUpdatedByRemote: + { + const LinphoneCallParams* current = linphone_call_get_current_params(call); + const LinphoneCallParams* remote = linphone_call_get_remote_params(call); + + /* remote wants to add video */ + if (!linphone_call_params_video_enabled(current) && + linphone_call_params_video_enabled(remote) && + !linphone_core_get_video_policy([LinphoneManager getLc])->automatically_accept) { + linphone_core_defer_call_update([LinphoneManager getLc], call); + [self displayAskToEnableVideoCall:call forUser:lUserName withDisplayName:lDisplayName]; + } else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) { + [self displayInCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } + break; + } + case LinphoneCallUpdated: + { + const LinphoneCallParams* current = linphone_call_get_current_params(call); + if (linphone_call_params_video_enabled(current)) { + [self displayVideoCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } else { + [self displayInCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } + break; + + } + case LinphoneCallError: { + if (canHideInCallView) { + [self displayDialerFromUI:nil + forUser:@"" + withDisplayName:@""]; + } else { + [self displayInCall:call + FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + } + break; + } + case LinphoneCallEnd: + if (canHideInCallView) { + [self displayDialerFromUI:nil + forUser:@"" + withDisplayName:@""]; + } else { + [self displayInCall:call + FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + } + break; + case LinphoneCallStreamsRunning: + //check video + if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { + [self displayVideoCall:call FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + } else { + [self displayInCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } + break; + default: + break; + } + +} + static void hideSpinner(LinphoneCall* call, void* user_data) { InCallViewController* thiz = (InCallViewController*) user_data; [thiz hideSpinnerIndicator:call]; @@ -798,7 +868,8 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { } else if (sender == contacts) { // start people picker myPeoplePickerController = [[[ABPeoplePickerNavigationController alloc] init] autorelease]; - [myPeoplePickerController setPeoplePickerDelegate:[[ContactPickerDelegate alloc] init] ]; + // TODO + //[myPeoplePickerController setPeoplePickerDelegate:[[ContactPickerDelegate alloc] init] ]; [self presentModalViewController: myPeoplePickerController animated:true]; } else if (sender == close) { @@ -831,6 +902,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { - (void)dealloc { [super dealloc]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } +(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf{ @@ -1177,7 +1249,7 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { // user must jhave pressed 'other...' button as we did not find a call // with the correct indice [UICallButton enableTransforMode:YES]; - [[LinphoneManager instance] displayDialer]; + [[LinphoneManager instance] changeView:PhoneView_Dialer]; break; } default: diff --git a/Classes/InCallViewController.xib b/Classes/InCallViewController.xib index 2bb8a21f5..9a6774b53 100644 --- a/Classes/InCallViewController.xib +++ b/Classes/InCallViewController.xib @@ -52,6 +52,7 @@ 292 {320, 480} + _NS:196 @@ -65,6 +66,7 @@ 292 {{240, 354}, {80, 106}} + IBCocoaTouchFramework @@ -74,6 +76,7 @@ 292 {{4, 428}, {28, 28}} + _NS:567 NO @@ -84,6 +87,7 @@ 292 {{141, 212}, {37, 37}} + _NS:1030 NO @@ -95,6 +99,7 @@ {320, 460} + _NS:196 @@ -109,6 +114,7 @@ 292 {320, 66} + 1 @@ -133,7 +139,7 @@ 3 MC41AA - + NSImage clavier-01-106px.png @@ -154,6 +160,7 @@ 274 {320, 251} + _NS:418 @@ -167,342 +174,6 @@ 22 22 - - - 292 - - YES - - - 292 - {{0, 1}, {320, 66}} - - - 1 - MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - stopcall-red.png - - - - - - - {{0, 393.5}, {320, 77}} - - - _NS:196 - - IBCocoaTouchFramework - - - - 292 - - YES - - - 292 - {{80, 70}, {80, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - grouper.png - - - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - - - - 292 - {{0, 4}, {107, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - mic_active.png - - - NSImage - micro_inverse.png - - - NSImage - micro.png - - - 2 - 2 - - - Helvetica-Bold - 18 - 16 - - - - - 292 - {{0, 70}, {80, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - ajouter.png - - - - - - - 292 - {{160, 70}, {80, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - Transfer - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - 2 - 15 - - - - - - 292 - {{240, 70}, {80, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - 1 - MCAwIDAAA - - - NSImage - contact.png - - - - - - - -2147483356 - {{240, 70}, {80, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - video - - - 3 - MC42NjY2NjY2NjY3AA - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - NSImage - clavier-01-160px.png - - - - - - - -2147483356 - {{261.5, 84.5}, {37, 37}} - - - _NS:1030 - NO - IBCocoaTouchFramework - NO - 0 - - - - 292 - {{107, 4}, {106, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - clavier.png - - - - - - - 292 - {{213, 4}, {107, 66}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - NSImage - HP_inverse.png - - - NSImage - HP.png - - - - - - - 292 - {{80, 70}, {80, 66}} - - - - NO - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - - - NSImage - pause_inactif.png - - - NSImage - pause.png - - - - - - {{0, 258.5}, {320, 135}} - - - - NO - NO - IBCocoaTouchFramework - -2147483356 @@ -513,7 +184,8 @@ 292 {{119, 251}, {82, 52}} - + + NO NO @@ -535,8 +207,12 @@ 292 {{119, 193}, {82, 52}} + - + + 3 + MC42NjY2NjY2NjY3AA + NO NO IBCocoaTouchFramework @@ -557,6 +233,7 @@ 292 {{31, 19}, {82, 52}} + NO @@ -579,6 +256,7 @@ 292 {{119, 19}, {82, 52}} + NO @@ -588,7 +266,10 @@ 0 2 - + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + @@ -598,6 +279,7 @@ 292 {{207, 19}, {82, 52}} + NO @@ -620,6 +302,7 @@ 292 {{31, 77}, {82, 52}} + NO @@ -642,6 +325,7 @@ 292 {{119, 77}, {82, 52}} + NO @@ -664,6 +348,7 @@ 292 {{207, 77}, {82, 52}} + NO @@ -686,6 +371,7 @@ 292 {{31, 135}, {82, 52}} + NO @@ -708,6 +394,7 @@ 292 {{119, 135}, {82, 52}} + NO @@ -730,6 +417,7 @@ 292 {{207, 135}, {82, 52}} + NO @@ -752,6 +440,7 @@ 292 {{31, 193}, {82, 52}} + NO @@ -774,6 +463,7 @@ 292 {{207, 193}, {82, 52}} + NO @@ -794,6 +484,7 @@ {{0, 71}, {320, 310}} + 3 @@ -806,6 +497,7 @@ {320, 460} + NO @@ -991,128 +683,6 @@ 45 - - - endCtrl - - - - 99 - - - - hangUpView - - - - 122 - - - - pause - - - - 115 - - - - speaker - - - - 82 - - - - dialer - - - - 49 - - - - contacts - - - - 84 - - - - addCall - - - - 112 - - - - mute - - - - 80 - - - - mergeCalls - - - - 114 - - - - addVideo - - - - 125 - - - - videoUpdateIndicator - - - - 143 - - - - transfer - - - - 150 - - - - controlSubView - - - - 44 - - - - doAction: - - - 7 - - 103 - - - - doAction: - - - 7 - - 100 - doAction: @@ -1168,10 +738,8 @@ YES - - @@ -1325,101 +893,6 @@ 5 - - 120 - - - YES - - - - hangupview - - - 18 - - - end - - - 26 - - - YES - - - - - - - - - - - - - controls - - - 113 - - - pauseresume - - - 13 - - - speaker - - - 17 - - - dialer - - - 15 - - - contacts - - - 111 - - - addcall - - - 16 - - - mute - - - 104 - - - merge - - - 123 - - - video - - - 142 - - - video_update_indicator - - - 147 - - - transfer - @@ -1430,38 +903,14 @@ -1.IBPluginDependency -2.CustomClassName -2.IBPluginDependency - 104.IBPluginDependency - 104.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 106.IBPluginDependency - 111.IBPluginDependency - 111.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 113.IBPluginDependency - 113.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 120.IBPluginDependency - 123.CustomClassName - 123.IBPluginDependency - 123.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 126.IBPluginDependency 127.IBPluginDependency - 13.CustomClassName - 13.IBPluginDependency - 13.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 132.IBPluginDependency 137.IBPluginDependency 140.CustomClassName 140.IBPluginDependency - 142.IBPluginDependency 144.IBPluginDependency - 147.IBPluginDependency - 147.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 15.IBPluginDependency - 16.CustomClassName - 16.IBPluginDependency - 16.IBUIButtonInspectorSelectedStateConfigurationMetadataKey - 17.IBPluginDependency - 18.CustomClassName - 18.IBPluginDependency - 26.IBPluginDependency 27.IBPluginDependency 29.IBPluginDependency 30.CustomClassName @@ -1498,21 +947,8 @@ UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIToggleVideoButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UISpeakerButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin UICamSwitch @@ -1520,17 +956,6 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin 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 - com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton @@ -1573,7 +998,550 @@ 159 - + + + YES + + InCallViewController + UIViewController + + doAction: + id + + + doAction: + + doAction: + id + + + + YES + + YES + addCall + addVideo + callTableView + close + conferenceDetail + contacts + controlSubView + dialer + eight + endCtrl + five + four + hangUpView + hash + mergeCalls + mute + nine + one + padSubView + pause + seven + six + speaker + star + testVideoView + three + transfer + two + videoCallQuality + videoCameraSwitch + videoGroup + videoPreview + videoUpdateIndicator + videoView + videoViewController + videoWaitingForFirstImage + zero + + + YES + UIButton + UIToggleVideoButton + UITableView + UIButton + UIViewController + UIButton + UIView + UIButton + UIButton + UIButton + UIButton + UIButton + UIView + UIButton + UIButton + UIButton + UIButton + UIButton + UIView + UIButton + UIButton + UIButton + UIButton + UIButton + UIView + UIButton + UIButton + UIButton + UIImageView + UICamSwitch + UIView + UIView + UIActivityIndicatorView + UIView + VideoViewController + UIActivityIndicatorView + UIButton + + + + YES + + YES + addCall + addVideo + callTableView + close + conferenceDetail + contacts + controlSubView + dialer + eight + endCtrl + five + four + hangUpView + hash + mergeCalls + mute + nine + one + padSubView + pause + seven + six + speaker + star + testVideoView + three + transfer + two + videoCallQuality + videoCameraSwitch + videoGroup + videoPreview + videoUpdateIndicator + videoView + videoViewController + videoWaitingForFirstImage + zero + + + YES + + addCall + UIButton + + + addVideo + UIToggleVideoButton + + + callTableView + UITableView + + + close + UIButton + + + conferenceDetail + UIViewController + + + contacts + UIButton + + + controlSubView + UIView + + + dialer + UIButton + + + eight + UIButton + + + endCtrl + UIButton + + + five + UIButton + + + four + UIButton + + + hangUpView + UIView + + + hash + UIButton + + + mergeCalls + UIButton + + + mute + UIButton + + + nine + UIButton + + + one + UIButton + + + padSubView + UIView + + + pause + UIButton + + + seven + UIButton + + + six + UIButton + + + speaker + UIButton + + + star + UIButton + + + testVideoView + UIView + + + three + UIButton + + + transfer + UIButton + + + two + UIButton + + + videoCallQuality + UIImageView + + + videoCameraSwitch + UICamSwitch + + + videoGroup + UIView + + + videoPreview + UIView + + + videoUpdateIndicator + UIActivityIndicatorView + + + videoView + UIView + + + videoViewController + VideoViewController + + + videoWaitingForFirstImage + UIActivityIndicatorView + + + zero + UIButton + + + + + IBProjectSource + ./Classes/InCallViewController.h + + + + UICamSwitch + UIButton + + preview + UIView + + + preview + + preview + UIView + + + + IBProjectSource + ./Classes/UICamSwitch.h + + + + UIDigitButton + UIButton + + IBProjectSource + ./Classes/UIDigitButton.h + + + + UIHangUpButton + UIButton + + IBProjectSource + ./Classes/UIHangUpButton.h + + + + UIMuteButton + UIToggleButton + + IBProjectSource + ./Classes/UIMuteButton.h + + + + UIToggleButton + UIButton + + IBProjectSource + ./Classes/UIToggleButton.h + + + + UIToggleVideoButton + UIButton + + videoUpdateIndicator + UIActivityIndicatorView + + + videoUpdateIndicator + + videoUpdateIndicator + UIActivityIndicatorView + + + + IBProjectSource + ./Classes/UIToggleVideoButton.h + + + + VideoViewController + UIViewController + + YES + + YES + mCallQuality + mCallQualityLandLeft + mCallQualityLandRight + mCamSwitch + mCamSwitchLandLeft + mCamSwitchLandRight + mDisplay + mDisplayLandLeft + mDisplayLandRight + mHangUp + mHangUpLandLeft + mHangUpLandRight + mLandscapeLeft + mLandscapeRight + mMute + mMuteLandLeft + mMuteLandRight + mPortrait + mPreview + mPreviewLandLeft + mPreviewLandRight + + + YES + UIImageView + UIImageView + UIImageView + UICamSwitch + UICamSwitch + UICamSwitch + UIView + UIView + UIView + UIHangUpButton + UIHangUpButton + UIHangUpButton + UIView + UIView + UIMuteButton + UIMuteButton + UIMuteButton + UIView + UIView + UIView + UIView + + + + YES + + YES + mCallQuality + mCallQualityLandLeft + mCallQualityLandRight + mCamSwitch + mCamSwitchLandLeft + mCamSwitchLandRight + mDisplay + mDisplayLandLeft + mDisplayLandRight + mHangUp + mHangUpLandLeft + mHangUpLandRight + mLandscapeLeft + mLandscapeRight + mMute + mMuteLandLeft + mMuteLandRight + mPortrait + mPreview + mPreviewLandLeft + mPreviewLandRight + + + YES + + mCallQuality + UIImageView + + + mCallQualityLandLeft + UIImageView + + + mCallQualityLandRight + UIImageView + + + mCamSwitch + UICamSwitch + + + mCamSwitchLandLeft + UICamSwitch + + + mCamSwitchLandRight + UICamSwitch + + + mDisplay + UIView + + + mDisplayLandLeft + UIView + + + mDisplayLandRight + UIView + + + mHangUp + UIHangUpButton + + + mHangUpLandLeft + UIHangUpButton + + + mHangUpLandRight + UIHangUpButton + + + mLandscapeLeft + UIView + + + mLandscapeRight + UIView + + + mMute + UIMuteButton + + + mMuteLandLeft + UIMuteButton + + + mMuteLandRight + UIMuteButton + + + mPortrait + UIView + + + mPreview + UIView + + + mPreviewLandLeft + UIView + + + mPreviewLandRight + UIView + + + + + IBProjectSource + ./Classes/VideoViewController.h + + + + 0 IBCocoaTouchFramework @@ -1591,41 +1559,8 @@ YES 3 - YES - - YES - HP.png - HP_inverse.png - ajouter.png - clavier-01-106px.png - clavier-01-160px.png - clavier.png - contact.png - grouper.png - mic_active.png - micro.png - micro_inverse.png - pause.png - pause_inactif.png - stopcall-red.png - - - YES - {107, 67} - {107, 67} - {107, 67} - {106, 60} - {160, 60} - {106, 67} - {107, 67} - {106, 67} - {82, 82} - {107, 67} - {107, 67} - {106, 67} - {106, 67} - {62, 54} - + clavier-01-106px.png + {106, 60} 1181 diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 4d4a92006..6a95c069e 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -20,7 +20,6 @@ #import "PhoneMainView.h" #import "PhoneViewController.h" #import "linphoneAppDelegate.h" -#import "ContactPickerDelegate.h" #import "AddressBook/ABPerson.h" #import "CoreTelephony/CTCallCenter.h" diff --git a/Classes/LinphoneUI/LinphoneCallBar.h b/Classes/LinphoneUI/LinphoneCallBar.h index d216a60bc..0a4b18262 100644 --- a/Classes/LinphoneUI/LinphoneCallBar.h +++ b/Classes/LinphoneUI/LinphoneCallBar.h @@ -19,8 +19,18 @@ #import +#import "UIMicroButton.h" + @interface LinphoneCallBar : UIViewController { - + UIButton* pauseButton; + UIButton* videoButton; + UIMicroButton* microButton; + UIButton* speakerButton; } +@property (nonatomic, retain) IBOutlet UIButton* pauseButton; +@property (nonatomic, retain) IBOutlet UIButton* videoButton; +@property (nonatomic, retain) IBOutlet UIMicroButton* microButton; +@property (nonatomic, retain) IBOutlet UIButton* speakerButton; +-(IBAction) onPauseClick: (id) event; @end diff --git a/Classes/LinphoneUI/LinphoneCallBar.m b/Classes/LinphoneUI/LinphoneCallBar.m index b0868360e..41ff73d57 100644 --- a/Classes/LinphoneUI/LinphoneCallBar.m +++ b/Classes/LinphoneUI/LinphoneCallBar.m @@ -18,7 +18,135 @@ */ #import "LinphoneCallBar.h" +#import "LinphoneManager.h" + +#include "linphonecore.h" +#include "private.h" + +#define STRINGIFY(x) #x +#define TOSTRING(x) STRINGIFY(x) +#define AT __FILE__ ":" TOSTRING(__LINE__) @implementation LinphoneCallBar +@synthesize pauseButton; +@synthesize videoButton; +@synthesize microButton; +@synthesize speakerButton; + +- (void) viewDidLoad { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil]; +} + +bool isInConference2(LinphoneCall* call) { + if (!call) + return false; + return linphone_call_get_current_params(call)->in_conference; +} + +int callCount2(LinphoneCore* lc) { + int count = 0; + const MSList* calls = linphone_core_get_calls(lc); + + while (calls != 0) { + if (!isInConference2((LinphoneCall*)calls->data)) { + count++; + } + calls = calls->next; + } + return count; +} + +-(IBAction) onPauseClick: (id) event { + [LinphoneManager logUIElementPressed:"PAUSE button"]; + + LinphoneCore* lc = [LinphoneManager getLc]; + LinphoneCall* currentCall = linphone_core_get_current_call(lc); + if (currentCall) { + if (linphone_call_get_state(currentCall) == LinphoneCallStreamsRunning) { + [pauseButton setSelected:NO]; + linphone_core_pause_call(lc, currentCall); + + // hide video view + //TODO + //[self disableVideoDisplay]; + } + } else { + if (linphone_core_get_calls_nb(lc) == 1) { + LinphoneCall* c = (LinphoneCall*) linphone_core_get_calls(lc)->data; + if (linphone_call_get_state(c) == LinphoneCallPaused) { + linphone_core_resume_call(lc, c); + [pauseButton setSelected:YES]; + + const LinphoneCallParams* p = linphone_call_get_current_params(c); + if (linphone_call_params_video_enabled(p)) { + //TODO + //[self enableVideoDisplay]; + } + } + } + } +} + +- (void) callUpdate: (NSNotification*) notif { + bool fullUpdate = true; + // check LinphoneCore is initialized + LinphoneCore* lc = nil; + @try { + lc = [LinphoneManager getLc]; + } @catch (NSException* exc) { + return; + } + // 1 call: show pause button, otherwise show merge btn + [LinphoneManager set:pauseButton enabled:(callCount2(lc) == 1) withName:"PAUSE button" andReason:"call count"]; + //TODO + //[LinphoneManager set:mergeCalls hidden:!pause.hidden withName:"MERGE button" andReason:"call count"]; + + LinphoneCall* currentCall = linphone_core_get_current_call([LinphoneManager getLc]); + int callsCount = linphone_core_get_calls_nb(lc); + + // hide pause/resume if in conference + if (currentCall) { + [microButton reset]; + if (linphone_core_is_in_conference(lc)) { + [LinphoneManager set:pauseButton enabled:FALSE withName:"PAUSE button" andReason:"is in conference"]; + } + else if (callCount2(lc) == callsCount && callsCount == 1) { + [LinphoneManager set:pauseButton enabled:TRUE withName:"PAUSE button" andReason:"call count == 1"]; + pauseButton.selected = NO; + } else { + [LinphoneManager set:pauseButton enabled:FALSE withName:"PAUSE button" andReason:AT]; + } + + if (fullUpdate) { + //TODO + //videoUpdateIndicator.hidden = YES; + LinphoneCallState state = linphone_call_get_state(currentCall); + if (state == LinphoneCallStreamsRunning || state == LinphoneCallUpdated || state == LinphoneCallUpdatedByRemote) { + if (linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall))) { + [videoButton setSelected:TRUE]; + } else { + [videoButton setSelected:FALSE]; + } + [videoButton setEnabled:YES]; + } else { + [videoButton setEnabled:NO]; + //[videoCallQuality setImage:nil]; + } + } + } else { + if (callsCount == 1) { + LinphoneCall* c = (LinphoneCall*)linphone_core_get_calls(lc)->data; + if (linphone_call_get_state(c) == LinphoneCallPaused || + linphone_call_get_state(c) == LinphoneCallPausing) { + pauseButton.selected = YES; + } + [LinphoneManager set:pauseButton enabled:TRUE withName:"PAUSE button" andReason:AT]; + } else { + [LinphoneManager set:pauseButton enabled:FALSE withName:"PAUSE button" andReason:AT]; + } + [videoButton setEnabled:NO]; + } +} + @end diff --git a/Classes/LinphoneUI/LinphoneCallBar.xib b/Classes/LinphoneUI/LinphoneCallBar.xib index cf9e4e53b..a9dda05bd 100644 --- a/Classes/LinphoneUI/LinphoneCallBar.xib +++ b/Classes/LinphoneUI/LinphoneCallBar.xib @@ -31,17 +31,17 @@ IBFirstResponder IBCocoaTouchFramework - + 292 - - + + -2147483356 {320, 135} - + - + _NS:9 3 @@ -54,13 +54,13 @@ NO IBCocoaTouchFramework - - + + 292 {80, 67} - + - + _NS:9 NO @@ -69,7 +69,8 @@ IBCocoaTouchFramework 0 0 - + NO + 3 MQA @@ -77,7 +78,7 @@ 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + 3 MC41AA @@ -93,23 +94,23 @@ NSImage video-OFF-actif.png - + 2 15 - + Helvetica-Bold 15 16 - - + + 292 {{80, 0}, {80, 67}} - + - + _NS:9 NO @@ -118,12 +119,13 @@ IBCocoaTouchFramework 0 0 - + NO + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + NSImage micro-ON-over.png @@ -136,16 +138,16 @@ NSImage micro-OFF-actif.png - - + + - - + + 292 {{160, 0}, {80, 67}} - + - + _NS:9 NO @@ -154,31 +156,32 @@ IBCocoaTouchFramework 0 0 - + NO + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + NSImage speacker-ON-over.png - + NSImage speacker-OFF-actif.png - - - + + + - - + + 292 {{240, 0}, {80, 67}} - + - + _NS:9 NO @@ -187,31 +190,32 @@ IBCocoaTouchFramework 0 0 - + NO + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - + + NSImage add-call-over.png - + NSImage add-call-actif.png - - + + - - + + 264 {{0, 67}, {105, 68}} - + - + _NS:9 NO @@ -220,13 +224,14 @@ IBCocoaTouchFramework 0 0 - + NO + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - + + NSImage pause-over.png @@ -234,17 +239,17 @@ NSImage pause-actif.png - - - + + + - - + + 264 {{105, 67}, {111, 68}} - + - + _NS:9 NO @@ -253,13 +258,14 @@ IBCocoaTouchFramework 0 0 - + NO + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - + + NSImage raccrocher-over.png @@ -267,16 +273,17 @@ NSImage raccrocher-actif.png - - - + + + - - + + 264 {{215, 67}, {105, 68}} - + + _NS:9 NO @@ -285,13 +292,14 @@ IBCocoaTouchFramework 0 0 - + NO + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - + + NSImage dialer-meteo-sortir-over.png @@ -299,15 +307,15 @@ NSImage dialer-meteo-sortir-actif.png - - - + + + {320, 135} - + _NS:9 1 @@ -323,10 +331,51 @@ view - + 13 + + + pauseButton + + + + 15 + + + + speakerButton + + + + 16 + + + + videoButton + + + + 17 + + + + microButton + + + + 14 + + + + onPauseClick: + + + 7 + + 18 + @@ -349,67 +398,68 @@ 4 - + - - - - - - - - + + + + + + + + callTabBar 5 - - + + + mask 6 - - + + back 7 - - + + hangup 8 - - + + pause 9 - - + + speaker 10 - - + + addCall - 11 - - - micro + 12 + + + video - 12 - - - video + 11 + + + micro @@ -420,18 +470,22 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIMicroButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIToggleVideoButton 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 + UISpeakerButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -439,18 +493,104 @@ - 13 + 18 LinphoneCallBar UIViewController + + onPauseClick: + id + + + onPauseClick: + + onPauseClick: + id + + + + UIMicroButton + UIButton + UIButton + UIButton + + + + microButton + UIMicroButton + + + pauseButton + UIButton + + + speakerButton + UIButton + + + videoButton + UIButton + + IBProjectSource ./Classes/LinphoneCallBar.h + + UIHangUpButton + UIButton + + IBProjectSource + ./Classes/UIHangUpButton.h + + + + UIMicroButton + UIToggleButton + + IBProjectSource + ./Classes/UIMicroButton.h + + + + UISpeakerButton + UIToggleButton + + IBProjectSource + ./Classes/UISpeakerButton.h + + + + UIToggleButton + UIButton + + IBProjectSource + ./Classes/UIToggleButton.h + + + + UIToggleVideoButton + UIButton + + videoUpdateIndicator + UIActivityIndicatorView + + + videoUpdateIndicator + + videoUpdateIndicator + UIActivityIndicatorView + + + + IBProjectSource + ./Classes/UIToggleVideoButton.h + + 0 diff --git a/Classes/LinphoneUI/LinphoneMainBar.m b/Classes/LinphoneUI/LinphoneMainBar.m index a2d042cae..e3f858e21 100644 --- a/Classes/LinphoneUI/LinphoneMainBar.m +++ b/Classes/LinphoneUI/LinphoneMainBar.m @@ -63,11 +63,16 @@ - (void) viewDidUnload { [[NSNotificationCenter defaultCenter] removeObserver:self]; + [historyButton release]; + [contactsButton release]; + [dialerButton release]; + [settingsButton release]; + [chatButton release]; } - (void) dealloc { - [super dealloc]; [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; } - (IBAction) onHistoryClick: (id) sender { diff --git a/Classes/LinphoneUI/LinphoneManager.h b/Classes/LinphoneUI/LinphoneManager.h index fe3d26bf0..60869ddd4 100644 --- a/Classes/LinphoneUI/LinphoneManager.h +++ b/Classes/LinphoneUI/LinphoneManager.h @@ -20,9 +20,9 @@ #import #import #import -#include "linphonecore.h" #import "LogView.h" -#import "LinphoneUIDelegates.h" + +#include "linphonecore.h" typedef enum _PhoneView { PhoneView_Dialer, @@ -58,6 +58,12 @@ typedef struct _LinphoneCallAppData { int transferButtonIndex; } LinphoneCallAppData; +@interface LinphoneCallWrapper : NSObject { + @public + LinphoneCall* call; +} +- (id) initWithCall: (LinphoneCall*) call; +@end @interface LinphoneManager : NSObject { @protected @@ -66,7 +72,6 @@ typedef struct _LinphoneCallAppData { NSTimer* mIterateTimer; id mLogView; bool isbackgroundModeEnabled; - id callDelegate; UIViewController* mCurrentViewController; Connectivity connectivity; @@ -85,10 +90,9 @@ typedef struct _LinphoneCallAppData { +(LinphoneCore*) getLc; +(BOOL) runningOnIpad; +(void) set:(UIView*)view hidden: (BOOL) hidden withName:(const char*)name andReason:(const char*) reason; ++(void) set:(UIButton*)view enabled: (BOOL) enabled withName:(const char*)name andReason:(const char*) reason; +(void) logUIElementPressed:(const char*) name; --(void) displayDialer; - -(void) registerLogView:(id) view; -(void) startLibLinphone; @@ -106,9 +110,9 @@ typedef struct _LinphoneCallAppData { -(void) refreshRegisters; -(void) changeView:(PhoneView) view; +-(void) changeView:(PhoneView) view dict:(NSDictionary *)dict; -(PhoneView) currentView; -@property (nonatomic, retain) id callDelegate; @property Connectivity connectivity; @property (readonly) const char* frontCamId; @property (readonly) const char* backCamId; diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 9a88cbe3f..3102f382f 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -49,8 +49,20 @@ extern void libmssilk_init(); #if HAVE_G729 extern void libmsbcg729_init(); #endif + +@implementation LinphoneCallWrapper + +- (id) initWithCall: (LinphoneCall*) acall { + if((self = [super init]) != nil) { + call = acall; + } + return self; +} + +@end + @implementation LinphoneManager -@synthesize callDelegate; + @synthesize connectivity; @synthesize frontCamId; @synthesize backCamId; @@ -69,16 +81,23 @@ extern void libmsbcg729_init(); } -(void) changeView:(PhoneView) view { + [self changeView:view dict:nil]; +} + +-(void) changeView:(PhoneView) view dict:(NSDictionary *)dict { currentView = view; - NSDictionary* dict = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:currentView] forKey:@"view"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:dict]; + + NSMutableDictionary* mdict = [NSMutableDictionary dictionaryWithObject: [NSNumber numberWithInt:currentView] forKey:@"view"]; + if(dict != nil) + [mdict addEntriesFromDictionary:dict]; + + [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:mdict]; } -(PhoneView) currentView { return currentView; } - -(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log { //1 normalize NSString* lNormalizedNumber = [FastAddressBook normalizePhoneNumber:number]; @@ -151,6 +170,7 @@ extern void libmsbcg729_init(); } -(void) onCall:(LinphoneCall*) call StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message { + // Handling wrapper if(new_state == LinphoneCallReleased) { if(linphone_call_get_user_pointer(call) != NULL) { free (linphone_call_get_user_pointer(call)); @@ -158,85 +178,43 @@ extern void libmsbcg729_init(); } return; } - - const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); - NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); - if (new_state == LinphoneCallIncomingReceived) { - [self updateCallWithAddressBookData:call]; // display name is updated - } - const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); - NSString* lDisplayName = [lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@"" autorelease]; - - bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL); - if (!linphone_call_get_user_pointer(call)) { LinphoneCallAppData* data = (LinphoneCallAppData*) malloc(sizeof(LinphoneCallAppData)); data->batteryWarningShown = FALSE; linphone_call_set_user_pointer(call, data); } - switch (new_state) { - case LinphoneCallIncomingReceived: - [callDelegate displayIncomingCall:call - NotificationFromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName]; - break; - - case LinphoneCallOutgoingInit: - [callDelegate displayCall:call - InProgressFromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName]; - break; - case LinphoneCallPausedByRemote: - case LinphoneCallConnected: - [callDelegate displayInCall: call - FromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName]; - break; - case LinphoneCallUpdatedByRemote: - { - const LinphoneCallParams* current = linphone_call_get_current_params(call); - const LinphoneCallParams* remote = linphone_call_get_remote_params(call); - - /* remote wants to add video */ - if (!linphone_call_params_video_enabled(current) && linphone_call_params_video_enabled(remote) && !linphone_core_get_video_policy(theLinphoneCore)->automatically_accept) { - linphone_core_defer_call_update(theLinphoneCore, call); - [callDelegate displayAskToEnableVideoCall:call forUser:lUserName withDisplayName:lDisplayName]; - } else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) { - [callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; - } - break; - } - case LinphoneCallUpdated: - { - const LinphoneCallParams* current = linphone_call_get_current_params(call); - if (linphone_call_params_video_enabled(current)) { - [callDelegate displayVideoCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; + if (new_state == LinphoneCallIncomingReceived) { + [self updateCallWithAddressBookData:call]; // display name is updated + } + + // Post event + NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys: + [[[LinphoneCallWrapper alloc] initWithCall: call] autorelease], @"call", + [NSNumber numberWithInt:new_state], @"state", + [[NSString stringWithFormat:@"%c", message] autorelease], @"message", + nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self userInfo:dict]; + + const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); + NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); + switch (new_state) { + case LinphoneCallError: { + /* + NSString* lTitle= state->message!=nil?[NSString stringWithCString:state->message length:strlen(state->message)]: @"Error"; + NSString* lMessage=lTitle; + */ + NSString* lMessage; + NSString* lTitle; + LinphoneProxyConfig* proxyCfg; + //get default proxy + linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); + if (proxyCfg == nil) { + lMessage=NSLocalizedString(@"Please make sure your device is connected to the internet and double check your SIP account configuration in the settings.",nil ); } else { - [callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; + lMessage=[NSString stringWithFormat : NSLocalizedString(@"Cannot call %@",nil),lUserName]; } - break; - - } - case LinphoneCallError: { - /* - NSString* lTitle= state->message!=nil?[NSString stringWithCString:state->message length:strlen(state->message)]: @"Error"; - NSString* lMessage=lTitle; - */ - NSString* lMessage; - NSString* lTitle; - LinphoneProxyConfig* proxyCfg; - //get default proxy - linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); - if (proxyCfg == nil) { - lMessage=NSLocalizedString(@"Please make sure your device is connected to the internet and double check your SIP account configuration in the settings.",nil); - } else { - lMessage=[NSString stringWithFormat : NSLocalizedString(@"Cannot call %@",nil),lUserName]; - } - + if (linphone_call_get_reason(call) == LinphoneReasonNotFound) { lMessage=[NSString stringWithFormat : NSLocalizedString(@"'%@' not registered to Service",nil), lUserName]; } else { @@ -244,59 +222,20 @@ extern void libmsbcg729_init(); lMessage=[NSString stringWithFormat : NSLocalizedString(@"%@\nReason was: %s",nil),lMessage, message]; } } - lTitle=NSLocalizedString(@"Call failed",nil); - - UIAlertView* error = [[UIAlertView alloc] initWithTitle:lTitle - message:lMessage - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Dismiss",nil) - otherButtonTitles:nil]; - [error show]; + lTitle=NSLocalizedString(@"Call failed",nil); + UIAlertView* error = [[UIAlertView alloc] initWithTitle:lTitle + message:lMessage + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Dismiss",nil) + otherButtonTitles:nil]; + [error show]; [error release]; - if (canHideInCallView) { - [callDelegate displayDialerFromUI:mCurrentViewController - forUser:@"" - withDisplayName:@""]; - } else { - [callDelegate displayInCall:call - FromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName]; - } - break; - } - case LinphoneCallEnd: - if (canHideInCallView) { - [callDelegate displayDialerFromUI:mCurrentViewController - forUser:@"" - withDisplayName:@""]; - } else { - [callDelegate displayInCall:call - FromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName]; - } - break; - case LinphoneCallStreamsRunning: - //check video - if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { - [callDelegate displayVideoCall:call FromUI:mCurrentViewController - forUser:lUserName - withDisplayName:lDisplayName]; - } else { - [callDelegate displayInCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; - } - break; + break; + } default: break; - } - -} - --(void) displayDialer { - [callDelegate displayDialerFromUI:mCurrentViewController - forUser:@"" - withDisplayName:@""]; + } + } +(LinphoneCore*) getLc { @@ -306,12 +245,18 @@ extern void libmsbcg729_init(); return theLinphoneCore; } --(void) addLog:(NSString*) log { +- (void)addLog:(NSString*) log { [mLogView addLog:log]; } --(void)displayStatus:(NSString*) message { - [callDelegate displayStatus:message]; + +- (void)displayStatus:(NSString*) message { + // Post event + NSDictionary* dict = [[NSDictionary alloc] initWithObjectsAndKeys: + message, @"message", + nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneDisplayStatus" object:self userInfo:dict]; } + //generic log handler for debug version static void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){ NSString* format = [[NSString alloc] initWithCString:fmt encoding:[NSString defaultCStringEncoding]]; @@ -1062,6 +1007,13 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach return NO; } ++(void) set:(UIButton*)view enabled: (BOOL) enabled withName:(const char*)name andReason:(const char*) reason{ + if (view.enabled != enabled) { + ms_message("UI - '%s' is now '%s' ('%s')", name, enabled ? "ENABLED" : "DISABLED", reason); + [view setEnabled:enabled]; + } +} + +(void) set:(UIView*)view hidden: (BOOL) hidden withName:(const char*)name andReason:(const char*) reason{ if (view.hidden != hidden) { ms_message("UI - '%s' is now '%s' ('%s')", name, hidden ? "HIDDEN" : "SHOWN", reason); diff --git a/Classes/LinphoneUI/LinphoneUIDelegates.h b/Classes/LinphoneUI/LinphoneUIDelegates.h deleted file mode 100644 index 4abdf0027..000000000 --- a/Classes/LinphoneUI/LinphoneUIDelegates.h +++ /dev/null @@ -1,34 +0,0 @@ -/* LinphoneUIControler.h - * - * Copyright (C) 2011 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 -#include "linphonecore.h" - -@protocol LinphoneUICallDelegate -// UI changes --(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(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; -//status reporting --(void) displayStatus:(NSString*) message; --(void) displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) firstVideoFrameDecoded:(LinphoneCall*) call; -@end - diff --git a/Classes/LinphoneUI/UILinphone.h b/Classes/LinphoneUI/UILinphone.h index a65b21951..e195b8d5f 100644 --- a/Classes/LinphoneUI/UILinphone.h +++ b/Classes/LinphoneUI/UILinphone.h @@ -21,10 +21,9 @@ #import "UIHangUpButton.h" #import "UIDigitButton.h" #import "UIToggleButton.h" -#import "UIMuteButton.h" +#import "UIMicroButton.h" #import "UISpeakerButton.h" #import "UIDuration.h" #import "UIEraseButton.h" -#import "LinphoneUIDelegates.h" #import "UICamSwitch.h" #import "UIPauseResumeButton.h" diff --git a/Classes/LinphoneUI/UIMuteButton.h b/Classes/LinphoneUI/UIMicroButton.h similarity index 94% rename from Classes/LinphoneUI/UIMuteButton.h rename to Classes/LinphoneUI/UIMicroButton.h index cef92d8a4..eab24d82b 100644 --- a/Classes/LinphoneUI/UIMuteButton.h +++ b/Classes/LinphoneUI/UIMicroButton.h @@ -21,7 +21,7 @@ #import "UIToggleButton.h" -@interface UIMuteButton : UIToggleButton { +@interface UIMicroButton : UIToggleButton { } diff --git a/Classes/LinphoneUI/UIMuteButton.m b/Classes/LinphoneUI/UIMicroButton.m similarity index 74% rename from Classes/LinphoneUI/UIMuteButton.m rename to Classes/LinphoneUI/UIMicroButton.m index 033d5bdb7..20b85983a 100644 --- a/Classes/LinphoneUI/UIMuteButton.m +++ b/Classes/LinphoneUI/UIMicroButton.m @@ -15,42 +15,33 @@ * 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 "UIMuteButton.h" -#include "LinphoneManager.h" + */ +#import "UIMicroButton.h" -@implementation UIMuteButton +#import "LinphoneManager.h" +@implementation UIMicroButton - --(void) onOn { - linphone_core_mute_mic([LinphoneManager getLc], true); -} --(void) onOff { +- (void)onOn { linphone_core_mute_mic([LinphoneManager getLc], false); } --(bool) isInitialStateOn { - @try { - return true == linphone_core_is_mic_muted([LinphoneManager getLc]); - } @catch(NSException* e) { - //not ready yet - return false; - } - + +- (void)onOff { + linphone_core_mute_mic([LinphoneManager getLc], true); } -/* -// Only override drawRect: if you perform custom drawing. -// An empty implementation adversely affects performance during animation. -- (void)drawRect:(CGRect)rect { - // Drawing code. +- (bool)isInitialStateOn { + @try { + return linphone_core_is_mic_muted([LinphoneManager getLc]) == false; + } @catch(NSException* e) { + //not ready yet + return true; + } } -*/ - (void)dealloc { [super dealloc]; } - @end diff --git a/Classes/LinphoneUI/UISpeakerButton.m b/Classes/LinphoneUI/UISpeakerButton.m index 1508f4cdf..3cf561365 100644 --- a/Classes/LinphoneUI/UISpeakerButton.m +++ b/Classes/LinphoneUI/UISpeakerButton.m @@ -35,14 +35,16 @@ static void audioRouteChangeListenerCallback ( } --(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{ - [super initWithOnImage:onImage offImage:offImage debugName:name]; +- (id)init { + if((self = [super init]) != nil) { - AudioSessionInitialize(NULL, NULL, NULL, NULL); - OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self); - if (lStatus) { - ms_error ("cannot register route change handler [%ld]",lStatus); - } + AudioSessionInitialize(NULL, NULL, NULL, NULL); + OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self); + if (lStatus) { + ms_error ("cannot register route change handler [%ld]",lStatus); + } + } + return self; } diff --git a/Classes/LinphoneUI/UIToggleButton.h b/Classes/LinphoneUI/UIToggleButton.h index 6e37990d0..50d8a6268 100644 --- a/Classes/LinphoneUI/UIToggleButton.h +++ b/Classes/LinphoneUI/UIToggleButton.h @@ -25,18 +25,9 @@ -(bool) isInitialStateOn; @end -@interface UIToggleButton : UIButton { -@private - UIImage* mOnImage; - UIImage* mOffImage; - bool mIsOn; - const char* debugName; - - +@interface UIToggleButton : UIButton { } --(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char*) name; -(bool) reset; --(bool) isOn; -(bool) toggle; @end diff --git a/Classes/LinphoneUI/UIToggleButton.m b/Classes/LinphoneUI/UIToggleButton.m index c6db043e3..0c34e15f2 100644 --- a/Classes/LinphoneUI/UIToggleButton.m +++ b/Classes/LinphoneUI/UIToggleButton.m @@ -16,60 +16,55 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #import "UIToggleButton.h" -#include "linphonecore.h" @implementation UIToggleButton --(void) touchUp:(id) sender { +- (void)touchUp:(id) sender { [self toggle]; } --(bool) isOn { - return mIsOn; -} --(bool) toggle { - ms_message("UI - Toggle button '%s' state change %d -> %d", - debugName, mIsOn, !mIsOn); - if (mIsOn) { - [self setImage:mOffImage forState:UIControlStateNormal]; - mIsOn=!mIsOn; + +- (bool)toggle { + if (self.selected) { + self.selected=!self.selected; [self onOff]; } else { - [self setImage:mOnImage forState:UIControlStateNormal]; - mIsOn=!mIsOn; + self.selected=!self.selected; [self onOn]; } - return mIsOn; - -} --(bool) reset { - mIsOn = [self isInitialStateOn]; - [self setImage:mIsOn?mOnImage:mOffImage forState:UIControlStateNormal]; - return mIsOn; + return self.selected; } --(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{ - mOnImage = [onImage retain]; - mOffImage = [offImage retain]; - mIsOn=false; - debugName = name; - [self reset]; +- (bool)reset { + self.selected = [self isInitialStateOn]; + return self.selected; +} + +- (id) init { + [self reset]; [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; - + return self; } -/* - // Only override drawRect: if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - - (void)drawRect:(CGRect)rect { - // Drawing code. - } - */ +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self init]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self init]; + } + return self; +} - (void)dealloc { [super dealloc]; - [mOffImage release]; - [mOffImage release]; } -(void) onOn { @@ -86,5 +81,4 @@ return false; } - @end diff --git a/Classes/LinphoneUI/UIToggleVideoButton.m b/Classes/LinphoneUI/UIToggleVideoButton.m index 1c96079a3..da69d7174 100644 --- a/Classes/LinphoneUI/UIToggleVideoButton.m +++ b/Classes/LinphoneUI/UIToggleVideoButton.m @@ -55,14 +55,15 @@ [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; return self; } + - (id)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; if (self) { [self init]; } return self; } + - (id)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (self) { diff --git a/Classes/MoreViewController.m b/Classes/MoreViewController.m index b2b9e4a96..b68f444a7 100644 --- a/Classes/MoreViewController.m +++ b/Classes/MoreViewController.m @@ -21,7 +21,6 @@ #include "ConsoleViewController.h" #import "LinphoneManager.h" - @implementation MoreViewController @synthesize web; @synthesize credit; @@ -29,7 +28,6 @@ @synthesize creditText; @synthesize weburi; - //Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; @@ -40,8 +38,6 @@ } - - /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -62,16 +58,12 @@ // e.g. self.myOutlet = nil; } - - (void)dealloc { [super dealloc]; } - - -(void) enableLogView { isLogViewEnabled = true; - } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { @@ -99,9 +91,6 @@ } } - - - - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { return credit; diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index f9708a822..85e829d48 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -29,20 +29,23 @@ @private NSMutableDictionary *viewDescriptions; NSArray *views; - UIViewController *callTabBarController; + UIViewController *statusBarController; + + UIViewController *callTabBarController; UIViewController *mainTabBarController; - UIView *addCallTabBar; + UIViewController *incomingCallTabBarController; } @property (nonatomic, retain) IBOutlet UIView* statusBarView; @property (nonatomic, retain) IBOutlet UIView* contentView; @property (nonatomic, retain) IBOutlet UIView* tabBarView; -@property (nonatomic, retain) IBOutlet UIViewController* callTabBarController; @property (nonatomic, retain) IBOutlet UIViewController* statusBarController; + +@property (nonatomic, retain) IBOutlet UIViewController* callTabBarController; @property (nonatomic, retain) IBOutlet UIViewController* mainTabBarController; -@property (nonatomic, retain) IBOutlet UIView* addCallTabBar; +@property (nonatomic, retain) IBOutlet UIViewController* incomingCallTabBarController; -(void) changeView: (NSNotification*) notif; @end diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index ba851eb9b..788272d0d 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -45,13 +45,14 @@ typedef enum _TabBar { @synthesize contentView; @synthesize tabBarView; -@synthesize callTabBarController; @synthesize statusBarController; -@synthesize mainTabBarController; -@synthesize addCallTabBar; -- (void) changeView: (NSNotification*) notif { - PhoneView view = [[notif.userInfo objectForKey: @"PhoneView"] intValue]; +@synthesize callTabBarController; +@synthesize mainTabBarController; +@synthesize incomingCallTabBarController; + +- (void)changeView: (NSNotification*) notif { + PhoneView view = [[notif.userInfo objectForKey: @"view"] intValue]; ViewsDescription *description = [viewDescriptions objectForKey:[NSNumber numberWithInt: view]]; for (UIView *view in contentView.subviews) { @@ -101,7 +102,7 @@ typedef enum _TabBar { contentView.frame = contentFrame; } --(void)viewDidLoad { +- (void)viewDidLoad { [super viewDidLoad]; UIView *dumb; @@ -174,11 +175,11 @@ typedef enum _TabBar { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeView:) name:@"LinphoneMainViewChange" object:nil]; } -- (void) viewDidUnload { +- (void)viewDidUnload { [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (void) dealloc { +- (void)dealloc { [super dealloc]; [viewDescriptions dealloc]; [statusBarView dealloc]; diff --git a/Classes/PhoneMainView.xib b/Classes/PhoneMainView.xib index 2b2629153..9451833ab 100644 --- a/Classes/PhoneMainView.xib +++ b/Classes/PhoneMainView.xib @@ -161,7 +161,7 @@ 2 15 - + Helvetica-Bold 15 16 @@ -196,7 +196,7 @@ refuser-actif.png - + {320, 77} @@ -263,7 +263,7 @@ contact-actif-add-call.png - + @@ -294,7 +294,7 @@ cancel-actif.png - + @@ -327,7 +327,7 @@ - + {320, 72} @@ -352,7 +352,7 @@ IBCocoaTouchFramework NO - + NO @@ -400,14 +400,6 @@ 159 - - - addCallTabBar - - - - 164 - statusBarView @@ -436,7 +428,7 @@ callTabBarController - + 196 @@ -583,7 +575,7 @@ 194 - + callBarController @@ -682,112 +674,6 @@ LinphoneMainBar UIViewController - - YES - - YES - onChatClick: - onContactsClick: - onDialerClick: - onHistoryClick: - onSettingsClick: - - - YES - id - id - id - id - id - - - - YES - - YES - onChatClick: - onContactsClick: - onDialerClick: - onHistoryClick: - onSettingsClick: - - - YES - - onChatClick: - id - - - onContactsClick: - id - - - onDialerClick: - id - - - onHistoryClick: - id - - - onSettingsClick: - id - - - - - YES - - YES - chatButton - contactsButton - dialerButton - historyButton - settingsButton - - - YES - UIButton - UIButton - UIButton - UIButton - UIButton - - - - YES - - YES - chatButton - contactsButton - dialerButton - historyButton - settingsButton - - - YES - - chatButton - UIButton - - - contactsButton - UIButton - - - dialerButton - UIButton - - - historyButton - UIButton - - - settingsButton - UIButton - - - IBProjectSource ./Classes/LinphoneMainBar.h @@ -847,9 +733,9 @@ YES YES - addCallTabBar callTabBarController contentView + incomingCallTabBarController mainTabBarController statusBarController statusBarView @@ -857,11 +743,11 @@ YES - UIView UIViewController UIView UIViewController UIViewController + UIViewController UIView UIView @@ -870,9 +756,9 @@ YES YES - addCallTabBar callTabBarController contentView + incomingCallTabBarController mainTabBarController statusBarController statusBarView @@ -880,10 +766,6 @@ YES - - addCallTabBar - UIView - callTabBarController UIViewController @@ -892,6 +774,10 @@ contentView UIView + + incomingCallTabBarController + UIViewController + mainTabBarController UIViewController diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index 1212237fa..5c99d57be 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -28,7 +28,7 @@ @class FirstLoginViewController; -@interface PhoneViewController : UIViewController { +@interface PhoneViewController : UIViewController { @private //UI definition @@ -62,7 +62,6 @@ UIActionSheet *mIncomingCallActionSheet; FirstLoginViewController* myFirstLoginViewController; - InCallViewController* mIncallViewController; MainScreenWithVideoPreview* mMainScreenWithVideoPreview; UIButton* switchCamera; diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 776270846..2f3feda4d 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -102,6 +102,9 @@ - (void)viewDidLoad { [super viewDidLoad]; + // Set observer + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil]; + [mDisplayName release]; mDisplayName = [UILabel alloc]; [zero initWithNumber:'0' addressField:address dtmf:false]; @@ -121,10 +124,6 @@ [erase initWithAddressField:address]; [backToCallView addTarget:self action:@selector(backToCallViewPressed) forControlEvents:UIControlEventTouchUpInside]; - if (mIncallViewController == nil) - mIncallViewController = [[InCallViewController alloc] initWithNibName:[LinphoneManager runningOnIpad]?@"InCallViewController-ipad":@"InCallViewController" - bundle:[NSBundle mainBundle]]; - /*if (statusSubViewController == nil) { statusSubViewController = [[StatusSubViewController alloc] initWithNibName:@"StatusSubViewController" bundle:[NSBundle mainBundle]]; @@ -144,6 +143,7 @@ - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; + [[NSNotificationCenter defaultCenter] removeObserver:self]; } - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { @@ -160,6 +160,107 @@ [super viewWillAppear:animated]; } +- (void)callUpdate: (NSNotification*) notif { + LinphoneCallWrapper *callWrapper = [notif.userInfo objectForKey: @"call"]; + LinphoneCall *call = callWrapper->call; + LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue]; + + const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); + NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); + const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); + NSString* lDisplayName = [lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@"" autorelease]; + + bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL); + + switch (state) { + case LinphoneCallIncomingReceived: + [self displayIncomingCall:call + NotificationFromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + break; + + case LinphoneCallOutgoingInit: + [self displayCall:call + InProgressFromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + break; + case LinphoneCallPausedByRemote: + case LinphoneCallConnected: + [self displayInCall: call + FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + break; + case LinphoneCallUpdatedByRemote: + { + const LinphoneCallParams* current = linphone_call_get_current_params(call); + const LinphoneCallParams* remote = linphone_call_get_remote_params(call); + + /* remote wants to add video */ + if (!linphone_call_params_video_enabled(current) && + linphone_call_params_video_enabled(remote) && + !linphone_core_get_video_policy([LinphoneManager getLc])->automatically_accept) { + linphone_core_defer_call_update([LinphoneManager getLc], call); + [self displayAskToEnableVideoCall:call forUser:lUserName withDisplayName:lDisplayName]; + } else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) { + [self displayInCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } + break; + } + case LinphoneCallUpdated: + { + const LinphoneCallParams* current = linphone_call_get_current_params(call); + if (linphone_call_params_video_enabled(current)) { + [self displayVideoCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } else { + [self displayInCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } + break; + + } + case LinphoneCallError: { + if (canHideInCallView) { + [self displayDialerFromUI:nil + forUser:@"" + withDisplayName:@""]; + } else { + [self displayInCall:call + FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + } + break; + } + case LinphoneCallEnd: + if (canHideInCallView) { + [self displayDialerFromUI:nil + forUser:@"" + withDisplayName:@""]; + } else { + [self displayInCall:call + FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + } + break; + case LinphoneCallStreamsRunning: + //check video + if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { + [self displayVideoCall:call FromUI:nil + forUser:lUserName + withDisplayName:lDisplayName]; + } else { + [self displayInCall:call FromUI:nil forUser:lUserName withDisplayName:lDisplayName]; + } + break; + default: + break; + } + +} + - (void)displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { //cancel local notification, just in case @@ -186,19 +287,12 @@ //first login case, dismmis first login view [self dismissModalViewControllerAnimated:true]; }; - [mIncallViewController displayDialerFromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - //[myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; + [[LinphoneManager instance] changeView:PhoneView_Dialer]; [mMainScreenWithVideoPreview showPreview:YES]; } -- (void)displayStatus:(NSString*) message { - [mIncallViewController displayStatus:message]; -} - - (void)displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] @@ -245,7 +339,7 @@ - (void)backToCallViewPressed { [UICallButton enableTransforMode:NO]; - [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; + [[LinphoneManager instance] changeView:PhoneView_InCall]; LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); @@ -261,29 +355,20 @@ - (void)displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; - if (self.presentedViewController != (UIViewController*)mIncallViewController) { - [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; + if ([[LinphoneManager instance]currentView] != PhoneView_InCall) { + [[LinphoneManager instance] changeView:PhoneView_InCall]; } - [mIncallViewController displayCall:call InProgressFromUI:viewCtrl - forUser:username - withDisplayName:displayName]; [mMainScreenWithVideoPreview showPreview:NO]; - } - (void)displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; - if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 || + if ([[LinphoneManager instance]currentView] != PhoneView_InCall && (call == 0x0 || linphone_call_get_dir(call)==LinphoneCallIncoming)){ - [self presentModalViewController:(UIViewController*)mIncallViewController animated:true]; - + [[LinphoneManager instance] changeView:PhoneView_InCall]; } - [mIncallViewController displayInCall:call FromUI:viewCtrl - forUser:username - withDisplayName:displayName]; - [LinphoneManager set:callLarge hidden:YES withName:"CALL_LARGE button" andReason:__FUNCTION__]; [LinphoneManager set:switchCamera hidden:YES withName:"SWITCH_CAMERA button" andReason:__FUNCTION__]; [LinphoneManager set:callShort hidden:NO withName:"CALL_SHORT button" andReason:__FUNCTION__]; @@ -295,20 +380,14 @@ - (void)displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [mMainScreenWithVideoPreview showPreview:NO]; - [mIncallViewController displayVideoCall:call FromUI:viewCtrl - forUser:username - withDisplayName:displayName]; [mMainScreenWithVideoPreview showPreview:NO]; [self updateCallAndBackButtons]; } - (void)displayAskToEnableVideoCall:(LinphoneCall*) call forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [mIncallViewController displayAskToEnableVideoCall:call forUser:username withDisplayName:displayName]; } - - - (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas { if (type != CD_NEW_CALL) return; @@ -323,8 +402,9 @@ } - (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; [address dealloc]; - [ mDisplayName dealloc]; + [mDisplayName dealloc]; [dialerView dealloc]; [callShort dealloc]; [callLarge dealloc]; @@ -342,7 +422,6 @@ [zero dealloc]; [hash dealloc]; [myTabBarController release]; - [mIncallViewController release]; [super dealloc]; } @@ -371,7 +450,7 @@ } - (void)firstVideoFrameDecoded: (LinphoneCall*) call { - [mIncallViewController firstVideoFrameDecoded:call]; + // [mIncallViewController firstVideoFrameDecoded:call]; } - (IBAction)onAddContact: (id) event { diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index e7476dd81..87104bbe8 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -127,7 +127,6 @@ {{215, 0}, {105, 72}} - _NS:9 NO IBCocoaTouchFramework @@ -770,6 +769,14 @@ 186 + + + callLarge + + + + 189 + delegate @@ -1106,7 +1113,7 @@ - 188 + 189 diff --git a/Classes/VideoViewController.h b/Classes/VideoViewController.h index 7f4db8d17..b7a31603a 100644 --- a/Classes/VideoViewController.h +++ b/Classes/VideoViewController.h @@ -23,21 +23,21 @@ UIView* mPortrait; UIView* mDisplay; UIView* mPreview; - UIMuteButton* mMute; + UIMicroButton* mMute; UIHangUpButton* mHangUp; UICamSwitch* mCamSwitch; UIView* mLandscapeRight; UIView* mDisplayLandRight; UIView* mPreviewLandRight; - UIMuteButton* mMuteLandRight; + UIMicroButton* mMuteLandRight; UIHangUpButton* mHangUpLandRight; UICamSwitch* mCamSwitchLandRight; UIView* mLandscapeLeft; UIView* mDisplayLandLeft; UIView* mPreviewLandLeft; - UIMuteButton* mMuteLandLeft; + UIMicroButton* mMuteLandLeft; UIHangUpButton* mHangUpLandLeft; UICamSwitch* mCamSwitchLandLeft; BOOL isFirst; @@ -48,7 +48,7 @@ @property (nonatomic, retain) IBOutlet UIView* mPortrait; @property (nonatomic, retain) IBOutlet UIView* mDisplay; @property (nonatomic, retain) IBOutlet UIView* mPreview; -@property (nonatomic, retain) IBOutlet UIMuteButton* mMute; +@property (nonatomic, retain) IBOutlet UIMicroButton* mMute; @property (nonatomic, retain) IBOutlet UIHangUpButton* mHangUp; @property (nonatomic, retain) IBOutlet UICamSwitch* mCamSwitch; @property (nonatomic, retain) IBOutlet UIImageView *mCallQuality; @@ -56,7 +56,7 @@ @property (nonatomic, retain) IBOutlet UIView* mLandscapeRight; @property (nonatomic, retain) IBOutlet UIView* mDisplayLandRight; @property (nonatomic, retain) IBOutlet UIView* mPreviewLandRight; -@property (nonatomic, retain) IBOutlet UIMuteButton* mMuteLandRight; +@property (nonatomic, retain) IBOutlet UIMicroButton* mMuteLandRight; @property (nonatomic, retain) IBOutlet UIHangUpButton* mHangUpLandRight; @property (nonatomic, retain) IBOutlet UICamSwitch* mCamSwitchLandRight; @property (nonatomic, retain) IBOutlet UIImageView *mCallQualityLandRight; @@ -64,7 +64,7 @@ @property (nonatomic, retain) IBOutlet UIView* mLandscapeLeft; @property (nonatomic, retain) IBOutlet UIView* mDisplayLandLeft; @property (nonatomic, retain) IBOutlet UIView* mPreviewLandLeft; -@property (nonatomic, retain) IBOutlet UIMuteButton* mMuteLandLeft; +@property (nonatomic, retain) IBOutlet UIMicroButton* mMuteLandLeft; @property (nonatomic, retain) IBOutlet UIHangUpButton* mHangUpLandLeft; @property (nonatomic, retain) IBOutlet UICamSwitch* mCamSwitchLandLeft; @property (retain, nonatomic) IBOutlet UIImageView *mCallQualityLandLeft; diff --git a/Classes/VideoViewController.m b/Classes/VideoViewController.m index 6158c8392..f885a5513 100644 --- a/Classes/VideoViewController.m +++ b/Classes/VideoViewController.m @@ -78,9 +78,9 @@ NSTimer *callQualityRefresher; - (void)viewDidLoad { [super viewDidLoad]; - [mMute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"]; + /*[mMute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"]; [mMuteLandRight initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE2 button"]; - [mMuteLandLeft initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE3 button"]; + [mMuteLandLeft initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE3 button"];*/ [mCamSwitch setPreview:mPreview]; [mCamSwitchLandRight setPreview:mPreviewLandRight]; [mCamSwitchLandLeft setPreview:mPreviewLandLeft]; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 11fa0066c..9b21ff9ef 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -56,8 +56,7 @@ 2214783D1386A2030020F8B8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2214783B1386A2030020F8B8 /* Localizable.strings */; }; 2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB7912F846B1002A5394 /* UICallButton.m */; }; 2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB8812F84EBB002A5394 /* UIHangUpButton.m */; }; - 2214EBDA12F8558F002A5394 /* UIToggleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EBD912F8558F002A5394 /* UIToggleButton.m */; }; - 2214EBF312F86360002A5394 /* UIMuteButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EBF212F86360002A5394 /* UIMuteButton.m */; }; + 2214EBF312F86360002A5394 /* UIMicroButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EBF212F86360002A5394 /* UIMicroButton.m */; }; 2218A92512FBE1340088A667 /* FirstLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2218A92312FBE1340088A667 /* FirstLoginViewController.m */; }; 2218A92612FBE1340088A667 /* FirstLoginViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2218A92412FBE1340088A667 /* FirstLoginViewController.xib */; }; 22226C12118197C0000CA27B /* startcall-green.png in Resources */ = {isa = PBXBuildFile; fileRef = 22226C11118197C0000CA27B /* startcall-green.png */; }; @@ -105,7 +104,6 @@ 22AA8AFE13D7125600B30535 /* libmsx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFC13D7125500B30535 /* libmsx264.a */; }; 22AA8B0113D83F6300B30535 /* UICamSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 22AA8B0013D83F6300B30535 /* UICamSwitch.m */; }; 22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */; }; - 22B5EFE510CE5E5800777D97 /* ContactPickerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */; }; 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5F03410CE6B2F00777D97 /* AddressBook.framework */; }; 22BB1A69132FF16A005CD7AA /* UIEraseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22BB1A68132FF16A005CD7AA /* UIEraseButton.m */; }; 22C755601317E59C007BC101 /* UIBluetoothButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */; }; @@ -138,15 +136,13 @@ 22D8F144147548E2008C97DB /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 22D8F145147548E2008C97DB /* LinphoneAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* LinphoneAppDelegate.m */; }; 22D8F146147548E2008C97DB /* PhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22F2508C107141E100AC9B3F /* PhoneViewController.m */; }; - 22D8F147147548E2008C97DB /* ContactPickerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */; }; 22D8F14A147548E2008C97DB /* MoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0A81C111C44E100B04932 /* MoreViewController.m */; }; 22D8F14B147548E2008C97DB /* ConsoleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22E0A81F111C44E100B04932 /* ConsoleViewController.m */; }; 22D8F14C147548E2008C97DB /* UIDigitButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */; }; 22D8F14D147548E2008C97DB /* LinphoneManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 2248E99E12F801C200220D9C /* LinphoneManager.m */; }; 22D8F14E147548E2008C97DB /* UICallButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB7912F846B1002A5394 /* UICallButton.m */; }; 22D8F14F147548E2008C97DB /* UIHangUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB8812F84EBB002A5394 /* UIHangUpButton.m */; }; - 22D8F150147548E2008C97DB /* UIToggleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EBD912F8558F002A5394 /* UIToggleButton.m */; }; - 22D8F151147548E2008C97DB /* UIMuteButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EBF212F86360002A5394 /* UIMuteButton.m */; }; + 22D8F151147548E2008C97DB /* UIMicroButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EBF212F86360002A5394 /* UIMicroButton.m */; }; 22D8F152147548E2008C97DB /* UISpeakerButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22968A5E12F875C600588287 /* UISpeakerButton.m */; }; 22D8F153147548E2008C97DB /* UIDuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 22968A8712F87C2000588287 /* UIDuration.m */; }; 22D8F154147548E2008C97DB /* FirstLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2218A92312FBE1340088A667 /* FirstLoginViewController.m */; }; @@ -264,6 +260,8 @@ D326483F1588950F00930C67 /* LinphoneCallBar.m in Sources */ = {isa = PBXBuildFile; fileRef = D326483C1588950F00930C67 /* LinphoneCallBar.m */; }; D32648401588950F00930C67 /* LinphoneCallBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D326483D1588950F00930C67 /* LinphoneCallBar.xib */; }; D32648411588950F00930C67 /* LinphoneCallBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D326483D1588950F00930C67 /* LinphoneCallBar.xib */; }; + D32648441588F6FC00930C67 /* UIToggleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D32648431588F6FB00930C67 /* UIToggleButton.m */; }; + D32648451588F6FC00930C67 /* UIToggleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = D32648431588F6FB00930C67 /* UIToggleButton.m */; }; D347347A1580DDF1003C7B8C /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D34734791580DDF1003C7B8C /* PhoneMainView.xib */; }; D347347E1580E5F8003C7B8C /* history-actif.png in Resources */ = {isa = PBXBuildFile; fileRef = D347347C1580E5F8003C7B8C /* history-actif.png */; }; D347347F1580E5F8003C7B8C /* history-selectionne.png in Resources */ = {isa = PBXBuildFile; fileRef = D347347D1580E5F8003C7B8C /* history-selectionne.png */; }; @@ -635,11 +633,8 @@ 2214EB8712F84EBB002A5394 /* UIHangUpButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIHangUpButton.h; sourceTree = ""; }; 2214EB8812F84EBB002A5394 /* UIHangUpButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIHangUpButton.m; sourceTree = ""; }; 2214EB8A12F84FE9002A5394 /* UILinphone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UILinphone.h; sourceTree = ""; }; - 2214EBD812F8558F002A5394 /* UIToggleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIToggleButton.h; sourceTree = ""; }; - 2214EBD912F8558F002A5394 /* UIToggleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIToggleButton.m; sourceTree = ""; }; - 2214EBF112F86360002A5394 /* UIMuteButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIMuteButton.h; sourceTree = ""; }; - 2214EBF212F86360002A5394 /* UIMuteButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIMuteButton.m; sourceTree = ""; }; - 2218A5C412F9597B0088A667 /* LinphoneUIDelegates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneUIDelegates.h; sourceTree = ""; }; + 2214EBF112F86360002A5394 /* UIMicroButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIMicroButton.h; sourceTree = ""; }; + 2214EBF212F86360002A5394 /* UIMicroButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIMicroButton.m; sourceTree = ""; }; 2218A5CE12F973450088A667 /* LogView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogView.h; sourceTree = ""; }; 2218A92212FBE1340088A667 /* FirstLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstLoginViewController.h; sourceTree = ""; }; 2218A92312FBE1340088A667 /* FirstLoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstLoginViewController.m; sourceTree = ""; }; @@ -696,8 +691,6 @@ 22AA8AFF13D83F6300B30535 /* UICamSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICamSwitch.h; sourceTree = ""; }; 22AA8B0013D83F6300B30535 /* UICamSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICamSwitch.m; sourceTree = ""; }; 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; - 22B5EFE310CE5E5800777D97 /* ContactPickerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactPickerDelegate.h; sourceTree = ""; }; - 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactPickerDelegate.m; sourceTree = ""; }; 22B5F03410CE6B2F00777D97 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; 22BB1A67132FF16A005CD7AA /* UIEraseButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEraseButton.h; sourceTree = ""; }; 22BB1A68132FF16A005CD7AA /* UIEraseButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIEraseButton.m; sourceTree = ""; }; @@ -842,6 +835,8 @@ D326483B1588950F00930C67 /* LinphoneCallBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCallBar.h; sourceTree = ""; }; D326483C1588950F00930C67 /* LinphoneCallBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneCallBar.m; sourceTree = ""; }; D326483D1588950F00930C67 /* LinphoneCallBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LinphoneCallBar.xib; sourceTree = ""; }; + D32648421588F6FA00930C67 /* UIToggleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIToggleButton.h; sourceTree = ""; }; + D32648431588F6FB00930C67 /* UIToggleButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIToggleButton.m; sourceTree = ""; }; D34734791580DDF1003C7B8C /* PhoneMainView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PhoneMainView.xib; sourceTree = ""; }; D347347C1580E5F8003C7B8C /* history-actif.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "history-actif.png"; path = "Resources/history-actif.png"; sourceTree = ""; }; D347347D1580E5F8003C7B8C /* history-selectionne.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "history-selectionne.png"; path = "Resources/history-selectionne.png"; sourceTree = ""; }; @@ -1074,8 +1069,6 @@ 22E0A820111C44E100B04932 /* ConsoleViewController.h */, 22E0A81F111C44E100B04932 /* ConsoleViewController.m */, 22E0A81E111C44E100B04932 /* ConsoleViewController.xib */, - 22B5EFE310CE5E5800777D97 /* ContactPickerDelegate.h */, - 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */, D35497FB15875372000081D8 /* ContactsController.h */, D35497FC15875372000081D8 /* ContactsController.m */, D35497FD15875372000081D8 /* ContactsController.xib */, @@ -1342,7 +1335,6 @@ D354981E1587716B000081D8 /* LinphoneStatusBar.h */, D354981F1587716B000081D8 /* LinphoneStatusBar.m */, D35498201587716B000081D8 /* LinphoneStatusBar.xib */, - 2218A5C412F9597B0088A667 /* LinphoneUIDelegates.h */, 2218A5CE12F973450088A667 /* LogView.h */, 22C7555E1317E59C007BC101 /* UIBluetoothButton.h */, 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */, @@ -1359,12 +1351,12 @@ 2214EB8712F84EBB002A5394 /* UIHangUpButton.h */, 2214EB8812F84EBB002A5394 /* UIHangUpButton.m */, 2214EB8A12F84FE9002A5394 /* UILinphone.h */, - 2214EBF112F86360002A5394 /* UIMuteButton.h */, - 2214EBF212F86360002A5394 /* UIMuteButton.m */, + 2214EBF112F86360002A5394 /* UIMicroButton.h */, + 2214EBF212F86360002A5394 /* UIMicroButton.m */, 22968A5D12F875C600588287 /* UISpeakerButton.h */, 22968A5E12F875C600588287 /* UISpeakerButton.m */, - 2214EBD812F8558F002A5394 /* UIToggleButton.h */, - 2214EBD912F8558F002A5394 /* UIToggleButton.m */, + D32648421588F6FA00930C67 /* UIToggleButton.h */, + D32648431588F6FB00930C67 /* UIToggleButton.m */, 340751E5150F38FC00B89C47 /* UIToggleVideoButton.h */, 340751E6150F38FD00B89C47 /* UIToggleVideoButton.m */, ); @@ -2086,15 +2078,13 @@ 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 1D3623260D0F684500981E51 /* LinphoneAppDelegate.m in Sources */, 22F2508E107141E100AC9B3F /* PhoneViewController.m in Sources */, - 22B5EFE510CE5E5800777D97 /* ContactPickerDelegate.m in Sources */, 22E0A822111C44E100B04932 /* MoreViewController.m in Sources */, 22E0A824111C44E100B04932 /* ConsoleViewController.m in Sources */, 2248E90E12F7E4CF00220D9C /* UIDigitButton.m in Sources */, 2248E99F12F801C200220D9C /* LinphoneManager.m in Sources */, 2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */, 2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */, - 2214EBDA12F8558F002A5394 /* UIToggleButton.m in Sources */, - 2214EBF312F86360002A5394 /* UIMuteButton.m in Sources */, + 2214EBF312F86360002A5394 /* UIMicroButton.m in Sources */, 22968A5F12F875C600588287 /* UISpeakerButton.m in Sources */, 22968A8812F87C2000588287 /* UIDuration.m in Sources */, 2218A92512FBE1340088A667 /* FirstLoginViewController.m in Sources */, @@ -2119,6 +2109,7 @@ D3A55FBC15877E5E003FD403 /* ContactCell.m in Sources */, D326483815887D5200930C67 /* OrderedDictionary.m in Sources */, D326483E1588950F00930C67 /* LinphoneCallBar.m in Sources */, + D32648441588F6FC00930C67 /* UIToggleButton.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2129,15 +2120,13 @@ 22D8F144147548E2008C97DB /* main.m in Sources */, 22D8F145147548E2008C97DB /* LinphoneAppDelegate.m in Sources */, 22D8F146147548E2008C97DB /* PhoneViewController.m in Sources */, - 22D8F147147548E2008C97DB /* ContactPickerDelegate.m in Sources */, 22D8F14A147548E2008C97DB /* MoreViewController.m in Sources */, 22D8F14B147548E2008C97DB /* ConsoleViewController.m in Sources */, 22D8F14C147548E2008C97DB /* UIDigitButton.m in Sources */, 22D8F14D147548E2008C97DB /* LinphoneManager.m in Sources */, 22D8F14E147548E2008C97DB /* UICallButton.m in Sources */, 22D8F14F147548E2008C97DB /* UIHangUpButton.m in Sources */, - 22D8F150147548E2008C97DB /* UIToggleButton.m in Sources */, - 22D8F151147548E2008C97DB /* UIMuteButton.m in Sources */, + 22D8F151147548E2008C97DB /* UIMicroButton.m in Sources */, 22D8F152147548E2008C97DB /* UISpeakerButton.m in Sources */, 22D8F153147548E2008C97DB /* UIDuration.m in Sources */, 22D8F154147548E2008C97DB /* FirstLoginViewController.m in Sources */, @@ -2162,6 +2151,7 @@ D3A55FBD15877E5E003FD403 /* ContactCell.m in Sources */, D326483915887D5200930C67 /* OrderedDictionary.m in Sources */, D326483F1588950F00930C67 /* LinphoneCallBar.m in Sources */, + D32648451588F6FC00930C67 /* UIToggleButton.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; };