Commit 2dd98554 authored by Felix Paul Kühne's avatar Felix Paul Kühne

playback: add shuffle UI stub

parent 9501fbbf
......@@ -118,6 +118,7 @@
- (void)toggleEqualizer;
- (void)toggleUILock;
- (void)toggleChapterAndTitleSelector;
- (void)toggleShuffleMode;
- (void)hideMenu;
- (BOOL)rotationIsDisabled;
......
......@@ -1631,6 +1631,13 @@ static inline NSArray * RemoteCommandCenterCommandsToHandle(MPRemoteCommandCente
}
}
- (void)toggleShuffleMode
{
LOCKCHECK;
// FIXME: missing implementation
}
- (void)hideMenu
{
[UIView animateWithDuration:.2
......
......@@ -15,6 +15,7 @@
- (void)toggleEqualizer;
- (void)toggleChapterAndTitleSelector;
- (void)toggleRepeatMode;
- (void)toggleShuffleMode;
- (void)hideMenu;
@end
......@@ -28,6 +29,7 @@
- (void)setDisplayRepeatOne:(BOOL)displayRepeatOne;
- (void)setDisplayLock:(BOOL)displayLock;
- (void)setDisplayShuffle:(BOOL)displayShuffle;
- (CGSize)proposedDisplaySize;
@end
......@@ -18,6 +18,7 @@
UIButton *_chapterSelectorButton;
UIButton *_repeatButton;
UIButton *_lockButton;
UIButton *_shuffleButton;
BOOL _showsEQ;
}
......@@ -54,9 +55,15 @@
_repeatButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self addSubview:_repeatButton];
_shuffleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_shuffleButton setTitle:@"S" forState:UIControlStateNormal];
_shuffleButton.frame = CGRectMake(spacer, 4. * spacer + buttonHeight * 3., buttonWidth, buttonHeight);
[_shuffleButton addTarget:self action:@selector(shuffleAction:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_shuffleButton];
_lockButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_lockButton setImage:[UIImage imageNamed:@"lock"] forState:UIControlStateNormal];
_lockButton.frame = CGRectMake(spacer, spacer + buttonHeight + spacer + buttonHeight + spacer + buttonHeight + spacer, buttonWidth, buttonHeight);
_lockButton.frame = CGRectMake(spacer, 5. * spacer + buttonHeight * 4., buttonWidth, buttonHeight);
[_lockButton addTarget:self action:@selector(lockAction:) forControlEvents:UIControlEventTouchUpInside];
_lockButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self addSubview:_lockButton];
......@@ -74,7 +81,7 @@
if (_showsEqualizer) {
if (_mediaHasChapters) {
height = 5. * spacer + 4. * buttonHeight;
height = 6. * spacer + 5. * buttonHeight;
workFrame = _equalizerButton.frame;
workFrame.origin.y = spacer;
_equalizerButton.frame = workFrame;
......@@ -86,8 +93,11 @@
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2.;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame = _shuffleButton.frame;
workFrame.origin.y = spacer * 4. + buttonHeight * 3.;
_shuffleButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 5. + buttonHeight * 4.;
_lockButton.frame = workFrame;
} else {
height = 4. * spacer + 3. * buttonHeight;
......@@ -99,8 +109,11 @@
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame = _shuffleButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2.;
_shuffleButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 4. + buttonHeight * 3.;
_lockButton.frame = workFrame;
}
} else {
......@@ -114,8 +127,11 @@
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_repeatButton.frame = workFrame;
workFrame = _shuffleButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2.;
_shuffleButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2;
workFrame.origin.y = spacer * 4. + buttonHeight * 3.;
_lockButton.frame = workFrame;
} else {
height = 3. * spacer + 2. * buttonHeight;
......@@ -124,8 +140,11 @@
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame = _shuffleButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_shuffleButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2.;
_lockButton.frame = workFrame;
}
}
......@@ -149,6 +168,15 @@
[_lockButton setBackgroundColor:[UIColor clearColor]];
}
- (void)setDisplayShuffle:(BOOL)displayShuffle
{
// FIXME: fix icon state
if (displayShuffle)
[_shuffleButton setBackgroundColor:[UIColor VLCOrangeTintColor]];
else
[_shuffleButton setBackgroundColor:[UIColor clearColor]];
}
- (void)equalizerAction:(id)sender
{
[self.delegate toggleEqualizer];
......@@ -166,6 +194,11 @@
[self.delegate toggleRepeatMode];
}
- (void)shuffleAction:(id)sender
{
[self.delegate toggleShuffleMode];
}
- (void)lockAction:(id)sender
{
[self.delegate toggleUILock];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment