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
...@@ -19,18 +19,16 @@ ...@@ -19,18 +19,16 @@
<outlet property="brightnessLabel" destination="148" id="165"/> <outlet property="brightnessLabel" destination="148" id="165"/>
<outlet property="brightnessSlider" destination="147" id="163"/> <outlet property="brightnessSlider" destination="147" id="163"/>
<outlet property="bwdButton" destination="276" id="284"/> <outlet property="bwdButton" destination="276" id="284"/>
<outlet property="chapterButton" destination="D3O-Bo-TYi" id="o5p-gI-ydF"/>
<outlet property="contrastLabel" destination="146" id="160"/> <outlet property="contrastLabel" destination="146" id="160"/>
<outlet property="contrastSlider" destination="145" id="161"/> <outlet property="contrastSlider" destination="145" id="161"/>
<outlet property="controllerPanel" destination="272" id="298"/> <outlet property="controllerPanel" destination="272" id="298"/>
<outlet property="currentScrubSpeedLabel" destination="244" id="246"/> <outlet property="currentScrubSpeedLabel" destination="244" id="246"/>
<outlet property="equalizerButton" destination="iAS-0C-clq" id="hu9-uh-EsK"/>
<outlet property="fwdButton" destination="274" id="286"/> <outlet property="fwdButton" destination="274" id="286"/>
<outlet property="gammaLabel" destination="152" id="171"/> <outlet property="gammaLabel" destination="152" id="171"/>
<outlet property="gammaSlider" destination="151" id="169"/> <outlet property="gammaSlider" destination="151" id="169"/>
<outlet property="hueLabel" destination="143" id="158"/> <outlet property="hueLabel" destination="143" id="158"/>
<outlet property="hueSlider" destination="144" id="157"/> <outlet property="hueSlider" destination="144" id="157"/>
<outlet property="lockButton" destination="o2q-eo-cnU" id="08s-Qv-duE"/> <outlet property="moreActionsButton" destination="o2v-AM-dqM" id="IzQ-ac-6DG"/>
<outlet property="movieView" destination="121" id="122"/> <outlet property="movieView" destination="121" id="122"/>
<outlet property="playPauseButton" destination="275" id="282"/> <outlet property="playPauseButton" destination="275" id="282"/>
<outlet property="playbackSpeedButton" destination="278" id="295"/> <outlet property="playbackSpeedButton" destination="278" id="295"/>
...@@ -42,7 +40,6 @@ ...@@ -42,7 +40,6 @@
<outlet property="playingExternallyTitle" destination="125" id="133"/> <outlet property="playingExternallyTitle" destination="125" id="133"/>
<outlet property="playingExternallyView" destination="123" id="131"/> <outlet property="playingExternallyView" destination="123" id="131"/>
<outlet property="positionSlider" destination="249" id="261"/> <outlet property="positionSlider" destination="249" id="261"/>
<outlet property="repeatButton" destination="96c-QK-bZI" id="SPv-gB-C2a"/>
<outlet property="resetVideoFilterButton" destination="142" id="175"/> <outlet property="resetVideoFilterButton" destination="142" id="175"/>
<outlet property="saturationLabel" destination="150" id="166"/> <outlet property="saturationLabel" destination="150" id="166"/>
<outlet property="saturationSlider" destination="149" id="168"/> <outlet property="saturationSlider" destination="149" id="168"/>
...@@ -314,7 +311,7 @@ ...@@ -314,7 +311,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" id="k3r-6B-CmK" userLabel="audioSwitcherContainer"> <view contentMode="scaleToFill" id="k3r-6B-CmK" userLabel="audioSwitcherContainer">
<rect key="frame" x="258" y="5" width="50" height="40"/> <rect key="frame" x="241" y="5" width="50" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="278"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="278">
...@@ -337,7 +334,7 @@ ...@@ -337,7 +334,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view> </view>
<view contentMode="scaleToFill" id="OCK-fG-mgo" userLabel="videoEffectsContainer"> <view contentMode="scaleToFill" id="OCK-fG-mgo" userLabel="videoEffectsContainer">
<rect key="frame" x="599" y="5" width="50" height="40"/> <rect key="frame" x="617" y="5" width="50" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="279"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="279">
...@@ -360,7 +357,7 @@ ...@@ -360,7 +357,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="277"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="277">
<rect key="frame" x="493" y="5" width="32" height="40"/> <rect key="frame" x="535" y="5" width="32" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
...@@ -431,48 +428,21 @@ ...@@ -431,48 +428,21 @@
<action selector="playPause" destination="-1" eventType="touchUpInside" id="283"/> <action selector="playPause" destination="-1" eventType="touchUpInside" id="283"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="96c-QK-bZI"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="o2v-AM-dqM">
<rect key="frame" x="217" y="5" width="32" height="40"/> <rect key="frame" x="727" y="5" width="32" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" image="repeat.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="toggleRepeatMode:" destination="-1" eventType="touchUpInside" id="UWl-MQ-MX7"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="o2q-eo-cnU">
<rect key="frame" x="541" y="5" width="32" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="22"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<inset key="contentEdgeInsets" minX="0.0" minY="4" maxX="0.0" maxY="4"/>
<state key="normal" title="L"/>
<connections>
<action selector="lock:" destination="-1" eventType="touchUpInside" id="QFm-Re-ySf"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="D3O-Bo-TYi">
<rect key="frame" x="577" y="6" width="32" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
<inset key="contentEdgeInsets" minX="0.0" minY="4" maxX="0.0" maxY="4"/>
<state key="normal" title="C"/>
<connections>
<action selector="switchChapter:" destination="-1" eventType="touchUpInside" id="NHE-kB-Qpz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="iAS-0C-clq">
<rect key="frame" x="657" y="6" width="32" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
<inset key="contentEdgeInsets" minX="0.0" minY="4" maxX="0.0" maxY="4"/> <inset key="contentEdgeInsets" minX="0.0" minY="4" maxX="0.0" maxY="4"/>
<state key="normal" title="E"/> <state key="normal" image="More.png">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections> <connections>
<action selector="equalizer:" destination="-2" eventType="touchUpInside" id="fpe-ay-cLY"/> <action selector="moreActions:" destination="-1" eventType="touchUpInside" id="ZhG-d9-vzl"/>
</connections> </connections>
</button> </button>
</subviews> </subviews>
...@@ -575,13 +545,13 @@ ...@@ -575,13 +545,13 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="More.png" width="20" height="6"/>
<image name="PlayingExternally.png" width="261" height="195"/> <image name="PlayingExternally.png" width="261" height="195"/>
<image name="audioTrackIcon.png" width="19" height="19"/> <image name="audioTrackIcon.png" width="19" height="19"/>
<image name="backIcon.png" width="32" height="16"/> <image name="backIcon.png" width="32" height="16"/>
<image name="forwardIcon.png" width="32" height="16"/> <image name="forwardIcon.png" width="32" height="16"/>
<image name="playIcon.png" width="19" height="17"/> <image name="playIcon.png" width="19" height="17"/>
<image name="ratioIcon.png" width="15" height="15"/> <image name="ratioIcon.png" width="15" height="15"/>
<image name="repeat.png" width="23" height="18"/>
<image name="resetIcon.png" width="24" height="30"/> <image name="resetIcon.png" width="24" height="30"/>
<image name="speedIcon.png" width="19" height="19"/> <image name="speedIcon.png" width="19" height="19"/>
<image name="videoEffectsIcon.png" width="21" height="21"/> <image name="videoEffectsIcon.png" width="21" height="21"/>
......
This diff is collapsed.
...@@ -33,13 +33,6 @@ ...@@ -33,13 +33,6 @@
@property (nonatomic, strong) IBOutlet UIButton *fwdButtonLandscape; @property (nonatomic, strong) IBOutlet UIButton *fwdButtonLandscape;
@property (nonatomic, strong) IBOutlet UIButton *trackSwitcherButton; @property (nonatomic, strong) IBOutlet UIButton *trackSwitcherButton;
@property (nonatomic, strong) IBOutlet UIButton *trackSwitcherButtonLandscape; @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 UIButton *sleepTimerButton;
@property (nonatomic, strong) IBOutlet UINavigationBar *toolbar; @property (nonatomic, strong) IBOutlet UINavigationBar *toolbar;
@property (nonatomic, strong) IBOutlet VLCFrostedGlasView *controllerPanel; @property (nonatomic, strong) IBOutlet VLCFrostedGlasView *controllerPanel;
...@@ -80,6 +73,7 @@ ...@@ -80,6 +73,7 @@
@property (nonatomic, strong) IBOutlet UILabel *spuDelayLabel; @property (nonatomic, strong) IBOutlet UILabel *spuDelayLabel;
@property (nonatomic, strong) IBOutlet UILabel *spuDelayIndicator; @property (nonatomic, strong) IBOutlet UILabel *spuDelayIndicator;
@property (nonatomic, strong) IBOutlet UIButton *aspectRatioButton; @property (nonatomic, strong) IBOutlet UIButton *aspectRatioButton;
@property (nonatomic, strong) IBOutlet UIButton *moreActionsButton;
@property (nonatomic, strong) IBOutlet VLCFrostedGlasView *scrubIndicatorView; @property (nonatomic, strong) IBOutlet VLCFrostedGlasView *scrubIndicatorView;
@property (nonatomic, strong) IBOutlet UILabel *currentScrubSpeedLabel; @property (nonatomic, strong) IBOutlet UILabel *currentScrubSpeedLabel;
...@@ -108,12 +102,9 @@ ...@@ -108,12 +102,9 @@
- (IBAction)playPause; - (IBAction)playPause;
- (IBAction)backward:(id)sender; - (IBAction)backward:(id)sender;
- (IBAction)forward:(id)sender; - (IBAction)forward:(id)sender;
- (IBAction)toggleRepeatMode:(id)sender;
- (IBAction)switchTrack:(id)sender; - (IBAction)switchTrack:(id)sender;
- (IBAction)lock:(id)sender;
- (IBAction)switchChapter:(id)sender;
- (IBAction)equalizer:(id)sender;
- (IBAction)sleepTimer:(id)sender; - (IBAction)sleepTimer:(id)sender;
- (IBAction)moreActions:(id)sender;
- (IBAction)videoFilterToggle:(id)sender; - (IBAction)videoFilterToggle:(id)sender;
- (IBAction)videoFilterSliderAction:(id)sender; - (IBAction)videoFilterSliderAction:(id)sender;
...@@ -121,6 +112,12 @@ ...@@ -121,6 +112,12 @@
- (IBAction)playbackSliderAction:(id)sender; - (IBAction)playbackSliderAction:(id)sender;
- (IBAction)videoDimensionAction:(id)sender; - (IBAction)videoDimensionAction:(id)sender;
- (void)toggleRepeatMode;
- (void)toggleEqualizer;
- (void)toggleUILock;
- (void)toggleChapterAndTitleSelector;
- (void)hideMenu;
- (BOOL)rotationIsDisabled; - (BOOL)rotationIsDisabled;
@end @end
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#import "VLCTrackSelectorTableViewCell.h" #import "VLCTrackSelectorTableViewCell.h"
#import "VLCTrackSelectorHeaderView.h" #import "VLCTrackSelectorHeaderView.h"
#import "VLCEqualizerView.h" #import "VLCEqualizerView.h"
#import "VLCMultiSelectionMenuView.h"
#import "OBSlider.h" #import "OBSlider.h"
#import "VLCStatusLabel.h" #import "VLCStatusLabel.h"
...@@ -47,7 +48,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -47,7 +48,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
VLCPanTypeVolume, VLCPanTypeVolume,
}; };
@interface VLCMovieViewController () <UIGestureRecognizerDelegate, AVAudioSessionDelegate, VLCMediaDelegate, UITableViewDataSource, UITableViewDelegate, VLCEqualizerViewDelegate> @interface VLCMovieViewController () <UIGestureRecognizerDelegate, AVAudioSessionDelegate, VLCMediaDelegate, UITableViewDataSource, UITableViewDelegate, VLCEqualizerViewDelegate, VLCMultiSelectionViewDelegate>
{ {
VLCMediaListPlayer *_listPlayer; VLCMediaListPlayer *_listPlayer;
VLCMediaPlayer *_mediaPlayer; VLCMediaPlayer *_mediaPlayer;
...@@ -88,6 +89,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -88,6 +89,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
UITableView *_trackSelectorTableView; UITableView *_trackSelectorTableView;
VLCEqualizerView *_equalizerView; VLCEqualizerView *_equalizerView;
VLCMultiSelectionMenuView *_multiSelectionView;
UIView *_sleepTimerContainer; UIView *_sleepTimerContainer;
UIDatePicker *_sleepTimeDatePicker; UIDatePicker *_sleepTimeDatePicker;
...@@ -209,10 +211,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -209,10 +211,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_trackSwitcherButton.isAccessibilityElement = YES; _trackSwitcherButton.isAccessibilityElement = YES;
_trackSwitcherButtonLandscape.accessibilityLabel = NSLocalizedString(@"OPEN_TRACK_PANEL", nil); _trackSwitcherButtonLandscape.accessibilityLabel = NSLocalizedString(@"OPEN_TRACK_PANEL", nil);
_trackSwitcherButtonLandscape.isAccessibilityElement = YES; _trackSwitcherButtonLandscape.isAccessibilityElement = YES;
_chapterButton.accessibilityLabel = NSLocalizedString(@"JUMP_TO_TITLE_OR_CHAPTER", nil);
_chapterButton.isAccessibilityElement = YES;
_chapterButtonLandscape.accessibilityLabel = NSLocalizedString(@"JUMP_TO_TITLE_OR_CHAPTER", nil);
_chapterButtonLandscape.isAccessibilityElement = YES;
_playbackSpeedButton.accessibilityLabel = _playbackSpeedLabel.text; _playbackSpeedButton.accessibilityLabel = _playbackSpeedLabel.text;
_playbackSpeedButton.isAccessibilityElement = YES; _playbackSpeedButton.isAccessibilityElement = YES;
_playbackSpeedButtonLandscape.accessibilityLabel = _playbackSpeedLabel.text; _playbackSpeedButtonLandscape.accessibilityLabel = _playbackSpeedLabel.text;
...@@ -237,14 +235,16 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -237,14 +235,16 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_fwdButton.isAccessibilityElement = YES; _fwdButton.isAccessibilityElement = YES;
_fwdButtonLandscape.accessibilityLabel = NSLocalizedString(@"FWD_BUTTON", nil); _fwdButtonLandscape.accessibilityLabel = NSLocalizedString(@"FWD_BUTTON", nil);
_fwdButtonLandscape.isAccessibilityElement = YES; _fwdButtonLandscape.isAccessibilityElement = YES;
_repeatButton.accessibilityLabel = NSLocalizedString(@"BUTTON_REPEAT", nil);
_repeatButton.isAccessibilityElement = YES;
_equalizerButton.accessibilityLabel = NSLocalizedString(@"BUTTON_EQUALIZER", nil);
_equalizerButton.isAccessibilityElement = YES;
_sleepTimerButton.accessibilityLabel = NSLocalizedString(@"BUTTON_SLEEP_TIMER", nil); _sleepTimerButton.accessibilityLabel = NSLocalizedString(@"BUTTON_SLEEP_TIMER", nil);
_sleepTimerButton.isAccessibilityElement = YES; _sleepTimerButton.isAccessibilityElement = YES;
[_sleepTimerButton setTitle:NSLocalizedString(@"BUTTON_SLEEP_TIMER", nil) forState:UIControlStateNormal]; [_sleepTimerButton setTitle:NSLocalizedString(@"BUTTON_SLEEP_TIMER", nil) forState:UIControlStateNormal];
_multiSelectionView = [[VLCMultiSelectionMenuView alloc] init];
_multiSelectionView.delegate = self;
_multiSelectionView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin;
_multiSelectionView.hidden = YES;
[self.view addSubview:_multiSelectionView];
_scrubHelpLabel.text = NSLocalizedString(@"PLAYBACK_SCRUB_HELP", nil); _scrubHelpLabel.text = NSLocalizedString(@"PLAYBACK_SCRUB_HELP", nil);
self.playbackSpeedView.hidden = YES; self.playbackSpeedView.hidden = YES;
...@@ -473,18 +473,42 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -473,18 +473,42 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (void)viewWillLayoutSubviews - (void)viewWillLayoutSubviews
{ {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { CGRect multiSelectionFrame;
CGSize viewSize = self.view.frame.size; CGRect controllerPanelFrame;
if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) {
[_controllerPanel removeFromSuperview]; if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone) {
_controllerPanelLandscape.frame = (CGRect){CGPointMake(0, viewSize.height - _controllerPanelLandscape.frame.size.height), CGSizeMake(viewSize.width, _controllerPanelLandscape.frame.size.height)}; controllerPanelFrame = _controllerPanel.frame;
[self.view addSubview:_controllerPanelLandscape]; multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
} else { multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
[_controllerPanelLandscape removeFromSuperview]; multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
_controllerPanel.frame = (CGRect){CGPointMake(0, viewSize.height - _controllerPanel.frame.size.height), CGSizeMake(viewSize.width, _controllerPanel.frame.size.height)}; _multiSelectionView.frame = multiSelectionFrame;
[self.view addSubview:_controllerPanel]; _multiSelectionView.showsEqualizer = YES;
} return;
} }
CGSize viewSize = self.view.frame.size;
if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation)) {
[_controllerPanel removeFromSuperview];
controllerPanelFrame = (CGRect){CGPointMake(0, viewSize.height - _controllerPanelLandscape.frame.size.height), CGSizeMake(viewSize.width, _controllerPanelLandscape.frame.size.height)};
_controllerPanelLandscape.frame = controllerPanelFrame;
[self.view addSubview:_controllerPanelLandscape];
_multiSelectionView.showsEqualizer = YES;
multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
} else {
[_controllerPanelLandscape removeFromSuperview];
controllerPanelFrame = (CGRect){CGPointMake(0, viewSize.height - _controllerPanel.frame.size.height), CGSizeMake(viewSize.width, _controllerPanel.frame.size.height)};
_controllerPanel.frame = controllerPanelFrame;
[self.view addSubview:_controllerPanel];
_multiSelectionView.showsEqualizer = NO;
multiSelectionFrame = (CGRect){CGPointMake(0., 0.), [_multiSelectionView proposedDisplaySize]};
multiSelectionFrame.origin.x = controllerPanelFrame.size.width - multiSelectionFrame.size.width;
multiSelectionFrame.origin.y = controllerPanelFrame.origin.y - multiSelectionFrame.size.height;
}
_multiSelectionView.frame = multiSelectionFrame;
} }
- (void)_startPlayback - (void)_startPlayback
...@@ -584,8 +608,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -584,8 +608,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
self.positionSlider.value = 0.; self.positionSlider.value = 0.;
[self.timeDisplay setTitle:@"" forState:UIControlStateNormal]; [self.timeDisplay setTitle:@"" forState:UIControlStateNormal];
self.timeDisplay.accessibilityLabel = @""; self.timeDisplay.accessibilityLabel = @"";
[self.repeatButton setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
[self.repeatButtonLandscape setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
if (![self _isMediaSuitableForDevice]) { if (![self _isMediaSuitableForDevice]) {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DEVICE_TOOSLOW_TITLE", nil) message:[NSString stringWithFormat:NSLocalizedString(@"DEVICE_TOOSLOW", nil), [[UIDevice currentDevice] model], self.fileFromMediaLibrary.title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil) otherButtonTitles:NSLocalizedString(@"BUTTON_OPEN", nil), nil]; UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"DEVICE_TOOSLOW_TITLE", nil) message:[NSString stringWithFormat:NSLocalizedString(@"DEVICE_TOOSLOW", nil), [[UIDevice currentDevice] model], self.fileFromMediaLibrary.title] delegate:self cancelButtonTitle:NSLocalizedString(@"BUTTON_CANCEL", nil) otherButtonTitles:NSLocalizedString(@"BUTTON_OPEN", nil), nil];
...@@ -952,6 +974,8 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -952,6 +974,8 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_sleepTimerContainer.alpha = 0.0f; _sleepTimerContainer.alpha = 0.0f;
_sleepTimerContainer.hidden = YES; _sleepTimerContainer.hidden = YES;
} }
_multiSelectionView.alpha = 0.0f;
_multiSelectionView.hidden = YES;
} }
void (^animationBlock)() = ^() { void (^animationBlock)() = ^() {
...@@ -962,6 +986,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -962,6 +986,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_playbackSpeedView.alpha = alpha; _playbackSpeedView.alpha = alpha;
_trackSelectorContainer.alpha = alpha; _trackSelectorContainer.alpha = alpha;
_equalizerView.alpha = alpha; _equalizerView.alpha = alpha;
_multiSelectionView.alpha = alpha;
if (_sleepTimerContainer) if (_sleepTimerContainer)
_sleepTimerContainer.alpha = alpha; _sleepTimerContainer.alpha = alpha;
}; };
...@@ -976,6 +1001,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -976,6 +1001,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_equalizerView.hidden = YES; _equalizerView.hidden = YES;
if (_sleepTimerContainer) if (_sleepTimerContainer)
_sleepTimerContainer.hidden = YES; _sleepTimerContainer.hidden = YES;
_multiSelectionView.hidden = YES;
}; };
UIStatusBarAnimation animationType = animated? UIStatusBarAnimationFade: UIStatusBarAnimationNone; UIStatusBarAnimation animationType = animated? UIStatusBarAnimationFade: UIStatusBarAnimationNone;
...@@ -1168,13 +1194,10 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -1168,13 +1194,10 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
self.trackSwitcherButtonLandscape.hidden = YES; self.trackSwitcherButtonLandscape.hidden = YES;
} }
if (_mediaPlayer.titles.count > 1 || [_mediaPlayer chaptersForTitleIndex:_mediaPlayer.currentTitleIndex].count > 1) { if (_mediaPlayer.titles.count > 1 || [_mediaPlayer chaptersForTitleIndex:_mediaPlayer.currentTitleIndex].count > 1)
self.chapterButton.hidden = NO; _multiSelectionView.mediaHasChapters = YES;
self.chapterButtonLandscape.hidden = NO; else
} else { _multiSelectionView.mediaHasChapters = NO;
self.chapterButton.hidden = YES;
self.chapterButtonLandscape.hidden = YES;
}
} }
- (IBAction)playPause - (IBAction)playPause
...@@ -1207,19 +1230,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -1207,19 +1230,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[_mediaPlayer mediumJumpBackward]; [_mediaPlayer mediumJumpBackward];
} }
- (void)toggleRepeatMode:(id)sender
{
if (_listPlayer.repeatMode == VLCDoNotRepeat) {
_listPlayer.repeatMode = VLCRepeatCurrentItem;
[self.repeatButton setImage:[UIImage imageNamed:@"repeatOne"] forState:UIControlStateNormal];
[self.repeatButtonLandscape setImage:[UIImage imageNamed:@"repeatOne"] forState:UIControlStateNormal];
} else {
_listPlayer.repeatMode = VLCDoNotRepeat;
[self.repeatButton setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
[self.repeatButtonLandscape setImage:[UIImage imageNamed:@"repeat"] forState:UIControlStateNormal];
}
}
- (IBAction)switchTrack:(id)sender - (IBAction)switchTrack:(id)sender
{ {
LOCKCHECK; LOCKCHECK;
...@@ -1248,33 +1258,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -1248,33 +1258,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
} }
} }
- (IBAction)switchChapter:(id)sender
{
LOCKCHECK;
if (_trackSelectorContainer.hidden == YES || _switchingTracksNotChapters == YES) {
_switchingTracksNotChapters = NO;
[_trackSelectorTableView reloadData];
_trackSelectorContainer.hidden = NO;
_trackSelectorContainer.alpha = 1.;
if (!_playbackSpeedViewHidden)
self.playbackSpeedView.hidden = _playbackSpeedViewHidden = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (!_controlsHidden) {
self.controllerPanel.hidden = _controlsHidden = YES;
self.controllerPanelLandscape.hidden = YES;
}
}
self.videoFilterView.hidden = _videoFiltersHidden = YES;
} else {
_trackSelectorContainer.hidden = YES;
}
}
- (IBAction)toggleTimeDisplay:(id)sender - (IBAction)toggleTimeDisplay:(id)sender
{ {
LOCKCHECK; LOCKCHECK;
...@@ -1284,33 +1267,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -1284,33 +1267,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[self _resetIdleTimer]; [self _resetIdleTimer];
} }
- (IBAction)lock:(id)sender
{
_interfaceIsLocked = !_interfaceIsLocked;
}
- (IBAction)equalizer:(id)sender
{
LOCKCHECK;
if (_equalizerView.hidden) {
if (!_playbackSpeedViewHidden)
self.playbackSpeedView.hidden = _playbackSpeedViewHidden = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (!_controlsHidden) {
self.controllerPanel.hidden = _controlsHidden = YES;
self.controllerPanelLandscape.hidden = YES;
}
}
self.videoFilterView.hidden = _videoFiltersHidden = YES;
_equalizerView.alpha = 1.;
_equalizerView.hidden = NO;
} else
_equalizerView.hidden = YES;
}
- (IBAction)sleepTimer:(id)sender - (IBAction)sleepTimer:(id)sender
{ {
if (!_sleepTimerContainer) { if (!_sleepTimerContainer) {
...@@ -1381,6 +1337,124 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -1381,6 +1337,124 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
_sleepTimer = [NSTimer scheduledTimerWithTimeInterval:_sleepTimeDatePicker.countDownDuration target:self selector:@selector(closePlayback:) userInfo:nil repeats:NO]; _sleepTimer = [NSTimer scheduledTimerWithTimeInterval:_sleepTimeDatePicker.countDownDuration target:self selector:@selector(closePlayback:) userInfo:nil repeats:NO];
} }
- (void)moreActions:(id)sender
{
if (_multiSelectionView.hidden == NO) {
[UIView animateWithDuration:.3
animations:^{
_multiSelectionView.hidden = YES;
}
completion:^(BOOL finished){
}];
return;
}
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
_multiSelectionView.showsEqualizer = YES;
else
_multiSelectionView.showsEqualizer = NO;
}
CGRect workFrame = _multiSelectionView.frame;
workFrame.size = [_multiSelectionView proposedDisplaySize];
workFrame.origin.x = self.toolbar.frame.size.width - workFrame.size.width;
_multiSelectionView.alpha = 1.0f;
/* animate */
_multiSelectionView.frame = CGRectMake(workFrame.origin.x, workFrame.origin.y + workFrame.size.height, workFrame.size.width, 0.);
[UIView animateWithDuration:.3
animations:^{
_multiSelectionView.frame = workFrame;
_multiSelectionView.hidden = NO;
}
completion:^(BOOL finished){
}];
[self _resetIdleTimer];
}
#pragma mark - multi-select delegation
- (void)toggleUILock
{
_interfaceIsLocked = !_interfaceIsLocked;
}
- (void)toggleEqualizer
{
LOCKCHECK;
if (_equalizerView.hidden) {
if (!_playbackSpeedViewHidden)
self.playbackSpeedView.hidden = _playbackSpeedViewHidden = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (!_controlsHidden) {
self.controllerPanel.hidden = _controlsHidden = YES;
self.controllerPanelLandscape.hidden = YES;
self.toolbar.hidden = YES;
}
}
self.videoFilterView.hidden = _videoFiltersHidden = YES;
_equalizerView.alpha = 1.;
_equalizerView.hidden = NO;
} else
_equalizerView.hidden = YES;
}
- (void)toggleChapterAndTitleSelector
{
LOCKCHECK;
if (_trackSelectorContainer.hidden == YES || _switchingTracksNotChapters == YES) {
_switchingTracksNotChapters = NO;
[_trackSelectorTableView reloadData];
_trackSelectorContainer.hidden = NO;
_trackSelectorContainer.alpha = 1.;
if (!_playbackSpeedViewHidden)
self.playbackSpeedView.hidden = _playbackSpeedViewHidden = YES;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
if (!_controlsHidden) {
self.controllerPanel.hidden = _controlsHidden = YES;
self.controllerPanelLandscape.hidden = YES;
}
}
self.videoFilterView.hidden = _videoFiltersHidden = YES;
} else {
_trackSelectorContainer.hidden = YES;
}
}
- (void)toggleRepeatMode
{
LOCKCHECK;
if (_listPlayer.repeatMode == VLCDoNotRepeat) {
_listPlayer.repeatMode = VLCRepeatCurrentItem;
_multiSelectionView.displayRepeatOne = YES;
} else {
_listPlayer.repeatMode = VLCDoNotRepeat;
_multiSelectionView.displayRepeatOne = NO;
}
}
- (void)hideMenu
{
[UIView animateWithDuration:.2
animations:^{
_multiSelectionView.hidden = YES;
}
completion:^(BOOL finished){
}];
[self _resetIdleTimer];
}
#pragma mark - track selector table view #pragma mark - track selector table view
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{ {
......