Commit e7066b96 authored by Tobias's avatar Tobias Committed by Felix Paul Kühne

add list repeat mode

(cherry picked from commit c4736292)
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent ce7be37c
......@@ -1127,14 +1127,20 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
LOCKCHECK;
VLCMediaListPlayer *listPlayer = self.playbackController.listPlayer;
if (listPlayer.repeatMode == VLCDoNotRepeat) {
listPlayer.repeatMode = VLCRepeatCurrentItem;
_multiSelectionView.displayRepeatOne = YES;
} else {
listPlayer.repeatMode = VLCDoNotRepeat;
_multiSelectionView.displayRepeatOne = NO;
VLCRepeatMode nextRepeatMode = VLCDoNotRepeat;
switch (listPlayer.repeatMode) {
case VLCDoNotRepeat:
nextRepeatMode = VLCRepeatCurrentItem;
break;
case VLCRepeatCurrentItem:
nextRepeatMode = VLCRepeatAllItems;
break;
default:
nextRepeatMode = VLCDoNotRepeat;
break;
}
listPlayer.repeatMode = nextRepeatMode;
_multiSelectionView.repeatMode = nextRepeatMode;
}
- (void)toggleShuffleMode
......
......@@ -27,7 +27,8 @@
@property (readwrite, assign) BOOL showsEqualizer;
@property (readwrite, assign) BOOL mediaHasChapters;
- (void)setDisplayRepeatOne:(BOOL)displayRepeatOne;
@property (nonatomic, assign) VLCRepeatMode repeatMode;
- (void)setDisplayLock:(BOOL)displayLock;
- (void)setDisplayShuffle:(BOOL)displayShuffle;
- (CGSize)proposedDisplaySize;
......
......@@ -152,12 +152,21 @@
return CGSizeMake(spacer + buttonWidth + spacer, height);
}
- (void)setDisplayRepeatOne:(BOOL)displayRepeatOne
- (void)setRepeatMode:(VLCRepeatMode)repeatMode
{
if (displayRepeatOne)
[_repeatButton setImage:[UIImage imageNamed:@"repeatOne"] forState:UIControlStateNormal];
else
[_repeatButton setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
_repeatMode = repeatMode;
switch (repeatMode) {
case VLCRepeatCurrentItem:
[_repeatButton setImage:[UIImage imageNamed:@"repeatOne"] forState:UIControlStateNormal];
break;
case VLCRepeatAllItems:
[_repeatButton setImage:[UIImage imageNamed:@"repeatList"] forState:UIControlStateNormal];
break;
case VLCDoNotRepeat:
default:
[_repeatButton setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
break;
}
}
- (void)setDisplayLock:(BOOL)displayLock
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "repeatList.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "repeatList@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "repeatList@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
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