mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Fix Xcode warnings
This commit is contained in:
parent
edaa567ff1
commit
e94fba9564
8 changed files with 90 additions and 127 deletions
|
|
@ -18,6 +18,7 @@
|
|||
@synthesize back;
|
||||
@synthesize hangup;
|
||||
@synthesize table;
|
||||
@synthesize addCall;
|
||||
|
||||
@synthesize conferenceDetailCell;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#import "IncallViewController.h"
|
||||
#import "VideoViewController.h"
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
#import <AddressBook/AddressBook.h>
|
||||
#import "linphonecore.h"
|
||||
|
|
@ -58,16 +59,8 @@ const NSInteger SECURE_BUTTON_TAG=5;
|
|||
@synthesize hash;
|
||||
@synthesize videoViewController;
|
||||
|
||||
/*
|
||||
// The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
|
||||
// Custom initialization
|
||||
@synthesize addVideo;
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
*/
|
||||
|
||||
+ (UIImage*) stat_sys_signal_0 {
|
||||
return [[UIImage imageNamed:@"stat_sys_signal_0.png"] retain];
|
||||
|
|
@ -108,6 +101,63 @@ int callCount(LinphoneCore* lc) {
|
|||
return count;
|
||||
}
|
||||
|
||||
-(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl {
|
||||
activeCallCell = nil;
|
||||
[mute reset];
|
||||
|
||||
LinphoneCore* lc;
|
||||
|
||||
@try {
|
||||
lc = [LinphoneManager getLc];
|
||||
|
||||
if (callCount([LinphoneManager getLc]) > 1) {
|
||||
[pause setHidden:YES];
|
||||
[mergeCalls setHidden:NO];
|
||||
} else {
|
||||
[pause setHidden:NO];
|
||||
[mergeCalls setHidden:YES];
|
||||
}
|
||||
|
||||
[callTableView reloadData];
|
||||
} @catch (NSException* exc) {
|
||||
return;
|
||||
}
|
||||
LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
int callsCount = linphone_core_get_calls_nb(lc);
|
||||
// hide pause/resume if in conference
|
||||
if (selectedCall) {
|
||||
if (linphone_core_is_in_conference(lc))
|
||||
[pause setHidden:YES];
|
||||
else if (callCount(lc) == callsCount && callsCount == 1) {
|
||||
[pause setHidden:NO];
|
||||
pause.selected = NO;
|
||||
} else {
|
||||
[pause setHidden:YES];
|
||||
}
|
||||
} else {
|
||||
if (callsCount == 1) {
|
||||
LinphoneCall* c = (LinphoneCall*)linphone_core_get_calls(lc)->data;
|
||||
if (linphone_call_get_state(c) == LinphoneCallPaused ||
|
||||
linphone_call_get_state(c) == LinphoneCallPausing) {
|
||||
[pause setHidden:NO];
|
||||
pause.selected = YES;
|
||||
}
|
||||
[pause setHidden:NO];
|
||||
} else {
|
||||
[pause setHidden:YES];
|
||||
}
|
||||
}
|
||||
[mergeCalls setHidden:!pause.hidden];
|
||||
|
||||
// update conference details view if diaplsyed
|
||||
if (self.presentedViewController == conferenceDetail) {
|
||||
if (!linphone_core_is_in_conference(lc))
|
||||
[self dismissModalViewControllerAnimated:YES];
|
||||
else
|
||||
[conferenceDetail.table reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
|
@ -288,7 +338,7 @@ int callCount(LinphoneCore* lc) {
|
|||
}
|
||||
|
||||
-(void) dismissVideoView {
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
|
||||
[self dismissModalViewControllerAnimated:FALSE];//just in case
|
||||
mVideoShown=FALSE;
|
||||
}
|
||||
|
|
@ -315,7 +365,7 @@ int callCount(LinphoneCore* lc) {
|
|||
linphone_core_set_native_video_window_id([LinphoneManager getLc],0);
|
||||
linphone_core_set_native_preview_window_id([LinphoneManager getLc],0);
|
||||
}
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
|
||||
[self dismissModalViewControllerAnimated:FALSE];//just in case
|
||||
}
|
||||
|
||||
|
|
@ -325,7 +375,7 @@ int callCount(LinphoneCore* lc) {
|
|||
}
|
||||
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
|
||||
if (mIncallViewIsReady) {
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
|
||||
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
|
||||
mVideoShown=TRUE;
|
||||
[self presentModalViewController:mVideoViewController animated:true];
|
||||
} else {
|
||||
|
|
@ -333,65 +383,6 @@ int callCount(LinphoneCore* lc) {
|
|||
mVideoIsPending=TRUE;
|
||||
}
|
||||
}
|
||||
-(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl {
|
||||
activeCallCell = nil;
|
||||
[mute reset];
|
||||
// if (
|
||||
// [pause reset];
|
||||
|
||||
|
||||
LinphoneCore* lc;
|
||||
|
||||
@try {
|
||||
lc = [LinphoneManager getLc];
|
||||
|
||||
if (callCount([LinphoneManager getLc]) > 1) {
|
||||
[pause setHidden:YES];
|
||||
[mergeCalls setHidden:NO];
|
||||
} else {
|
||||
[pause setHidden:NO];
|
||||
[mergeCalls setHidden:YES];
|
||||
}
|
||||
|
||||
[callTableView reloadData];
|
||||
} @catch (NSException* exc) {
|
||||
return;
|
||||
}
|
||||
LinphoneCall* selectedCall = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
int callsCount = linphone_core_get_calls_nb(lc);
|
||||
// hide pause/resume if in conference
|
||||
if (selectedCall) {
|
||||
if (linphone_core_is_in_conference(lc))
|
||||
[pause setHidden:YES];
|
||||
else if (callCount(lc) == callsCount && callsCount == 1) {
|
||||
[pause setHidden:NO];
|
||||
pause.selected = NO;
|
||||
} else {
|
||||
[pause setHidden:YES];
|
||||
}
|
||||
} else {
|
||||
if (callsCount == 1) {
|
||||
LinphoneCall* c = (LinphoneCall*)linphone_core_get_calls(lc)->data;
|
||||
if (linphone_call_get_state(c) == LinphoneCallPaused ||
|
||||
linphone_call_get_state(c) == LinphoneCallPausing) {
|
||||
[pause setHidden:NO];
|
||||
pause.selected = YES;
|
||||
}
|
||||
[pause setHidden:NO];
|
||||
} else {
|
||||
[pause setHidden:YES];
|
||||
}
|
||||
}
|
||||
[mergeCalls setHidden:!pause.hidden];
|
||||
|
||||
// update conference details view if diaplsyed
|
||||
if (self.presentedViewController == conferenceDetail) {
|
||||
if (!linphone_core_is_in_conference(lc))
|
||||
[self dismissModalViewControllerAnimated:YES];
|
||||
else
|
||||
[conferenceDetail.table reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)doAction:(id)sender {
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%ld",method,au)
|
|||
//redirect audio to bluetooth
|
||||
|
||||
UInt32 size = sizeof(CFStringRef);
|
||||
CFStringRef route="HeadsetBT";
|
||||
CFStringRef route=CFSTR("HeadsetBT");
|
||||
OSStatus result = AudioSessionSetProperty(kAudioSessionProperty_AudioRoute, size, &route);
|
||||
check_auresult(result,"set kAudioSessionProperty_AudioRoute HeadsetBT");
|
||||
|
||||
|
|
@ -52,8 +52,8 @@ if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%ld",method,au)
|
|||
);
|
||||
check_auresult(result,"set kAudioSessionProperty_OverrideCategoryEnableBluetoothInput 0");
|
||||
UInt32 size = sizeof(CFStringRef);
|
||||
CFStringRef route="ReceiverAndMicrophone";
|
||||
result = AudioSessionSetProperty(kAudioSessionProperty_AudioRoute, &size, &route);
|
||||
CFStringRef route=CFSTR("ReceiverAndMicrophone");
|
||||
result = AudioSessionSetProperty(kAudioSessionProperty_AudioRoute, size, &route);
|
||||
check_auresult(result,"set kAudioSessionProperty_AudioRoute ReceiverAndMicrophone");
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
@interface UICamSwitch : UIButton {
|
||||
|
||||
@private
|
||||
char* currentCamId;
|
||||
char* nextCamId;
|
||||
const char* currentCamId;
|
||||
const char* nextCamId;
|
||||
UIView* preview;
|
||||
}
|
||||
@property (nonatomic, retain) IBOutlet UIView* preview;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@
|
|||
linphone_core_update_call([LinphoneManager getLc]
|
||||
, linphone_core_get_current_call([LinphoneManager getLc])
|
||||
,NULL);
|
||||
linphone_core_set_native_preview_window_id([LinphoneManager getLc],preview);
|
||||
linphone_core_set_native_preview_window_id([LinphoneManager getLc],
|
||||
(unsigned long)preview);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,11 +91,6 @@
|
|||
|
||||
@property (nonatomic, retain) IBOutlet UIButton* switchCamera;
|
||||
|
||||
|
||||
// method to handle keypad event
|
||||
- (IBAction)doKeyPad:(id)sender;
|
||||
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController;
|
||||
@property (nonatomic, retain) IBOutlet MainScreenWithVideoPreview* mMainScreenWithVideoPreview;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#import "PhoneViewController.h"
|
||||
#import "linphoneAppDelegate.h"
|
||||
#import "IncallViewController.h"
|
||||
#import <AVFoundation/AVAudioSession.h>
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
#import "LinphoneManager.h"
|
||||
|
|
@ -55,17 +56,25 @@
|
|||
@synthesize switchCamera;
|
||||
|
||||
|
||||
//implements keypad behavior
|
||||
/*-(IBAction) doKeyPad:(id)sender {
|
||||
if (sender == back) {
|
||||
if ([address.text length] >0) {
|
||||
NSString* newAddress;
|
||||
newAddress = [address.text substringToIndex: [address.text length]-1];
|
||||
[address setText:newAddress];
|
||||
}
|
||||
}
|
||||
|
||||
}*/
|
||||
-(void) updateCallAndBackButtons {
|
||||
@try {
|
||||
if (linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) {
|
||||
[callLarge setHidden:FALSE];
|
||||
[callShort setHidden:TRUE];
|
||||
[backToCallView setHidden:TRUE];
|
||||
} else {
|
||||
[callShort setEnabled:!linphone_core_sound_resources_locked([LinphoneManager getLc])];
|
||||
[callLarge setHidden:TRUE];
|
||||
[callShort setHidden:FALSE];
|
||||
[backToCallView setHidden:FALSE];
|
||||
}
|
||||
} @catch (NSException* exc) {
|
||||
// R.A.S: linphone core si simply not ready...
|
||||
ms_warning("Exception %s: %s",
|
||||
[exc.name cStringUsingEncoding:[NSString defaultCStringEncoding]],
|
||||
[exc.reason cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[[UIApplication sharedApplication] setIdleTimerDisabled:true];
|
||||
|
|
@ -109,20 +118,8 @@
|
|||
|
||||
mIncallViewController = [[IncallViewController alloc] initWithNibName:[LinphoneManager runningOnIpad]?@"InCallViewController-ipad":@"IncallViewController"
|
||||
bundle:[NSBundle mainBundle]];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// 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];
|
||||
|
|
@ -144,26 +141,6 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
-(void) updateCallAndBackButtons {
|
||||
@try {
|
||||
if (linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) {
|
||||
[callLarge setHidden:FALSE];
|
||||
[callShort setHidden:TRUE];
|
||||
[backToCallView setHidden:TRUE];
|
||||
} else {
|
||||
[callShort setEnabled:!linphone_core_sound_resources_locked([LinphoneManager getLc])];
|
||||
[callLarge setHidden:TRUE];
|
||||
[callShort setHidden:FALSE];
|
||||
[backToCallView setHidden:FALSE];
|
||||
}
|
||||
} @catch (NSException* exc) {
|
||||
// R.A.S: linphone core si simply not ready...
|
||||
ms_warning("Exception %s: %s",
|
||||
[exc.name cStringUsingEncoding:[NSString defaultCStringEncoding]],
|
||||
[exc.reason cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||
}
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated {
|
||||
[self updateCallAndBackButtons];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,4 @@
|
|||
|
||||
- (void) updateCallQualityIndicator;
|
||||
|
||||
- (void) waitBeforeUpdatingCallQualityIndicator;
|
||||
|
||||
@end
|
||||
Loading…
Add table
Reference in a new issue