Commit b021f08d authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx: re-arranged the audio and video menus to look similar to the Qt4...

macosx: re-arranged the audio and video menus to look similar to the Qt4 interface. Additionally, implemented an 'Open File...' item in the subtitles-submenu
parent 47801e51
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
}, },
{ {
ACTIONS = { ACTIONS = {
addSubtitleFile = id;
backward = id; backward = id;
faster = id; faster = id;
forward = id; forward = id;
...@@ -215,6 +216,7 @@ ...@@ -215,6 +216,7 @@
"o_main_pgbar" = NSProgressIndicator; "o_main_pgbar" = NSProgressIndicator;
"o_messages" = id; "o_messages" = id;
"o_mi_about" = NSMenuItem; "o_mi_about" = NSMenuItem;
"o_mi_addSub" = NSMenuItem;
"o_mi_add_intf" = NSMenuItem; "o_mi_add_intf" = NSMenuItem;
"o_mi_aspect_ratio" = NSMenuItem; "o_mi_aspect_ratio" = NSMenuItem;
"o_mi_audiotrack" = NSMenuItem; "o_mi_audiotrack" = NSMenuItem;
...@@ -286,7 +288,6 @@ ...@@ -286,7 +288,6 @@
"o_mi_show_all" = NSMenuItem; "o_mi_show_all" = NSMenuItem;
"o_mi_slower" = NSMenuItem; "o_mi_slower" = NSMenuItem;
"o_mi_snapshot" = NSMenuItem; "o_mi_snapshot" = NSMenuItem;
"o_mi_sprefs" = NSMenuItem;
"o_mi_stop" = NSMenuItem; "o_mi_stop" = NSMenuItem;
"o_mi_subtitle" = NSMenuItem; "o_mi_subtitle" = NSMenuItem;
"o_mi_teletext" = NSMenuItem; "o_mi_teletext" = NSMenuItem;
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>402 63 356 240 0 0 1280 778 </string> <string>246 207 356 240 0 0 1280 778 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>29</key> <key>29</key>
<string>69 318 438 44 0 0 1280 778 </string> <string>391 728 438 44 0 0 1280 778 </string>
<key>3568</key> <key>3568</key>
<string>476 535 328 85 0 0 1280 778 </string> <string>476 535 328 85 0 0 1280 778 </string>
<key>915</key> <key>915</key>
...@@ -21,12 +21,8 @@ ...@@ -21,12 +21,8 @@
<integer>4</integer> <integer>4</integer>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>282</integer>
<integer>915</integer>
<integer>29</integer>
<integer>3568</integer> <integer>3568</integer>
<integer>3706</integer> <integer>29</integer>
<integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>9G55</string> <string>9G55</string>
......
/***************************************************************************** /*****************************************************************************
* controls.h: MacOS X interface module * controls.h: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2007 the VideoLAN team * Copyright (C) 2002-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
* Felix Kühne <fkuehne at videolan org> * Felix Paul Kühne <fkuehne at videolan org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -86,11 +86,12 @@ ...@@ -86,11 +86,12 @@
- (IBAction)showPosition: (id)sender; - (IBAction)showPosition: (id)sender;
- (IBAction)toogleFullscreen:(id)sender; - (IBAction)toogleFullscreen:(id)sender;
- (BOOL) isFullscreen; - (BOOL)isFullscreen;
- (IBAction)windowAction:(id)sender; - (IBAction)windowAction:(id)sender;
- (IBAction)telxTransparent:(id)sender; - (IBAction)telxTransparent:(id)sender;
- (IBAction)telxNavLink:(id)sender; - (IBAction)telxNavLink:(id)sender;
- (IBAction)addSubtitleFile:(id)sender;
- (BOOL)keyEvent:(NSEvent *)o_event; - (BOOL)keyEvent:(NSEvent *)o_event;
- (void)scrollWheel: (NSEvent *)theEvent; - (void)scrollWheel: (NSEvent *)theEvent;
......
/***************************************************************************** /*****************************************************************************
* controls.m: MacOS X interface module * controls.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2007 the VideoLAN team * Copyright (C) 2002-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
* Derk-Jan Hartman <hartman at videolan dot org> * Derk-Jan Hartman <hartman at videolan dot org>
* Benjamin Pracht <bigben at videolan doit org> * Benjamin Pracht <bigben at videolan doit org>
* Felix Kühne <fkuehne at videolan dot org> * Felix Paul Kühne <fkuehne at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -532,7 +532,7 @@ ...@@ -532,7 +532,7 @@
} }
} }
- (IBAction)telxNavLink:(id)sender; - (IBAction)telxNavLink:(id)sender
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
vlc_object_t *p_vbi; vlc_object_t *p_vbi;
...@@ -559,6 +559,43 @@ ...@@ -559,6 +559,43 @@
} }
} }
- (IBAction)addSubtitleFile:(id)sender
{
NSInteger i_returnValue = 0;
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( !p_input ) return;
input_item_t *p_item = input_GetItem( p_input );
if( !p_item ) return;
char *path = input_item_GetURI( p_item );
if( !path ) path = strdup( "" );
NSOpenPanel * openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseFiles: YES];
[openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES];
i_returnValue = [openPanel runModalForDirectory: [NSString stringWithUTF8String: path] file: nil types: [NSArray arrayWithObjects: @"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi", nil]];
free( path );
if( i_returnValue == NSOKButton )
{
NSUInteger c = 0;
if( !p_input ) return;
c = [[openPanel filenames] count];
NSLog( @"count: %i", c );
for (int i = 0; [[openPanel filenames] count] > i ; i++)
{
msg_Dbg( VLCIntf, "loading subs from %s", [[[openPanel filenames] objectAtIndex: i] UTF8String] );
if( input_AddSubtitle( p_input, [[[openPanel filenames] objectAtIndex: i] UTF8String], TRUE ) )
msg_Warn( VLCIntf, "unable to load subtitles from '%s'",
[[[openPanel filenames] objectAtIndex: i] UTF8String] );
i++;
}
}
}
- (void)scrollWheel:(NSEvent *)theEvent - (void)scrollWheel:(NSEvent *)theEvent
{ {
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
...@@ -754,6 +791,17 @@ ...@@ -754,6 +791,17 @@
/* make (un)sensitive */ /* make (un)sensitive */
[o_parent setEnabled: ( val_list.p_list->i_count > 1 )]; [o_parent setEnabled: ( val_list.p_list->i_count > 1 )];
/* special case for the subtitles items */
if( [[o_parent title] isEqualToString: _NS("Subtitles Track")] == YES )
{
NSMenuItem * o_lmi_tmp;
o_lmi_tmp = [o_menu addItemWithTitle: _NS("Open File...") action: @selector(addSubtitleFile:) keyEquivalent: @""];
[o_lmi_tmp setTarget: self];
[o_lmi_tmp setEnabled: YES];
[o_parent setEnabled: YES];
[o_menu addItem: [NSMenuItem separatorItem]];
}
for( i = 0; i < val_list.p_list->i_count; i++ ) for( i = 0; i < val_list.p_list->i_count; i++ )
{ {
vlc_value_t another_val; vlc_value_t another_val;
...@@ -803,6 +851,14 @@ ...@@ -803,6 +851,14 @@
} }
} }
/* special case for the subtitles sub-menu
* In case that we don't have any subs, we don't want a separator item at the end */
if( [[o_parent title] isEqualToString: _NS("Subtitles Track")] == YES )
{
if( [o_menu numberOfItems] == 2 )
[o_menu removeItemAtIndex: 1];
}
/* clean up everything */ /* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string ); if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list ); var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
......
...@@ -258,6 +258,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned ); ...@@ -258,6 +258,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
IBOutlet NSMenu * o_mu_crop; IBOutlet NSMenu * o_mu_crop;
IBOutlet NSMenuItem * o_mi_subtitle; IBOutlet NSMenuItem * o_mi_subtitle;
IBOutlet NSMenu * o_mu_subtitle; IBOutlet NSMenu * o_mu_subtitle;
IBOutlet NSMenuItem * o_mi_addSub;
IBOutlet NSMenuItem * o_mi_deinterlace; IBOutlet NSMenuItem * o_mi_deinterlace;
IBOutlet NSMenu * o_mu_deinterlace; IBOutlet NSMenu * o_mu_deinterlace;
IBOutlet NSMenuItem * o_mi_ffmpeg_pp; IBOutlet NSMenuItem * o_mi_ffmpeg_pp;
......
...@@ -590,8 +590,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -590,8 +590,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mu_chapter setTitle: _NS("Chapter")]; [o_mu_chapter setTitle: _NS("Chapter")];
[o_mu_audio setTitle: _NS("Audio")]; [o_mu_audio setTitle: _NS("Audio")];
[o_mi_vol_up setTitle: _NS("Volume Up")]; [o_mi_vol_up setTitle: _NS("Increase Volume")];
[o_mi_vol_down setTitle: _NS("Volume Down")]; [o_mi_vol_down setTitle: _NS("Decrease Volume")];
[o_mi_mute setTitle: _NS("Mute")]; [o_mi_mute setTitle: _NS("Mute")];
[o_mi_audiotrack setTitle: _NS("Audio Track")]; [o_mi_audiotrack setTitle: _NS("Audio Track")];
[o_mu_audiotrack setTitle: _NS("Audio Track")]; [o_mu_audiotrack setTitle: _NS("Audio Track")];
...@@ -620,6 +620,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -620,6 +620,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mu_screen setTitle: _NS("Fullscreen Video Device")]; [o_mu_screen setTitle: _NS("Fullscreen Video Device")];
[o_mi_subtitle setTitle: _NS("Subtitles Track")]; [o_mi_subtitle setTitle: _NS("Subtitles Track")];
[o_mu_subtitle setTitle: _NS("Subtitles Track")]; [o_mu_subtitle setTitle: _NS("Subtitles Track")];
[o_mi_addSub setTitle: _NS("Open File...")];
[o_mi_deinterlace setTitle: _NS("Deinterlace")]; [o_mi_deinterlace setTitle: _NS("Deinterlace")];
[o_mu_deinterlace setTitle: _NS("Deinterlace")]; [o_mu_deinterlace setTitle: _NS("Deinterlace")];
[o_mi_ffmpeg_pp setTitle: _NS("Post processing")]; [o_mi_ffmpeg_pp setTitle: _NS("Post processing")];
...@@ -1755,6 +1756,10 @@ end: ...@@ -1755,6 +1756,10 @@ end:
[o_controls setupVarMenuItem: o_mi_subtitle target: (vlc_object_t *)p_input [o_controls setupVarMenuItem: o_mi_subtitle target: (vlc_object_t *)p_input
var: "spu-es" selector: @selector(toggleVar:)]; var: "spu-es" selector: @selector(toggleVar:)];
/* special case for "Open File" inside the subtitles menu item */
if( [o_mi_videotrack isEnabled] == YES )
[o_mi_subtitle setEnabled: YES];
aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT, aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_aout != NULL ) if( p_aout != NULL )
...@@ -1910,6 +1915,7 @@ end: ...@@ -1910,6 +1915,7 @@ end:
[o_mi_screen setEnabled: b_enabled]; [o_mi_screen setEnabled: b_enabled];
[o_mi_aspect_ratio setEnabled: b_enabled]; [o_mi_aspect_ratio setEnabled: b_enabled];
[o_mi_crop setEnabled: b_enabled]; [o_mi_crop setEnabled: b_enabled];
[o_mi_teletext setEnabled: b_enabled];
} }
- (IBAction)timesliderUpdate:(id)sender - (IBAction)timesliderUpdate:(id)sender
......
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