Commit 8a75aae2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

playback: implement pseudo-menu for secondary actions (closes #14028, #14030)

parent ced8633b
This diff is collapsed.
This diff is collapsed.
......@@ -33,13 +33,6 @@
@property (nonatomic, strong) IBOutlet UIButton *fwdButtonLandscape;
@property (nonatomic, strong) IBOutlet UIButton *trackSwitcherButton;
@property (nonatomic, strong) IBOutlet UIButton *trackSwitcherButtonLandscape;
@property (nonatomic, strong) IBOutlet UIButton *repeatButton;
@property (nonatomic, strong) IBOutlet UIButton *repeatButtonLandscape;
@property (nonatomic, strong) IBOutlet UIButton *lockButton;
@property (nonatomic, strong) IBOutlet UIButton *lockButtonLandscape;
@property (nonatomic, strong) IBOutlet UIButton *chapterButton;
@property (nonatomic, strong) IBOutlet UIButton *chapterButtonLandscape;
@property (nonatomic, strong) IBOutlet UIButton *equalizerButton;
@property (nonatomic, strong) IBOutlet UIButton *sleepTimerButton;
@property (nonatomic, strong) IBOutlet UINavigationBar *toolbar;
@property (nonatomic, strong) IBOutlet VLCFrostedGlasView *controllerPanel;
......@@ -80,6 +73,7 @@
@property (nonatomic, strong) IBOutlet UILabel *spuDelayLabel;
@property (nonatomic, strong) IBOutlet UILabel *spuDelayIndicator;
@property (nonatomic, strong) IBOutlet UIButton *aspectRatioButton;
@property (nonatomic, strong) IBOutlet UIButton *moreActionsButton;
@property (nonatomic, strong) IBOutlet VLCFrostedGlasView *scrubIndicatorView;
@property (nonatomic, strong) IBOutlet UILabel *currentScrubSpeedLabel;
......@@ -108,12 +102,9 @@
- (IBAction)playPause;
- (IBAction)backward:(id)sender;
- (IBAction)forward:(id)sender;
- (IBAction)toggleRepeatMode:(id)sender;
- (IBAction)switchTrack:(id)sender;
- (IBAction)lock:(id)sender;
- (IBAction)switchChapter:(id)sender;
- (IBAction)equalizer:(id)sender;
- (IBAction)sleepTimer:(id)sender;
- (IBAction)moreActions:(id)sender;
- (IBAction)videoFilterToggle:(id)sender;
- (IBAction)videoFilterSliderAction:(id)sender;
......@@ -121,6 +112,12 @@
- (IBAction)playbackSliderAction:(id)sender;
- (IBAction)videoDimensionAction:(id)sender;
- (void)toggleRepeatMode;
- (void)toggleEqualizer;
- (void)toggleUILock;
- (void)toggleChapterAndTitleSelector;
- (void)hideMenu;
- (BOOL)rotationIsDisabled;
@end
This diff is collapsed.
//
// VLCMultiSelectionMenuView.h
// VLC for iOS
//
// Created by Felix Paul Kühne on 09/03/15.
// Copyright (c) 2015 VideoLAN. All rights reserved.
//
#import "VLCFrostedGlasView.h"
@protocol VLCMultiSelectionViewDelegate <NSObject>
@required
- (void)toggleUILock;
- (void)toggleEqualizer;
- (void)toggleChapterAndTitleSelector;
- (void)toggleRepeatMode;
- (void)hideMenu;
@end
@interface VLCMultiSelectionMenuView : VLCFrostedGlasView
@property (readwrite, weak) id<VLCMultiSelectionViewDelegate> delegate;
@property (readwrite, assign) BOOL showsEqualizer;
@property (readwrite, assign) BOOL mediaHasChapters;
- (void)setDisplayRepeatOne:(BOOL)displayRepeatOne;
- (CGSize)proposedDisplaySize;
@end
//
// VLCMultiSelectionMenuView.m
// VLC for iOS
//
// Created by Felix Paul Kühne on 09/03/15.
// Copyright (c) 2015 VideoLAN. All rights reserved.
//
#import "VLCMultiSelectionMenuView.h"
#define buttonWidth 32.
#define buttonHeight 35.
#define spacer 8.
@interface VLCMultiSelectionMenuView ()
{
UIButton *_equalizerButton;
UIButton *_chapterSelectorButton;
UIButton *_repeatButton;
UIButton *_lockButton;
BOOL _showsEQ;
}
@end
@implementation VLCMultiSelectionMenuView
- (instancetype)init
{
self = [super initWithFrame:CGRectMake(0., 0., buttonWidth, buttonHeight)];
if (self) {
_equalizerButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_equalizerButton setTitle:@"E" forState:UIControlStateNormal];
_equalizerButton.titleLabel.textColor = [UIColor whiteColor];
_equalizerButton.frame = CGRectMake(spacer, spacer, buttonWidth, buttonHeight);
[_equalizerButton addTarget:self action:@selector(equalizerAction:) forControlEvents:UIControlEventTouchUpInside];
_equalizerButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self addSubview:_equalizerButton];
_chapterSelectorButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_chapterSelectorButton setTitle:@"C" forState:UIControlStateNormal];
_chapterSelectorButton.titleLabel.textColor = [UIColor whiteColor];
_chapterSelectorButton.frame = CGRectMake(spacer, spacer + buttonHeight + spacer, buttonWidth, buttonHeight);
[_chapterSelectorButton addTarget:self action:@selector(chapterSelectorAction:) forControlEvents:UIControlEventTouchUpInside];
_chapterSelectorButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self addSubview:_chapterSelectorButton];
_repeatButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_repeatButton setImage:[UIImage imageNamed:@"repeat.png"] forState:UIControlStateNormal];
_repeatButton.frame = CGRectMake(spacer, spacer + buttonHeight + spacer + buttonHeight + spacer, buttonWidth, buttonHeight);
[_repeatButton addTarget:self action:@selector(repeatAction:) forControlEvents:UIControlEventTouchUpInside];
_repeatButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self addSubview:_repeatButton];
_lockButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_lockButton setImage:[UIImage imageNamed:@"lock.png"] forState:UIControlStateNormal];
_lockButton.frame = CGRectMake(spacer, spacer + buttonHeight + spacer + buttonHeight + spacer + buttonHeight + spacer, buttonWidth, buttonHeight);
[_lockButton addTarget:self action:@selector(lockAction:) forControlEvents:UIControlEventTouchUpInside];
_lockButton.autoresizingMask = UIViewAutoresizingFlexibleTopMargin;
[self addSubview:_lockButton];
}
return self;
}
- (CGSize)proposedDisplaySize
{
_equalizerButton.hidden = !_showsEqualizer;
_chapterSelectorButton.hidden = !_mediaHasChapters;
CGFloat height;
CGRect workFrame;
if (_showsEqualizer) {
if (_mediaHasChapters) {
height = 5. * spacer + 4. * buttonHeight;
workFrame = _equalizerButton.frame;
workFrame.origin.y = spacer;
_equalizerButton.frame = workFrame;
_equalizerButton.hidden = NO;
workFrame = _chapterSelectorButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_chapterSelectorButton.frame = workFrame;
_chapterSelectorButton.hidden = NO;
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2.;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 4. + buttonHeight * 3.;
_lockButton.frame = workFrame;
} else {
height = 4. * spacer + 3. * buttonHeight;
workFrame = _equalizerButton.frame;
workFrame.origin.y = spacer;
_equalizerButton.frame = workFrame;
_equalizerButton.hidden = NO;
_chapterSelectorButton.hidden = YES;
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2.;
_lockButton.frame = workFrame;
}
} else {
if (_mediaHasChapters) {
height = 4. * spacer + 3. * buttonHeight;
_equalizerButton.hidden = YES;
workFrame = _chapterSelectorButton.frame;
workFrame.origin.y = spacer;
_chapterSelectorButton.frame = workFrame;
_chapterSelectorButton.hidden = NO;
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 3. + buttonHeight * 2;
_lockButton.frame = workFrame;
} else {
height = 3. * spacer + 2. * buttonHeight;
_equalizerButton.hidden = YES;
_chapterSelectorButton.hidden = YES;
workFrame = _repeatButton.frame;
workFrame.origin.y = spacer;
_repeatButton.frame = workFrame;
workFrame = _lockButton.frame;
workFrame.origin.y = spacer * 2. + buttonHeight;
_lockButton.frame = workFrame;
}
}
return CGSizeMake(spacer + buttonWidth + spacer, height);
}
- (void)setDisplayRepeatOne:(BOOL)displayRepeatOne
{
if (displayRepeatOne)
[_repeatButton setImage:[UIImage imageNamed:@"repeatOne"] forState:UIControlStateNormal];
else
[_repeatButton setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
}
- (void)equalizerAction:(id)sender
{
[self.delegate toggleEqualizer];
[self.delegate hideMenu];
}
- (void)chapterSelectorAction:(id)sender
{
[self.delegate toggleChapterAndTitleSelector];
[self.delegate hideMenu];
}
- (void)repeatAction:(id)sender
{
[self.delegate toggleRepeatMode];
}
- (void)lockAction:(id)sender
{
[self.delegate toggleUILock];
}
@end
......@@ -127,6 +127,13 @@
7D1052E61A4DC5FF00295F08 /* LiveSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D1052E51A4DC5FF00295F08 /* LiveSDK.framework */; };
7D1052E91A4DCC1100295F08 /* VLCOneDriveTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1052E81A4DCC1100295F08 /* VLCOneDriveTableViewController.m */; };
7D1052EE1A4DCD1E00295F08 /* VLCOneDriveController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1052ED1A4DCD1E00295F08 /* VLCOneDriveController.m */; };
7D12765A1AAD9D9A00F0260C /* lock@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1276541AAD9D9A00F0260C /* lock@3x.png */; };
7D12765B1AAD9D9A00F0260C /* lock.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1276551AAD9D9A00F0260C /* lock.png */; };
7D12765C1AAD9D9A00F0260C /* lock@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1276561AAD9D9A00F0260C /* lock@2x.png */; };
7D12765D1AAD9D9A00F0260C /* More.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1276571AAD9D9A00F0260C /* More.png */; };
7D12765E1AAD9D9A00F0260C /* More@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1276581AAD9D9A00F0260C /* More@2x.png */; };
7D12765F1AAD9D9A00F0260C /* More@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D1276591AAD9D9A00F0260C /* More@3x.png */; };
7D1276621AADA0E600F0260C /* VLCMultiSelectionMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1276611AADA0E600F0260C /* VLCMultiSelectionMenuView.m */; };
7D1516421868D7E0004B18F3 /* VLCFirstStepsFifthPageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D15163B1868D7E0004B18F3 /* VLCFirstStepsFifthPageViewController.xib */; };
7D1516431868D7E0004B18F3 /* VLCFirstStepsFirstPageViewController~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D15163C1868D7E0004B18F3 /* VLCFirstStepsFirstPageViewController~iphone.xib */; };
7D1516461868D7E0004B18F3 /* VLCFirstStepsSixthPageViewController~iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D15163F1868D7E0004B18F3 /* VLCFirstStepsSixthPageViewController~iphone.xib */; };
......@@ -677,6 +684,14 @@
7D1052EB1A4DCC4B00295F08 /* VLCOneDriveConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VLCOneDriveConstants.h; path = Sources/VLCOneDriveConstants.h; sourceTree = SOURCE_ROOT; };
7D1052EC1A4DCD1E00295F08 /* VLCOneDriveController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCOneDriveController.h; path = Sources/VLCOneDriveController.h; sourceTree = SOURCE_ROOT; };
7D1052ED1A4DCD1E00295F08 /* VLCOneDriveController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCOneDriveController.m; path = Sources/VLCOneDriveController.m; sourceTree = SOURCE_ROOT; };
7D1276541AAD9D9A00F0260C /* lock@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock@3x.png"; sourceTree = "<group>"; };
7D1276551AAD9D9A00F0260C /* lock.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lock.png; sourceTree = "<group>"; };
7D1276561AAD9D9A00F0260C /* lock@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lock@2x.png"; sourceTree = "<group>"; };
7D1276571AAD9D9A00F0260C /* More.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = More.png; sourceTree = "<group>"; };
7D1276581AAD9D9A00F0260C /* More@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "More@2x.png"; sourceTree = "<group>"; };
7D1276591AAD9D9A00F0260C /* More@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "More@3x.png"; sourceTree = "<group>"; };
7D1276601AADA0E600F0260C /* VLCMultiSelectionMenuView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCMultiSelectionMenuView.h; path = Sources/VLCMultiSelectionMenuView.h; sourceTree = SOURCE_ROOT; };
7D1276611AADA0E600F0260C /* VLCMultiSelectionMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCMultiSelectionMenuView.m; path = Sources/VLCMultiSelectionMenuView.m; sourceTree = SOURCE_ROOT; };
7D15163B1868D7E0004B18F3 /* VLCFirstStepsFifthPageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = VLCFirstStepsFifthPageViewController.xib; path = Resources/VLCFirstStepsFifthPageViewController.xib; sourceTree = SOURCE_ROOT; };
7D15163C1868D7E0004B18F3 /* VLCFirstStepsFirstPageViewController~iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCFirstStepsFirstPageViewController~iphone.xib"; path = "Resources/VLCFirstStepsFirstPageViewController~iphone.xib"; sourceTree = SOURCE_ROOT; };
7D15163F1868D7E0004B18F3 /* VLCFirstStepsSixthPageViewController~iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCFirstStepsSixthPageViewController~iphone.xib"; path = "Resources/VLCFirstStepsSixthPageViewController~iphone.xib"; sourceTree = SOURCE_ROOT; };
......@@ -1857,6 +1872,12 @@
7D47D6C81760CD2700E86BAD /* Movie VIew */ = {
isa = PBXGroup;
children = (
7D1276541AAD9D9A00F0260C /* lock@3x.png */,
7D1276551AAD9D9A00F0260C /* lock.png */,
7D1276561AAD9D9A00F0260C /* lock@2x.png */,
7D1276571AAD9D9A00F0260C /* More.png */,
7D1276581AAD9D9A00F0260C /* More@2x.png */,
7D1276591AAD9D9A00F0260C /* More@3x.png */,
7D588D63187DD9B700469FCF /* modernSliderKnob.png */,
7D588D62187DD9B700469FCF /* modernSliderKnob@2x.png */,
7D98701F1A3DEC99009CF27D /* modernSliderKnob@3x.png */,
......@@ -1999,6 +2020,8 @@
7D5CAA881A4AD763003F2CBC /* VLCTrackSelectorTableViewCell.m */,
7D5CAA8A1A4AD8E5003F2CBC /* VLCTrackSelectorHeaderView.h */,
7D5CAA8B1A4AD8E5003F2CBC /* VLCTrackSelectorHeaderView.m */,
7D1276601AADA0E600F0260C /* VLCMultiSelectionMenuView.h */,
7D1276611AADA0E600F0260C /* VLCMultiSelectionMenuView.m */,
);
name = Playback;
sourceTree = "<group>";
......@@ -2805,6 +2828,7 @@
7AC862A61765E9510011611A /* jquery-1.10.1.min.js in Resources */,
7AC862A71765E9510011611A /* jquery.fileupload.js in Resources */,
7DF3B78419DF01550041A02E /* fsarrow-speed@3x.png in Resources */,
7D12765E1AAD9D9A00F0260C /* More@2x.png in Resources */,
7DFC38CD1A45F0F8002476CB /* DriveWhite@3x.png in Resources */,
7AC862A81765E9510011611A /* jquery.iframe-transport.js in Resources */,
7AC862A91765E9510011611A /* jquery.ui.widget.js in Resources */,
......@@ -2831,11 +2855,13 @@
7DF04F4E1961F2B8004A5429 /* web-download.png in Resources */,
7DBBF1A8183AB4300009A339 /* VLCOpenNetworkStreamViewController.xib in Resources */,
A7CB0DB31716F72600050CF3 /* PlayingExternally~ipad.png in Resources */,
7D12765F1AAD9D9A00F0260C /* More@3x.png in Resources */,
A7CB0DB41716F72600050CF3 /* PlayingExternally@2x~ipad.png in Resources */,
7DBBF1A9183AB4300009A339 /* VLCPlaylistCollectionViewCell.xib in Resources */,
7DA8B0FB173318E80029698C /* SourceCodePro-Regular.ttf in Resources */,
A7FF9F3E17428C1900999819 /* DeleteButton.png in Resources */,
A7FF9F4017428C3800999819 /* DeleteButton@2x.png in Resources */,
7D12765B1AAD9D9A00F0260C /* lock.png in Resources */,
7D9870581A3DEE68009CF27D /* Drive@3x.png in Resources */,
7D9870361A3DED40009CF27D /* playIcon@3x.png in Resources */,
7D27EC0919DF30CB00EF0370 /* cloud@2x.png in Resources */,
......@@ -2862,6 +2888,7 @@
7D07F710175669D800CDE21C /* buttonHighlight.png in Resources */,
7DBBF1A4183AB4300009A339 /* VLCLocalNetworkListCell~iphone.xib in Resources */,
7DFC38E11A45F243002476CB /* sudHeaderBg@3x.png in Resources */,
7D12765D1AAD9D9A00F0260C /* More.png in Resources */,
7D07F711175669D800CDE21C /* buttonHighlight@2x.png in Resources */,
260B41DD1A75006300DA89C9 /* OneDrive@2x.png in Resources */,
7D27EC1E19DF30CB00EF0370 /* sidebar@2x.png in Resources */,
......@@ -2888,6 +2915,7 @@
9BF07090185122AA009B23DD /* audio@2x~ipad.png in Resources */,
7D07F72F175691CC00CDE21C /* backButton@2x.png in Resources */,
7D98705A1A3DEE88009CF27D /* TVBroadcastIcon@3x.png in Resources */,
7D12765A1AAD9D9A00F0260C /* lock@3x.png in Resources */,
7D27EC2019DF30CB00EF0370 /* uploadarrow.png in Resources */,
7D32B384185E293D006CA474 /* Raleway.woff in Resources */,
7D9870521A3DEE30009CF27D /* AllFiles@3x.png in Resources */,
......@@ -3055,6 +3083,7 @@
7DEB3B8B1764A4F40038FC70 /* movie.png in Resources */,
7D27EC2C19DF310300EF0370 /* VLCFirstStepsSecondPageViewController~iphone.xib in Resources */,
7DEB3B8C1764A4F40038FC70 /* blank.png in Resources */,
7D12765C1AAD9D9A00F0260C /* lock@2x.png in Resources */,
7DEB3B8D1764A4F40038FC70 /* blank@2x.png in Resources */,
7DF3B78719DF01550041A02E /* fsarrow-subtitles@3x.png in Resources */,
4115E5FF197977850071C4B9 /* tableViewIcon@2x.png in Resources */,
......@@ -3279,6 +3308,7 @@
41CD695C1A29D72600E60BCE /* VLCBoxController.m in Sources */,
7D3784C2183A9938009EE944 /* VLCSlider.m in Sources */,
7D3784C3183A9938009EE944 /* VLCStatusLabel.m in Sources */,
7D1276621AADA0E600F0260C /* VLCMultiSelectionMenuView.m in Sources */,
7D3784C8183A9972009EE944 /* NSString+SupportedMedia.m in Sources */,
7D3784C9183A9972009EE944 /* UIDevice+VLC.m in Sources */,
262C71591A98FA9200F7ED34 /* VLCPlexMediaInformationViewController.m in Sources */,
......
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