| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 @end | 115 @end |
| 116 | 116 |
| 117 @implementation ARDMainView { | 117 @implementation ARDMainView { |
| 118 UILabel *_appLabel; | 118 UILabel *_appLabel; |
| 119 ARDRoomTextField *_roomText; | 119 ARDRoomTextField *_roomText; |
| 120 UILabel *_callOptionsLabel; | 120 UILabel *_callOptionsLabel; |
| 121 UISwitch *_audioOnlySwitch; | 121 UISwitch *_audioOnlySwitch; |
| 122 UILabel *_audioOnlyLabel; | 122 UILabel *_audioOnlyLabel; |
| 123 UISwitch *_loopbackSwitch; | 123 UISwitch *_loopbackSwitch; |
| 124 UILabel *_loopbackLabel; | 124 UILabel *_loopbackLabel; |
| 125 UISwitch *_audioConfigDelaySwitch; | 125 UISwitch *_useManualAudioSwitch; |
| 126 UILabel *_audioConfigDelayLabel; | 126 UILabel *_useManualAudioLabel; |
| 127 UIButton *_startCallButton; | 127 UIButton *_startCallButton; |
| 128 UIButton *_audioLoopButton; | 128 UIButton *_audioLoopButton; |
| 129 } | 129 } |
| 130 | 130 |
| 131 @synthesize delegate = _delegate; | 131 @synthesize delegate = _delegate; |
| 132 @synthesize isAudioLoopPlaying = _isAudioLoopPlaying; | 132 @synthesize isAudioLoopPlaying = _isAudioLoopPlaying; |
| 133 | 133 |
| 134 - (instancetype)initWithFrame:(CGRect)frame { | 134 - (instancetype)initWithFrame:(CGRect)frame { |
| 135 if (self = [super initWithFrame:frame]) { | 135 if (self = [super initWithFrame:frame]) { |
| 136 _appLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 136 _appLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 [_loopbackSwitch sizeToFit]; | 168 [_loopbackSwitch sizeToFit]; |
| 169 [self addSubview:_loopbackSwitch]; | 169 [self addSubview:_loopbackSwitch]; |
| 170 | 170 |
| 171 _loopbackLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 171 _loopbackLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 172 _loopbackLabel.text = @"Loopback mode"; | 172 _loopbackLabel.text = @"Loopback mode"; |
| 173 _loopbackLabel.font = controlFont; | 173 _loopbackLabel.font = controlFont; |
| 174 _loopbackLabel.textColor = controlFontColor; | 174 _loopbackLabel.textColor = controlFontColor; |
| 175 [_loopbackLabel sizeToFit]; | 175 [_loopbackLabel sizeToFit]; |
| 176 [self addSubview:_loopbackLabel]; | 176 [self addSubview:_loopbackLabel]; |
| 177 | 177 |
| 178 _audioConfigDelaySwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; | 178 _useManualAudioSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; |
| 179 [_audioConfigDelaySwitch sizeToFit]; | 179 [_useManualAudioSwitch sizeToFit]; |
| 180 _audioConfigDelaySwitch.on = YES; | 180 _useManualAudioSwitch.on = YES; |
| 181 [self addSubview:_audioConfigDelaySwitch]; | 181 [self addSubview:_useManualAudioSwitch]; |
| 182 | 182 |
| 183 _audioConfigDelayLabel = [[UILabel alloc] initWithFrame:CGRectZero]; | 183 _useManualAudioLabel = [[UILabel alloc] initWithFrame:CGRectZero]; |
| 184 _audioConfigDelayLabel.text = @"Delay audio config"; | 184 _useManualAudioLabel.text = @"Use manual audio config"; |
| 185 _audioConfigDelayLabel.font = controlFont; | 185 _useManualAudioLabel.font = controlFont; |
| 186 _audioConfigDelayLabel.textColor = controlFontColor; | 186 _useManualAudioLabel.textColor = controlFontColor; |
| 187 [_audioConfigDelayLabel sizeToFit]; | 187 [_useManualAudioLabel sizeToFit]; |
| 188 [self addSubview:_audioConfigDelayLabel]; | 188 [self addSubview:_useManualAudioLabel]; |
| 189 | 189 |
| 190 _startCallButton = [UIButton buttonWithType:UIButtonTypeSystem]; | 190 _startCallButton = [UIButton buttonWithType:UIButtonTypeSystem]; |
| 191 _startCallButton.backgroundColor = [UIColor blueColor]; | 191 _startCallButton.backgroundColor = [UIColor blueColor]; |
| 192 _startCallButton.layer.cornerRadius = 10; | 192 _startCallButton.layer.cornerRadius = 10; |
| 193 _startCallButton.clipsToBounds = YES; | 193 _startCallButton.clipsToBounds = YES; |
| 194 _startCallButton.contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10); | 194 _startCallButton.contentEdgeInsets = UIEdgeInsetsMake(5, 10, 5, 10); |
| 195 [_startCallButton setTitle:@"Start call" | 195 [_startCallButton setTitle:@"Start call" |
| 196 forState:UIControlStateNormal]; | 196 forState:UIControlStateNormal]; |
| 197 _startCallButton.titleLabel.font = controlFont; | 197 _startCallButton.titleLabel.font = controlFont; |
| 198 [_startCallButton setTitleColor:[UIColor whiteColor] | 198 [_startCallButton setTitleColor:[UIColor whiteColor] |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 CGRect loopbackModeRect = CGRectMake(kCallControlMargin * 3, | 268 CGRect loopbackModeRect = CGRectMake(kCallControlMargin * 3, |
| 269 loopbackModeTop, | 269 loopbackModeTop, |
| 270 _loopbackSwitch.frame.size.width, | 270 _loopbackSwitch.frame.size.width, |
| 271 _loopbackSwitch.frame.size.height); | 271 _loopbackSwitch.frame.size.height); |
| 272 _loopbackSwitch.frame = loopbackModeRect; | 272 _loopbackSwitch.frame = loopbackModeRect; |
| 273 CGFloat loopbackModeLabelCenterX = CGRectGetMaxX(loopbackModeRect) + | 273 CGFloat loopbackModeLabelCenterX = CGRectGetMaxX(loopbackModeRect) + |
| 274 kCallControlMargin + _loopbackLabel.frame.size.width / 2; | 274 kCallControlMargin + _loopbackLabel.frame.size.width / 2; |
| 275 _loopbackLabel.center = CGPointMake(loopbackModeLabelCenterX, | 275 _loopbackLabel.center = CGPointMake(loopbackModeLabelCenterX, |
| 276 CGRectGetMidY(loopbackModeRect)); | 276 CGRectGetMidY(loopbackModeRect)); |
| 277 | 277 |
| 278 CGFloat audioConfigDelayTop = | 278 CGFloat useManualAudioTop = |
| 279 CGRectGetMaxY(_loopbackSwitch.frame) + kCallControlMargin; | 279 CGRectGetMaxY(_loopbackSwitch.frame) + kCallControlMargin; |
| 280 CGRect audioConfigDelayRect = | 280 CGRect useManualAudioRect = |
| 281 CGRectMake(kCallControlMargin * 3, | 281 CGRectMake(kCallControlMargin * 3, |
| 282 audioConfigDelayTop, | 282 useManualAudioTop, |
| 283 _audioConfigDelaySwitch.frame.size.width, | 283 _useManualAudioSwitch.frame.size.width, |
| 284 _audioConfigDelaySwitch.frame.size.height); | 284 _useManualAudioSwitch.frame.size.height); |
| 285 _audioConfigDelaySwitch.frame = audioConfigDelayRect; | 285 _useManualAudioSwitch.frame = useManualAudioRect; |
| 286 CGFloat audioConfigDelayLabelCenterX = CGRectGetMaxX(audioConfigDelayRect) + | 286 CGFloat useManualAudioLabelCenterX = CGRectGetMaxX(useManualAudioRect) + |
| 287 kCallControlMargin + _audioConfigDelayLabel.frame.size.width / 2; | 287 kCallControlMargin + _useManualAudioLabel.frame.size.width / 2; |
| 288 _audioConfigDelayLabel.center = | 288 _useManualAudioLabel.center = |
| 289 CGPointMake(audioConfigDelayLabelCenterX, | 289 CGPointMake(useManualAudioLabelCenterX, |
| 290 CGRectGetMidY(audioConfigDelayRect)); | 290 CGRectGetMidY(useManualAudioRect)); |
| 291 | 291 |
| 292 CGFloat audioLoopTop = | 292 CGFloat audioLoopTop = |
| 293 CGRectGetMaxY(audioConfigDelayRect) + kCallControlMargin * 3; | 293 CGRectGetMaxY(useManualAudioRect) + kCallControlMargin * 3; |
| 294 _audioLoopButton.frame = CGRectMake(kCallControlMargin, | 294 _audioLoopButton.frame = CGRectMake(kCallControlMargin, |
| 295 audioLoopTop, | 295 audioLoopTop, |
| 296 _audioLoopButton.frame.size.width, | 296 _audioLoopButton.frame.size.width, |
| 297 _audioLoopButton.frame.size.height); | 297 _audioLoopButton.frame.size.height); |
| 298 | 298 |
| 299 CGFloat startCallTop = | 299 CGFloat startCallTop = |
| 300 CGRectGetMaxY(_audioLoopButton.frame) + kCallControlMargin * 3; | 300 CGRectGetMaxY(_audioLoopButton.frame) + kCallControlMargin * 3; |
| 301 _startCallButton.frame = CGRectMake(kCallControlMargin, | 301 _startCallButton.frame = CGRectMake(kCallControlMargin, |
| 302 startCallTop, | 302 startCallTop, |
| 303 _startCallButton.frame.size.width, | 303 _startCallButton.frame.size.width, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 328 NSString *room = _roomText.roomText; | 328 NSString *room = _roomText.roomText; |
| 329 // If this is a loopback call, allow a generated room name. | 329 // If this is a loopback call, allow a generated room name. |
| 330 if (!room.length && _loopbackSwitch.isOn) { | 330 if (!room.length && _loopbackSwitch.isOn) { |
| 331 room = [[NSUUID UUID] UUIDString]; | 331 room = [[NSUUID UUID] UUIDString]; |
| 332 } | 332 } |
| 333 room = [room stringByReplacingOccurrencesOfString:@"-" withString:@""]; | 333 room = [room stringByReplacingOccurrencesOfString:@"-" withString:@""]; |
| 334 [_delegate mainView:self | 334 [_delegate mainView:self |
| 335 didInputRoom:room | 335 didInputRoom:room |
| 336 isLoopback:_loopbackSwitch.isOn | 336 isLoopback:_loopbackSwitch.isOn |
| 337 isAudioOnly:_audioOnlySwitch.isOn | 337 isAudioOnly:_audioOnlySwitch.isOn |
| 338 shouldDelayAudioConfig:_audioConfigDelaySwitch.isOn]; | 338 useManualAudio:_useManualAudioSwitch.isOn]; |
| 339 } | 339 } |
| 340 | 340 |
| 341 @end | 341 @end |
| OLD | NEW |