Commit 3131d924 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added the prev/next buttons back (disabled by default) (close #6822)

you can enable them in the 'Playback' menu (since we got no 'View' menu so far) or in the advanced preferences

note that preliminary artwork is used at this point
parent 3b9f212d
......@@ -189,7 +189,9 @@ EXTRA_DIST += \
extras/package/macosx/Resources/icons/wav.icns \
extras/package/macosx/Resources/icons/wma.icns \
extras/package/macosx/Resources/icons/wmv.icns \
extras/package/macosx/Resources/mainwindow/back-pressed-single.png \
extras/package/macosx/Resources/mainwindow/back-pressed.png \
extras/package/macosx/Resources/mainwindow/back-single.png \
extras/package/macosx/Resources/mainwindow/back.png \
extras/package/macosx/Resources/mainwindow/bottom-background.png \
extras/package/macosx/Resources/mainwindow/bottombar-mini.png \
......@@ -200,7 +202,9 @@ EXTRA_DIST += \
extras/package/macosx/Resources/mainwindow/effects-double-buttons.png \
extras/package/macosx/Resources/mainwindow/effects-one-button-blue.png \
extras/package/macosx/Resources/mainwindow/effects-one-button.png \
extras/package/macosx/Resources/mainwindow/forward-pressed-single.png \
extras/package/macosx/Resources/mainwindow/forward-pressed.png \
extras/package/macosx/Resources/mainwindow/forward-single.png \
extras/package/macosx/Resources/mainwindow/forward.png \
extras/package/macosx/Resources/mainwindow/fullscreen-double-buttons-pressed.png \
extras/package/macosx/Resources/mainwindow/fullscreen-double-buttons.png \
......
......@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1050</int>
<string key="IBDocument.SystemVersion">11D50</string>
<string key="IBDocument.SystemVersion">11E53</string>
<string key="IBDocument.InterfaceBuilderVersion">851</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<string key="IBDocument.AppKitVersion">1138.47</string>
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
......@@ -21,16 +21,16 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="4850"/>
<integer value="4722"/>
<integer value="4756"/>
<integer value="915"/>
<integer value="2770"/>
<integer value="235"/>
<integer value="2730"/>
<integer value="4850"/>
<integer value="1617"/>
<integer value="205"/>
<integer value="21"/>
<integer value="4948"/>
<integer value="4596"/>
<integer value="2770"/>
<integer value="4722"/>
<integer value="4948"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -1811,6 +1811,24 @@
</object>
</object>
</object>
<object class="NSMenuItem" id="57503205">
<reference key="NSMenu" ref="1017583928"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="447396056"/>
<reference key="NSMixedImage" ref="100133332"/>
</object>
<object class="NSMenuItem" id="835383299">
<reference key="NSMenu" ref="1017583928"/>
<string key="NSTitle">Show Previous &amp; Next Buttons</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="447396056"/>
<reference key="NSMixedImage" ref="100133332"/>
</object>
</object>
</object>
</object>
......@@ -7971,6 +7989,22 @@ LCAuLi4</string>
</object>
<int key="connectionID">5086</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">toggleJumpButtons:</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="835383299"/>
</object>
<int key="connectionID">5089</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_mi_toggleJumpButtons</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="835383299"/>
</object>
<int key="connectionID">5090</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -8443,6 +8477,8 @@ LCAuLi4</string>
<reference ref="823365566"/>
<reference ref="375871953"/>
<reference ref="261314859"/>
<reference ref="57503205"/>
<reference ref="835383299"/>
</object>
<reference key="parent" ref="565445175"/>
</object>
......@@ -11024,6 +11060,16 @@ LCAuLi4</string>
<reference key="object" ref="454498061"/>
<reference key="parent" ref="701329419"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5087</int>
<reference key="object" ref="57503205"/>
<reference key="parent" ref="1017583928"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5088</int>
<reference key="object" ref="835383299"/>
<reference key="parent" ref="1017583928"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
......@@ -11834,6 +11880,8 @@ LCAuLi4</string>
<string>5004.IBPluginDependency</string>
<string>5005.IBPluginDependency</string>
<string>5084.IBPluginDependency</string>
<string>5087.IBPluginDependency</string>
<string>5088.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>56.ImportedFromIB2</string>
<string>57.IBEditorWindowLastContentRect</string>
......@@ -11895,7 +11943,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{594, 563}, {197, 173}}</string>
<string>{{740, 702}, {197, 173}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12113,7 +12161,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{461, 86}, {222, 363}}</string>
<string>{{663, 482}, {298, 393}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12130,7 +12178,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{653, 166}, {243, 283}}</string>
<string>{{855, 592}, {243, 283}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12289,7 +12337,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{608, 299}, {208, 363}}</string>
<string>{{798, 512}, {208, 363}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12793,6 +12841,8 @@ LCAuLi4</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{329, 186}, {267, 263}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12805,7 +12855,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{387, 419}, {297, 243}}</string>
<string>{{577, 632}, {297, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12849,7 +12899,7 @@ LCAuLi4</string>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">5086</int>
<int key="maxID">5090</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -15655,6 +15705,7 @@ LCAuLi4</string>
<string>showWizard:</string>
<string>toggleFullscreen:</string>
<string>toggleFullscreenDevice:</string>
<string>toggleJumpButtons:</string>
<string>toggleRecord:</string>
<string>toggleVar:</string>
<string>viewAbout:</string>
......@@ -15693,6 +15744,7 @@ LCAuLi4</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
......@@ -15722,6 +15774,7 @@ LCAuLi4</string>
<string>showWizard:</string>
<string>toggleFullscreen:</string>
<string>toggleFullscreenDevice:</string>
<string>toggleJumpButtons:</string>
<string>toggleRecord:</string>
<string>toggleVar:</string>
<string>viewAbout:</string>
......@@ -15823,6 +15876,10 @@ LCAuLi4</string>
<string key="name">toggleFullscreenDevice:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">toggleJumpButtons:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">toggleRecord:</string>
<string key="candidateClassName">id</string>
......@@ -15950,6 +16007,7 @@ LCAuLi4</string>
<string>o_mi_teletext_transparent</string>
<string>o_mi_teletext_yellow</string>
<string>o_mi_title</string>
<string>o_mi_toggleJumpButtons</string>
<string>o_mi_trackSynchronization</string>
<string>o_mi_videoeffects</string>
<string>o_mi_videotrack</string>
......@@ -16100,6 +16158,7 @@ LCAuLi4</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenu</string>
<string>NSMenu</string>
<string>NSMenu</string>
......@@ -16239,6 +16298,7 @@ LCAuLi4</string>
<string>o_mi_teletext_transparent</string>
<string>o_mi_teletext_yellow</string>
<string>o_mi_title</string>
<string>o_mi_toggleJumpButtons</string>
<string>o_mi_trackSynchronization</string>
<string>o_mi_videoeffects</string>
<string>o_mi_videotrack</string>
......@@ -16673,6 +16733,10 @@ LCAuLi4</string>
<string key="name">o_mi_title</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_mi_toggleJumpButtons</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_mi_trackSynchronization</string>
<string key="candidateClassName">NSMenuItem</string>
......
......@@ -270,6 +270,10 @@
CCD83E4D13FEA143004F1652 /* VideoEffects.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E4013FEA143004F1652 /* VideoEffects.xib */; };
CCD83E4E13FEA143004F1652 /* Wizard.xib in Resources */ = {isa = PBXBuildFile; fileRef = CCD83E4213FEA143004F1652 /* Wizard.xib */; };
CCDB535D13E97D3500A1782F /* dropzone-background.png in Resources */ = {isa = PBXBuildFile; fileRef = CCDB535C13E97D3500A1782F /* dropzone-background.png */; };
CCE4057A15655B1900FA5CCA /* forward-pressed-single.png in Resources */ = {isa = PBXBuildFile; fileRef = CCE4057815655B1900FA5CCA /* forward-pressed-single.png */; };
CCE4057B15655B1900FA5CCA /* forward-single.png in Resources */ = {isa = PBXBuildFile; fileRef = CCE4057915655B1900FA5CCA /* forward-single.png */; };
CCE4057F15655B2100FA5CCA /* back-pressed-single.png in Resources */ = {isa = PBXBuildFile; fileRef = CCE4057D15655B2100FA5CCA /* back-pressed-single.png */; };
CCE4058215655B3300FA5CCA /* back-single.png in Resources */ = {isa = PBXBuildFile; fileRef = CCE4058115655B3300FA5CCA /* back-single.png */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -637,6 +641,10 @@
CCD83E4313FEA143004F1652 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/Wizard.xib; sourceTree = "<group>"; };
CCDB535C13E97D3500A1782F /* dropzone-background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "dropzone-background.png"; path = "Resources/mainwindow/dropzone-background.png"; sourceTree = "<group>"; };
CCDBA3B313D32E200006127B /* macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = macosx.m; path = ../../../modules/video_output/macosx.m; sourceTree = "<group>"; };
CCE4057815655B1900FA5CCA /* forward-pressed-single.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "forward-pressed-single.png"; path = "Resources/mainwindow/forward-pressed-single.png"; sourceTree = "<group>"; };
CCE4057915655B1900FA5CCA /* forward-single.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "forward-single.png"; path = "Resources/mainwindow/forward-single.png"; sourceTree = "<group>"; };
CCE4057D15655B2100FA5CCA /* back-pressed-single.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "back-pressed-single.png"; path = "Resources/mainwindow/back-pressed-single.png"; sourceTree = "<group>"; };
CCE4058115655B3300FA5CCA /* back-single.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "back-single.png"; path = "Resources/mainwindow/back-single.png"; sourceTree = "<group>"; };
CCF0777913659A8000AF19FD /* SPInvocationGrabbing.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SPInvocationGrabbing.h; path = ../../../modules/gui/macosx/SPInvocationGrabbing.h; sourceTree = "<group>"; };
CCF0777A13659A8000AF19FD /* SPInvocationGrabbing.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = SPInvocationGrabbing.m; path = ../../../modules/gui/macosx/SPInvocationGrabbing.m; sourceTree = "<group>"; };
CCF0777B13659A8000AF19FD /* SPMediaKeyTap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SPMediaKeyTap.h; path = ../../../modules/gui/macosx/SPMediaKeyTap.h; sourceTree = "<group>"; };
......@@ -925,6 +933,8 @@
children = (
CC04332B13B28B8200D7D52E /* back-pressed.png */,
CC04332C13B28B8200D7D52E /* back.png */,
CCE4057D15655B2100FA5CCA /* back-pressed-single.png */,
CCE4058115655B3300FA5CCA /* back-single.png */,
CC9B43AE13B29C79000205AE /* bottom-background.png */,
CC5800F41423A80400166912 /* bottombar-mini.png */,
CC04332E13B28B8200D7D52E /* effects-double-buttons-blue.png */,
......@@ -934,6 +944,8 @@
CC04333213B28B8200D7D52E /* effects-one-button.png */,
CC04333513B28B8200D7D52E /* forward-pressed.png */,
CC04333613B28B8200D7D52E /* forward.png */,
CCE4057815655B1900FA5CCA /* forward-pressed-single.png */,
CCE4057915655B1900FA5CCA /* forward-single.png */,
CC04333713B28B8200D7D52E /* fullscreen-double-buttons-pressed.png */,
CC04333813B28B8200D7D52E /* fullscreen-double-buttons.png */,
CC0F725015063C820086B6A0 /* fullscreen-one-button-pressed.png */,
......@@ -1543,6 +1555,10 @@
CC0F725715063C980086B6A0 /* fullscreen-one-button_dark.png in Resources */,
CC0F725815063C980086B6A0 /* fullscreen-one-button-pressed_dark.png in Resources */,
CC68B0331544C1AE00FD9C7F /* vlc-xmas.png in Resources */,
CCE4057A15655B1900FA5CCA /* forward-pressed-single.png in Resources */,
CCE4057B15655B1900FA5CCA /* forward-single.png in Resources */,
CCE4057F15655B2100FA5CCA /* back-pressed-single.png in Resources */,
CCE4058215655B3300FA5CCA /* back-single.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
/*****************************************************************************
* MainMenu.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011 Felix Paul Kühne
* Copyright (C) 2011-2012 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
......@@ -102,6 +102,7 @@
IBOutlet NSMenu * o_mu_title;
IBOutlet NSMenuItem * o_mi_chapter;
IBOutlet NSMenu * o_mu_chapter;
IBOutlet NSMenuItem * o_mi_toggleJumpButtons;
IBOutlet NSMenu * o_mu_audio;
IBOutlet NSMenuItem * o_mi_vol_up;
......@@ -212,6 +213,7 @@
- (void)updateRecordState:(BOOL)b_value;
- (IBAction)setPlaybackRate:(id)sender;
- (void)updatePlaybackRate;
- (IBAction)toggleJumpButtons:(id)sender;
- (IBAction)toggleFullscreen:(id)sender;
- (IBAction)resizeVideoWindow:(id)sender;
......
/*****************************************************************************
* MainMenu.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011 Felix Paul Kühne
* Copyright (C) 2011-2012 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
......@@ -281,6 +281,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mi_quitAfterPB setTitle: _NS("Quit after Playback")];
[o_mi_fwd setTitle: _NS("Step Forward")];
[o_mi_bwd setTitle: _NS("Step Backward")];
[o_mi_toggleJumpButtons setTitle: _NS("Show Previous & Next Buttons")];
[o_mi_toggleJumpButtons setState: config_GetInt( VLCIntf, "macosx-show-playback-buttons")];
[o_mi_program setTitle: _NS("Program")];
[o_mu_program setTitle: _NS("Program")];
......@@ -609,8 +611,16 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mi_rate_sld setIntValue: i];
}
- (IBAction)toggleJumpButtons:(id)sender
{
BOOL b_value = !config_GetInt( VLCIntf, "macosx-show-playback-buttons" );
config_PutInt( VLCIntf, "macosx-show-playback-buttons", b_value );
[[[VLCMain sharedInstance] mainWindow] toggleJumpButtons];
[o_mi_toggleJumpButtons setState: b_value];
}
#pragma mark -
#pragma video menu
#pragma mark video menu
- (IBAction)toggleFullscreen:(id)sender
{
[[VLCCoreInteraction sharedInstance] toggleFullscreen];
......
......@@ -94,6 +94,7 @@
BOOL b_splitview_removed;
BOOL b_minimized_view;
BOOL b_video_deco;
BOOL b_show_jump_buttons;
int i_lastSplitViewHeight;
int i_lastShownVolume;
input_state_e cachedInputState;
......@@ -117,6 +118,9 @@
NSTimeInterval last_bwd_event;
BOOL just_triggered_next;
BOOL just_triggered_previous;
NSButton * o_prev_btn;
NSButton * o_next_btn;
NSMutableArray *o_sidebaritems;
BOOL b_nonembedded;
......@@ -171,6 +175,7 @@
- (void)setRepeatAll;
- (void)setRepeatOff;
- (void)setShuffle;
- (void)toggleJumpButtons;
- (void)drawFancyGradientEffectForTimeSlider;
......
......@@ -277,6 +277,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_volume_sld setEnabled: b_mute];
[o_volume_up_btn setEnabled: b_mute];
b_show_jump_buttons = config_GetInt( VLCIntf, "macosx-show-playback-buttons" );
if (b_show_jump_buttons)
[self addJumpButtons];
/* interface builder action */
float f_threshold_height = f_min_video_height + [o_bottombar_view frame].size.height;
if( b_dark_interface )
......@@ -585,6 +589,130 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
#pragma mark -
#pragma mark interface customization
- (void)toggleJumpButtons
{
b_show_jump_buttons = config_GetInt( VLCIntf, "macosx-show-playback-buttons" );
if (b_show_jump_buttons)
[self addJumpButtons];
else
[self removeJumpButtons];
}
- (void)addJumpButtons
{
NSRect preliminaryFrame = [o_bwd_btn frame];
BOOL b_enabled = [o_bwd_btn isEnabled];
preliminaryFrame.size.width = 26.;
o_prev_btn = [[NSButton alloc] initWithFrame:preliminaryFrame];
[o_prev_btn setButtonType: NSMomentaryChangeButton];
[o_prev_btn setImage: [NSImage imageNamed:@"back-single"]];
[o_prev_btn setAlternateImage: [NSImage imageNamed:@"back-pressed-single"]];
[o_prev_btn setBezelStyle:NSRegularSquareBezelStyle];
[o_prev_btn setBordered:NO];
[o_prev_btn setTarget:self];
[o_prev_btn setAction:@selector(prev:)];
[o_prev_btn setToolTip: _NS("Previous")];
[o_prev_btn setEnabled: b_enabled];
o_next_btn = [[NSButton alloc] initWithFrame:preliminaryFrame];
[o_next_btn setButtonType: NSMomentaryChangeButton];
[o_next_btn setImage: [NSImage imageNamed:@"forward-single"]];
[o_next_btn setAlternateImage: [NSImage imageNamed:@"forward-pressed-single"]];
[o_next_btn setBezelStyle:NSRegularSquareBezelStyle];
[o_next_btn setBordered:NO];
[o_next_btn setTarget:self];
[o_next_btn setAction:@selector(next:)];
[o_next_btn setToolTip: _NS("Next")];
[o_next_btn setEnabled: b_enabled];
NSRect frame;
float f_space = 32.;
#define moveItem( item ) \
frame = [item frame]; \
frame.origin.x = frame.origin.x + f_space; \
[item setFrame: frame]
moveItem( o_bwd_btn );
moveItem( o_play_btn );
moveItem( o_fwd_btn );
f_space = 62.;
moveItem( o_stop_btn );
moveItem( o_playlist_btn );
moveItem( o_repeat_btn );
moveItem( o_shuffle_btn );
#undef moveItem
#define resizeItem( item ) \
frame = [item frame]; \
frame.size.width = frame.size.width - f_space; \
frame.origin.x = frame.origin.x + f_space; \
[item setFrame: frame]
resizeItem( o_time_sld );
resizeItem( o_progress_bar );
resizeItem( o_time_sld_background );
resizeItem( o_time_sld_fancygradient_view );
#undef resizeItem
preliminaryFrame.origin.x = [o_fwd_btn frame].origin.x + [o_fwd_btn frame].size.width + 4.;
[o_next_btn setFrame: preliminaryFrame];
[[self contentView] addSubview: o_prev_btn];
[[self contentView] addSubview: o_next_btn];
[o_fwd_btn setAction:@selector(forward:)];
[o_bwd_btn setAction:@selector(backward:)];
}
- (void)removeJumpButtons
{
if (!o_prev_btn || !o_next_btn )
return;
[[o_prev_btn animator] setHidden: YES];
[[o_next_btn animator] setHidden: YES];
[o_prev_btn removeFromSuperviewWithoutNeedingDisplay];
[o_next_btn removeFromSuperviewWithoutNeedingDisplay];
[o_prev_btn release];
[o_next_btn release];
NSRect frame;
float f_space = 32.;
#define moveItem( item ) \
frame = [item frame]; \
frame.origin.x = frame.origin.x - f_space; \
[item setFrame: frame]
moveItem( o_bwd_btn );
moveItem( o_play_btn );
moveItem( o_fwd_btn );
f_space = 62.;
moveItem( o_stop_btn );
moveItem( o_playlist_btn );
moveItem( o_repeat_btn );
moveItem( o_shuffle_btn );
#undef moveItem
#define resizeItem( item ) \
frame = [item frame]; \
frame.size.width = frame.size.width + f_space; \
frame.origin.x = frame.origin.x - f_space; \
[item setFrame: frame]
resizeItem( o_time_sld );
resizeItem( o_progress_bar );
resizeItem( o_time_sld_background );
resizeItem( o_time_sld_fancygradient_view );
#undef resizeItem
[o_bottombar_view setNeedsDisplay:YES];
[o_fwd_btn setAction:@selector(fwd:)];
[o_bwd_btn setAction:@selector(bwd:)];
}
#pragma mark -
#pragma mark Button Actions
......@@ -609,6 +737,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
just_triggered_previous = NO;
}
- (IBAction)prev:(id)sender
{
[[VLCCoreInteraction sharedInstance] previous];
}
- (IBAction)bwd:(id)sender
{
if(!just_triggered_previous)
......@@ -632,6 +765,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
- (IBAction)backward:(id)sender
{
[[VLCCoreInteraction sharedInstance] backwardShort];
}
- (void)resetNextButton
{
if (([NSDate timeIntervalSinceReferenceDate] - last_fwd_event) >= 0.35) {
......@@ -648,6 +786,16 @@ static VLCMainWindow *_o_sharedInstance = nil;
just_triggered_next = NO;
}
- (IBAction)next:(id)sender
{
[[VLCCoreInteraction sharedInstance] next];
}
- (IBAction)forward:(id)sender
{
[[VLCCoreInteraction sharedInstance] forwardShort];
}
- (IBAction)fwd:(id)sender
{
if(!just_triggered_next)
......@@ -1402,6 +1550,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_stop_btn setEnabled: b_input];
[o_fwd_btn setEnabled: (b_seekable || b_plmul || b_chapters)];
[o_bwd_btn setEnabled: (b_seekable || b_plmul || b_chapters)];
if (b_show_jump_buttons)
{
[o_prev_btn setEnabled: (b_seekable || b_plmul || b_chapters)];
[o_next_btn setEnabled: (b_seekable || b_plmul || b_chapters)];
}
if (b_video_deco)
{
[o_detached_fwd_btn setEnabled: (b_seekable || b_plmul || b_chapters)];
......
......@@ -102,10 +102,13 @@ void WindowClose ( vout_window_t * );
#define PAUSE_MINIMIZED_LONGTEXT N_( \
"With this option enabled, the playback will be automatically paused when minimizing the window." )
#define ICONCHANGE_TEXT N_( "Allow automatic icon changes")
#define ICONCHANGE_LONGTEXT N_( "This option allows the interface to change its icon on various occasions.")
#define ICONCHANGE_TEXT N_( "Allow automatic icon changes" )
#define ICONCHANGE_LONGTEXT N_( "This option allows the interface to change its icon on various occasions." )
#define LOCK_ASPECT_RATIO_TEXT N_("Lock Aspect Ratio")
#define LOCK_ASPECT_RATIO_TEXT N_( "Lock Aspect Ratio" )
#define JUMPBUTTONS_TEXT N_( "Shows playlist item control buttons" )
#define JUMPBUTTONS_LONGTEXT N_("Shows the previous and next buttons in the main window" )
vlc_module_begin ()
set_description( N_("Mac OS X interface") )
......@@ -129,6 +132,7 @@ vlc_module_begin ()
add_bool( "macosx-pause-minimized", false, PAUSE_MINIMIZED_TEXT, PAUSE_MINIMIZED_LONGTEXT, false )
add_bool( "macosx-lock-aspect-ratio", true, LOCK_ASPECT_RATIO_TEXT, LOCK_ASPECT_RATIO_TEXT, true )
add_bool( "macosx-icon-change", true, ICONCHANGE_TEXT, ICONCHANGE_LONGTEXT, true )
add_bool( "macosx-show-playback-buttons", false, JUMPBUTTONS_TEXT, JUMPBUTTONS_LONGTEXT, false )
add_submodule ()
set_description( "Mac OS X Video Output Provider" )
......
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