From 7b1e2087032af10f38d53b9eb6f26d069d602be4 Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Mon, 2 Jul 2012 18:49:14 +0200 Subject: [PATCH] Improve UI Add pragma mark Add wait indicator on video button --- Classes/ContactsTableViewController.h | 2 +- Classes/ContactsTableViewController.m | 11 +- Classes/ContactsViewController.m | 19 +- Classes/ContactsViewController.xib | 4 +- Classes/DialerViewController.h | 4 +- Classes/DialerViewController.m | 110 +-- Classes/FirstLoginViewController.m | 38 +- Classes/HistoryTableViewController.h | 2 +- Classes/HistoryTableViewController.m | 12 +- Classes/HistoryViewController.m | 54 +- Classes/InCallTableViewController.h | 2 +- Classes/InCallTableViewController.m | 277 ++++---- Classes/InCallViewController.m | 282 ++++---- Classes/IncomingCallViewController.m | 28 +- Classes/LinphoneAppDelegate.m | 12 +- Classes/LinphoneManager.h | 4 +- Classes/LinphoneManager.m | 31 +- Classes/LinphoneUI/UICallBar.m | 123 ++-- Classes/LinphoneUI/UICallBar.xib | 52 +- Classes/LinphoneUI/UICallButton.m | 41 +- Classes/LinphoneUI/UICallCell.h | 11 +- Classes/LinphoneUI/UICallCell.m | 102 +-- Classes/LinphoneUI/UICallCell.xib | 106 ++- Classes/LinphoneUI/UIChatCell.m | 18 +- .../LinphoneUI/UICompositeViewController.m | 5 + Classes/LinphoneUI/UIConferenceHeader.m | 18 + Classes/LinphoneUI/UIContactCell.m | 20 +- Classes/LinphoneUI/UIDigitButton.m | 56 +- Classes/LinphoneUI/UIDuration.h | 33 - Classes/LinphoneUI/UIDuration.m | 66 -- Classes/LinphoneUI/UIEraseButton.m | 25 +- Classes/LinphoneUI/UIHangUpButton.m | 58 +- Classes/LinphoneUI/UIHistoryCell.m | 26 +- Classes/LinphoneUI/UILinphone.h | 29 - Classes/LinphoneUI/UILongTouchButton.m | 45 +- Classes/LinphoneUI/UIMainBar.m | 39 +- Classes/LinphoneUI/UIPauseButton.m | 84 +-- Classes/LinphoneUI/UISpeakerButton.m | 36 +- Classes/LinphoneUI/UIStateBar.m | 80 ++- Classes/LinphoneUI/UIToggleButton.m | 69 +- Classes/LinphoneUI/UIVideoButton.h | 7 + Classes/LinphoneUI/UIVideoButton.m | 65 +- Classes/MainScreenWithVideoPreview.h | 42 -- Classes/MainScreenWithVideoPreview.m | 185 ------ Classes/MainScreenWithVideoPreview.xib | 629 ------------------ Classes/MoreViewController.h | 2 +- Classes/MoreViewController.m | 43 +- Classes/PhoneMainView.m | 179 ++--- Classes/SettingsViewController.m | 67 +- Classes/Utils/CPAnimationSequence.m | 5 + Classes/Utils/CPAnimationStep.h | 2 +- Classes/Utils/CPAnimationStep.m | 8 +- .../supprimer-participant-conf-actif.png | Bin 0 -> 2116 bytes Resources/supprimer-participant-conf-over.png | Bin 0 -> 2090 bytes Resources/video-ON-disabled.png | Bin 0 -> 3044 bytes linphone.xcodeproj/project.pbxproj | 40 +- 56 files changed, 1347 insertions(+), 1961 deletions(-) delete mode 100644 Classes/LinphoneUI/UIDuration.h delete mode 100644 Classes/LinphoneUI/UIDuration.m delete mode 100644 Classes/LinphoneUI/UILinphone.h delete mode 100644 Classes/MainScreenWithVideoPreview.h delete mode 100644 Classes/MainScreenWithVideoPreview.m delete mode 100644 Classes/MainScreenWithVideoPreview.xib create mode 100644 Resources/supprimer-participant-conf-actif.png create mode 100644 Resources/supprimer-participant-conf-over.png create mode 100644 Resources/video-ON-disabled.png diff --git a/Classes/ContactsTableViewController.h b/Classes/ContactsTableViewController.h index 696b0ef7e..5ef07e6ea 100644 --- a/Classes/ContactsTableViewController.h +++ b/Classes/ContactsTableViewController.h @@ -22,7 +22,7 @@ #import "OrderedDictionary.h" -@interface ContactsTableViewController : UITableViewController { +@interface ContactsTableViewController : UITableViewController { OrderedDictionary* addressBookMap; ABAddressBookRef addressBook; diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index ece60dc47..55c1b33d2 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -23,8 +23,6 @@ @implementation ContactsTableViewController -#pragma mark Table view methods - void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { ContactsTableViewController* controller = (ContactsTableViewController*)context; OrderedDictionary* lAddressBookMap = controller->addressBookMap; @@ -72,6 +70,9 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, [(UITableView *)controller.view reloadData]; } + +#pragma mark - ViewController Functions + - (void) viewDidLoad { addressBookMap = [[OrderedDictionary alloc] init]; addressBook = ABAddressBookCreate(); @@ -79,6 +80,9 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, sync_toc_address_book(addressBook, nil, self); } + +#pragma mark - UITableViewDataSource Functions + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return [addressBookMap count]; } @@ -133,6 +137,9 @@ void sync_toc_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, CFRelease(lPhoneNumbers); } + +#pragma mark - Lifecycle Functions + - (void)dealloc { [super dealloc]; [addressBookMap removeAllObjects]; diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index a946c277b..e3f3df8a6 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -35,15 +35,29 @@ typedef enum _HistoryView { History_MAX } HistoryView; +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"ContactsViewController" bundle:[NSBundle mainBundle]]; } + +#pragma mark - ViewController Functions + - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self.tableView reloadData]; } + +- (void)viewDidLoad { + [super viewDidLoad]; + [self changeView: History_All]; +} + + +#pragma mark - + - (void)changeView: (HistoryView) view { if(view == History_All) { allButton.selected = TRUE; @@ -58,10 +72,7 @@ typedef enum _HistoryView { } } -- (void)viewDidLoad { - [super viewDidLoad]; - [self changeView: History_All]; -} +#pragma mark - Action Functions - (IBAction)onAllClick: (id) event { [self changeView: History_All]; diff --git a/Classes/ContactsViewController.xib b/Classes/ContactsViewController.xib index f58cd17b9..05961c8d6 100644 --- a/Classes/ContactsViewController.xib +++ b/Classes/ContactsViewController.xib @@ -413,7 +413,7 @@ UIButton UIButton - UITableViewController + ContactsTableViewController UITableView @@ -427,7 +427,7 @@ tableController - UITableViewController + ContactsTableViewController tableView diff --git a/Classes/DialerViewController.h b/Classes/DialerViewController.h index 188c63465..6db7ae801 100644 --- a/Classes/DialerViewController.h +++ b/Classes/DialerViewController.h @@ -19,7 +19,9 @@ #import -#import "UILinphone.h" +#import "UIEraseButton.h" +#import "UICallButton.h" +#import "UIDigitButton.h" @interface DialerViewController : UIViewController { diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index f2a3dfc1d..302f98355 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -50,36 +50,46 @@ @synthesize zeroButton; @synthesize hashButton; +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"DialerViewController" bundle:[NSBundle mainBundle]]; } +- (void)dealloc { + [addressField release]; + [addContactButton release]; + [cancelButton release]; + [eraseButton release]; + [callButton release]; + [addCallButton release]; + + [oneButton release]; + [twoButton release]; + [threeButton release]; + [fourButton release]; + [fiveButton release]; + [sixButton release]; + [sevenButton release]; + [eightButton release]; + [nineButton release]; + [starButton release]; + [zeroButton release]; + [hashButton release]; + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [super dealloc]; +} + + +#pragma mark - ViewController Functions + - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self update]; } -- (void)callUpdate:(NSNotification*)notif { - [self update]; -} - -- (void)update { - if([LinphoneManager isLcReady]) { - LinphoneCore *lc = [LinphoneManager getLc]; - if(linphone_core_get_calls_nb(lc) > 0) { - [addCallButton setHidden:false]; - [callButton setHidden:true]; - [cancelButton setHidden:false]; - [addContactButton setHidden:true]; - } else { - [addCallButton setHidden:true]; - [callButton setHidden:false]; - [cancelButton setHidden:true]; - [addContactButton setHidden:false]; - } - } -} - - (void)viewDidLoad { [super viewDidLoad]; @@ -107,35 +117,40 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; } + +#pragma mark - Event Functions + +- (void)callUpdate:(NSNotification*)notif { + [self update]; +} + + +#pragma mark - + +- (void)update { + if([LinphoneManager isLcReady]) { + LinphoneCore *lc = [LinphoneManager getLc]; + if(linphone_core_get_calls_nb(lc) > 0) { + [addCallButton setHidden:false]; + [callButton setHidden:true]; + [cancelButton setHidden:false]; + [addContactButton setHidden:true]; + } else { + [addCallButton setHidden:true]; + [callButton setHidden:false]; + [cancelButton setHidden:true]; + [addContactButton setHidden:false]; + } + } +} + + - (void)setAddress:(NSString*) address { [addressField setText:address]; } -- (void)dealloc { - [addressField release]; - [addContactButton release]; - [cancelButton release]; - [eraseButton release]; - [callButton release]; - [addCallButton release]; - - [oneButton release]; - [twoButton release]; - [threeButton release]; - [fourButton release]; - [fiveButton release]; - [sixButton release]; - [sevenButton release]; - [eightButton release]; - [nineButton release]; - [starButton release]; - [zeroButton release]; - [hashButton release]; - - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [super dealloc]; -} + +#pragma mark - UITextFieldDelegate Functions - (BOOL)textFieldShouldReturn:(UITextField *)textField { if (textField == addressField) { @@ -144,6 +159,9 @@ return YES; } + +#pragma mark - Action Functions + - (IBAction)onAddContactClick: (id) event { } diff --git a/Classes/FirstLoginViewController.m b/Classes/FirstLoginViewController.m index 437c76a2a..d3f202da5 100644 --- a/Classes/FirstLoginViewController.m +++ b/Classes/FirstLoginViewController.m @@ -29,10 +29,24 @@ @synthesize passwordField; @synthesize waitView; +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"FirstLoginViewController" bundle:[NSBundle mainBundle]]; } +- (void)dealloc { + [super dealloc]; + [loginButton dealloc]; + [siteButton dealloc]; + [usernameField dealloc]; + [passwordField dealloc]; + [waitView dealloc]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - ViewController Functions + - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [usernameField setText:[[LinphoneManager instance].settingsStore objectForKey:@"username_preference"]]; @@ -50,6 +64,13 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) name:@"LinphoneRegistrationUpdate" object:nil]; } +- (void)viewDidUnload { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + + +#pragma mark - Event Functions + - (void)registrationUpdate: (NSNotification*) notif { LinphoneRegistrationState state = [[notif.userInfo objectForKey: @"state"] intValue]; switch (state) { @@ -91,19 +112,7 @@ } } -- (void)dealloc { - [super dealloc]; - [loginButton dealloc]; - [siteButton dealloc]; - [usernameField dealloc]; - [passwordField dealloc]; - [waitView dealloc]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)viewDidUnload { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} +#pragma mark - Action Functions - (void)onSiteClick:(id)sender { NSURL *url = [NSURL URLWithString:siteButton.titleLabel.text]; @@ -136,6 +145,9 @@ }; } + +#pragma mark - UITextFieldDelegate Functions + - (BOOL)textFieldShouldReturn:(UITextField *)theTextField { // When the user presses return, take focus away from the text field so that the keyboard is dismissed. [theTextField resignFirstResponder]; diff --git a/Classes/HistoryTableViewController.h b/Classes/HistoryTableViewController.h index 09f55b9e7..b668e5fc4 100644 --- a/Classes/HistoryTableViewController.h +++ b/Classes/HistoryTableViewController.h @@ -19,7 +19,7 @@ #import -@interface HistoryTableViewController : UITableViewController { +@interface HistoryTableViewController : UITableViewController { @private BOOL editMode; } diff --git a/Classes/HistoryTableViewController.m b/Classes/HistoryTableViewController.m index 7f9f7a04e..83635f53a 100644 --- a/Classes/HistoryTableViewController.m +++ b/Classes/HistoryTableViewController.m @@ -23,6 +23,8 @@ @implementation HistoryTableViewController +#pragma mark - Lifecycle Functions + - (id)init { if((self = [super init]) != nil) { self->editMode = false; @@ -30,6 +32,9 @@ return self; } + +#pragma mark - UITableViewDataSource Functions + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } @@ -97,6 +102,9 @@ [dispName release]; } + +#pragma mark - + - (void) toggleEditMode { editMode = !editMode; [(UITableView*)[self view] reloadData]; @@ -114,9 +122,5 @@ } } -- (void)dealloc { - [super dealloc]; -} - @end diff --git a/Classes/HistoryViewController.m b/Classes/HistoryViewController.m index 261e2fb3f..afad71699 100644 --- a/Classes/HistoryViewController.m +++ b/Classes/HistoryViewController.m @@ -34,15 +34,46 @@ typedef enum _HistoryView { History_MAX } HistoryView; + +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"HistoryViewController" bundle:[NSBundle mainBundle]]; } +- (void)dealloc { + [allButton release]; + [missedButton release]; + [editButton release]; + [super dealloc]; +} + + +#pragma mark - ViewController Functions + - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [self.tableView reloadData]; } +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + [tableController exitEditMode]; + [editButton setOff]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self changeView: History_All]; + + // Set selected+over background: IB lack ! + [editButton setBackgroundImage:[UIImage imageNamed:@"ok-edit-list-history-over.png"] + forState:(UIControlStateHighlighted | UIControlStateSelected)]; +} + + +#pragma mark - + - (void)changeView: (HistoryView) view { if(view == History_All) { allButton.selected = TRUE; @@ -57,14 +88,8 @@ typedef enum _HistoryView { } } -- (void)viewDidLoad { - [super viewDidLoad]; - [self changeView: History_All]; - - // Set selected+over background: IB lack ! - [editButton setBackgroundImage:[UIImage imageNamed:@"ok-edit-list-history-over.png"] - forState:(UIControlStateHighlighted | UIControlStateSelected)]; -} + +#pragma mark - Action Functions - (IBAction)onAllClick:(id) event { [self changeView: History_All]; @@ -79,17 +104,4 @@ typedef enum _HistoryView { } -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - [tableController exitEditMode]; - [editButton setOff]; -} - -- (void)dealloc { - [allButton release]; - [missedButton release]; - [editButton release]; - [super dealloc]; -} - @end diff --git a/Classes/InCallTableViewController.h b/Classes/InCallTableViewController.h index 99abc4d60..1ccd38a08 100644 --- a/Classes/InCallTableViewController.h +++ b/Classes/InCallTableViewController.h @@ -23,7 +23,7 @@ #include "linphonecore.h" -@interface InCallTableViewController : UITableViewController { +@interface InCallTableViewController : UITableViewController { @private NSMutableDictionary* callCellData; NSTimer *updateTime; diff --git a/Classes/InCallTableViewController.m b/Classes/InCallTableViewController.m index f5802c21f..4ca89b328 100644 --- a/Classes/InCallTableViewController.m +++ b/Classes/InCallTableViewController.m @@ -31,6 +31,8 @@ enum TableSection { CallSection = 1 }; +#pragma mark - Lifecycle Functions + - (void)initInCallTableViewController { self->callCellData = [[NSMutableDictionary alloc] init]; } @@ -59,6 +61,13 @@ enum TableSection { return self; } +- (void)dealloc { + [callCellData removeAllObjects]; + [callCellData dealloc]; + [super dealloc]; +} + +#pragma mark - ViewController Functions - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; @@ -77,6 +86,9 @@ enum TableSection { } } + +#pragma mark - Static Functions + + (bool)isInConference:(LinphoneCall*) call { if (!call) return false; @@ -117,145 +129,7 @@ enum TableSection { } -- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if(section == CallSection) { - return [[UIView alloc] initWithFrame:CGRectZero]; - } else if(section == ConferenceSection) { - LinphoneCore* lc = [LinphoneManager getLc]; - if(linphone_core_get_conference_size(lc) > 0){ - UIConferenceHeader *headerController = [[UIConferenceHeader alloc] init]; - [headerController update]; - UIView *headerView = [headerController view]; - [headerController release]; - return headerView; - } else { - return [[UIView alloc] initWithFrame:CGRectZero]; - } - } - return [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { - return [[UIView alloc] initWithFrame:CGRectZero]; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - LinphoneCore* lc = [LinphoneManager getLc]; - if(section == CallSection) { - return 0.000001f; // Hack UITableView = 0 - } else if(section == ConferenceSection) { - if(linphone_core_get_conference_size(lc) > 0) { - return [UIConferenceHeader getHeight]; - } - } - return 0.000001f; // Hack UITableView = 0 -} - -- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - LinphoneCore* lc = [LinphoneManager getLc]; - if(section == CallSection) { - return 0.000000f; // Hack UITableView = 0 - } else if(section == ConferenceSection) { - if(linphone_core_get_conference_size(lc) > 0) { - return 20; - } - } - return 0.000001f; // Hack UITableView = 0 -} - -- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - UICallCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UICallCell"]; - if (cell == nil) { - cell = [[UICallCell alloc] initWithIdentifier:@"UICallCell"]; - } - - bool inConference = indexPath.section == ConferenceSection; - - LinphoneCore* lc = [LinphoneManager getLc]; - LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference]; - [cell setData:[self addCallData:call]]; - [cell update]; - - if ([indexPath section] == CallSection && [indexPath row] == 0 && linphone_core_get_conference_size(lc) == 0) { - [cell firstCell]; - } else { - [cell otherCell]; - } - - if (linphone_core_get_calls_nb(lc) > 1 || linphone_core_get_conference_size(lc) > 0) { - tableView.scrollEnabled = TRUE; - } else { - tableView.scrollEnabled = FALSE; - } - return cell; -} - -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - int count = 0; - - LinphoneCore* lc = [LinphoneManager getLc]; - - if(section == CallSection) { - count = [InCallTableViewController callCount:lc]; - } else { - count = linphone_core_get_conference_size(lc); - if(linphone_core_is_in_conference(lc)) { - count--; - } - } - return count; -} - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; -} - -- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section -{ - return @""; -} - -- (NSString*)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section -{ - return @""; -} - -- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath -{ - bool inConference = indexPath.section == ConferenceSection; - LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference]; - UICallCellData* data = [callCellData objectForKey:[NSValue valueWithPointer:call]]; - if(data != nil &&data->minimize) - return [UICallCell getMinimizedHeight]; - return [UICallCell getMaximizedHeight]; -} - -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - [tableView deselectRowAtIndexPath:indexPath animated:NO]; - - LinphoneCore* lc = [LinphoneManager getLc]; - - bool inConference = indexPath.section == ConferenceSection; - - LinphoneCall* selectedCall = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference]; - - if (inConference) { - if (linphone_core_is_in_conference(lc)) - return; - LinphoneCall* current = linphone_core_get_current_call(lc); - if (current) - linphone_core_pause_call(lc, current); - linphone_core_enter_conference([LinphoneManager getLc]); - } else if (selectedCall) { - if (linphone_core_is_in_conference(lc)) { - linphone_core_leave_conference(lc); - } - if(!linphone_core_sound_resources_locked(lc)) { - linphone_core_resume_call([LinphoneManager getLc], selectedCall); - } - } -} +#pragma mark - - (void)removeCallData:(LinphoneCall*) call { // Remove data associated with the call @@ -303,12 +177,6 @@ enum TableSection { } } -- (void)dealloc { - [callCellData removeAllObjects]; - [callCellData dealloc]; - [super dealloc]; -} - - (void)minimizeAll { for(id key in callCellData) { UICallCellData *data = [callCellData objectForKey:key]; @@ -325,5 +193,124 @@ enum TableSection { [[self tableView] reloadData]; } +#pragma mark - UITableViewDataSource Functions + +- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { + if(section == CallSection) { + return [[UIView alloc] initWithFrame:CGRectZero]; + } else if(section == ConferenceSection) { + LinphoneCore* lc = [LinphoneManager getLc]; + if(linphone_core_get_conference_size(lc) > 0){ + UIConferenceHeader *headerController = [[UIConferenceHeader alloc] init]; + [headerController update]; + UIView *headerView = [headerController view]; + [headerController release]; + return headerView; + } else { + return [[UIView alloc] initWithFrame:CGRectZero]; + } + } + return [[UIView alloc] initWithFrame:CGRectZero]; +} + +- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { + return [[UIView alloc] initWithFrame:CGRectZero]; +} + +- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UICallCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UICallCell"]; + if (cell == nil) { + cell = [[UICallCell alloc] initWithIdentifier:@"UICallCell"]; + } + + bool inConference = indexPath.section == ConferenceSection; + + LinphoneCore* lc = [LinphoneManager getLc]; + LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference]; + [cell setData:[self addCallData:call]]; + + // Update cell + if ([indexPath section] == CallSection && [indexPath row] == 0 && linphone_core_get_conference_size(lc) == 0) { + [cell setFirstCell:true]; + } else { + [cell setFirstCell:false]; + } + [cell setConferenceCall:inConference]; + [cell update]; + + if (linphone_core_get_calls_nb(lc) > 1 || linphone_core_get_conference_size(lc) > 0) { + tableView.scrollEnabled = true; + } else { + tableView.scrollEnabled = false; + } + return cell; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + int count = 0; + + LinphoneCore* lc = [LinphoneManager getLc]; + + if(section == CallSection) { + count = [InCallTableViewController callCount:lc]; + } else { + count = linphone_core_get_conference_size(lc); + if(linphone_core_is_in_conference(lc)) { + count--; + } + } + return count; +} + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 2; +} + +- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return @""; +} + +- (NSString*)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section +{ + return @""; +} + + +#pragma mark - UITableViewDelegate Functions + +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + LinphoneCore* lc = [LinphoneManager getLc]; + if(section == CallSection) { + return 0.000001f; // Hack UITableView = 0 + } else if(section == ConferenceSection) { + if(linphone_core_get_conference_size(lc) > 0) { + return [UIConferenceHeader getHeight]; + } + } + return 0.000001f; // Hack UITableView = 0 +} + +- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { + LinphoneCore* lc = [LinphoneManager getLc]; + if(section == CallSection) { + return 0.000001f; // Hack UITableView = 0 + } else if(section == ConferenceSection) { + if(linphone_core_get_conference_size(lc) > 0) { + return 20; + } + } + return 0.000001f; // Hack UITableView = 0 +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath +{ + bool inConference = indexPath.section == ConferenceSection; + LinphoneCall* call = [InCallTableViewController retrieveCallAtIndex:indexPath.row inConference:inConference]; + UICallCellData* data = [callCellData objectForKey:[NSValue valueWithPointer:call]]; + if(data != nil &&data->minimize) + return [UICallCell getMinimizedHeight]; + return [UICallCell getMaximizedHeight]; +} @end diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 11a16c8f5..01b0699fc 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -48,66 +48,110 @@ const NSInteger SECURE_BUTTON_TAG=5; @synthesize testVideoView; #endif + +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"InCallViewController" bundle:[NSBundle mainBundle]]; } -//TODO -/* -- (void)orientationChanged: (NSNotification*) notif { - int oldLinphoneOrientation = linphone_core_get_device_rotation([LinphoneManager getLc]); - UIDeviceOrientation orientation = [UIDevice currentDevice].orientation; - int newRotation = 0; - switch (orientation) { - case UIInterfaceOrientationLandscapeRight: - newRotation = 270; - break; - case UIInterfaceOrientationLandscapeLeft: - newRotation = 90; - break; - default: - newRotation = 0; +- (void)dealloc { + [callTableController release]; + [callTableView release]; + + [videoGroup release]; + [videoView release]; + [videoPreview release]; +#ifdef TEST_VIDEO_VIEW_CHANGE + [testVideoView release]; +#endif + [videoCameraSwitch release]; + + [videoWaitingForFirstImage release]; + + [videoZoomHandler release]; + + [super dealloc]; +} + + +#pragma mark - ViewController Functions + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + + [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; + UIDevice *device = [UIDevice currentDevice]; + device.proximityMonitoringEnabled = YES; + + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [callTableController viewDidAppear:NO]; + } +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + if (visibleActionSheet != nil) { + [visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:NO]; } - if (oldLinphoneOrientation != newRotation) { - linphone_core_set_device_rotation([LinphoneManager getLc], newRotation); - linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView); - - LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); - if (call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { - //Orientation has changed, must call update call - linphone_core_update_call([LinphoneManager getLc], call, NULL); - - - // animate button images rotation -#define degreesToRadians(x) (M_PI * x / 180.0) - CGAffineTransform transform = CGAffineTransformIdentity; - switch (orientation) { - case UIInterfaceOrientationLandscapeRight: - transform = CGAffineTransformMakeRotation(degreesToRadians(90)); - break; - case UIInterfaceOrientationLandscapeLeft: - transform = CGAffineTransformMakeRotation(degreesToRadians(-90)); - break; - default: - transform = CGAffineTransformIdentity; - break; - } - - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationDuration:0.2f]; - //TODO - //endCtrl.imageView.transform = transform; - //mute.imageView.transform = transform; - //speaker.imageView.transform = transform; - //pause.imageView.transform = transform; - //contacts.imageView.transform = transform; - //addCall.imageView.transform = transform; - //addVideo.imageView.transform = transform; - //dialer.imageView.transform = transform; - [UIView commitAnimations]; - } - } -}*/ + if (hideControlsTimer != nil) { + [hideControlsTimer invalidate]; + hideControlsTimer = nil; + } + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [callTableController viewWillDisappear:NO]; + } +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [callTableController viewWillAppear:NO]; + } +} + +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + + [[UIApplication sharedApplication] setIdleTimerDisabled:false]; + UIDevice *device = [UIDevice currentDevice]; + device.proximityMonitoringEnabled = NO; + + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [callTableController viewDidDisappear:NO]; + } +} + +- (void)viewDidUnload { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Set windows (warn memory leaks) + linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView); + linphone_core_set_native_preview_window_id([LinphoneManager getLc],(unsigned long)videoPreview); + + // Set observer + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil]; + + + UITapGestureRecognizer* singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showControls:)]; + [singleFingerTap setNumberOfTapsRequired:1]; + [singleFingerTap setCancelsTouchesInView: FALSE]; + [[[UIApplication sharedApplication].delegate window] addGestureRecognizer:singleFingerTap]; + [singleFingerTap release]; + + videoZoomHandler = [[VideoZoomHandler alloc] init]; + [videoZoomHandler setup:videoGroup]; + videoGroup.alpha = 0; + + [videoCameraSwitch setPreview:videoPreview]; +} + + +#pragma mark - - (void)showControls:(id)sender { if (hideControlsTimer) { @@ -141,7 +185,7 @@ const NSInteger SECURE_BUTTON_TAG=5; if([[LinphoneManager instance] currentView] == PhoneView_InCall && videoShown) [[LinphoneManager instance] showTabBar: false]; - + if (hideControlsTimer) { [hideControlsTimer invalidate]; hideControlsTimer = nil; @@ -162,9 +206,10 @@ const NSInteger SECURE_BUTTON_TAG=5; #endif - (void)enableVideoDisplay:(BOOL)animation { + if(videoShown) + return; + videoShown = true; - //TODO - //[self orientationChanged:nil]; [videoZoomHandler resetZoom]; @@ -189,7 +234,7 @@ const NSInteger SECURE_BUTTON_TAG=5; #ifdef TEST_VIDEO_VIEW_CHANGE [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(_debugChangeVideoView) userInfo:nil repeats:YES]; #endif - // [self batteryLevelChanged:nil]; + // [self batteryLevelChanged:nil]; videoWaitingForFirstImage.hidden = NO; [videoWaitingForFirstImage startAnimating]; @@ -201,17 +246,20 @@ const NSInteger SECURE_BUTTON_TAG=5; } - (void)disableVideoDisplay:(BOOL)animation { + if(!videoShown) + return; + videoShown = false; if(animation) { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; } - + [videoGroup setAlpha:0.0]; [[LinphoneManager instance] showTabBar: true]; [callTableView setAlpha:1.0]; [videoCameraSwitch setAlpha:0.0]; - + if(animation) { [UIView commitAnimations]; } @@ -224,36 +272,6 @@ const NSInteger SECURE_BUTTON_TAG=5; [[LinphoneManager instance] fullScreen:false]; } -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; - - // Set windows (warn memory leaks) - linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)videoView); - linphone_core_set_native_preview_window_id([LinphoneManager getLc],(unsigned long)videoPreview); - - // Set observer - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil]; - - - UITapGestureRecognizer* singleFingerTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showControls:)]; - [singleFingerTap setNumberOfTapsRequired:1]; - [singleFingerTap setCancelsTouchesInView: FALSE]; - [[[UIApplication sharedApplication].delegate window] addGestureRecognizer:singleFingerTap]; - [singleFingerTap release]; - - videoZoomHandler = [[VideoZoomHandler alloc] init]; - [videoZoomHandler setup:videoGroup]; - videoGroup.alpha = 0; - - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(batteryLevelChanged:) name:UIDeviceBatteryLevelDidChangeNotification object:nil]; - - - [videoCameraSwitch setPreview:videoPreview]; -} - - (void)transferPressed { /* allow only if call is active */ if (!linphone_core_get_current_call([LinphoneManager getLc])) @@ -314,67 +332,17 @@ const NSInteger SECURE_BUTTON_TAG=5; } } -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - - [[UIApplication sharedApplication] setIdleTimerDisabled:YES]; - - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [callTableController viewDidAppear:NO]; - } -} - -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - if (visibleActionSheet != nil) { - [visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:NO]; - } - if (hideControlsTimer != nil) { - [hideControlsTimer invalidate]; - hideControlsTimer = nil; - } - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [callTableController viewWillDisappear:NO]; - } -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [callTableController viewWillAppear:NO]; - } -} - -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - - if (!videoShown) [[UIApplication sharedApplication] setIdleTimerDisabled:false]; - - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [callTableController viewDidDisappear:NO]; - } -} - -- (void)viewDidUnload { - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -- (void)displayVideoCall:(LinphoneCall*) call { - UIDevice *device = [UIDevice currentDevice]; - device.proximityMonitoringEnabled = YES; - - if(!videoShown) - [self enableVideoDisplay: TRUE]; +- (void)displayVideoCall:(LinphoneCall*) call { + [self enableVideoDisplay: TRUE]; } - (void)displayTableCall:(LinphoneCall*) call { - UIDevice *device = [UIDevice currentDevice]; - device.proximityMonitoringEnabled = YES; - - if(videoShown) - [self disableVideoDisplay: TRUE]; + [self disableVideoDisplay: TRUE]; } + +#pragma mark - Spinner Functions + - (void)hideSpinnerIndicator: (LinphoneCall*)call { videoWaitingForFirstImage.hidden = TRUE; } @@ -384,6 +352,8 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { [thiz hideSpinnerIndicator:call]; } +#pragma mark - Event Functions + - (void)callUpdate: (NSNotification*) notif { LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue]; LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue]; @@ -460,6 +430,8 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { } +#pragma mark - ActionSheet Functions + - (void)dismissActionSheet: (id)o { if (visibleActionSheet != nil) { [visibleActionSheet dismissWithClickedButtonIndex:visibleActionSheet.cancelButtonIndex animated:TRUE]; @@ -500,22 +472,6 @@ static void hideSpinner(LinphoneCall* call, void* user_data) { [visibleActionSheet release]; } -- (void)dealloc { - [videoGroup release]; - [callTableView release]; - [videoView release]; - [videoPreview release]; -#ifdef TEST_VIDEO_VIEW_CHANGE - [testVideoView release]; -#endif - [videoCameraSwitch release]; - [videoWaitingForFirstImage release]; - - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [super dealloc]; -} - - (void)actionSheet:(UIActionSheet *)actionSheet ofType:(enum CallDelegateType)type clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas { LinphoneCall* call = (LinphoneCall*)datas; // maybe we could verify call validity diff --git a/Classes/IncomingCallViewController.m b/Classes/IncomingCallViewController.m index 109a2577d..47965e2c3 100644 --- a/Classes/IncomingCallViewController.m +++ b/Classes/IncomingCallViewController.m @@ -25,6 +25,9 @@ @synthesize addressLabel; @synthesize avatarImage; + +#pragma mark - Lifecycle Functions + - (id)init { self = [super initWithNibName:@"IncomingCallViewController" bundle:[NSBundle mainBundle]]; if(self) { @@ -42,6 +45,9 @@ [super dealloc]; } + +#pragma mark - Event Functions + - (void)callUpdate:(NSNotification*)notif { LinphoneCall *acall = [[notif.userInfo objectForKey: @"call"] pointerValue]; LinphoneCallState astate = [[notif.userInfo objectForKey: @"state"] intValue]; @@ -50,15 +56,8 @@ } } -- (IBAction)onAcceptClick:(id)event { - linphone_core_accept_call([LinphoneManager getLc], call); - [self dismiss: IncomingCall_Accepted]; -} -- (IBAction)onDeclineClick:(id)event { - linphone_core_terminate_call([LinphoneManager getLc], call); - [self dismiss: IncomingCall_Decline]; -} +#pragma mark - - (void)update:(LinphoneCall*)acall { [self view]; //Force view load @@ -76,4 +75,17 @@ return call; } + +#pragma mark - Action Functions + +- (IBAction)onAcceptClick:(id)event { + linphone_core_accept_call([LinphoneManager getLc], call); + [self dismiss: IncomingCall_Accepted]; +} + +- (IBAction)onDeclineClick:(id)event { + linphone_core_terminate_call([LinphoneManager getLc], call); + [self dismiss: IncomingCall_Decline]; +} + @end diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 079869ac6..2fa9e57c8 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -153,13 +153,15 @@ int __aeabi_idiv(int a, int b) { } - (void)setupGSMInteraction { - callCenter = [[CTCallCenter alloc] init]; - callCenter.callEventHandler = ^(CTCall* call) { - // post on main thread - [self performSelectorOnMainThread:@selector(handleGSMCallInteration:) + if (callCenter == nil) { + callCenter = [[CTCallCenter alloc] init]; + callCenter.callEventHandler = ^(CTCall* call) { + // post on main thread + [self performSelectorOnMainThread:@selector(handleGSMCallInteration:) withObject:callCenter waitUntilDone:YES]; - }; + }; + } } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index a7c527252..7818511b1 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -89,9 +89,6 @@ typedef struct _LinphoneCallAppData { + (LinphoneCore*) getLc; + (BOOL)isLcReady; + (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)registerLogView:(id) view; + (NSString *)getPreferenceForCodec: (const char*) name withRate: (int) rate; @@ -117,6 +114,7 @@ typedef struct _LinphoneCallAppData { - (PhoneView) currentView; - (void)enableSpeaker:(BOOL)enable; +- (BOOL)isSpeakerEnabled; @property (nonatomic, retain) id settingsStore; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index ee51828a7..cbff80a55 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -765,6 +765,19 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } } +- (BOOL)isSpeakerEnabled { + CFStringRef lNewRoute = CFSTR("Unknown"); + UInt32 lNewRouteSize = sizeof(lNewRoute); + OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute, &lNewRouteSize, &lNewRoute); + if (!lStatus && lNewRouteSize > 0) { + NSString *route = (NSString *) lNewRoute; + ms_message("Current audio route is [%s]", [route cStringUsingEncoding:[NSString defaultCStringEncoding]]); + return [route isEqualToString: @"Speaker"] || [route isEqualToString: @"SpeakerAndMicrophone"]; + } else { + return false; + } +} + + (BOOL)runningOnIpad { #ifdef UI_USER_INTERFACE_IDIOM return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad); @@ -772,22 +785,4 @@ 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); - [view setHidden:hidden]; - } -} - -+ (void)logUIElementPressed:(const char*) name { - ms_message("UI - '%s' pressed", name); -} - @end diff --git a/Classes/LinphoneUI/UICallBar.m b/Classes/LinphoneUI/UICallBar.m index c63769ada..4ce0132b2 100644 --- a/Classes/LinphoneUI/UICallBar.m +++ b/Classes/LinphoneUI/UICallBar.m @@ -50,10 +50,29 @@ @synthesize zeroButton; @synthesize hashButton; + +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"UICallBar" bundle:[NSBundle mainBundle]]; } +- (void)dealloc { + [pauseButton release]; + [conferenceButton release]; + [videoButton release]; + [microButton release]; + [speakerButton release]; + [optionsButton release]; + + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + [super dealloc]; +} + + +#pragma mark - ViewController Functions + - (void)viewDidLoad { [pauseButton setType:UIPauseButtonType_CurrentCall call:nil]; @@ -71,12 +90,19 @@ [hashButton initWithNumber:'#' addressField:nil dtmf:true]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) name:@"LinphoneCallUpdate" object:nil]; + + // Set selected+over background: IB lack ! + [videoButton setBackgroundImage:[UIImage imageNamed:@"video-ON-disabled.png"] + forState:(UIControlStateDisabled | UIControlStateSelected)]; } - (void)viewDidUnload { [[NSNotificationCenter defaultCenter] removeObserver:self]; } + +#pragma mark - Event Functions + - (void)callUpdate: (NSNotification*) notif { //LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue]; LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue]; @@ -122,19 +148,54 @@ } } -- (void)dealloc { - [pauseButton release]; - [conferenceButton release]; - [videoButton release]; - [microButton release]; - [speakerButton release]; - [optionsButton release]; - - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [super dealloc]; + +#pragma mark - + +- (void)showPad{ + if([padView isHidden]) { + CGRect frame = [padView frame]; + int original_y = frame.origin.y; + frame.origin.y = [[self view] frame].size.height; + [padView setFrame:frame]; + [padView setHidden:FALSE]; + CPAnimationSequence* move = [[CPAnimationSequence sequenceWithSteps: + [[CPAnimationStep for:0.5 animate:^{ + CGRect frame = [padView frame]; + frame.origin.y = original_y; + [padView setFrame:frame]; + }] autorelease], + nil + ] autorelease]; + [move run]; + } } +- (void)hidePad{ + if(![padView isHidden]) { + CGRect frame = [padView frame]; + int original_y = frame.origin.y; + + CPAnimationSequence* move = [[CPAnimationSequence sequenceWithSteps: + [[CPAnimationStep for:0.5 animate:^{ + CGRect frame = [padView frame]; + frame.origin.y = [[self view] frame].size.height; + [padView setFrame:frame]; + }] autorelease], + [[CPAnimationStep after:0.0 animate:^{ + CGRect frame = [padView frame]; + frame.origin.y = original_y; + [padView setHidden:TRUE]; + [padView setFrame:frame]; + }] autorelease], + nil + ] autorelease]; + [move run]; + } +} + + +#pragma mark - Action Functions + - (IBAction)onPadClick:(id)sender { if([padView isHidden]) { [self showPad]; @@ -143,46 +204,6 @@ } } -- (void)showPad{ - CGRect frame = [padView frame]; - int original_y = frame.origin.y; - frame.origin.y = [[self view] frame].size.height; - [padView setFrame:frame]; - [padView setHidden:FALSE]; - CPAnimationSequence* move = [CPAnimationSequence sequenceWithSteps: - [CPAnimationStep for:0.5 animate:^{ - CGRect frame = [padView frame]; - frame.origin.y = original_y; - [padView setFrame:frame]; - }], - nil - ]; - [move run]; - [move release]; -} - -- (void)hidePad{ - CGRect frame = [padView frame]; - int original_y = frame.origin.y; - - CPAnimationSequence* move = [CPAnimationSequence sequenceWithSteps: - [CPAnimationStep for:0.5 animate:^{ - CGRect frame = [padView frame]; - frame.origin.y = [[self view] frame].size.height; - [padView setFrame:frame]; - }], - [CPAnimationStep after:0.0 animate:^{ - CGRect frame = [padView frame]; - frame.origin.y = original_y; - [padView setHidden:TRUE]; - [padView setFrame:frame]; - }], - nil - ]; - [move run]; - [move release]; -} - - (IBAction)onOptionsClick:(id)sender { // Go to dialer view NSDictionary *dict = [[[NSDictionary alloc] initWithObjectsAndKeys: diff --git a/Classes/LinphoneUI/UICallBar.xib b/Classes/LinphoneUI/UICallBar.xib index 529c86679..f2aea4760 100644 --- a/Classes/LinphoneUI/UICallBar.xib +++ b/Classes/LinphoneUI/UICallBar.xib @@ -11,9 +11,10 @@ 1181 - IBProxyObject - IBUIView IBUIButton + IBUIActivityIndicatorView + IBUIView + IBProxyObject com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -41,6 +42,7 @@ {{0, 335}, {320, 125}} + _NS:9 1 @@ -424,6 +426,7 @@ {{20, 57}, {281, 260}} + _NS:9 3 @@ -444,7 +447,7 @@ {80, 67} - + _NS:9 NO @@ -478,6 +481,18 @@ + + + -2147483356 + {{20, 18}, {37, 37}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 292 @@ -903,6 +918,14 @@ 20 + + + waitView + + + + 60 + onConferenceClick: @@ -962,6 +985,7 @@ + buttons @@ -1106,6 +1130,12 @@ 6 + + 59 + + + waitView + @@ -1120,7 +1150,7 @@ UIVideoButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1163,6 +1193,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIHangUpButton @@ -1179,7 +1210,7 @@ - 58 + 60 @@ -1381,6 +1412,17 @@ UIVideoButton UIToggleButton + + waitView + UIActivityIndicatorView + + + waitView + + waitView + UIActivityIndicatorView + + IBProjectSource ./Classes/UIVideoButton.h diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 850ad2df5..56d34fd18 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -25,6 +25,23 @@ static BOOL transferMode = NO; +#pragma mark - Lifecycle Functions + +-(void) initWithAddress:(UITextField*) address{ + mAddress=[address retain]; + transferMode = NO; + [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; +} + +- (void)dealloc { + [super dealloc]; + [mAddress release]; + +} + + +#pragma mark - Statics Functions + +(void) enableTransforMode:(BOOL) enable { transferMode = enable; } @@ -33,6 +50,9 @@ static BOOL transferMode = NO; return transferMode; } + +#pragma mark - + -(void) touchUp:(id) sender { if (!linphone_core_is_network_reachabled([LinphoneManager getLc])) { UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Network Error",nil) @@ -109,25 +129,4 @@ static BOOL transferMode = NO; } - -/* - // Only override drawRect: if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - - (void)drawRect:(CGRect)rect { - // Drawing code. - } - */ --(void) initWithAddress:(UITextField*) address{ - mAddress=[address retain]; - transferMode = NO; - [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; -} - -- (void)dealloc { - [super dealloc]; - [mAddress release]; - -} - - @end diff --git a/Classes/LinphoneUI/UICallCell.h b/Classes/LinphoneUI/UICallCell.h index 05a7eccc0..ae278cff5 100644 --- a/Classes/LinphoneUI/UICallCell.h +++ b/Classes/LinphoneUI/UICallCell.h @@ -34,6 +34,9 @@ @interface UICallCell : UITableViewCell { @private + BOOL firstCell; + BOOL conferenceCall; + UIView *firstBackground; UIView *otherBackground; @@ -41,6 +44,7 @@ UILabel *stateLabel; UIImageView *stateImage; UIPauseButton *pauseButton; + UIButton *removeButton; UIImageView *avatarImage; UIView *headerView; @@ -58,18 +62,21 @@ @property (nonatomic, retain) IBOutlet UILabel* stateLabel; @property (nonatomic, retain) IBOutlet UIImageView* stateImage; @property (nonatomic, retain) IBOutlet UIImageView* avatarImage; +@property (nonatomic, retain) IBOutlet UIButton *removeButton; @property (nonatomic, retain) IBOutlet UIPauseButton *pauseButton; @property (nonatomic, retain) IBOutlet UIView* headerView; @property (nonatomic, retain) IBOutlet UIView* avatarView; -- (void)firstCell; -- (void)otherCell; +@property (assign) BOOL firstCell; +@property (assign) BOOL conferenceCall; + - (void)update; - (id)initWithIdentifier:(NSString*)identifier; - (IBAction)doHeaderClick:(id)sender; +- (IBAction)doRemoveClick:(id)sender; + (int)getMaximizedHeight; + (int)getMinimizedHeight; diff --git a/Classes/LinphoneUI/UICallCell.m b/Classes/LinphoneUI/UICallCell.m index cfdd143c7..200cf0066 100644 --- a/Classes/LinphoneUI/UICallCell.m +++ b/Classes/LinphoneUI/UICallCell.m @@ -19,6 +19,8 @@ #import "UICallCell.h" +#import "LinphoneManager.h" + @implementation UICallCellData - (id)init:(LinphoneCall*) acall { @@ -43,10 +45,17 @@ @synthesize stateImage; @synthesize avatarImage; @synthesize pauseButton; +@synthesize removeButton; @synthesize headerView; @synthesize avatarView; +@synthesize firstCell; +@synthesize conferenceCall; + + +#pragma mark - Lifecycle Functions + - (id)initWithIdentifier:(NSString*)identifier { if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) { NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UICallCell" @@ -63,16 +72,31 @@ return self; } -- (void)firstCell{ - [firstBackground setHidden:false]; - [otherBackground setHidden:true]; +- (void)dealloc { + [firstBackground release]; + [otherBackground release]; + [addressLabel release]; + [stateLabel release]; + [stateImage release]; + [avatarImage release]; + [headerView release]; + [super dealloc]; } -- (void)otherCell{ - [firstBackground setHidden:true]; - [otherBackground setHidden:false]; + +#pragma mark - Static cell sizes + ++ (int)getMaximizedHeight { + return 280; } ++ (int)getMinimizedHeight { + return 54; +} + + +#pragma mark - + - (void)update:(UICallCellData*) adata { self->data = adata; [self update]; @@ -109,18 +133,25 @@ LinphoneCallState state = linphone_call_get_state(call); - if(state == LinphoneCallOutgoingRinging) { - [stateImage setImage:[UIImage imageNamed:@"ring-champ-numero-actif"]]; - [stateImage setHidden:false]; - [pauseButton setHidden:true]; - } else if(state == LinphoneCallOutgoingInit || state == LinphoneCallOutgoingProgress){ - [stateImage setImage:[UIImage imageNamed:@"outgoing-champ-numero-actif"]]; - [stateImage setHidden:false]; - [pauseButton setHidden:true]; + if(!conferenceCall) { + if(state == LinphoneCallOutgoingRinging) { + [stateImage setImage:[UIImage imageNamed:@"ring-champ-numero-actif"]]; + [stateImage setHidden:false]; + [pauseButton setHidden:true]; + } else if(state == LinphoneCallOutgoingInit || state == LinphoneCallOutgoingProgress){ + [stateImage setImage:[UIImage imageNamed:@"outgoing-champ-numero-actif"]]; + [stateImage setHidden:false]; + [pauseButton setHidden:true]; + } else { + [stateImage setHidden:true]; + [pauseButton setHidden:false]; + [pauseButton update]; + } + [removeButton setHidden:true]; } else { [stateImage setHidden:true]; - [pauseButton setHidden:false]; - [pauseButton update]; + [pauseButton setHidden:true]; + [removeButton setHidden:false]; } NSMutableString* msDuration = [[NSMutableString alloc] init]; @@ -142,14 +173,9 @@ } } [pauseButton setType:UIPauseButtonType_Call call:call]; -} - -- (IBAction)doHeaderClick:(id)sender { - NSLog(@"Toggle UICallCell"); - if(data) { - data->minimize = !data->minimize; - [self selfUpdate]; - } + + [firstBackground setHidden:!firstCell]; + [otherBackground setHidden:firstCell]; } - (void)selfUpdate { @@ -166,24 +192,20 @@ }*/ } -- (void)dealloc { - [firstBackground release]; - [otherBackground release]; - [addressLabel release]; - [stateLabel release]; - [stateImage release]; - [avatarImage release]; - [headerView release]; - [super dealloc]; + +#pragma mark - Action Functions + +- (IBAction)doHeaderClick:(id)sender { + if(data) { + data->minimize = !data->minimize; + [self selfUpdate]; + } } -+ (int)getMaximizedHeight { - return 280; +- (IBAction)doRemoveClick:(id)sender { + if(data != nil && data->call != NULL) { + linphone_core_remove_from_conference([LinphoneManager getLc], data->call); + } } -+ (int)getMinimizedHeight { - return 54; -} - - @end diff --git a/Classes/LinphoneUI/UICallCell.xib b/Classes/LinphoneUI/UICallCell.xib index 265869dbc..1c1d7f2f6 100644 --- a/Classes/LinphoneUI/UICallCell.xib +++ b/Classes/LinphoneUI/UICallCell.xib @@ -153,7 +153,7 @@ {320, 63} - + _NS:9 IBCocoaTouchFramework @@ -4597,9 +4597,9 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE NO IBCocoaTouchFramework - + - 292 + -2147483356 {{216, 6}, {41, 41}} @@ -4616,6 +4616,36 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 8 8 + + NSImage + supprimer-participant-conf-over.png + + + NSImage + supprimer-participant-conf-actif.png + + + + + + + -2147483356 + {{216, 6}, {41, 41}} + + + + _NS:9 + NO + IBCocoaTouchFramework + 0 + 0 + NO + NO + 8 + 8 + 8 + 8 + NSImage play-champ-numero-over.png @@ -4666,7 +4696,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE {{0, 5}, {200, 40}} - _NS:9 NO IBCocoaTouchFramework @@ -4793,6 +4822,14 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 48 + + + removeButton + + + + 50 + doHeaderClick: @@ -4802,6 +4839,15 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE 39 + + + doRemoveClick: + + + 7 + + 51 + @@ -4859,6 +4905,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE + headerView @@ -4893,12 +4940,6 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE stateLabel - - 38 - - - toggleButton - 30 @@ -4922,6 +4963,18 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE pauseButton + + 49 + + + removeButton + + + 38 + + + toggleButton + @@ -4947,30 +5000,36 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIPauseButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - + + UIPauseButton + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + - 48 + 51 UICallCell UITableViewCell - - doHeaderClick: - id - - - doHeaderClick: - + + id + id + + + doHeaderClick: id - + + doRemoveClick: + id + + UILabel UIImageView @@ -4979,6 +5038,7 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE UIView UIView UIPauseButton + UIButton UIImageView UILabel @@ -5011,6 +5071,10 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE pauseButton UIPauseButton + + removeButton + UIButton + stateImage UIImageView @@ -5059,6 +5123,8 @@ AAgAAAAIAAIACAACAAAAAgAAAAEAAQABAAE {43, 50} {43, 46} {43, 46} + {43, 43} + {43, 43} 1181 diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index ae8693e42..6d0a7737d 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -25,6 +25,9 @@ @synthesize displayNameLabel; @synthesize chatContentLabel; + +#pragma mark - Lifecycle Functions + - (id)init { if ((self = [super init]) != nil) { NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIChatCell" @@ -38,10 +41,15 @@ return self; } -- (IBAction)onDetails: (id) event { +- (void)dealloc { + [displayNameLabel release]; + [chatContentLabel release]; + [super dealloc]; } +#pragma mark - + - (void)update{ [avatarView setImage:[UIImage imageNamed:@"avatar-small.png"]]; @@ -69,11 +77,11 @@ [chatContentLabel setFrame: lastNameFrame]; } -- (void)dealloc { - [displayNameLabel release]; - [chatContentLabel release]; + +#pragma mark - Action Functions + +- (IBAction)onDetails: (id) event { - [super dealloc]; } @end diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index 06286378b..76efd4cde 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -56,6 +56,9 @@ @synthesize viewTransition; + +#pragma mark - Lifecycle Functions + - (void)initUICompositeViewController { self->viewControllerCache = [[NSMutableDictionary alloc] init]; } @@ -93,6 +96,8 @@ [super dealloc]; } +#pragma mark - + + (void)addSubView:(UIViewController*)controller view:(UIView*)view { if(controller != nil) { if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { diff --git a/Classes/LinphoneUI/UIConferenceHeader.m b/Classes/LinphoneUI/UIConferenceHeader.m index 240453ff8..06354bf87 100644 --- a/Classes/LinphoneUI/UIConferenceHeader.m +++ b/Classes/LinphoneUI/UIConferenceHeader.m @@ -26,10 +26,22 @@ @synthesize stateImage; @synthesize pauseButton; + +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"UIConferenceHeader" bundle:[NSBundle mainBundle]]; } +- (void)dealloc { + [stateImage release]; + [pauseButton release]; + [super dealloc]; +} + + +#pragma mark - ViewController Functions + - (void)viewDidLoad { [super viewDidLoad]; // Set selected+over background: IB lack ! @@ -38,10 +50,16 @@ [pauseButton setType:UIPauseButtonType_Conference call:nil]; } + +#pragma mark - Static size Functions + + (int)getHeight { return 50; } + +#pragma mark - + - (void)update { [self view]; [stateImage setHidden:true]; diff --git a/Classes/LinphoneUI/UIContactCell.m b/Classes/LinphoneUI/UIContactCell.m index a0b292195..c5ebbf8dd 100644 --- a/Classes/LinphoneUI/UIContactCell.m +++ b/Classes/LinphoneUI/UIContactCell.m @@ -24,6 +24,9 @@ @synthesize firstNameLabel; @synthesize lastNameLabel; + +#pragma mark - Lifecycle Functions + - (id)initWithIdentifier:(NSString*)identifier { if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) { NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIContactCell" @@ -37,6 +40,16 @@ return self; } +- (void) dealloc { + [firstNameLabel release]; + [lastNameLabel release]; + + [super dealloc]; +} + + +#pragma mark - + - (void)touchUp:(id) sender { [self setHighlighted:true animated:true]; } @@ -93,11 +106,4 @@ [lastNameLabel setFrame: lastNameFrame]; } -- (void) dealloc { - [firstNameLabel release]; - [lastNameLabel release]; - - [super dealloc]; -} - @end diff --git a/Classes/LinphoneUI/UIDigitButton.m b/Classes/LinphoneUI/UIDigitButton.m index d0fd07868..7136b6cfc 100644 --- a/Classes/LinphoneUI/UIDigitButton.m +++ b/Classes/LinphoneUI/UIDigitButton.m @@ -25,31 +25,8 @@ @synthesize sendDtmfDuringCall; -- (void)touchDown:(id) sender { - if (mAddress && (!sendDtmfDuringCall || !linphone_core_in_call([LinphoneManager getLc]))) { - NSString* newAddress = [NSString stringWithFormat:@"%@%c",mAddress.text,mDigit]; - [mAddress setText:newAddress]; - linphone_core_play_dtmf([LinphoneManager getLc], mDigit, -1); - } else { - linphone_core_send_dtmf([LinphoneManager getLc], mDigit); - linphone_core_play_dtmf([LinphoneManager getLc], mDigit, 100); - } -} -- (void)touchUp:(id) sender { - linphone_core_stop_dtmf([LinphoneManager getLc]); -} - -- (void)onRepeatTouch { -} - -- (void)onLongTouch { - if (mDigit == '0') { - NSString* newAddress = [[mAddress.text substringToIndex: [mAddress.text length]-1] stringByAppendingString:@"+"]; - [mAddress setText:newAddress]; - [mAddress sendActionsForControlEvents:UIControlEventEditingChanged]; - } -} +#pragma mark - Lifecycle Functions - (void)initWithNumber:(char)digit { [self initWithNumber:digit addressField:nil dtmf:true]; @@ -69,4 +46,35 @@ } +#pragma mark - Actions Functions + +- (void)touchDown:(id) sender { + if (mAddress && (!sendDtmfDuringCall || !linphone_core_in_call([LinphoneManager getLc]))) { + NSString* newAddress = [NSString stringWithFormat:@"%@%c",mAddress.text,mDigit]; + [mAddress setText:newAddress]; + linphone_core_play_dtmf([LinphoneManager getLc], mDigit, -1); + } else { + linphone_core_send_dtmf([LinphoneManager getLc], mDigit); + linphone_core_play_dtmf([LinphoneManager getLc], mDigit, 100); + } +} + +- (void)touchUp:(id) sender { + linphone_core_stop_dtmf([LinphoneManager getLc]); +} + + +#pragma mark - UILongTouchButtonDelegate Functions + +- (void)onRepeatTouch { +} + +- (void)onLongTouch { + if (mDigit == '0') { + NSString* newAddress = [[mAddress.text substringToIndex: [mAddress.text length]-1] stringByAppendingString:@"+"]; + [mAddress setText:newAddress]; + [mAddress sendActionsForControlEvents:UIControlEventEditingChanged]; + } +} + @end diff --git a/Classes/LinphoneUI/UIDuration.h b/Classes/LinphoneUI/UIDuration.h deleted file mode 100644 index 9493d43cd..000000000 --- a/Classes/LinphoneUI/UIDuration.h +++ /dev/null @@ -1,33 +0,0 @@ -/* UIDuration.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 - - -@interface UIDuration : UILabel { -@private - NSTimer *durationRefreasher; -} - --(void) start; --(void) stop; - -@end diff --git a/Classes/LinphoneUI/UIDuration.m b/Classes/LinphoneUI/UIDuration.m deleted file mode 100644 index 54351b929..000000000 --- a/Classes/LinphoneUI/UIDuration.m +++ /dev/null @@ -1,66 +0,0 @@ -/* UIDuration.m - * - * 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 "UIDuration.h" -#import "LinphoneManager.h" - - -@implementation UIDuration - --(void)updateCallDuration { - int lDuration = linphone_core_get_current_call_duration([LinphoneManager getLc]); - if (lDuration < 60) { - [self setText:[NSString stringWithFormat: @"%02i s", lDuration]]; - } else { - [self setText:[NSString stringWithFormat: @"%02i:%02i", lDuration/60,lDuration - 60 *(lDuration/60)]]; - } -} - --(void) start { - [self setText:@"00 s"]; - durationRefreasher = [NSTimer scheduledTimerWithTimeInterval:1 - target:self - selector:@selector(updateCallDuration) - userInfo:nil - repeats:YES]; -} --(void) stop { - [durationRefreasher invalidate]; - durationRefreasher=nil; - -} - - -/* - // Only override drawRect: if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - - (void)drawRect:(CGRect)rect { - // Drawing code. - } - */ - -- (void)dealloc { - [super dealloc]; - [durationRefreasher invalidate]; -} - - -@end diff --git a/Classes/LinphoneUI/UIEraseButton.m b/Classes/LinphoneUI/UIEraseButton.m index 9c44d10d9..5a4b58e22 100644 --- a/Classes/LinphoneUI/UIEraseButton.m +++ b/Classes/LinphoneUI/UIEraseButton.m @@ -22,16 +22,28 @@ @implementation UIEraseButton +#pragma mark - Lifecycle Functions + +-(void) initWithAddressField:(UITextField*) address { + mAddress = address; + [self addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown]; +} + +- (void)dealloc { + [super dealloc]; +} + + +#pragma mark - Action Functions + -(void) touchDown:(id) sender { if ([mAddress.text length] > 0) { [mAddress setText:[mAddress.text substringToIndex:[mAddress.text length]-1]]; } } --(void) initWithAddressField:(UITextField*) address { - mAddress = address; - [self addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown]; -} + +#pragma mark - UILongTouchButtonDelegate Functions - (void)onRepeatTouch { } @@ -40,9 +52,4 @@ [mAddress setText:@""]; } -- (void)dealloc { - [super dealloc]; -} - - @end diff --git a/Classes/LinphoneUI/UIHangUpButton.m b/Classes/LinphoneUI/UIHangUpButton.m index c7cb1ddab..ec71460d1 100644 --- a/Classes/LinphoneUI/UIHangUpButton.m +++ b/Classes/LinphoneUI/UIHangUpButton.m @@ -24,6 +24,9 @@ @implementation UIHangUpButton + +#pragma mark - Static Functions + + (bool)isInConference:(LinphoneCall*) call { if (!call) return false; @@ -43,24 +46,8 @@ return count; } --(void) touchUp:(id) sender { - if([LinphoneManager isLcReady]) { - LinphoneCore* lc = [LinphoneManager getLc]; - LinphoneCall* currentcall = linphone_core_get_current_call(lc); - if (linphone_core_is_in_conference(lc) || // In conference - (linphone_core_get_conference_size(lc) > 0 && [UIHangUpButton callCount:lc] == 0) // Only one conf - ) { - linphone_core_terminate_conference(lc); - } else if(currentcall != NULL) { // In a call - linphone_core_terminate_call(lc, currentcall); - } else { - const MSList* calls = linphone_core_get_calls(lc); - if (ms_list_size(calls) == 1) { // Only one call - linphone_core_terminate_call(lc,(LinphoneCall*)(calls->data)); - } - } - } -} + +#pragma mark - Lifecycle Functions - (void)initUIHangUpButton { [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; @@ -90,6 +77,13 @@ return self; } +- (void)dealloc { + [super dealloc]; +} + + +#pragma mark - + - (void)update { if([LinphoneManager isLcReady]) { LinphoneCore * lc = [LinphoneManager getLc]; @@ -105,17 +99,25 @@ [self setEnabled:false]; } -/* - // Only override drawRect: if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - - (void)drawRect:(CGRect)rect { - // Drawing code. - } - */ +#pragma mark - Action Functions -- (void)dealloc { - [super dealloc]; +-(void) touchUp:(id) sender { + if([LinphoneManager isLcReady]) { + LinphoneCore* lc = [LinphoneManager getLc]; + LinphoneCall* currentcall = linphone_core_get_current_call(lc); + if (linphone_core_is_in_conference(lc) || // In conference + (linphone_core_get_conference_size(lc) > 0 && [UIHangUpButton callCount:lc] == 0) // Only one conf + ) { + linphone_core_terminate_conference(lc); + } else if(currentcall != NULL) { // In a call + linphone_core_terminate_call(lc, currentcall); + } else { + const MSList* calls = linphone_core_get_calls(lc); + if (ms_list_size(calls) == 1) { // Only one call + linphone_core_terminate_call(lc,(LinphoneCall*)(calls->data)); + } + } + } } - @end diff --git a/Classes/LinphoneUI/UIHistoryCell.m b/Classes/LinphoneUI/UIHistoryCell.m index 81dafdde6..f9692c9e0 100644 --- a/Classes/LinphoneUI/UIHistoryCell.m +++ b/Classes/LinphoneUI/UIHistoryCell.m @@ -29,6 +29,8 @@ #define DETAILS_DISABLED +#pragma mark - Lifecycle Functions + - (id)initWithIdentifier:(NSString*)identifier { if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier]) != nil) { NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UIHistoryCell" @@ -44,6 +46,18 @@ return self; } +- (void) dealloc { + [detailsButton release]; + [deleteButton release]; + [displayNameLabel release]; + [imageView release]; + + [super dealloc]; +} + + +#pragma mark - Action Functions + - (IBAction)onDetails:(id) event { if(callLog != NULL) { @@ -58,6 +72,9 @@ } } + +#pragma mark - + - (void)update:(LinphoneCallLog*) aCallLog { self->callLog = aCallLog; // Set up the cell... @@ -97,13 +114,4 @@ [deleteButton setHidden:true]; } -- (void) dealloc { - [detailsButton release]; - [deleteButton release]; - [displayNameLabel release]; - [imageView release]; - - [super dealloc]; -} - @end diff --git a/Classes/LinphoneUI/UILinphone.h b/Classes/LinphoneUI/UILinphone.h deleted file mode 100644 index e195b8d5f..000000000 --- a/Classes/LinphoneUI/UILinphone.h +++ /dev/null @@ -1,29 +0,0 @@ -/* UILinphone.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 "UICallButton.h" -#import "UIHangUpButton.h" -#import "UIDigitButton.h" -#import "UIToggleButton.h" -#import "UIMicroButton.h" -#import "UISpeakerButton.h" -#import "UIDuration.h" -#import "UIEraseButton.h" -#import "UICamSwitch.h" -#import "UIPauseResumeButton.h" diff --git a/Classes/LinphoneUI/UILongTouchButton.m b/Classes/LinphoneUI/UILongTouchButton.m index 616aa87c7..03088ce79 100644 --- a/Classes/LinphoneUI/UILongTouchButton.m +++ b/Classes/LinphoneUI/UILongTouchButton.m @@ -21,12 +21,39 @@ @implementation UILongTouchButton -- (id)init { + +#pragma mark - Lifecycle Functions + +- (id)initUILongTouchButton { [self addTarget:self action:@selector(___touchDown:) forControlEvents:UIControlEventTouchDown]; [self addTarget:self action:@selector(___touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside]; return self; } +- (id)init { + self = [super init]; + if (self) { + [self initUILongTouchButton]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initUILongTouchButton]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self initUILongTouchButton]; + } + return self; +} + - (void)___touchDown:(id) sender { [self performSelector:@selector(doLongTouch) withObject:nil afterDelay:0.5]; } @@ -47,22 +74,6 @@ [self performSelector:@selector(doRepeatTouch) withObject:nil afterDelay:0.1]; } -- (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)onRepeatTouch { [NSException raise:NSInternalInconsistencyException format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index de9e36f8a..36150e13c 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -28,16 +28,38 @@ @synthesize settingsButton; @synthesize chatButton; + +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"UIMainBar" bundle:[NSBundle mainBundle]]; } +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [super dealloc]; +} + + +#pragma mark - ViewController Functions + - (void)viewDidLoad { - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveLinphoneMainViewChangeEvent:) name:@"LinphoneMainViewChange" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeView:) name:@"LinphoneMainViewChange" object:nil]; [self update:[[LinphoneManager instance] currentView]]; } -- (void)receiveLinphoneMainViewChangeEvent: (NSNotification*) notif { +- (void)viewDidUnload { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [historyButton release]; + [contactsButton release]; + [dialerButton release]; + [settingsButton release]; + [chatButton release]; +} + +#pragma mark - + +- (void)changeView: (NSNotification*) notif { NSNumber *viewNumber = [notif.userInfo objectForKey: @"view"]; if(viewNumber != nil) [self update:[viewNumber intValue]]; @@ -71,19 +93,8 @@ } } -- (void)viewDidUnload { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [historyButton release]; - [contactsButton release]; - [dialerButton release]; - [settingsButton release]; - [chatButton release]; -} -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; -} +#pragma mark - Action Functions - (IBAction)onHistoryClick: (id) sender { [[LinphoneManager instance] changeView:PhoneView_History]; diff --git a/Classes/LinphoneUI/UIPauseButton.m b/Classes/LinphoneUI/UIPauseButton.m index 36fe79341..fc53aa47e 100644 --- a/Classes/LinphoneUI/UIPauseButton.m +++ b/Classes/LinphoneUI/UIPauseButton.m @@ -25,6 +25,9 @@ @implementation UIPauseButton + +#pragma mark - Lifecycle Functions + - (void)initUIPauseButton { self->type = UIPauseButtonType_CurrentCall; } @@ -53,11 +56,48 @@ return self; } + +#pragma mark - Static Functions + ++ (bool)isInConference: (LinphoneCall*) call { + if (!call) + return false; + return linphone_call_get_current_params(call)->in_conference; +} + ++ (int)notInConferenceCallCount: (LinphoneCore*) lc { + int count = 0; + const MSList* calls = linphone_core_get_calls(lc); + + while (calls != 0) { + if (![UIPauseButton isInConference: (LinphoneCall*)calls->data]) { + count++; + } + calls = calls->next; + } + return count; +} + ++ (LinphoneCall*)getCall { + LinphoneCore* lc = [LinphoneManager getLc]; + LinphoneCall* currentCall = linphone_core_get_current_call(lc); + if (currentCall == nil && linphone_core_get_calls_nb(lc) == 1) { + currentCall = (LinphoneCall*) linphone_core_get_calls(lc)->data; + } + return currentCall; +} + + +#pragma mark - + - (void)setType:(UIPauseButtonType) atype call:(LinphoneCall*)acall { self->type = atype; self->call = acall; } + +#pragma mark - UIToggleButtonDelegate Functions + - (void)onOn { switch (type) { case UIPauseButtonType_Call: @@ -113,25 +153,6 @@ } } -+ (bool)isInConference: (LinphoneCall*) call { - if (!call) - return false; - return linphone_call_get_current_params(call)->in_conference; -} - -+ (int)notInConferenceCallCount: (LinphoneCore*) lc { - int count = 0; - const MSList* calls = linphone_core_get_calls(lc); - - while (calls != 0) { - if (![UIPauseButton isInConference: (LinphoneCall*)calls->data]) { - count++; - } - calls = calls->next; - } - return count; -} - - (bool)onUpdate { bool ret = false; // TODO: disable pause on not running call @@ -145,9 +166,9 @@ if(state == LinphoneCallPaused || state == LinphoneCallPausing) { ret = true; } - [LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:""]; + [self setEnabled:TRUE]; } else { - [LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""]; + [self setEnabled:FALSE]; } break; } @@ -157,9 +178,9 @@ if (!linphone_core_is_in_conference(lc)) { ret = true; } - [LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:""]; + [self setEnabled:TRUE]; } else { - [LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""]; + [self setEnabled:FALSE]; } break; } @@ -171,9 +192,9 @@ if(state == LinphoneCallPaused || state == LinphoneCallPausing) { ret = true; } - [LinphoneManager set:self enabled:TRUE withName:"PAUSE button" andReason:""]; + [self setEnabled:TRUE]; } else { - [LinphoneManager set:self enabled:FALSE withName:"PAUSE button" andReason:""]; + [self setEnabled:FALSE]; } break; } @@ -182,17 +203,4 @@ return ret; } -+ (LinphoneCall*)getCall { - LinphoneCore* lc = [LinphoneManager getLc]; - LinphoneCall* currentCall = linphone_core_get_current_call(lc); - if (currentCall == nil && linphone_core_get_calls_nb(lc) == 1) { - currentCall = (LinphoneCall*) linphone_core_get_calls(lc)->data; - } - return currentCall; -} - -- (void)dealloc { - [super dealloc]; -} - @end diff --git a/Classes/LinphoneUI/UISpeakerButton.m b/Classes/LinphoneUI/UISpeakerButton.m index d931cb4df..cae8f76b0 100644 --- a/Classes/LinphoneUI/UISpeakerButton.m +++ b/Classes/LinphoneUI/UISpeakerButton.m @@ -25,6 +25,10 @@ #include "linphonecore.h" @implementation UISpeakerButton + + +#pragma mark - Static Functions + static AudioSessionPropertyID routeChangeID = kAudioSessionProperty_AudioRouteChange; static void audioRouteChangeListenerCallback ( @@ -70,6 +74,16 @@ static void audioRouteChangeListenerCallback ( return self; } +- (void)dealloc { + OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(routeChangeID, audioRouteChangeListenerCallback, self); + if (lStatus) { + ms_error ("cannot un register route change handler [%ld]",lStatus); + } + [super dealloc]; +} + +#pragma mark - UIToggleButtonDelegate Functions + - (void)onOn { [[LinphoneManager instance] enableSpeaker:TRUE]; } @@ -79,27 +93,7 @@ static void audioRouteChangeListenerCallback ( } - (bool)onUpdate { - CFStringRef lNewRoute=CFSTR("Unknown"); - UInt32 lNewRouteSize = sizeof(lNewRoute); - OSStatus lStatus = AudioSessionGetProperty(kAudioSessionProperty_AudioRoute - ,&lNewRouteSize - ,&lNewRoute); - if (!lStatus && CFStringGetLength(lNewRoute) > 0) { - char route[64]; - CFStringGetCString(lNewRoute, route,sizeof(route), kCFStringEncodingUTF8); - ms_message("Current audio route is [%s]",route); - return ( kCFCompareEqualTo == CFStringCompare (lNewRoute,CFSTR("Speaker"),0) - || kCFCompareEqualTo == CFStringCompare (lNewRoute,CFSTR("SpeakerAndMicrophone"),0)); - } else - return false; -} - -- (void)dealloc { - OSStatus lStatus = AudioSessionRemovePropertyListenerWithUserData(routeChangeID, audioRouteChangeListenerCallback, self); - if (lStatus) { - ms_error ("cannot un register route change handler [%ld]",lStatus); - } - [super dealloc]; + return [[LinphoneManager instance] isSpeakerEnabled]; } @end diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index 2600765b6..dd5724bf6 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -30,10 +30,23 @@ NSTimer *callQualityTimer; + +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]]; } +- (void) dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [callQualityTimer invalidate]; + [callQualityTimer release]; + [super dealloc]; +} + + +#pragma mark - ViewController Functions + - (void)viewDidLoad { [super viewDidLoad]; @@ -55,41 +68,20 @@ NSTimer *callQualityTimer; [self proxyConfigUpdate: config]; } -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return (interfaceOrientation == UIInterfaceOrientationPortrait); +- (void) viewDidUnload { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [callQualityTimer invalidate]; } + +#pragma mark - Event Functions + - (void)registrationUpdate: (NSNotification*) notif { LinphoneProxyConfig* config = NULL; linphone_core_get_default_proxy([LinphoneManager getLc], &config); [self proxyConfigUpdate:config]; } -- (void)callQualityUpdate { - UIImage *image = nil; - if([LinphoneManager isLcReady]) { - LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); - if(call != NULL) { - float quality = linphone_call_get_average_quality(call); - if(quality < 1) { - image = [UIImage imageNamed:@"quality-call-0.png"]; - } else if (quality < 2) { - image = [UIImage imageNamed:@"quality-call-1.png"]; - } else if (quality < 3) { - image = [UIImage imageNamed:@"quality-call-2.png"]; - } else { - image = [UIImage imageNamed:@"quality-call-3.png"]; - } - } - } - if(image != nil) { - [callQualityImage setHidden: false]; - [callQualityImage setImage: image]; - } else { - [callQualityImage setHidden: true]; - } -} - - (void)proxyConfigUpdate: (LinphoneProxyConfig*) config { LinphoneRegistrationState state; NSString* message = nil; @@ -148,16 +140,32 @@ NSTimer *callQualityTimer; [registrationStateImage setImage:image]; } -- (void) viewDidUnload { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [callQualityTimer invalidate]; -} -- (void) dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [callQualityTimer invalidate]; - [callQualityTimer release]; - [super dealloc]; +#pragma mark - + +- (void)callQualityUpdate { + UIImage *image = nil; + if([LinphoneManager isLcReady]) { + LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); + if(call != NULL) { + float quality = linphone_call_get_average_quality(call); + if(quality < 1) { + image = [UIImage imageNamed:@"quality-call-0.png"]; + } else if (quality < 2) { + image = [UIImage imageNamed:@"quality-call-1.png"]; + } else if (quality < 3) { + image = [UIImage imageNamed:@"quality-call-2.png"]; + } else { + image = [UIImage imageNamed:@"quality-call-3.png"]; + } + } + } + if(image != nil) { + [callQualityImage setHidden: false]; + [callQualityImage setImage: image]; + } else { + [callQualityImage setHidden: true]; + } } @end diff --git a/Classes/LinphoneUI/UIToggleButton.m b/Classes/LinphoneUI/UIToggleButton.m index 92efe199d..a8b92feab 100644 --- a/Classes/LinphoneUI/UIToggleButton.m +++ b/Classes/LinphoneUI/UIToggleButton.m @@ -21,38 +21,8 @@ @implementation UIToggleButton -- (void)touchUp:(id) sender { - [self toggle]; -} - -- (bool)toggle { - if (self.selected) { - self.selected=!self.selected; - [self onOff]; - } else { - self.selected=!self.selected; - [self onOn]; - } - return self.selected; -} - -- (void)setOn { - if (!self.selected) { - [self toggle]; - } -} - -- (void)setOff { - if (self.selected) { - [self toggle]; - } -} - -- (bool)update { - self.selected = [self onUpdate]; - return self.selected; -} +#pragma mark - Lifecycle Functions - (void)initUIToggleButton { [self update]; @@ -88,6 +58,43 @@ } +#pragma mark - + +- (void)touchUp:(id) sender { + [self toggle]; +} + +- (bool)toggle { + if (self.selected) { + self.selected=!self.selected; + [self onOff]; + } else { + self.selected=!self.selected; + [self onOn]; + } + return self.selected; +} + +- (void)setOn { + if (!self.selected) { + [self toggle]; + } +} + +- (void)setOff { + if (self.selected) { + [self toggle]; + } +} + +- (bool)update { + self.selected = [self onUpdate]; + return self.selected; +} + + +#pragma mark - UIToggleButtonDelegate Functions + -(void) onOn { /*[NSException raise:NSInternalInconsistencyException format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)];*/ diff --git a/Classes/LinphoneUI/UIVideoButton.h b/Classes/LinphoneUI/UIVideoButton.h index 86586ce74..fbd07c43f 100644 --- a/Classes/LinphoneUI/UIVideoButton.h +++ b/Classes/LinphoneUI/UIVideoButton.h @@ -23,6 +23,13 @@ @interface UIVideoButton : UIToggleButton { BOOL locked; + BOOL unlockVideoState; + UIActivityIndicatorView *waitView; } +@property (assign) BOOL locked; +@property (assign) BOOL unlockVideoState; + +@property (nonatomic, retain) IBOutlet UIActivityIndicatorView* waitView; + @end diff --git a/Classes/LinphoneUI/UIVideoButton.m b/Classes/LinphoneUI/UIVideoButton.m index 961f1686a..f5b0b9055 100644 --- a/Classes/LinphoneUI/UIVideoButton.m +++ b/Classes/LinphoneUI/UIVideoButton.m @@ -22,6 +22,39 @@ @implementation UIVideoButton +@synthesize locked; +@synthesize unlockVideoState; +@synthesize waitView; + +- (void)initUIVideoButton { + self->locked = FALSE; + self->unlockVideoState = FALSE; +} + +- (id)init{ + self = [super init]; + if (self) { + [self initUIVideoButton]; + } + return self; +} + +- (id)initWithCoder:(NSCoder *)decoder { + self = [super initWithCoder:decoder]; + if (self) { + [self initUIVideoButton]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initUIVideoButton]; + } + return self; +} + - (void)onOn { LinphoneCore* lc = [LinphoneManager getLc]; @@ -29,6 +62,10 @@ return; [self setEnabled: FALSE]; + [waitView startAnimating]; + [self setLocked: TRUE]; + [self setUnlockVideoState: TRUE]; + LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); if (call) { LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call)); @@ -37,8 +74,7 @@ linphone_call_params_destroy(call_params); } else { ms_warning("Cannot toggle video, because no current call"); - } - + } } - (void)onOff { @@ -48,6 +84,10 @@ return; [self setEnabled: FALSE]; + [waitView startAnimating]; + [self setLocked: TRUE]; + [self setUnlockVideoState: FALSE]; + LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); if (call) { LinphoneCallParams* call_params = linphone_call_params_copy(linphone_call_get_current_params(call)); @@ -69,19 +109,33 @@ if (state == LinphoneCallStreamsRunning || state == LinphoneCallUpdated || state == LinphoneCallUpdatedByRemote) { if (linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall))) { val = true; + if(locked && unlockVideoState) { + locked = FALSE; + [waitView stopAnimating]; + } + } else { + if(locked && !unlockVideoState) { + locked = FALSE; + [waitView stopAnimating]; + } + } + if(!locked) { + [self setEnabled:TRUE]; } - [self setEnabled:TRUE]; } else { // Disable button if the call is not running [self setEnabled:FALSE]; + [waitView stopAnimating]; } } else { // Disable button if there is no call [self setEnabled:FALSE]; + [waitView stopAnimating]; } } else { // Disable button if video is not enabled [self setEnabled:FALSE]; + [waitView stopAnimating]; } return val; } else { @@ -90,4 +144,9 @@ } } +- (void)dealloc { + [waitView release]; + [super dealloc]; +} + @end diff --git a/Classes/MainScreenWithVideoPreview.h b/Classes/MainScreenWithVideoPreview.h deleted file mode 100644 index c02bd0647..000000000 --- a/Classes/MainScreenWithVideoPreview.h +++ /dev/null @@ -1,42 +0,0 @@ -/* MainScreenWithVideoPreview.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 Library 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 "DialerViewController.h" - -@interface MainScreenWithVideoPreview : UIViewController { - UIWindow *window; - DialerViewController* phoneMainView; - - - AVCaptureSession* session; - AVCaptureDeviceInput* input; - - int currentCamera; -} - --(void) showPreview:(BOOL) show; - --(void) useCameraAtIndex:(NSInteger)camIndex startSession:(BOOL)start; - -@property (nonatomic, retain) IBOutlet DialerViewController* phoneMainView; -@property (nonatomic, retain) IBOutlet UIWindow *window; -@end diff --git a/Classes/MainScreenWithVideoPreview.m b/Classes/MainScreenWithVideoPreview.m deleted file mode 100644 index 411e79b12..000000000 --- a/Classes/MainScreenWithVideoPreview.m +++ /dev/null @@ -1,185 +0,0 @@ -/* MainScreenWithVideoPreview.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 Library 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 "MainScreenWithVideoPreview.h" -#import "LinphoneManager.h" - -@implementation MainScreenWithVideoPreview -@synthesize window; -@synthesize phoneMainView; - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -#pragma mark - View lifecycle - -/* -// Implement loadView to create a view hierarchy programmatically, without using a nib. -- (void)loadView -{ -} -*/ - --(void) initVideoPreview { - session = [[AVCaptureSession alloc] init]; - - currentCamera = 0; - - AVCaptureVideoPreviewLayer* previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:session]; - - previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill; - previewLayer.frame = self.view.bounds; - [self.view.layer addSublayer:previewLayer]; - - [session beginConfiguration]; - [session setSessionPreset:AVCaptureSessionPresetHigh]; - [session commitConfiguration]; - - [self useCameraAtIndex:0 startSession:NO]; -} - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad -{ - [super viewDidLoad]; -} - --(void) switchCameraPressed { - [self useCameraAtIndex: (currentCamera + 1) startSession:YES]; -} - --(void) useCameraAtIndex:(NSInteger)camIndex startSession:(BOOL)start { - @synchronized (self) { - [session stopRunning]; - - if (input != nil) - [session removeInput:input]; - - NSError* error; - - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc]init]; - NSArray* array = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; - if ( [array count] == 0) { - ms_warning("No camera available (running on simulator ?"); - return; - } - currentCamera = camIndex % [array count]; - AVCaptureDevice* device = (AVCaptureDevice*) [array objectAtIndex:currentCamera]; - input = [[AVCaptureDeviceInput deviceInputWithDevice:device - error:&error] retain]; - - [session addInput:input]; - - [pool drain]; - - if (start) - [session startRunning]; - } -} - --(void) stopPreview:(id) a { - @synchronized (self) { - if (!session.running) - return; - [self.view removeFromSuperview]; - [session stopRunning]; - } -} - --(void) startPreview:(id) a { - @synchronized (self) { - if (session.running) - return; - [window addSubview:self.view]; - [window sendSubviewToBack:self.view]; - [session startRunning]; - } -} - - --(void) showPreview:(BOOL) show { - LinphoneCore* lc; - if([LinphoneManager isLcReady]) - lc = [LinphoneManager getLc]; - - lc = [LinphoneManager getLc]; - - if (lc==NULL) return; - - bool enableVideo = linphone_core_video_enabled(lc); - - if (enableVideo) { - LinphoneCall* call = linphone_core_get_current_call(lc); - if (show && call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { - return; - } - - if (session == nil) { - [self initVideoPreview]; - } - - if (show && !session.running) { - [self performSelectorInBackground:@selector(startPreview:) withObject:nil]; - } else if (!show && session.running) { - [self performSelectorInBackground:@selector(stopPreview:) withObject:nil]; - } - } else { - [self stopPreview:nil]; - } -} - --(void) viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - //TODO - //[phoneMainView.switchCamera addTarget:self action:@selector(switchCameraPressed) forControlEvents:UIControlEventTouchUpInside]; -} - --(void) viewDidDisappear:(BOOL)animated { - -} - -- (void)viewDidUnload -{ - [super viewDidUnload]; - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - -/*- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return NO; -}*/ - -@end diff --git a/Classes/MainScreenWithVideoPreview.xib b/Classes/MainScreenWithVideoPreview.xib deleted file mode 100644 index 9eadcbda7..000000000 --- a/Classes/MainScreenWithVideoPreview.xib +++ /dev/null @@ -1,629 +0,0 @@ - - - - 1296 - 11E53 - 2182 - 1138.47 - 569.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1181 - - - IBProxyObject - IBUITabBarItem - IBUIViewController - IBUICustomObject - IBUITabBarController - IBUIWindow - IBUITabBar - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - IBIPadFramework - - - - 292 - {768, 1024} - - - _NS:196 - - 3 - MC42NjY2NjY2NjY3AA - - NO - NO - - 2 - - IBIPadFramework - YES - - - - - 2 - - - 1 - 1 - - IBIPadFramework - NO - - History - - History - - NSImage - history-orange.png - - IBIPadFramework - - - - - - 1 - 1 - - IBIPadFramework - NO - - - - - - Dialer - - NSImage - dialer-orange.png - - IBIPadFramework - - - - PhoneViewController-ipad - - - 1 - 1 - - IBIPadFramework - NO - - - - IBIPadFramework - - 5 - - - - 1 - 1 - - IBIPadFramework - NO - - - - - IBIPadFramework - - 0 - - - - - 1 - 1 - - IBIPadFramework - NO - - - - - 266 - {{0, 975}, {768, 49}} - - - - 3 - MCAwAA - - NO - IBIPadFramework - - - - - - - - - - - - - 274 - {{0, 20}, {768, 1004}} - - - _NS:212 - - 1 - MC40MzUwMTEzNDA3IDAuNjI1IDEAA - - IBIPadFramework - - - 2 - - - 1 - 1 - - IBIPadFramework - NO - - - - - - - delegate - - - - 30 - - - - window - - - - 9 - - - - phoneMainView - - - - 44 - - - - window - - - - 27 - - - - myTabBarController - - - - 28 - - - - mMainScreenWithVideoPreview - - - - 31 - - - - - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 3 - - - - - - 6 - - - - - - - - 16 - - - linphoneAppDelegate - - - 17 - - - - - - - - - - - - 18 - - - - - - dialer - - - 19 - - - - - - history - - - 20 - - - - - - more - - - 21 - - - - - - Contacts - - - 22 - - - - - 23 - - - - - 24 - - - - - 25 - - - - - 26 - - - - - 7 - - - - - - - - UIApplication - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - linphoneAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - PhoneViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - HistoryTableViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MoreViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - MainScreenWithVideoPreview - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 44 - - - - - HistoryTableViewController - UITableViewController - - IBProjectSource - ./Classes/HistoryTableViewController.h - - - - MainScreenWithVideoPreview - UIViewController - - PhoneViewController - UIWindow - - - - phoneMainView - PhoneViewController - - - window - UIWindow - - - - IBProjectSource - ./Classes/MainScreenWithVideoPreview.h - - - - MoreViewController - UITableViewController - - UITableViewCell - UITableViewCell - UITextView - UITableViewCell - UILabel - - - - console - UITableViewCell - - - credit - UITableViewCell - - - creditText - UITextView - - - web - UITableViewCell - - - weburi - UILabel - - - - IBProjectSource - ./Classes/MoreViewController.h - - - - PhoneViewController - UIViewController - - onAddContact: - id - - - onAddContact: - - onAddContact: - id - - - - UITextField - UIButton - UIButton - UIButton - UIView - UIButton - UIEraseButton - UIButton - UIButton - UIButton - UILabel - MainScreenWithVideoPreview - UITabBarController - UIButton - UIButton - UIButton - UIButton - UIButton - UILabel - UIView - UIButton - UIButton - UIButton - UIButton - - - - address - UITextField - - - backToCallView - UIButton - - - callLarge - UIButton - - - callShort - UIButton - - - dialerView - UIView - - - eight - UIButton - - - erase - UIEraseButton - - - five - UIButton - - - four - UIButton - - - hash - UIButton - - - mDisplayName - UILabel - - - mMainScreenWithVideoPreview - MainScreenWithVideoPreview - - - myTabBarController - UITabBarController - - - nine - UIButton - - - one - UIButton - - - seven - UIButton - - - six - UIButton - - - star - UIButton - - - status - UILabel - - - statusViewHolder - UIView - - - switchCamera - UIButton - - - three - UIButton - - - two - UIButton - - - zero - UIButton - - - - IBProjectSource - ./Classes/PhoneViewController.h - - - - UIEraseButton - UIButton - - IBProjectSource - ./Classes/UIEraseButton.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - YES - 3 - - {25, 24} - {25, 23} - - 1181 - - diff --git a/Classes/MoreViewController.h b/Classes/MoreViewController.h index 896a3a003..4cc2a28d4 100644 --- a/Classes/MoreViewController.h +++ b/Classes/MoreViewController.h @@ -20,7 +20,7 @@ #import @class ConsoleViewController; -@interface MoreViewController : UITableViewController { +@interface MoreViewController : UITableViewController { bool isLogViewEnabled; diff --git a/Classes/MoreViewController.m b/Classes/MoreViewController.m index 9a9eb35d3..6963f31ab 100644 --- a/Classes/MoreViewController.m +++ b/Classes/MoreViewController.m @@ -23,13 +23,16 @@ #include "lpconfig.h" @implementation MoreViewController + @synthesize web; @synthesize credit; @synthesize console; @synthesize creditText; @synthesize weburi; -//Implement viewDidLoad to do additional setup after loading the view, typically from a nib. + +#pragma mark - Lifecycle Functions + - (void)viewDidLoad { [super viewDidLoad]; [creditText setText: [NSString stringWithFormat:creditText.text,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]]]; @@ -39,38 +42,35 @@ } -/* -// Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return (interfaceOrientation == UIInterfaceOrientationPortrait); -} -*/ - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - (void)dealloc { + [credit release]; + [creditText release]; + + [web release]; + [weburi release]; + [console release]; + + [consoleViewController release]; [super dealloc]; } + +#pragma mark - + -(void) enableLogView { isLogViewEnabled = true; } + +#pragma mark - UITableViewDelegate Functions + - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } + +#pragma mark - UITableViewDataSource Functions + - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { return 230; @@ -79,7 +79,6 @@ } } -// Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section == 0) { return 1; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 1c0f0ab5e..8d9e26959 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -30,6 +30,9 @@ @synthesize mainViewController; + +#pragma mark - Lifecycle Functions + - (void)initPhoneMainView { currentPhoneView = -1; loadCount = 0; // For avoiding IOS 4 bug @@ -63,78 +66,22 @@ return self; } -- (CATransition*)getTransition:(PhoneView)old new:(PhoneView)new { - CATransition* trans = [CATransition animation]; - [trans setType:kCATransitionPush]; - [trans setDuration:0.35]; - [trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; - bool left = false; + [mainViewController release]; - if(old == PhoneView_Chat) { - if(new == PhoneView_Contacts || - new == PhoneView_Dialer || - new == PhoneView_Settings || - new == PhoneView_History) { - left = true; - } - } else if(old == PhoneView_Settings) { - if(new == PhoneView_Dialer || - new == PhoneView_Contacts || - new == PhoneView_History) { - left = true; - } - } else if(old == PhoneView_Dialer) { - if(new == PhoneView_Contacts || - new == PhoneView_History) { - left = true; - } - } else if(old == PhoneView_Contacts) { - if(new == PhoneView_History) { - left = true; - } - } + [viewDescriptions removeAllObjects]; + [viewDescriptions release]; - if(left) { - [trans setSubtype:kCATransitionFromLeft]; - } else { - [trans setSubtype:kCATransitionFromRight]; - } - - return trans; + [modalControllers removeAllObjects]; + [modalControllers release]; + + [super dealloc]; } -- (void)changeView: (NSNotification*) notif { - NSNumber *viewId = [notif.userInfo objectForKey: @"view"]; - NSNumber *tabBar = [notif.userInfo objectForKey: @"tabBar"]; - NSNumber *fullscreen = [notif.userInfo objectForKey: @"fullscreen"]; - - // Check view change - if(viewId != nil) { - PhoneView view = [viewId intValue]; - UICompositeViewDescription* description = [viewDescriptions objectForKey:[NSNumber numberWithInt: view]]; - if(description == nil) - return; - if(view != currentPhoneView) { - [mainViewController setViewTransition:[self getTransition:currentPhoneView new:view]]; - [mainViewController changeView:description]; - currentPhoneView = view; - } - } - - if(tabBar != nil) { - [mainViewController setToolBarHidden:![tabBar boolValue]]; - } - - if(fullscreen != nil) { - [mainViewController setFullScreen:[fullscreen boolValue]]; - } - - // Call abstractCall - NSDictionary *dict = [notif.userInfo objectForKey: @"args"]; - if(dict != nil) - [AbstractCall call:[mainViewController getCurrentViewController] dict:dict]; -} + +#pragma mark - ViewController Functions - (void)viewDidLoad { // Avoid IOS 4 bug @@ -259,6 +206,9 @@ self->loadCount--; } + +#pragma mark - Event Functions + - (void)registrationUpdate:(NSNotification*)notif { LinphoneRegistrationState state = [[notif.userInfo objectForKey: @"state"] intValue]; LinphoneProxyConfig *cfg = [[notif.userInfo objectForKey: @"cfg"] pointerValue]; @@ -362,6 +312,82 @@ } + +#pragma mark - + +- (CATransition*)getTransition:(PhoneView)old new:(PhoneView)new { + CATransition* trans = [CATransition animation]; + [trans setType:kCATransitionPush]; + [trans setDuration:0.35]; + [trans setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; + + bool left = false; + + if(old == PhoneView_Chat) { + if(new == PhoneView_Contacts || + new == PhoneView_Dialer || + new == PhoneView_Settings || + new == PhoneView_History) { + left = true; + } + } else if(old == PhoneView_Settings) { + if(new == PhoneView_Dialer || + new == PhoneView_Contacts || + new == PhoneView_History) { + left = true; + } + } else if(old == PhoneView_Dialer) { + if(new == PhoneView_Contacts || + new == PhoneView_History) { + left = true; + } + } else if(old == PhoneView_Contacts) { + if(new == PhoneView_History) { + left = true; + } + } + + if(left) { + [trans setSubtype:kCATransitionFromLeft]; + } else { + [trans setSubtype:kCATransitionFromRight]; + } + + return trans; +} + +- (void)changeView: (NSNotification*) notif { + NSNumber *viewId = [notif.userInfo objectForKey: @"view"]; + NSNumber *tabBar = [notif.userInfo objectForKey: @"tabBar"]; + NSNumber *fullscreen = [notif.userInfo objectForKey: @"fullscreen"]; + + // Check view change + if(viewId != nil) { + PhoneView view = [viewId intValue]; + UICompositeViewDescription* description = [viewDescriptions objectForKey:[NSNumber numberWithInt: view]]; + if(description == nil) + return; + if(view != currentPhoneView) { + [mainViewController setViewTransition:[self getTransition:currentPhoneView new:view]]; + [mainViewController changeView:description]; + currentPhoneView = view; + } + } + + if(tabBar != nil) { + [mainViewController setToolBarHidden:![tabBar boolValue]]; + } + + if(fullscreen != nil) { + [mainViewController setFullScreen:[fullscreen boolValue]]; + } + + // Call abstractCall + NSDictionary *dict = [notif.userInfo objectForKey: @"args"]; + if(dict != nil) + [AbstractCall call:[mainViewController getCurrentViewController] dict:dict]; +} + - (void)displayCallError:(LinphoneCall*) call message:(NSString*) message { const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); NSString* lUserName = lUserNameChars?[[[NSString alloc] initWithUTF8String:lUserNameChars] autorelease]:NSLocalizedString(@"Unknown",nil); @@ -404,6 +430,8 @@ } +#pragma mark - ActionSheet Functions + - (void)displayIncomingCall:(LinphoneCall*) call{ const char* userNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); @@ -489,6 +517,9 @@ } } + +#pragma mark - Modal Functions + - (void)modalViewDismiss:(UIModalViewController*)controller value:(int)value { [self removeModalViewController:controller]; } @@ -522,18 +553,4 @@ [[controller view] removeFromSuperview]; } -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [mainViewController release]; - - [viewDescriptions removeAllObjects]; - [viewDescriptions release]; - - [modalControllers removeAllObjects]; - [modalControllers release]; - - [super dealloc]; -} - @end \ No newline at end of file diff --git a/Classes/SettingsViewController.m b/Classes/SettingsViewController.m index 5411037f3..bd5f34100 100644 --- a/Classes/SettingsViewController.m +++ b/Classes/SettingsViewController.m @@ -25,10 +25,15 @@ @synthesize settingsController; @synthesize navigationController; +#pragma mark - Lifecycle Functions + - (id)init { return [super initWithNibName:@"SettingsViewController" bundle:[NSBundle mainBundle]]; } + +#pragma mark - ViewController Functions + - (void)viewDidLoad { settingsController.delegate = self; settingsController.settingsReaderDelegate = self; @@ -39,6 +44,37 @@ [self.view addSubview: navigationController.view]; } +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [settingsController viewWillDisappear:NO]; + } +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [settingsController viewWillAppear:NO]; + } +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [settingsController viewDidAppear:NO]; + } +} + +- (void)viewDidDisappear:(BOOL)animated { + [super viewDidDisappear:animated]; + if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { + [settingsController viewDidDisappear:NO]; + } +} + + +#pragma mark - IASKSettingsReaderFilterDelegate Functions + - (NSDictionary*)filterPreferenceSpecifier:(NSDictionary *)specifier { if (![LinphoneManager isLcReady]) { // LinphoneCore not ready: do not filter @@ -81,35 +117,10 @@ return specifier; } + +#pragma mark - IASKSettingsDelegate Functions + - (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController *)sender { } -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [settingsController viewWillDisappear:NO]; - } -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [settingsController viewWillAppear:NO]; - } -} - -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [settingsController viewDidAppear:NO]; - } -} - -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - if ([[UIDevice currentDevice].systemVersion doubleValue] < 5.0) { - [settingsController viewDidDisappear:NO]; - } -} - @end diff --git a/Classes/Utils/CPAnimationSequence.m b/Classes/Utils/CPAnimationSequence.m index e87e869ec..d0b1ebd35 100755 --- a/Classes/Utils/CPAnimationSequence.m +++ b/Classes/Utils/CPAnimationSequence.m @@ -32,10 +32,15 @@ } instance.steps = [NSArray arrayWithArray:tempSteps]; va_end(args); + [tempSteps release]; } return instance; } +- (void) dealloc { + [steps release]; + [super dealloc]; +} #pragma mark - property override diff --git a/Classes/Utils/CPAnimationStep.h b/Classes/Utils/CPAnimationStep.h index ca67b485c..709594a7c 100755 --- a/Classes/Utils/CPAnimationStep.h +++ b/Classes/Utils/CPAnimationStep.h @@ -33,7 +33,7 @@ typedef void (^AnimationStep)(void); @property (nonatomic) NSTimeInterval delay; @property (nonatomic) NSTimeInterval duration; -@property (nonatomic, copy) AnimationStep step; +@property (nonatomic, strong) AnimationStep step; @property (nonatomic) UIViewAnimationOptions options; #pragma mark - execution diff --git a/Classes/Utils/CPAnimationStep.m b/Classes/Utils/CPAnimationStep.m index 8ea76a77d..ba99bbfd9 100755 --- a/Classes/Utils/CPAnimationStep.m +++ b/Classes/Utils/CPAnimationStep.m @@ -43,11 +43,16 @@ instance.delay = theDelay; instance.duration = theDuration; instance.options = theOptions; - instance.step = [theStep copy]; + instance.step = theStep; } return instance; } +- (void)dealloc { + [step release]; + [super dealloc]; +} + #pragma mark action // From http://stackoverflow.com/questions/4007023/blocks-instead-of-performselectorwithobjectafterdelay @@ -65,6 +70,7 @@ self.consumableSteps = [[NSMutableArray alloc] initWithArray:[self animationStepArray]]; } if (![self.consumableSteps count]) { // recursion anchor + [self.consumableSteps release]; self.consumableSteps = nil; return; // we're done } diff --git a/Resources/supprimer-participant-conf-actif.png b/Resources/supprimer-participant-conf-actif.png new file mode 100644 index 0000000000000000000000000000000000000000..8c1843de8d4e30161a197b708189b475bd0a6d9c GIT binary patch literal 2116 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 literal 0 HcmV?d00001 diff --git a/Resources/video-ON-disabled.png b/Resources/video-ON-disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..b51fa8db39b539126091fe4697307a85b6261f86 GIT binary patch literal 3044 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 Mn^+lB3~xmJ7gI-@NdN!< literal 0 HcmV?d00001 diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index b2de10655..89f5d7a41 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -58,7 +58,6 @@ 228697C411AC29B800E9E0CA /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 228697C311AC29B800E9E0CA /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 228B19AF130290C500F154D3 /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = 228B19AE130290C500F154D3 /* iTunesArtwork */; }; 22968A5F12F875C600588287 /* UISpeakerButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22968A5E12F875C600588287 /* UISpeakerButton.m */; }; - 22968A8812F87C2000588287 /* UIDuration.m in Sources */ = {isa = PBXBuildFile; fileRef = 22968A8712F87C2000588287 /* UIDuration.m */; }; 22A10F3B11F8960300373793 /* libortp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2C10765B400068D98F /* libortp.a */; }; 22AA8AFD13D7125600B30535 /* libx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFB13D7125500B30535 /* libx264.a */; }; 22AA8AFE13D7125600B30535 /* libmsx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFC13D7125500B30535 /* libmsx264.a */; }; @@ -94,7 +93,6 @@ 22D8F14F147548E2008C97DB /* UIHangUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB8812F84EBB002A5394 /* UIHangUpButton.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 */; }; 22D8F155147548E2008C97DB /* UIBluetoothButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */; }; 22D8F156147548E2008C97DB /* UIEraseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22BB1A68132FF16A005CD7AA /* UIEraseButton.m */; }; @@ -163,10 +161,6 @@ 34A6ECEB14CF13CB00460C04 /* icone-linphone-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 34A6ECEA14CF13CB00460C04 /* icone-linphone-72.png */; }; 34C7646C14CD5585008E9607 /* dialer-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 34C7646A14CD5585008E9607 /* dialer-orange.png */; }; 34C7646D14CD5585008E9607 /* history-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 34C7646B14CD5585008E9607 /* history-orange.png */; }; - 34CA852F148F646700503C01 /* MainScreenWithVideoPreview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CA852E148F646700503C01 /* MainScreenWithVideoPreview.xib */; }; - 34CA8530148F646700503C01 /* MainScreenWithVideoPreview.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CA852E148F646700503C01 /* MainScreenWithVideoPreview.xib */; }; - 34CA8539148F692A00503C01 /* MainScreenWithVideoPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */; }; - 34CA853A148F692A00503C01 /* MainScreenWithVideoPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */; }; 57282931154AF1460076F540 /* history-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 34C7646B14CD5585008E9607 /* history-orange.png */; }; 57282933154AF14D0076F540 /* dialer-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 34C7646A14CD5585008E9607 /* dialer-orange.png */; }; 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; }; @@ -332,6 +326,11 @@ D37295CB158B1E2D00D2C0C7 /* registration_inprogress.png in Resources */ = {isa = PBXBuildFile; fileRef = D37295C9158B1E2D00D2C0C7 /* registration_inprogress.png */; }; D37295DB158B3C9600D2C0C7 /* video-OFF-disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D37295DA158B3C9600D2C0C7 /* video-OFF-disabled.png */; }; D37295DC158B3C9600D2C0C7 /* video-OFF-disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D37295DA158B3C9600D2C0C7 /* video-OFF-disabled.png */; }; + D377BBFA15A19DA6002B696B /* video-ON-disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D377BBF915A19DA6002B696B /* video-ON-disabled.png */; }; + D37B96B715A1A6F20005CCD2 /* supprimer-participant-conf-actif.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B515A1A6F20005CCD2 /* supprimer-participant-conf-actif.png */; }; + D37B96B815A1A6F20005CCD2 /* supprimer-participant-conf-actif.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B515A1A6F20005CCD2 /* supprimer-participant-conf-actif.png */; }; + D37B96B915A1A6F20005CCD2 /* supprimer-participant-conf-over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B615A1A6F20005CCD2 /* supprimer-participant-conf-over.png */; }; + D37B96BA15A1A6F20005CCD2 /* supprimer-participant-conf-over.png in Resources */ = {isa = PBXBuildFile; fileRef = D37B96B615A1A6F20005CCD2 /* supprimer-participant-conf-over.png */; }; D37DC6C11594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC6C21594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC6ED1594AE6F00B2A5EB /* IASKAppSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C61594AE6F00B2A5EB /* IASKAppSettingsViewController.m */; }; @@ -755,7 +754,6 @@ 2214EB7912F846B1002A5394 /* UICallButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallButton.m; sourceTree = ""; }; 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 = ""; }; 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 = ""; }; @@ -798,8 +796,6 @@ 228B19AE130290C500F154D3 /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = text; name = iTunesArtwork; path = Resources/iTunesArtwork; sourceTree = ""; }; 22968A5D12F875C600588287 /* UISpeakerButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISpeakerButton.h; sourceTree = ""; }; 22968A5E12F875C600588287 /* UISpeakerButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UISpeakerButton.m; sourceTree = ""; }; - 22968A8612F87C2000588287 /* UIDuration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDuration.h; sourceTree = ""; }; - 22968A8712F87C2000588287 /* UIDuration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDuration.m; sourceTree = ""; }; 22AA8AFB13D7125500B30535 /* libx264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libx264.a; path = "liblinphone-sdk/apple-darwin/lib/libx264.a"; sourceTree = ""; }; 22AA8AFC13D7125500B30535 /* libmsx264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsx264.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsx264.a"; sourceTree = ""; }; 22AA8AFF13D83F6300B30535 /* UICamSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICamSwitch.h; sourceTree = ""; }; @@ -915,9 +911,6 @@ 34A6ECEA14CF13CB00460C04 /* icone-linphone-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "icone-linphone-72.png"; path = "Resources/icone-linphone-72.png"; sourceTree = ""; }; 34C7646A14CD5585008E9607 /* dialer-orange.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "dialer-orange.png"; path = "submodules/linphone/pixmaps/dialer-orange.png"; sourceTree = ""; }; 34C7646B14CD5585008E9607 /* history-orange.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "history-orange.png"; path = "submodules/linphone/pixmaps/history-orange.png"; sourceTree = ""; }; - 34CA852E148F646700503C01 /* MainScreenWithVideoPreview.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainScreenWithVideoPreview.xib; sourceTree = ""; }; - 34CA8537148F692A00503C01 /* MainScreenWithVideoPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainScreenWithVideoPreview.h; sourceTree = ""; }; - 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScreenWithVideoPreview.m; sourceTree = ""; }; 70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = Resources/rootca.pem; sourceTree = ""; }; 7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = ""; }; 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; @@ -1023,6 +1016,9 @@ D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIPauseButton.m; sourceTree = ""; }; D37295C9158B1E2D00D2C0C7 /* registration_inprogress.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = registration_inprogress.png; path = Resources/registration_inprogress.png; sourceTree = ""; }; D37295DA158B3C9600D2C0C7 /* video-OFF-disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "video-OFF-disabled.png"; path = "Resources/video-OFF-disabled.png"; sourceTree = ""; }; + D377BBF915A19DA6002B696B /* video-ON-disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "video-ON-disabled.png"; path = "Resources/video-ON-disabled.png"; sourceTree = ""; }; + D37B96B515A1A6F20005CCD2 /* supprimer-participant-conf-actif.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "supprimer-participant-conf-actif.png"; path = "Resources/supprimer-participant-conf-actif.png"; sourceTree = ""; }; + D37B96B615A1A6F20005CCD2 /* supprimer-participant-conf-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "supprimer-participant-conf-over.png"; path = "Resources/supprimer-participant-conf-over.png"; sourceTree = ""; }; D37DC6BF1594AE1800B2A5EB /* LinphoneCoreSettingsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCoreSettingsStore.h; sourceTree = ""; }; D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneCoreSettingsStore.m; sourceTree = ""; }; D37DC6C51594AE6F00B2A5EB /* IASKAppSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IASKAppSettingsViewController.h; sourceTree = ""; }; @@ -1340,9 +1336,6 @@ D3EA53FB159850E80037DC6B /* LinphoneManager.h */, D3EA53FC159850E80037DC6B /* LinphoneManager.m */, 2214EB7012F84668002A5394 /* LinphoneUI */, - 34CA8537148F692A00503C01 /* MainScreenWithVideoPreview.h */, - 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */, - 34CA852E148F646700503C01 /* MainScreenWithVideoPreview.xib */, 22E0A81D111C44E100B04932 /* MoreViewController.h */, 22E0A81C111C44E100B04932 /* MoreViewController.m */, 22E0A81B111C44E100B04932 /* MoreViewController.xib */, @@ -1599,8 +1592,6 @@ D3A55FBE15877E69003FD403 /* UIContactCell.xib */, 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */, 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */, - 22968A8612F87C2000588287 /* UIDuration.h */, - 22968A8712F87C2000588287 /* UIDuration.m */, 22BB1A67132FF16A005CD7AA /* UIEraseButton.h */, 22BB1A68132FF16A005CD7AA /* UIEraseButton.m */, 2214EB8712F84EBB002A5394 /* UIHangUpButton.h */, @@ -1608,7 +1599,6 @@ D31C9C96158A1CDE00756B45 /* UIHistoryCell.h */, D31C9C97158A1CDE00756B45 /* UIHistoryCell.m */, D31AC4AF158A29C600C2638B /* UIHistoryCell.xib */, - 2214EB8A12F84FE9002A5394 /* UILinphone.h */, D32409C1158B49A600C8C119 /* UILongTouchButton.h */, D32409C2158B49A600C8C119 /* UILongTouchButton.m */, D3ED3E841586291B006C0DE4 /* UIMainBar.h */, @@ -1940,6 +1930,8 @@ D3432A5D158A4446001C6B0B /* status_error.png */, D3432A6F158A45AF001C6B0B /* status_inprogress.png */, 22226C13118197EC000CA27B /* stopcall-red.png */, + D37B96B515A1A6F20005CCD2 /* supprimer-participant-conf-actif.png */, + D37B96B615A1A6F20005CCD2 /* supprimer-participant-conf-over.png */, D35E757515931E5D0066B1C1 /* switch_camera_default.png */, D35E757615931E5D0066B1C1 /* switch_camera_over.png */, D38327F11580FE3A00FA0D23 /* tchat-actif.png */, @@ -1954,6 +1946,7 @@ D37295DA158B3C9600D2C0C7 /* video-OFF-disabled.png */, D3F83F01158205A100336684 /* video-OFF-over.png */, D3F83F02158205A100336684 /* video-ON-actif.png */, + D377BBF915A19DA6002B696B /* video-ON-disabled.png */, D3F83F03158205A100336684 /* video-ON-over.png */, ); name = Resources; @@ -2161,7 +2154,6 @@ 228B19AF130290C500F154D3 /* iTunesArtwork in Resources */, 2214783D1386A2030020F8B8 /* Localizable.strings in Resources */, 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */, - 34CA852F148F646700503C01 /* MainScreenWithVideoPreview.xib in Resources */, 3422AA5014975EC9000D4E8A /* InCallViewController-ipad.xib in Resources */, 3422AA5314978352000D4E8A /* PhoneViewController-ipad.xib in Resources */, 341FCA8E149798210084BC26 /* linphonerc-ipad in Resources */, @@ -2342,6 +2334,9 @@ D3211BC0159CBFD70098460B /* cancel_white_bg_disabled.png in Resources */, D3211BC2159CBFD70098460B /* cancel_white_bg_over.png in Resources */, D3C714B3159DB84400705B8E /* toy-mono.wav in Resources */, + D377BBFA15A19DA6002B696B /* video-ON-disabled.png in Resources */, + D37B96B715A1A6F20005CCD2 /* supprimer-participant-conf-actif.png in Resources */, + D37B96B915A1A6F20005CCD2 /* supprimer-participant-conf-over.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2366,7 +2361,6 @@ 22D8F13D147548E2008C97DB /* Localizable.strings in Resources */, 22D8F142147548E2008C97DB /* rootca.pem in Resources */, 2211DB95147564B400DEE054 /* Settings.bundle in Resources */, - 34CA8530148F646700503C01 /* MainScreenWithVideoPreview.xib in Resources */, 3422AA5114975EC9000D4E8A /* InCallViewController-ipad.xib in Resources */, 3422AA5414978352000D4E8A /* PhoneViewController-ipad.xib in Resources */, 341FCA8F149798210084BC26 /* linphonerc-ipad in Resources */, @@ -2531,6 +2525,8 @@ D3211BC1159CBFD70098460B /* cancel_white_bg_disabled.png in Resources */, D3211BC3159CBFD70098460B /* cancel_white_bg_over.png in Resources */, D3C714B4159DB84400705B8E /* toy-mono.wav in Resources */, + D37B96B815A1A6F20005CCD2 /* supprimer-participant-conf-actif.png in Resources */, + D37B96BA15A1A6F20005CCD2 /* supprimer-participant-conf-over.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2551,14 +2547,12 @@ 2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */, 2214EBF312F86360002A5394 /* UIMicroButton.m in Sources */, 22968A5F12F875C600588287 /* UISpeakerButton.m in Sources */, - 22968A8812F87C2000588287 /* UIDuration.m in Sources */, 2218A92512FBE1340088A667 /* FirstLoginViewController.m in Sources */, 22C755601317E59C007BC101 /* UIBluetoothButton.m in Sources */, 22BB1A69132FF16A005CD7AA /* UIEraseButton.m in Sources */, 223963171393CFAF001DE689 /* FastAddressBook.m in Sources */, 22AA8B0113D83F6300B30535 /* UICamSwitch.m in Sources */, 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */, - 34CA8539148F692A00503C01 /* MainScreenWithVideoPreview.m in Sources */, 340751E7150F38FD00B89C47 /* UIVideoButton.m in Sources */, 34216F401547EBCD00EA9777 /* VideoZoomHandler.m in Sources */, D3F83EEC1582021700336684 /* InCallViewController.m in Sources */, @@ -2625,14 +2619,12 @@ 22D8F14F147548E2008C97DB /* UIHangUpButton.m in Sources */, 22D8F151147548E2008C97DB /* UIMicroButton.m in Sources */, 22D8F152147548E2008C97DB /* UISpeakerButton.m in Sources */, - 22D8F153147548E2008C97DB /* UIDuration.m in Sources */, 22D8F154147548E2008C97DB /* FirstLoginViewController.m in Sources */, 22D8F155147548E2008C97DB /* UIBluetoothButton.m in Sources */, 22D8F156147548E2008C97DB /* UIEraseButton.m in Sources */, 22D8F157147548E2008C97DB /* FastAddressBook.m in Sources */, 22D8F159147548E2008C97DB /* UICamSwitch.m in Sources */, 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */, - 34CA853A148F692A00503C01 /* MainScreenWithVideoPreview.m in Sources */, 340751E8150F38FD00B89C47 /* UIVideoButton.m in Sources */, 34216F411547EBCD00EA9777 /* VideoZoomHandler.m in Sources */, D3F83EED1582021700336684 /* InCallViewController.m in Sources */,