OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 @end | 114 @end |
115 | 115 |
116 @implementation ARDMainView { | 116 @implementation ARDMainView { |
117 UILabel *_appLabel; | 117 UILabel *_appLabel; |
118 ARDRoomTextField *_roomText; | 118 ARDRoomTextField *_roomText; |
119 UILabel *_callOptionsLabel; | 119 UILabel *_callOptionsLabel; |
120 UISwitch *_audioOnlySwitch; | 120 UISwitch *_audioOnlySwitch; |
121 UILabel *_audioOnlyLabel; | 121 UILabel *_audioOnlyLabel; |
122 UISwitch *_aecdumpSwitch; | 122 UISwitch *_aecdumpSwitch; |
123 UILabel *_aecdumpLabel; | 123 UILabel *_aecdumpLabel; |
| 124 UISwitch *_levelControlSwitch; |
| 125 UILabel *_levelControlLabel; |
124 UISwitch *_loopbackSwitch; | 126 UISwitch *_loopbackSwitch; |
125 UILabel *_loopbackLabel; | 127 UILabel *_loopbackLabel; |
126 UISwitch *_useManualAudioSwitch; | 128 UISwitch *_useManualAudioSwitch; |
127 UILabel *_useManualAudioLabel; | 129 UILabel *_useManualAudioLabel; |
128 UIButton *_startCallButton; | 130 UIButton *_startCallButton; |
129 UIButton *_audioLoopButton; | 131 UIButton *_audioLoopButton; |
130 } | 132 } |
131 | 133 |
132 @synthesize delegate = _delegate; | 134 @synthesize delegate = _delegate; |
133 @synthesize isAudioLoopPlaying = _isAudioLoopPlaying; | 135 @synthesize isAudioLoopPlaying = _isAudioLoopPlaying; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 [_aecdumpSwitch sizeToFit]; | 182 [_aecdumpSwitch sizeToFit]; |
181 [self addSubview:_aecdumpSwitch]; | 183 [self addSubview:_aecdumpSwitch]; |
182 | 184 |
183 _aecdumpLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 185 _aecdumpLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
184 _aecdumpLabel.text = @"Create AecDump"; | 186 _aecdumpLabel.text = @"Create AecDump"; |
185 _aecdumpLabel.font = controlFont; | 187 _aecdumpLabel.font = controlFont; |
186 _aecdumpLabel.textColor = controlFontColor; | 188 _aecdumpLabel.textColor = controlFontColor; |
187 [_aecdumpLabel sizeToFit]; | 189 [_aecdumpLabel sizeToFit]; |
188 [self addSubview:_aecdumpLabel]; | 190 [self addSubview:_aecdumpLabel]; |
189 | 191 |
| 192 _levelControlSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; |
| 193 [_levelControlSwitch sizeToFit]; |
| 194 [self addSubview:_levelControlSwitch]; |
| 195 |
| 196 _levelControlLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 197 _levelControlLabel.text = @"Use level controller"; |
| 198 _levelControlLabel.font = controlFont; |
| 199 _levelControlLabel.textColor = controlFontColor; |
| 200 [_levelControlLabel sizeToFit]; |
| 201 [self addSubview:_levelControlLabel]; |
| 202 |
190 _useManualAudioSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; | 203 _useManualAudioSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; |
191 [_useManualAudioSwitch sizeToFit]; | 204 [_useManualAudioSwitch sizeToFit]; |
192 _useManualAudioSwitch.on = YES; | 205 _useManualAudioSwitch.on = YES; |
193 [self addSubview:_useManualAudioSwitch]; | 206 [self addSubview:_useManualAudioSwitch]; |
194 | 207 |
195 _useManualAudioLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 208 _useManualAudioLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
196 _useManualAudioLabel.text = @"Use manual audio config"; | 209 _useManualAudioLabel.text = @"Use manual audio config"; |
197 _useManualAudioLabel.font = controlFont; | 210 _useManualAudioLabel.font = controlFont; |
198 _useManualAudioLabel.textColor = controlFontColor; | 211 _useManualAudioLabel.textColor = controlFontColor; |
199 [_useManualAudioLabel sizeToFit]; | 212 [_useManualAudioLabel sizeToFit]; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 CGRect aecdumpModeRect = CGRectMake(kCallControlMargin * 3, | 305 CGRect aecdumpModeRect = CGRectMake(kCallControlMargin * 3, |
293 aecdumpModeTop, | 306 aecdumpModeTop, |
294 _aecdumpSwitch.frame.size.width, | 307 _aecdumpSwitch.frame.size.width, |
295 _aecdumpSwitch.frame.size.height); | 308 _aecdumpSwitch.frame.size.height); |
296 _aecdumpSwitch.frame = aecdumpModeRect; | 309 _aecdumpSwitch.frame = aecdumpModeRect; |
297 CGFloat aecdumpModeLabelCenterX = CGRectGetMaxX(aecdumpModeRect) + | 310 CGFloat aecdumpModeLabelCenterX = CGRectGetMaxX(aecdumpModeRect) + |
298 kCallControlMargin + _aecdumpLabel.frame.size.width / 2; | 311 kCallControlMargin + _aecdumpLabel.frame.size.width / 2; |
299 _aecdumpLabel.center = CGPointMake(aecdumpModeLabelCenterX, | 312 _aecdumpLabel.center = CGPointMake(aecdumpModeLabelCenterX, |
300 CGRectGetMidY(aecdumpModeRect)); | 313 CGRectGetMidY(aecdumpModeRect)); |
301 | 314 |
| 315 CGFloat levelControlModeTop = |
| 316 CGRectGetMaxY(_aecdumpSwitch.frame) + kCallControlMargin; |
| 317 CGRect levelControlModeRect = CGRectMake(kCallControlMargin * 3, |
| 318 levelControlModeTop, |
| 319 _levelControlSwitch.frame.size.width, |
| 320 _levelControlSwitch.frame.size.height
); |
| 321 _levelControlSwitch.frame = levelControlModeRect; |
| 322 CGFloat levelControlModeLabelCenterX = CGRectGetMaxX(levelControlModeRect) + |
| 323 kCallControlMargin + _levelControlLabel.frame.size.width / 2; |
| 324 _levelControlLabel.center = CGPointMake(levelControlModeLabelCenterX, |
| 325 CGRectGetMidY(levelControlModeRect)); |
302 | 326 |
303 CGFloat useManualAudioTop = | 327 CGFloat useManualAudioTop = |
304 CGRectGetMaxY(_aecdumpSwitch.frame) + kCallControlMargin; | 328 CGRectGetMaxY(_levelControlSwitch.frame) + kCallControlMargin; |
305 CGRect useManualAudioRect = | 329 CGRect useManualAudioRect = |
306 CGRectMake(kCallControlMargin * 3, | 330 CGRectMake(kCallControlMargin * 3, |
307 useManualAudioTop, | 331 useManualAudioTop, |
308 _useManualAudioSwitch.frame.size.width, | 332 _useManualAudioSwitch.frame.size.width, |
309 _useManualAudioSwitch.frame.size.height); | 333 _useManualAudioSwitch.frame.size.height); |
310 _useManualAudioSwitch.frame = useManualAudioRect; | 334 _useManualAudioSwitch.frame = useManualAudioRect; |
311 CGFloat useManualAudioLabelCenterX = CGRectGetMaxX(useManualAudioRect) + | 335 CGFloat useManualAudioLabelCenterX = CGRectGetMaxX(useManualAudioRect) + |
312 kCallControlMargin + _useManualAudioLabel.frame.size.width / 2; | 336 kCallControlMargin + _useManualAudioLabel.frame.size.width / 2; |
313 _useManualAudioLabel.center = | 337 _useManualAudioLabel.center = |
314 CGPointMake(useManualAudioLabelCenterX, | 338 CGPointMake(useManualAudioLabelCenterX, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 // If this is a loopback call, allow a generated room name. | 378 // If this is a loopback call, allow a generated room name. |
355 if (!room.length && _loopbackSwitch.isOn) { | 379 if (!room.length && _loopbackSwitch.isOn) { |
356 room = [[NSUUID UUID] UUIDString]; | 380 room = [[NSUUID UUID] UUIDString]; |
357 } | 381 } |
358 room = [room stringByReplacingOccurrencesOfString:@"-" withString:@""]; | 382 room = [room stringByReplacingOccurrencesOfString:@"-" withString:@""]; |
359 [_delegate mainView:self | 383 [_delegate mainView:self |
360 didInputRoom:room | 384 didInputRoom:room |
361 isLoopback:_loopbackSwitch.isOn | 385 isLoopback:_loopbackSwitch.isOn |
362 isAudioOnly:_audioOnlySwitch.isOn | 386 isAudioOnly:_audioOnlySwitch.isOn |
363 shouldMakeAecDump:_aecdumpSwitch.isOn | 387 shouldMakeAecDump:_aecdumpSwitch.isOn |
| 388 shouldUseLevelControl:_levelControlSwitch.isOn |
364 useManualAudio:_useManualAudioSwitch.isOn]; | 389 useManualAudio:_useManualAudioSwitch.isOn]; |
365 } | 390 } |
366 | 391 |
367 @end | 392 @end |
OLD | NEW |