Commit 4f6155f2 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

ALL: autogenerated menu's for chapter,title,program,audio-es,spu-es and video-es.

  - video-es seems broken. it always starts with -1 (Disabled) selected.
  - moved some menuitems to other menu's for gui interface consistency with
    other gui's.
  - added a "fit to screen" menuitem.
parent 4effacde
......@@ -30,11 +30,6 @@
prev = id;
slower = id;
stop = id;
toggleChapter = id;
toggleLanguage = id;
toggleProgram = id;
toggleSubtitle = id;
toggleTitle = id;
toggleVar = id;
volumeDown = id;
volumeSliderUpdated = id;
......@@ -92,6 +87,7 @@
"o_info_window" = id;
"o_messages" = id;
"o_mi_about" = id;
"o_mi_audiotrack" = id;
"o_mi_bring_atf" = id;
"o_mi_bwd" = id;
"o_mi_channels" = id;
......@@ -105,6 +101,7 @@
"o_mi_device" = id;
"o_mi_double_window" = id;
"o_mi_faster" = id;
"o_mi_fittoscreen" = id;
"o_mi_floatontop" = id;
"o_mi_fullscreen" = id;
"o_mi_fwd" = id;
......@@ -112,7 +109,6 @@
"o_mi_hide" = id;
"o_mi_hide_others" = id;
"o_mi_info" = id;
"o_mi_language" = id;
"o_mi_license" = id;
"o_mi_loop" = id;
"o_mi_messages" = id;
......@@ -142,6 +138,7 @@
"o_mi_stop" = id;
"o_mi_subtitle" = id;
"o_mi_title" = id;
"o_mi_videotrack" = id;
"o_mi_vol_down" = id;
"o_mi_vol_up" = id;
"o_mi_website" = id;
......
......@@ -24,7 +24,6 @@
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>1411</integer>
</array>
<key>IBSystem Version</key>
<string>6L29</string>
......
......@@ -2,7 +2,7 @@
* applescript.m: MacOS X AppleScript support
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: applescript.m,v 1.1 2003/03/06 11:43:07 hartman Exp $
* $Id: applescript.m,v 1.2 2003/05/08 01:16:57 hartman Exp $
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
......@@ -119,7 +119,7 @@
}
else if ( [o_command isEqualToString:@"fullscreen"] )
{
[o_controls fullscreen:self];
/*FIXME*/ [o_controls fullscreen:self];
return nil;
}
else if ( [o_command isEqualToString:@"mute"] )
......
......@@ -2,7 +2,7 @@
* controls.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.h,v 1.3 2003/05/06 20:12:28 hartman Exp $
* $Id: controls.h,v 1.4 2003/05/08 01:16:57 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -55,10 +55,6 @@
- (IBAction)windowAction:(id)sender;
- (IBAction)deinterlace:(id)sender;
- (IBAction)toggleProgram:(id)sender;
- (IBAction)toggleTitle:(id)sender;
- (IBAction)toggleChapter:(id)sender;
- (IBAction)toggleLanguage:(id)sender;
- (IBAction)toggleVar:(id)sender;
@end
\ No newline at end of file
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.m,v 1.36 2003/05/06 20:12:28 hartman Exp $
* $Id: controls.m,v 1.37 2003/05/08 01:16:57 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -349,6 +349,11 @@
[o_window scaleWindowWithFactor: 2.0];
else if( [o_title isEqualToString: _NS("Float On Top") ] )
[o_window toggleFloatOnTop];
else if( [o_title isEqualToString: _NS("Fit To Screen") ] )
{
if( ![o_window isZoomed] )
[o_window performZoom:self];
}
}
}
vlc_object_release( (vlc_object_t *)p_vout );
......@@ -372,198 +377,6 @@
}
}
- (IBAction)toggleProgram:(id)sender
{
NSMenuItem * o_mi = (NSMenuItem *)sender;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
if( [o_mi state] == NSOffState )
{
u16 i_program_id = [o_mi tag];
input_ChangeProgram( p_playlist->p_input, i_program_id );
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PLAY );
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
- (IBAction)toggleTitle:(id)sender
{
NSMenuItem * o_mi = (NSMenuItem *)sender;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
if( [o_mi state] == NSOffState )
{
int i_title = [o_mi tag];
#define p_input p_playlist->p_input
input_ChangeArea( p_input, p_input->stream.pp_areas[i_title] );
input_SetStatus( p_input, INPUT_STATUS_PLAY );
#undef p_input
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
- (IBAction)toggleChapter:(id)sender
{
NSMenuItem * o_mi = (NSMenuItem *)sender;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
if( [o_mi state] == NSOffState )
{
int i_chapter = [o_mi tag];
#define p_input p_playlist->p_input
p_input->stream.p_selected_area->i_part = i_chapter;
input_ChangeArea( p_input, p_input->stream.p_selected_area );
input_SetStatus( p_input, INPUT_STATUS_PLAY );
#undef p_input
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
- (IBAction)toggleLanguage:(id)sender
{
NSMenuItem * o_mi = (NSMenuItem *)sender;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
#if 0
/* We do not use this code, because you need to start stop .avi for
* it to work, so not very useful now --hartman */
if ( [o_mi state] == NSOffState && [o_mi tag] == 2000 )
{
NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
[o_open_panel setAllowsMultipleSelection: NO];
[o_open_panel setTitle: _NS("Open subtitle file")];
[o_open_panel setPrompt: _NS("Open")];
if( [o_open_panel runModalForDirectory: nil
file: nil types: nil] == NSOKButton )
{
NSString *o_filename = [[o_open_panel filenames] objectAtIndex: 0];
config_PutPsz( p_intf, "sub-file", strdup( [o_filename cString] ));
}
}
#endif
#define p_input p_playlist->p_input
if( !p_intf->p_sys->b_audio_update )
{
NSValue * o_value = [o_mi representedObject];
es_descriptor_t * p_es = [o_value pointerValue];
if( [o_mi state] == NSOnState )
{
/* we just have one ES to disable */
input_ToggleES( p_input, p_es, 0 );
}
else
{
unsigned int i;
int i_cat = [o_mi tag];
vlc_mutex_lock( &p_input->stream.stream_lock );
#define ES p_input->stream.pp_selected_es[i]
/* unselect the selected ES in the same class */
for( i = 0; i < p_input->stream.i_selected_es_number; i++ )
{
if( ES->i_cat == i_cat )
{
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_ToggleES( p_input, ES, 0 );
vlc_mutex_lock( &p_input->stream.stream_lock );
break;
}
}
#undef ES
vlc_mutex_unlock( &p_input->stream.stream_lock );
input_ToggleES( p_input, p_es, 1 );
}
}
#undef p_input
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
- (IBAction)toggleVar:(id)sender
{
NSMenuItem *o_mi = (NSMenuItem *)sender;
......@@ -582,7 +395,6 @@
{
msg_Warn( p_object, "cannot set variable %s: with %d", psz_variable, val.i_int );
}
if (psz_variable) free(psz_variable);
}
}
......@@ -675,6 +487,7 @@
[[o_mi title] isEqualToString: _NS("Half Size")] ||
[[o_mi title] isEqualToString: _NS("Normal Size")] ||
[[o_mi title] isEqualToString: _NS("Double Size")] ||
[[o_mi title] isEqualToString: _NS("Fit To Screen")] ||
[[o_mi title] isEqualToString: _NS("Float On Top")] )
{
id o_window;
......
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.h,v 1.34 2003/05/01 01:11:17 hartman Exp $
* $Id: intf.h,v 1.35 2003/05/08 01:16:57 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -80,6 +80,7 @@ struct intf_sys_t
vlc_bool_t b_program_update;
vlc_bool_t b_title_update;
vlc_bool_t b_audio_update;
vlc_bool_t b_video_update;
vlc_bool_t b_spu_update;
vlc_bool_t b_aout_update;
vlc_bool_t b_vout_update;
......@@ -173,13 +174,12 @@ struct intf_sys_t
IBOutlet id o_mi_program;
IBOutlet id o_mi_title;
IBOutlet id o_mi_chapter;
IBOutlet id o_mi_language;
IBOutlet id o_mi_subtitle;
IBOutlet id o_mu_audio;
IBOutlet id o_mi_vol_up;
IBOutlet id o_mi_vol_down;
IBOutlet id o_mi_mute;
IBOutlet id o_mi_audiotrack;
IBOutlet id o_mi_channels;
IBOutlet id o_mi_device;
......@@ -187,9 +187,12 @@ struct intf_sys_t
IBOutlet id o_mi_half_window;
IBOutlet id o_mi_normal_window;
IBOutlet id o_mi_double_window;
IBOutlet id o_mi_fittoscreen;
IBOutlet id o_mi_fullscreen;
IBOutlet id o_mi_floatontop;
IBOutlet id o_mi_videotrack;
IBOutlet id o_mi_screen;
IBOutlet id o_mi_subtitle;
IBOutlet id o_mi_deinterlace;
IBOutlet id o_mu_deinterlace;
......@@ -230,11 +233,6 @@ struct intf_sys_t
- (void)manageVolumeSlider;
- (void)setupMenus:(input_thread_t *)p_input;
- (void)setupLangMenu:(input_thread_t *)p_input
mi:(NSMenuItem *)o_mi
es:(es_descriptor_t *)p_es
category:(int)i_cat
selector:(SEL)pf_callback;
- (void)setupVarMenu:(NSMenuItem *)o_mi
target:(vlc_object_t *)p_object
var:(const char *)psz_var
......
This diff is collapsed.
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