mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Log 'toggle buttons' state change
This commit is contained in:
parent
8bbd36a62a
commit
bcc0bcee80
6 changed files with 16 additions and 12 deletions
|
|
@ -51,8 +51,8 @@ NSTimer *callQualityRefresher;
|
|||
|
||||
table.rowHeight = 80;
|
||||
|
||||
[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] ];
|
||||
[speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] ];
|
||||
[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"];
|
||||
[speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] debugName:"SPEAKER button"];
|
||||
}
|
||||
|
||||
-(void) backButtonPressed {
|
||||
|
|
|
|||
|
|
@ -161,8 +161,8 @@ int callCount(LinphoneCore* lc) {
|
|||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
//Controls
|
||||
[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] ];
|
||||
[speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] ];
|
||||
[mute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"];
|
||||
[speaker initWithOnImage:[UIImage imageNamed:@"HP_inverse.png"] offImage:[UIImage imageNamed:@"HP.png"] debugName:"SPEAKER button"];
|
||||
|
||||
verified = [[UIImage imageNamed:@"secured.png"] retain];
|
||||
unverified = [[UIImage imageNamed:@"unverified.png"] retain];
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ static void audioRouteChangeListenerCallback (
|
|||
|
||||
}
|
||||
|
||||
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage {
|
||||
[super initWithOnImage:onImage offImage:offImage];
|
||||
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{
|
||||
[super initWithOnImage:onImage offImage:offImage debugName:name];
|
||||
AudioSessionPropertyID routeChangeID = kAudioSessionProperty_AudioRouteChange;
|
||||
AudioSessionInitialize(NULL, NULL, NULL, NULL);
|
||||
OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self);
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@
|
|||
UIImage* mOnImage;
|
||||
UIImage* mOffImage;
|
||||
bool mIsOn;
|
||||
const char* debugName;
|
||||
|
||||
|
||||
}
|
||||
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage;
|
||||
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char*) name;
|
||||
-(bool) reset;
|
||||
-(bool) isOn;
|
||||
-(bool) toggle;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#import "UIToggleButton.h"
|
||||
|
||||
#include "linphonecore.h"
|
||||
|
||||
@implementation UIToggleButton
|
||||
|
||||
|
|
@ -28,6 +28,8 @@
|
|||
return mIsOn;
|
||||
}
|
||||
-(bool) toggle {
|
||||
ms_message("UI - Toggle button '%s' state change %d -> %d",
|
||||
debugName, mIsOn, !mIsOn);
|
||||
if (mIsOn) {
|
||||
[self setImage:mOffImage forState:UIControlStateNormal];
|
||||
mIsOn=!mIsOn;
|
||||
|
|
@ -46,10 +48,11 @@
|
|||
return mIsOn;
|
||||
}
|
||||
|
||||
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage {
|
||||
-(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage debugName:(const char *)name{
|
||||
mOnImage = [onImage retain];
|
||||
mOffImage = [offImage retain];
|
||||
mIsOn=false;
|
||||
debugName = name;
|
||||
[self reset];
|
||||
[self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@ NSTimer *callQualityRefresher;
|
|||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
[mMute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] ];
|
||||
[mMuteLandRight initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] ];
|
||||
[mMuteLandLeft initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] ];
|
||||
[mMute initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE button"];
|
||||
[mMuteLandRight initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE2 button"];
|
||||
[mMuteLandLeft initWithOnImage:[UIImage imageNamed:@"micro_inverse.png"] offImage:[UIImage imageNamed:@"micro.png"] debugName:"MUTE3 button"];
|
||||
[mCamSwitch setPreview:mPreview];
|
||||
[mCamSwitchLandRight setPreview:mPreviewLandRight];
|
||||
[mCamSwitchLandLeft setPreview:mPreviewLandLeft];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue