Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m

Issue 2294913003: Update iOS AppRTCDemo to use level controller. (Closed)
Patch Set: Remove blank line. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m
diff --git a/webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m b/webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m
index 59b428a3037eddb596923ffa1edefcbc7c5a519e..d9522045aebaa41635ac82da6c63c7d256afbb6c 100644
--- a/webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m
+++ b/webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.m
@@ -121,6 +121,8 @@ static CGFloat const kCallControlMargin = 8;
UILabel *_audioOnlyLabel;
UISwitch *_aecdumpSwitch;
UILabel *_aecdumpLabel;
+ UISwitch *_levelControlSwitch;
+ UILabel *_levelControlLabel;
UISwitch *_loopbackSwitch;
UILabel *_loopbackLabel;
UISwitch *_useManualAudioSwitch;
@@ -187,6 +189,17 @@ static CGFloat const kCallControlMargin = 8;
[_aecdumpLabel sizeToFit];
[self addSubview:_aecdumpLabel];
+ _levelControlSwitch = [[UISwitch alloc] initWithFrame:CGRectZero];
+ [_levelControlSwitch sizeToFit];
+ [self addSubview:_levelControlSwitch];
+
+ _levelControlLabel = [[UILabel alloc] initWithFrame:CGRectZero];
+ _levelControlLabel.text = @"Use level controller";
+ _levelControlLabel.font = controlFont;
+ _levelControlLabel.textColor = controlFontColor;
+ [_levelControlLabel sizeToFit];
+ [self addSubview:_levelControlLabel];
+
_useManualAudioSwitch = [[UISwitch alloc] initWithFrame:CGRectZero];
[_useManualAudioSwitch sizeToFit];
_useManualAudioSwitch.on = YES;
@@ -299,9 +312,20 @@ static CGFloat const kCallControlMargin = 8;
_aecdumpLabel.center = CGPointMake(aecdumpModeLabelCenterX,
CGRectGetMidY(aecdumpModeRect));
+ CGFloat levelControlModeTop =
+ CGRectGetMaxY(_aecdumpSwitch.frame) + kCallControlMargin;
+ CGRect levelControlModeRect = CGRectMake(kCallControlMargin * 3,
+ levelControlModeTop,
+ _levelControlSwitch.frame.size.width,
+ _levelControlSwitch.frame.size.height);
+ _levelControlSwitch.frame = levelControlModeRect;
+ CGFloat levelControlModeLabelCenterX = CGRectGetMaxX(levelControlModeRect) +
+ kCallControlMargin + _levelControlLabel.frame.size.width / 2;
+ _levelControlLabel.center = CGPointMake(levelControlModeLabelCenterX,
+ CGRectGetMidY(levelControlModeRect));
CGFloat useManualAudioTop =
- CGRectGetMaxY(_aecdumpSwitch.frame) + kCallControlMargin;
+ CGRectGetMaxY(_levelControlSwitch.frame) + kCallControlMargin;
CGRect useManualAudioRect =
CGRectMake(kCallControlMargin * 3,
useManualAudioTop,
@@ -361,6 +385,7 @@ static CGFloat const kCallControlMargin = 8;
isLoopback:_loopbackSwitch.isOn
isAudioOnly:_audioOnlySwitch.isOn
shouldMakeAecDump:_aecdumpSwitch.isOn
+ shouldUseLevelControl:_levelControlSwitch.isOn
useManualAudio:_useManualAudioSwitch.isOn];
}
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/ios/ARDMainView.h ('k') | webrtc/examples/objc/AppRTCDemo/ios/ARDMainViewController.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698