Skip to content

Commit

Permalink
revert namings
Browse files Browse the repository at this point in the history
Change-Id: I476103288dde2a6b6d626ba8273e144642826487
  • Loading branch information
ulukaya committed Mar 10, 2017
1 parent c9ad6c3 commit 523bb25
Show file tree
Hide file tree
Showing 4 changed files with 418 additions and 420 deletions.
2 changes: 1 addition & 1 deletion Classes/LocalPlayerView.m
Expand Up @@ -440,7 +440,7 @@ - (IBAction)playButtonClicked:(id)sender {
id<LocalPlayerViewDelegate> delegate = self.delegate;
if (self.playerState == LocalPlayerStateStopped && delegate &&
[delegate respondsToSelector:@selector(continueAfterPlayButtonClicked)]) {
if (![_delegate continueAfterPlayButtonClicked]) {
if (!_delegate.continueAfterPlayButtonClicked) {
return;
}
}
Expand Down
50 changes: 25 additions & 25 deletions Classes/MediaViewController.m
Expand Up @@ -37,10 +37,10 @@ typedef NS_ENUM(NSInteger, PlaybackMode) {
@interface MediaViewController ()<GCKSessionManagerListener,
GCKRemoteMediaClientListener,
LocalPlayerViewDelegate, GCKRequestDelegate> {
IBOutlet UILabel *titleLabel;
IBOutlet UILabel *subtitleLabel;
IBOutlet UITextView *descriptionTextView;
IBOutlet LocalPlayerView *localPlayerView;
IBOutlet UILabel *_titleLabel;
IBOutlet UILabel *_subtitleLabel;
IBOutlet UITextView *_descriptionTextView;
IBOutlet LocalPlayerView *_localPlayerView;
GCKSessionManager *_sessionManager;
GCKCastSession *_castSession;
GCKUIMediaController *_castMediaController;
Expand Down Expand Up @@ -77,7 +77,7 @@ - (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"in MediaViewController viewDidLoad");

localPlayerView.delegate = self;
_localPlayerView.delegate = self;

_castButton =
[[GCKUICastButton alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
Expand Down Expand Up @@ -115,7 +115,7 @@ - (void)viewWillAppear:(BOOL)animated {
appDelegate.castControlBarsEnabled = YES;

if ((_playbackMode == PlaybackModeLocal) && _localPlaybackImplicitlyPaused) {
[localPlayerView play];
[_localPlayerView play];
_localPlaybackImplicitlyPaused = NO;
}

Expand Down Expand Up @@ -182,10 +182,10 @@ - (void)viewWillDisappear:(BOOL)animated {
[self setNavigationBarStyle:LPVNavBarDefault];
switch (_playbackMode) {
case PlaybackModeLocal:
if (localPlayerView.playerState == LocalPlayerStatePlaying ||
localPlayerView.playerState == LocalPlayerStateStarting) {
if (_localPlayerView.playerState == LocalPlayerStatePlaying ||
_localPlayerView.playerState == LocalPlayerStateStarting) {
_localPlaybackImplicitlyPaused = YES;
[localPlayerView pause];
[_localPlayerView pause];
}
break;
case PlaybackModeRemote:
Expand Down Expand Up @@ -213,11 +213,11 @@ - (void)deviceOrientationDidChange:(NSNotification *)notification {
if (UIInterfaceOrientationIsLandscape(orientation)) {
[self setNavigationBarStyle:LPVNavBarTransparent];
} else if (!UIInterfaceOrientationIsLandscape(orientation) ||
!localPlayerView.playingLocally) {
!_localPlayerView.playingLocally) {
[self setNavigationBarStyle:LPVNavBarDefault];
}

[localPlayerView orientationChanged];
[_localPlayerView orientationChanged];
}

- (void)setMediaInfo:(GCKMediaInformation *)mediaInfo {
Expand Down Expand Up @@ -267,22 +267,22 @@ - (void)switchToLocalPlayback {
- (void)populateMediaInfo:(BOOL)autoPlay
playPosition:(NSTimeInterval)playPosition {
NSLog(@"populateMediaInfo");
titleLabel.text =
_titleLabel.text =
[self.mediaInfo.metadata stringForKey:kGCKMetadataKeyTitle];

NSString *subtitle =
[self.mediaInfo.metadata stringForKey:kGCKMetadataKeyArtist];
if (!subtitle) {
subtitle = [self.mediaInfo.metadata stringForKey:kGCKMetadataKeyStudio];
}
subtitleLabel.text = subtitle;
_subtitleLabel.text = subtitle;

NSString *description =
[self.mediaInfo.metadata stringForKey:kMediaKeyDescription];
descriptionTextView.text =
_descriptionTextView.text =
[description stringByReplacingOccurrencesOfString:@"\\n"
withString:@"\n"];
[localPlayerView loadMedia:self.mediaInfo
[_localPlayerView loadMedia:self.mediaInfo
autoPlay:autoPlay
playPosition:playPosition];
}
Expand All @@ -300,11 +300,11 @@ - (void)switchToRemotePlayback {

// If we were playing locally, load the local media on the remote player
if ((_playbackMode == PlaybackModeLocal) &&
(localPlayerView.playerState != LocalPlayerStateStopped) &&
(_localPlayerView.playerState != LocalPlayerStateStopped) &&
self.mediaInfo) {
NSLog(@"loading media: %@", self.mediaInfo);
NSTimeInterval playPosition = localPlayerView.streamPosition;
BOOL paused = (localPlayerView.playerState == LocalPlayerStatePaused);
NSTimeInterval playPosition = _localPlayerView.streamPosition;
BOOL paused = (_localPlayerView.playerState == LocalPlayerStatePaused);
GCKMediaQueueItemBuilder *builder = [[GCKMediaQueueItemBuilder alloc] init];
builder.mediaInformation = self.mediaInfo;
builder.autoplay = !paused;
Expand All @@ -318,17 +318,17 @@ - (void)switchToRemotePlayback {
repeatMode:GCKMediaRepeatModeOff
customData:nil];
}
[localPlayerView stop];
[localPlayerView showSplashScreen];
[_localPlayerView stop];
[_localPlayerView showSplashScreen];
[self setQueueButtonVisible:YES];
[_castSession.remoteMediaClient addListener:self];
_playbackMode = PlaybackModeRemote;
}

- (void)clearMetadata {
titleLabel.text = @"";
subtitleLabel.text = @"";
descriptionTextView.text = @"";
_titleLabel.text = @"";
_subtitleLabel.text = @"";
_descriptionTextView.text = @"";
}

- (void)showAlertWithTitle:(NSString *)title message:(NSString *)message {
Expand All @@ -351,7 +351,7 @@ - (void)finishAdjustingStreamPosition:(id)sender {
}

- (void)togglePlayPause:(id)sender {
[localPlayerView togglePause];
[_localPlayerView togglePause];
}

#pragma mark - GCKSessionManagerListener
Expand Down Expand Up @@ -485,7 +485,7 @@ - (BOOL)continueAfterPlayButtonClicked {
target:self
selector:@selector(enqueueSelectedItemRemotely)];
}
[_actionSheet presentInController:self sourceView:localPlayerView];
[_actionSheet presentInController:self sourceView:_localPlayerView];
return NO;
}

Expand Down
24 changes: 12 additions & 12 deletions Classes/RootContainerViewController.m
Expand Up @@ -21,9 +21,9 @@

@interface RootContainerViewController ()<
GCKUIMiniMediaControlsViewControllerDelegate> {
__weak IBOutlet UIView *miniMediaControlsContainerView;
__weak IBOutlet NSLayoutConstraint *miniMediaControlsHeightConstraint;
GCKUIMiniMediaControlsViewController *miniMediaControlsViewController;
__weak IBOutlet UIView *_miniMediaControlsContainerView;
__weak IBOutlet NSLayoutConstraint *_miniMediaControlsHeightConstraint;
GCKUIMiniMediaControlsViewController *_miniMediaControlsViewController;
}

@property(nonatomic, weak, readwrite)
Expand All @@ -36,13 +36,13 @@ @implementation RootContainerViewController
- (void)viewDidLoad {
[super viewDidLoad];
GCKCastContext *castContext = [GCKCastContext sharedInstance];
miniMediaControlsViewController =
_miniMediaControlsViewController =
[castContext createMiniMediaControlsViewController];
miniMediaControlsViewController.delegate = self;
_miniMediaControlsViewController.delegate = self;

[self updateControlBarsVisibility];
[self installViewController:miniMediaControlsViewController
inContainerView:miniMediaControlsContainerView];
[self installViewController:_miniMediaControlsViewController
inContainerView:_miniMediaControlsContainerView];
}

- (void)setMiniMediaControlsViewEnabled:(BOOL)miniMediaControlsViewEnabled {
Expand All @@ -56,12 +56,12 @@ - (void)setMiniMediaControlsViewEnabled:(BOOL)miniMediaControlsViewEnabled {

- (void)updateControlBarsVisibility {
if (self.miniMediaControlsViewEnabled &&
miniMediaControlsViewController.active) {
miniMediaControlsHeightConstraint.constant =
miniMediaControlsViewController.minHeight;
[self.view bringSubviewToFront:miniMediaControlsContainerView];
_miniMediaControlsViewController.active) {
_miniMediaControlsHeightConstraint.constant =
_miniMediaControlsViewController.minHeight;
[self.view bringSubviewToFront:_miniMediaControlsContainerView];
} else {
miniMediaControlsHeightConstraint.constant = 0;
_miniMediaControlsHeightConstraint.constant = 0;
}
[UIView animateWithDuration:kCastControlBarsAnimationDuration
animations:^{
Expand Down

0 comments on commit 523bb25

Please sign in to comment.