Don't play dtmf on light/door buttons

This commit is contained in:
Yann Diorcet 2012-11-15 11:26:06 +01:00
parent d02fdbc4cc
commit b001cc1b40
4 changed files with 11 additions and 2 deletions

View file

@ -94,8 +94,12 @@
- (void)viewDidLoad {
[super viewDidLoad];
[openDoorButton setPlay:FALSE];
[openDoorButton setDigit:'1'];
[lightsButton setPlay:FALSE];
[lightsButton setDigit:'2'];
[microButton setImage:[UIImage imageNamed:@"bj_mute_off.png"] forState:UIControlStateHighlighted | UIControlStateSelected];
/* init gradients */

View file

@ -78,7 +78,7 @@
}
- (void)update {
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO];
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NO];
NSArray *sortDescriptors = [NSArray arrayWithObjects:sortDescriptor, nil];
[tableController setHistory:[[LinphoneManager instance].configuration.history sortedArrayUsingDescriptors:sortDescriptors]];

View file

@ -30,5 +30,6 @@
@property (nonatomic, retain) IBOutlet UITextField* addressField;
@property char digit;
@property bool dtmf;
@property bool play;
@end

View file

@ -24,6 +24,7 @@
@implementation UIDigitButton
@synthesize dtmf;
@synthesize play;
@synthesize digit;
@synthesize addressField;
@synthesize chatRoom;
@ -33,6 +34,7 @@
- (void)initUIDigitButton {
dtmf = FALSE;
play = TRUE;
chatRoom = NULL;
[self addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside|UIControlEventTouchUpOutside];
@ -85,7 +87,9 @@
} else {
linphone_chat_room_send_message(chatRoom, [[NSString stringWithFormat:@"%c", digit] UTF8String]);
}
linphone_core_play_dtmf([LinphoneManager getLc], digit, 100);
if(play) {
linphone_core_play_dtmf([LinphoneManager getLc], digit, 100);
}
}
}