| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } | 112 } |
| 113 | 113 |
| 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; |
| 123 UILabel *_aecdumpLabel; |
| 122 UISwitch *_loopbackSwitch; | 124 UISwitch *_loopbackSwitch; |
| 123 UILabel *_loopbackLabel; | 125 UILabel *_loopbackLabel; |
| 124 UISwitch *_useManualAudioSwitch; | 126 UISwitch *_useManualAudioSwitch; |
| 125 UILabel *_useManualAudioLabel; | 127 UILabel *_useManualAudioLabel; |
| 126 UIButton *_startCallButton; | 128 UIButton *_startCallButton; |
| 127 UIButton *_audioLoopButton; | 129 UIButton *_audioLoopButton; |
| 128 } | 130 } |
| 129 | 131 |
| 130 @synthesize delegate = _delegate; | 132 @synthesize delegate = _delegate; |
| 131 @synthesize isAudioLoopPlaying = _isAudioLoopPlaying; | 133 @synthesize isAudioLoopPlaying = _isAudioLoopPlaying; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 [_loopbackSwitch sizeToFit]; | 169 [_loopbackSwitch sizeToFit]; |
| 168 [self addSubview:_loopbackSwitch]; | 170 [self addSubview:_loopbackSwitch]; |
| 169 | 171 |
| 170 _loopbackLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 172 _loopbackLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 171 _loopbackLabel.text = @"Loopback mode"; | 173 _loopbackLabel.text = @"Loopback mode"; |
| 172 _loopbackLabel.font = controlFont; | 174 _loopbackLabel.font = controlFont; |
| 173 _loopbackLabel.textColor = controlFontColor; | 175 _loopbackLabel.textColor = controlFontColor; |
| 174 [_loopbackLabel sizeToFit]; | 176 [_loopbackLabel sizeToFit]; |
| 175 [self addSubview:_loopbackLabel]; | 177 [self addSubview:_loopbackLabel]; |
| 176 | 178 |
| 179 _aecdumpSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; |
| 180 [_aecdumpSwitch sizeToFit]; |
| 181 [self addSubview:_aecdumpSwitch]; |
| 182 |
| 183 _aecdumpLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 184 _aecdumpLabel.text = @"Create AecDump"; |
| 185 _aecdumpLabel.font = controlFont; |
| 186 _aecdumpLabel.textColor = controlFontColor; |
| 187 [_aecdumpLabel sizeToFit]; |
| 188 [self addSubview:_aecdumpLabel]; |
| 189 |
| 177 _useManualAudioSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; | 190 _useManualAudioSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; |
| 178 [_useManualAudioSwitch sizeToFit]; | 191 [_useManualAudioSwitch sizeToFit]; |
| 179 _useManualAudioSwitch.on = YES; | 192 _useManualAudioSwitch.on = YES; |
| 180 [self addSubview:_useManualAudioSwitch]; | 193 [self addSubview:_useManualAudioSwitch]; |
| 181 | 194 |
| 182 _useManualAudioLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 195 _useManualAudioLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 183 _useManualAudioLabel.text = @"Use manual audio config"; | 196 _useManualAudioLabel.text = @"Use manual audio config"; |
| 184 _useManualAudioLabel.font = controlFont; | 197 _useManualAudioLabel.font = controlFont; |
| 185 _useManualAudioLabel.textColor = controlFontColor; | 198 _useManualAudioLabel.textColor = controlFontColor; |
| 186 [_useManualAudioLabel sizeToFit]; | 199 [_useManualAudioLabel sizeToFit]; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 CGRect loopbackModeRect = CGRectMake(kCallControlMargin * 3, | 280 CGRect loopbackModeRect = CGRectMake(kCallControlMargin * 3, |
| 268 loopbackModeTop, | 281 loopbackModeTop, |
| 269 _loopbackSwitch.frame.size.width, | 282 _loopbackSwitch.frame.size.width, |
| 270 _loopbackSwitch.frame.size.height); | 283 _loopbackSwitch.frame.size.height); |
| 271 _loopbackSwitch.frame = loopbackModeRect; | 284 _loopbackSwitch.frame = loopbackModeRect; |
| 272 CGFloat loopbackModeLabelCenterX = CGRectGetMaxX(loopbackModeRect) + | 285 CGFloat loopbackModeLabelCenterX = CGRectGetMaxX(loopbackModeRect) + |
| 273 kCallControlMargin + _loopbackLabel.frame.size.width / 2; | 286 kCallControlMargin + _loopbackLabel.frame.size.width / 2; |
| 274 _loopbackLabel.center = CGPointMake(loopbackModeLabelCenterX, | 287 _loopbackLabel.center = CGPointMake(loopbackModeLabelCenterX, |
| 275 CGRectGetMidY(loopbackModeRect)); | 288 CGRectGetMidY(loopbackModeRect)); |
| 276 | 289 |
| 290 CGFloat aecdumpModeTop = |
| 291 CGRectGetMaxY(_loopbackSwitch.frame) + kCallControlMargin; |
| 292 CGRect aecdumpModeRect = CGRectMake(kCallControlMargin * 3, |
| 293 aecdumpModeTop, |
| 294 _aecdumpSwitch.frame.size.width, |
| 295 _aecdumpSwitch.frame.size.height); |
| 296 _aecdumpSwitch.frame = aecdumpModeRect; |
| 297 CGFloat aecdumpModeLabelCenterX = CGRectGetMaxX(aecdumpModeRect) + |
| 298 kCallControlMargin + _aecdumpLabel.frame.size.width / 2; |
| 299 _aecdumpLabel.center = CGPointMake(aecdumpModeLabelCenterX, |
| 300 CGRectGetMidY(aecdumpModeRect)); |
| 301 |
| 302 |
| 277 CGFloat useManualAudioTop = | 303 CGFloat useManualAudioTop = |
| 278 CGRectGetMaxY(_loopbackSwitch.frame) + kCallControlMargin; | 304 CGRectGetMaxY(_aecdumpSwitch.frame) + kCallControlMargin; |
| 279 CGRect useManualAudioRect = | 305 CGRect useManualAudioRect = |
| 280 CGRectMake(kCallControlMargin * 3, | 306 CGRectMake(kCallControlMargin * 3, |
| 281 useManualAudioTop, | 307 useManualAudioTop, |
| 282 _useManualAudioSwitch.frame.size.width, | 308 _useManualAudioSwitch.frame.size.width, |
| 283 _useManualAudioSwitch.frame.size.height); | 309 _useManualAudioSwitch.frame.size.height); |
| 284 _useManualAudioSwitch.frame = useManualAudioRect; | 310 _useManualAudioSwitch.frame = useManualAudioRect; |
| 285 CGFloat useManualAudioLabelCenterX = CGRectGetMaxX(useManualAudioRect) + | 311 CGFloat useManualAudioLabelCenterX = CGRectGetMaxX(useManualAudioRect) + |
| 286 kCallControlMargin + _useManualAudioLabel.frame.size.width / 2; | 312 kCallControlMargin + _useManualAudioLabel.frame.size.width / 2; |
| 287 _useManualAudioLabel.center = | 313 _useManualAudioLabel.center = |
| 288 CGPointMake(useManualAudioLabelCenterX, | 314 CGPointMake(useManualAudioLabelCenterX, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 NSString *room = _roomText.roomText; | 353 NSString *room = _roomText.roomText; |
| 328 // If this is a loopback call, allow a generated room name. | 354 // If this is a loopback call, allow a generated room name. |
| 329 if (!room.length && _loopbackSwitch.isOn) { | 355 if (!room.length && _loopbackSwitch.isOn) { |
| 330 room = [[NSUUID UUID] UUIDString]; | 356 room = [[NSUUID UUID] UUIDString]; |
| 331 } | 357 } |
| 332 room = [room stringByReplacingOccurrencesOfString:@"-" withString:@""]; | 358 room = [room stringByReplacingOccurrencesOfString:@"-" withString:@""]; |
| 333 [_delegate mainView:self | 359 [_delegate mainView:self |
| 334 didInputRoom:room | 360 didInputRoom:room |
| 335 isLoopback:_loopbackSwitch.isOn | 361 isLoopback:_loopbackSwitch.isOn |
| 336 isAudioOnly:_audioOnlySwitch.isOn | 362 isAudioOnly:_audioOnlySwitch.isOn |
| 363 shouldMakeAecDump:_aecdumpSwitch.isOn |
| 337 useManualAudio:_useManualAudioSwitch.isOn]; | 364 useManualAudio:_useManualAudioSwitch.isOn]; |
| 338 } | 365 } |
| 339 | 366 |
| 340 @end | 367 @end |
| OLD | NEW |