Commit d1b7c01a authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added an option to hide the playmode buttons (displayed by default)

option can be set through the 'Playback' menu due to the lack of a 'View' menu and in the advanced preferences

changes take effect immediatelly

This is preliminary artwork, which will be improved shortly
parent 5003db86
......@@ -21,16 +21,16 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="4756"/>
<integer value="915"/>
<integer value="2770"/>
<integer value="235"/>
<integer value="2730"/>
<integer value="4850"/>
<integer value="1617"/>
<integer value="4596"/>
<integer value="4722"/>
<integer value="4948"/>
<integer value="4756"/>
<integer value="915"/>
<integer value="1617"/>
<integer value="4596"/>
<integer value="235"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -1829,6 +1829,14 @@
<reference key="NSOnImage" ref="447396056"/>
<reference key="NSMixedImage" ref="100133332"/>
</object>
<object class="NSMenuItem" id="833088677">
<reference key="NSMenu" ref="1017583928"/>
<string key="NSTitle">Show Shuffle &amp; Repeat Buttons</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="447396056"/>
<reference key="NSMixedImage" ref="100133332"/>
</object>
</object>
</object>
</object>
......@@ -8005,6 +8013,22 @@ LCAuLi4</string>
</object>
<int key="connectionID">5090</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_mi_togglePlaymodeButtons</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="833088677"/>
</object>
<int key="connectionID">5093</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">togglePlaymodeButtons:</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="833088677"/>
</object>
<int key="connectionID">5094</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -8479,6 +8503,7 @@ LCAuLi4</string>
<reference ref="261314859"/>
<reference ref="57503205"/>
<reference ref="835383299"/>
<reference ref="833088677"/>
</object>
<reference key="parent" ref="565445175"/>
</object>
......@@ -11070,6 +11095,11 @@ LCAuLi4</string>
<reference key="object" ref="835383299"/>
<reference key="parent" ref="1017583928"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5091</int>
<reference key="object" ref="833088677"/>
<reference key="parent" ref="1017583928"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
......@@ -11882,6 +11912,7 @@ LCAuLi4</string>
<string>5084.IBPluginDependency</string>
<string>5087.IBPluginDependency</string>
<string>5088.IBPluginDependency</string>
<string>5091.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>56.ImportedFromIB2</string>
<string>57.IBEditorWindowLastContentRect</string>
......@@ -12161,7 +12192,7 @@ LCAuLi4</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{663, 482}, {298, 393}}</string>
<string>{{663, 462}, {302, 413}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12843,6 +12874,7 @@ 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>
<boolean value="YES"/>
<string>{{329, 186}, {267, 263}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -12899,7 +12931,7 @@ LCAuLi4</string>
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">5090</int>
<int key="maxID">5094</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -15706,6 +15738,7 @@ LCAuLi4</string>
<string>toggleFullscreen:</string>
<string>toggleFullscreenDevice:</string>
<string>toggleJumpButtons:</string>
<string>togglePlaymodeButtons:</string>
<string>toggleRecord:</string>
<string>toggleVar:</string>
<string>viewAbout:</string>
......@@ -15745,6 +15778,7 @@ LCAuLi4</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
......@@ -15775,6 +15809,7 @@ LCAuLi4</string>
<string>toggleFullscreen:</string>
<string>toggleFullscreenDevice:</string>
<string>toggleJumpButtons:</string>
<string>togglePlaymodeButtons:</string>
<string>toggleRecord:</string>
<string>toggleVar:</string>
<string>viewAbout:</string>
......@@ -15880,6 +15915,10 @@ LCAuLi4</string>
<string key="name">toggleJumpButtons:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">togglePlaymodeButtons:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">toggleRecord:</string>
<string key="candidateClassName">id</string>
......@@ -16008,6 +16047,7 @@ LCAuLi4</string>
<string>o_mi_teletext_yellow</string>
<string>o_mi_title</string>
<string>o_mi_toggleJumpButtons</string>
<string>o_mi_togglePlaymodeButtons</string>
<string>o_mi_trackSynchronization</string>
<string>o_mi_videoeffects</string>
<string>o_mi_videotrack</string>
......@@ -16159,6 +16199,7 @@ LCAuLi4</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenuItem</string>
<string>NSMenu</string>
<string>NSMenu</string>
<string>NSMenu</string>
......@@ -16299,6 +16340,7 @@ LCAuLi4</string>
<string>o_mi_teletext_yellow</string>
<string>o_mi_title</string>
<string>o_mi_toggleJumpButtons</string>
<string>o_mi_togglePlaymodeButtons</string>
<string>o_mi_trackSynchronization</string>
<string>o_mi_videoeffects</string>
<string>o_mi_videotrack</string>
......@@ -16737,6 +16779,10 @@ LCAuLi4</string>
<string key="name">o_mi_toggleJumpButtons</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_mi_togglePlaymodeButtons</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo">
<string key="name">o_mi_trackSynchronization</string>
<string key="candidateClassName">NSMenuItem</string>
......
......@@ -103,6 +103,7 @@
IBOutlet NSMenuItem * o_mi_chapter;
IBOutlet NSMenu * o_mu_chapter;
IBOutlet NSMenuItem * o_mi_toggleJumpButtons;
IBOutlet NSMenuItem * o_mi_togglePlaymodeButtons;
IBOutlet NSMenu * o_mu_audio;
IBOutlet NSMenuItem * o_mi_vol_up;
......@@ -214,6 +215,7 @@
- (IBAction)setPlaybackRate:(id)sender;
- (void)updatePlaybackRate;
- (IBAction)toggleJumpButtons:(id)sender;
- (IBAction)togglePlaymodeButtons:(id)sender;
- (IBAction)toggleFullscreen:(id)sender;
- (IBAction)resizeVideoWindow:(id)sender;
......
......@@ -283,6 +283,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[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_togglePlaymodeButtons setTitle: _NS("Show Shuffle & Repeat Buttons")];
[o_mi_togglePlaymodeButtons setState: config_GetInt( VLCIntf, "macosx-show-playmode-buttons")];
[o_mi_program setTitle: _NS("Program")];
[o_mu_program setTitle: _NS("Program")];
......@@ -619,6 +621,14 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mi_toggleJumpButtons setState: b_value];
}
- (IBAction)togglePlaymodeButtons:(id)sender
{
BOOL b_value = !config_GetInt( VLCIntf, "macosx-show-playmode-buttons" );
config_PutInt( VLCIntf, "macosx-show-playmode-buttons", b_value );
[[[VLCMain sharedInstance] mainWindow] togglePlaymodeButtons];
[o_mi_togglePlaymodeButtons setState: b_value];
}
#pragma mark -
#pragma mark video menu
- (IBAction)toggleFullscreen:(id)sender
......
......@@ -95,6 +95,7 @@
BOOL b_minimized_view;
BOOL b_video_deco;
BOOL b_show_jump_buttons;
BOOL b_show_playmode_buttons;
int i_lastSplitViewHeight;
int i_lastShownVolume;
input_state_e cachedInputState;
......@@ -176,6 +177,7 @@
- (void)setRepeatOff;
- (void)setShuffle;
- (void)toggleJumpButtons;
- (void)togglePlaymodeButtons;
- (void)drawFancyGradientEffectForTimeSlider;
......
......@@ -631,7 +631,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
#define moveItem( item ) \
frame = [item frame]; \
frame.origin.x = frame.origin.x + f_space; \
[item setFrame: frame]
[[item animator] setFrame: frame]
moveItem( o_bwd_btn );
moveItem( o_play_btn );
......@@ -647,7 +647,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
frame = [item frame]; \
frame.size.width = frame.size.width - f_space; \
frame.origin.x = frame.origin.x + f_space; \
[item setFrame: frame]
[[item animator] setFrame: frame]
resizeItem( o_time_sld );
resizeItem( o_progress_bar );
......@@ -655,10 +655,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
resizeItem( o_time_sld_fancygradient_view );
#undef resizeItem
preliminaryFrame.origin.x = [o_fwd_btn frame].origin.x + [o_fwd_btn frame].size.width + 4.;
preliminaryFrame.origin.x = [o_next_btn frame].origin.x + 80. + [o_fwd_btn frame].size.width;
[o_next_btn setFrame: preliminaryFrame];
[[self contentView] addSubview: o_prev_btn];
[[self contentView] addSubview: o_next_btn];
// wait until the animation is done
[[self contentView] performSelector:@selector(addSubview:) withObject:o_prev_btn afterDelay:.2];
[[self contentView] performSelector:@selector(addSubview:) withObject:o_next_btn afterDelay:.2];
[o_fwd_btn setAction:@selector(forward:)];
[o_bwd_btn setAction:@selector(backward:)];
......@@ -681,7 +683,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
#define moveItem( item ) \
frame = [item frame]; \
frame.origin.x = frame.origin.x - f_space; \
[item setFrame: frame]
[[item animator] setFrame: frame]
moveItem( o_bwd_btn );
moveItem( o_play_btn );
......@@ -697,7 +699,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
frame = [item frame]; \
frame.size.width = frame.size.width + f_space; \
frame.origin.x = frame.origin.x - f_space; \
[item setFrame: frame]
[[item animator] setFrame: frame]
resizeItem( o_time_sld );
resizeItem( o_progress_bar );
......@@ -711,6 +713,61 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_bwd_btn setAction:@selector(bwd:)];
}
- (void)togglePlaymodeButtons
{
b_show_playmode_buttons = config_GetInt( VLCIntf, "macosx-show-playmode-buttons" );
if (b_show_playmode_buttons)
[self addPlaymodeButtons];
else
[self removePlaymodeButtons];
}
- (void)addPlaymodeButtons
{
NSRect frame;
float f_space = [o_repeat_btn frame].size.width + [o_shuffle_btn frame].size.width - 6.;
// FIXME: switch o_playlist_btn artwork
#define resizeItem( item ) \
frame = [item frame]; \
frame.size.width = frame.size.width - f_space; \
frame.origin.x = frame.origin.x + f_space; \
[[item animator] setFrame: frame]
resizeItem( o_time_sld );
resizeItem( o_progress_bar );
resizeItem( o_time_sld_background );
resizeItem( o_time_sld_fancygradient_view );
#undef resizeItem
[[o_repeat_btn animator] setHidden: NO];
[[o_shuffle_btn animator] setHidden: NO];
}
- (void)removePlaymodeButtons
{
NSRect frame;
float f_space = [o_repeat_btn frame].size.width + [o_shuffle_btn frame].size.width - 6.;
[o_repeat_btn setHidden: YES];
[o_shuffle_btn setHidden: YES];
// FIXME: switch o_playlist_btn artwork
#define resizeItem( item ) \
frame = [item frame]; \
frame.size.width = frame.size.width + f_space; \
frame.origin.x = frame.origin.x - f_space; \
[[item animator] setFrame: frame]
resizeItem( o_time_sld );
resizeItem( o_progress_bar );
resizeItem( o_time_sld_background );
resizeItem( o_time_sld_fancygradient_view );
#undef resizeItem
}
#pragma mark -
#pragma mark Button Actions
......
......@@ -108,7 +108,10 @@ void WindowClose ( vout_window_t * );
#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" )
#define JUMPBUTTONS_LONGTEXT N_( "Shows the previous and next buttons in the main window" )
#define PLAYMODEBUTTONS_TEXT N_( "Show play mode control buttons" )
#define PLAYMODEBUTTONS_LONGTEXT N_( "Shows the shuffle and repeat buttons in the main window" )
vlc_module_begin ()
set_description( N_("Mac OS X interface") )
......@@ -133,6 +136,7 @@ vlc_module_begin ()
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_bool( "macosx-show-playmode-buttons", true, PLAYMODEBUTTONS_TEXT, PLAYMODEBUTTONS_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