Commit 8345dff5 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* ./modules/gui/macosx/aout.m: M-Audio Revolution fixes.

                                 Dynamic device support.
  * ./modules/gui/macosx: Minor fixes and cosmetic changes.
parent 36401a1c
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
ACTIONS = {showCategory = id; toggleInfoPanel = id; }; ACTIONS = {showCategory = id; toggleInfoPanel = id; };
CLASS = VLCInfo; CLASS = VLCInfo;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {"o_info_selector" = id; "o_info_view" = id; "o_info_window" = id; }; OUTLETS = {"o_selector" = id; "o_view" = id; "o_window" = id; };
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{ {
......
...@@ -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>65 171 365 441 0 0 1280 1002 </string> <string>417 347 365 441 0 0 1600 1178 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>29</key> <key>29</key>
<string>16 822 419 44 0 0 1280 1002 </string> <string>22 973 419 44 0 0 1600 1178 </string>
<key>303</key> <key>303</key>
<string>60 509 104 114 0 0 1280 1002 </string> <string>60 509 104 114 0 0 1280 1002 </string>
<key>909</key> <key>909</key>
...@@ -23,8 +23,9 @@ ...@@ -23,8 +23,9 @@
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>29</integer> <integer>1194</integer>
<integer>21</integer> <integer>21</integer>
<integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>6I32</string> <string>6I32</string>
......
This diff is collapsed.
/***************************************************************************** /*****************************************************************************
* info.h: MacOS X info panel * info.h: MacOS X info panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: info.h,v 1.1 2003/02/17 10:52:07 hartman Exp $ * $Id: info.h,v 1.2 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* *
...@@ -21,28 +21,21 @@ ...@@ -21,28 +21,21 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#include <vlc/vlc.h>
#include <vlc/intf.h>
#import <Cocoa/Cocoa.h>
/***************************************************************************** /*****************************************************************************
* VLCInfo interface * VLCInfo interface
*****************************************************************************/ *****************************************************************************/
@interface VLCInfo : NSObject { @interface VLCInfo : NSObject
{
IBOutlet id o_window;
IBOutlet id o_view;
IBOutlet id o_selector;
IBOutlet id o_info_window; NSMutableDictionary * o_strings;
IBOutlet id o_info_view;
IBOutlet id o_info_selector;
intf_thread_t *p_intf;
NSMutableDictionary *o_info_strings;
} }
- (void)updateInfo;
- (IBAction)toggleInfoPanel:(id)sender; - (IBAction)toggleInfoPanel:(id)sender;
- (IBAction)showCategory:(id)sender; - (IBAction)showCategory:(id)sender;
- (void)updateInfo;
- (void)createInfoView:(input_info_category_t *)p_category; - (void)createInfoView:(input_info_category_t *)p_category;
@end @end
/***************************************************************************** /*****************************************************************************
* info.m: MacOS X info panel * info.m: MacOS X info panel
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: info.m,v 1.2 2003/02/18 20:54:02 hartman Exp $ * $Id: info.m,v 1.3 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net> * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
* *
...@@ -22,23 +22,25 @@ ...@@ -22,23 +22,25 @@
*****************************************************************************/ *****************************************************************************/
#include "intf.h" #include "intf.h"
#include "info.h"
#import "info.h"
/***************************************************************************** /*****************************************************************************
* VLCInfo implementation * VLCInfo implementation
*****************************************************************************/ *****************************************************************************/
@implementation VLCInfo @implementation VLCInfo
- (void)awakeFromNib
{
[o_window setExcludedFromWindowsMenu: YES];
}
- (id)init - (id)init
{ {
self = [super init]; self = [super init];
if( self != nil ) if( self != nil )
{ {
p_intf = [NSApp getIntf]; o_strings = [[NSMutableDictionary alloc] init];
o_info_strings = [[NSMutableDictionary alloc] init];
} }
return( self ); return( self );
...@@ -46,91 +48,99 @@ ...@@ -46,91 +48,99 @@
- (void)dealloc - (void)dealloc
{ {
[o_info_strings release]; [o_strings release];
[super dealloc]; [super dealloc];
} }
- (IBAction)toggleInfoPanel:(id)sender - (IBAction)toggleInfoPanel:(id)sender
{ {
if ( [o_info_window isVisible] ) if( [o_window isVisible] )
{ {
[o_info_window orderOut:sender]; [o_window orderOut: sender];
} }
else else
{ {
[o_info_window orderFront:sender]; [o_window orderFront: sender];
[self updateInfo]; [self updateInfo];
} }
} }
- (IBAction)showCategory:(id)sender - (IBAction)showCategory:(id)sender
{ {
NSString *o_selected = [o_info_selector titleOfSelectedItem]; NSString * o_title = [o_selector titleOfSelectedItem];
[o_info_view setString:(NSString *)[o_info_strings objectForKey: o_selected]]; [o_view setString: [o_strings objectForKey: o_title]];
[o_info_view setNeedsDisplay: YES]; [o_view setNeedsDisplay: YES];
} }
- (void)updateInfo - (void)updateInfo
{ {
if ( ![o_info_window isVisible] ) if( ![o_window isVisible] )
{ {
return; return;
} }
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
if( p_playlist == NULL ) if( p_playlist == NULL )
{ {
[o_info_window orderOut:self];
return; return;
} }
vlc_mutex_lock( &p_playlist->object_lock );
if ( p_playlist->p_input == NULL ) if ( p_playlist->p_input == NULL )
{ {
[o_info_window orderOut:self]; vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
return; return;
} }
[o_info_strings removeAllObjects]; [o_strings removeAllObjects];
[o_info_selector removeAllItems]; [o_selector removeAllItems];
[o_info_view setDrawsBackground: NO];
[[[o_info_view superview] superview] setDrawsBackground: NO];
[o_info_window setExcludedFromWindowsMenu:YES];
vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock ); vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
input_info_category_t *p_category = p_playlist->p_input->stream.p_info; input_info_category_t * p_category = p_playlist->p_input->stream.p_info;
while ( p_category )
while( p_category )
{ {
[self createInfoView: p_category ]; [self createInfoView: p_category];
p_category = p_category->p_next; p_category = p_category->p_next;
} }
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock ); vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
[o_info_selector selectItemAtIndex: 0]; [o_selector selectItemAtIndex: 0];
[self showCategory:o_info_selector]; [self showCategory: o_selector];
} }
- (void)createInfoView:(input_info_category_t *)p_category - (void)createInfoView:(input_info_category_t *)p_category
{ {
/* Add a catecory */ NSString * o_title;
NSString *title = [NSString stringWithCString: p_category->psz_name]; NSMutableString * o_content;
[o_info_selector addItemWithTitle: title]; input_info_t * p_info;
/* Create the textfield content */ /* Add a category */
NSMutableString *catString = [NSMutableString string]; o_title = [NSString stringWithCString: p_category->psz_name];
[o_selector addItemWithTitle: o_title];
/* Create empty content string */
o_content = [NSMutableString string];
/* Add the fields */ /* Add the fields */
input_info_t *p_info = p_category->p_info; p_info = p_category->p_info;
while ( p_info )
while( p_info )
{ {
[catString appendFormat: @"%s: %s\n\n", p_info->psz_name, p_info->psz_value]; [o_content appendFormat: @"%s: %s\n\n", p_info->psz_name,
p_info->psz_value];
p_info = p_info->p_next; p_info = p_info->p_next;
} }
[o_info_strings setObject: catString forKey: title];
[o_strings setObject: o_content forKey: o_title];
} }
@end @end
...@@ -141,6 +151,7 @@ ...@@ -141,6 +151,7 @@
{ {
BOOL bEnabled = TRUE; BOOL bEnabled = TRUE;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin * intf.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.60 2003/02/19 14:49:25 hartman Exp $ * $Id: intf.m,v 1.61 2003/02/23 05:53:53 jlj Exp $
* *
* 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>
...@@ -435,15 +435,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -435,15 +435,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
vlc_value_t val;
if( var_Get( (vlc_object_t *)p_playlist, "intf-change", &val )
>= 0 && val.b_bool )
{
p_intf->p_sys->b_playlist_update = 1;
p_intf->p_sys->b_intf_update = VLC_TRUE;
}
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
[self manage: p_playlist]; [self manage: p_playlist];
...@@ -465,8 +456,17 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -465,8 +456,17 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
- (void)manage:(playlist_t *)p_playlist - (void)manage:(playlist_t *)p_playlist
{ {
vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
if( var_Get( (vlc_object_t *)p_playlist, "intf-change", &val ) >= 0 &&
val.b_bool )
{
p_intf->p_sys->b_playlist_update = VLC_TRUE;
p_intf->p_sys->b_intf_update = VLC_TRUE;
}
#define p_input p_playlist->p_input #define p_input p_playlist->p_input
if( p_input ) if( p_input )
...@@ -508,8 +508,10 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -508,8 +508,10 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
p_intf->p_sys->b_aout_update = 1; p_intf->p_sys->b_aout_update = 1;
b_need_menus = VLC_TRUE; b_need_menus = VLC_TRUE;
} }
vlc_object_release( (vlc_object_t *)p_aout ); vlc_object_release( (vlc_object_t *)p_aout );
} }
aout_VolumeGet( p_intf, &i_volume ); aout_VolumeGet( p_intf, &i_volume );
p_intf->p_sys->b_mute = ( i_volume == 0 ); p_intf->p_sys->b_mute = ( i_volume == 0 );
...@@ -578,15 +580,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -578,15 +580,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
vout_Destroy( p_vout ); vout_Destroy( p_vout );
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
} }
aout_instance_t * p_aout = vlc_object_find( p_intf, VLC_OBJECT_AOUT,
FIND_ANYWHERE );
if( p_aout != NULL )
{
vlc_object_detach( (vlc_object_t *)p_aout );
vlc_object_release( (vlc_object_t *)p_aout );
aout_Delete( p_aout );
}
} }
p_intf->p_sys->b_intf_update = VLC_TRUE; p_intf->p_sys->b_intf_update = VLC_TRUE;
...@@ -610,51 +603,46 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -610,51 +603,46 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
return; return;
} }
vlc_mutex_lock( &p_playlist->object_lock );
if ( p_intf->p_sys->b_playlist_update ) if ( p_intf->p_sys->b_playlist_update )
{ {
vlc_value_t val; vlc_value_t val;
val.b_bool = 0;
val.b_bool = 0;
var_Set( (vlc_object_t *)p_playlist, "intf-change", val ); var_Set( (vlc_object_t *)p_playlist, "intf-change", val );
[o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE;
}
#define p_input p_playlist->p_input [o_playlist playlistUpdated];
if( p_input != NULL ) p_intf->p_sys->b_playlist_update = VLC_FALSE;
{
vlc_mutex_lock( &p_input->stream.stream_lock );
} }
if( p_intf->p_sys->b_current_title_update ) if( p_intf->p_sys->b_current_title_update )
{ {
id o_awindow = [NSApp keyWindow]; id o_vout_wnd;
NSArray *o_windows = [NSApp windows];
NSEnumerator *o_enumerator = [o_windows objectEnumerator]; NSEnumerator * o_enum = [[NSApp windows] objectEnumerator];
while ((o_awindow = [o_enumerator nextObject])) while( ( o_vout_wnd = [o_enum nextObject] ) )
{ {
if( [[o_awindow className] isEqualToString: @"VLCWindow"] ) if( [[o_vout_wnd className] isEqualToString: @"VLCWindow"] )
{ {
vlc_mutex_unlock( &p_playlist->object_lock ); [o_vout_wnd updateTitle];
[o_awindow updateTitle];
vlc_mutex_lock( &p_playlist->object_lock );
} }
} }
vlc_mutex_unlock( &p_playlist->object_lock );
[o_playlist updateState]; [o_playlist updateRowSelection];
[o_info updateInfo];
p_intf->p_sys->b_current_title_update = FALSE;
}
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
#define p_input p_playlist->p_input
if( p_input != NULL ) if( p_input != NULL )
{ {
vlc_mutex_unlock( &p_input->stream.stream_lock );
[o_info updateInfo];
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
} }
p_intf->p_sys->b_current_title_update = FALSE;
}
if( p_intf->p_sys->b_intf_update ) if( p_intf->p_sys->b_intf_update )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* macosx.m: MacOS X plugin for vlc * macosx.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: macosx.m,v 1.3 2003/02/20 01:52:46 sigmunau Exp $ * $Id: macosx.m,v 1.4 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Eugenio Jarosiewicz <ej0@cise.ufl.edu> * Eugenio Jarosiewicz <ej0@cise.ufl.edu>
...@@ -56,7 +56,7 @@ vlc_module_begin(); ...@@ -56,7 +56,7 @@ vlc_module_begin();
set_capability( "interface", 100 ); set_capability( "interface", 100 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) ); set_callbacks( E_(OpenIntf), E_(CloseIntf) );
add_submodule(); add_submodule();
set_capability( "video output", 100 ); set_capability( "video output", 200 );
set_callbacks( E_(OpenVideo), E_(CloseVideo) ); set_callbacks( E_(OpenVideo), E_(CloseVideo) );
add_category_hint( N_("Video"), NULL, VLC_FALSE ); add_category_hint( N_("Video"), NULL, VLC_FALSE );
add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT, VLC_FALSE ); add_integer( "macosx-vdev", 0, NULL, VDEV_TEXT, VDEV_TEXT, VLC_FALSE );
...@@ -64,6 +64,6 @@ vlc_module_begin(); ...@@ -64,6 +64,6 @@ vlc_module_begin();
set_capability( "audio output", 100 ); set_capability( "audio output", 100 );
set_callbacks( E_(OpenAudio), E_(CloseAudio) ); set_callbacks( E_(OpenAudio), E_(CloseAudio) );
add_category_hint( N_("Audio"), NULL, VLC_FALSE ); add_category_hint( N_("Audio"), NULL, VLC_FALSE );
add_integer( "macosx-adev", 0, NULL, ADEV_TEXT, ADEV_TEXT, VLC_FALSE ); add_integer( "macosx-adev", -1, NULL, ADEV_TEXT, ADEV_TEXT, VLC_FALSE );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
* playlist.h: MacOS X interface plugin * playlist.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.h,v 1.5 2003/02/13 14:16:41 hartman Exp $ * $Id: playlist.h,v 1.6 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
...@@ -56,7 +56,8 @@ ...@@ -56,7 +56,8 @@
- (IBAction)selectAll:(id)sender; - (IBAction)selectAll:(id)sender;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos enqueue:(BOOL)b_enqueue; - (void)appendArray:(NSArray*)o_array atPos:(int)i_pos enqueue:(BOOL)b_enqueue;
- (void)updateRowSelection;
- (void)playlistUpdated; - (void)playlistUpdated;
- (void)updateState;
@end @end
/***************************************************************************** /*****************************************************************************
* playlist.m: MacOS X interface plugin * playlist.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.11 2003/02/13 14:16:41 hartman Exp $ * $Id: playlist.m,v 1.12 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
{ {
case ' ': case ' ':
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist != NULL && p_playlist->p_input != NULL ) if( p_playlist->p_input != NULL )
{ {
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE ); input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE );
} }
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
[o_table_view reloadData]; [o_table_view reloadData];
} }
- (void)updateState - (void)updateRowSelection
{ {
int i_row; int i_row;
...@@ -313,7 +313,9 @@ ...@@ -313,7 +313,9 @@
return; return;
} }
vlc_mutex_lock( &p_playlist->object_lock );
i_row = p_playlist->i_index; i_row = p_playlist->i_index;
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
[o_table_view selectRow: i_row byExtendingSelection: NO]; [o_table_view selectRow: i_row byExtendingSelection: NO];
...@@ -322,16 +324,15 @@ ...@@ -322,16 +324,15 @@
vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE ); FIND_ANYWHERE );
if ( p_vout == NULL ) if( p_vout == NULL || !p_vout->b_fullscreen )
{ {
[[NSApp keyWindow] makeFirstResponder:o_table_view]; [[NSApp keyWindow] makeFirstResponder: o_table_view];
return;
} }
else if ( !p_vout->b_fullscreen )
if( p_vout != NULL )
{ {
[[NSApp keyWindow] makeFirstResponder:o_table_view];
}
vlc_object_release( (vlc_object_t *)p_vout ); vlc_object_release( (vlc_object_t *)p_vout );
}
} }
@end @end
...@@ -347,7 +348,9 @@ ...@@ -347,7 +348,9 @@
if( p_playlist != NULL ) if( p_playlist != NULL )
{ {
vlc_mutex_lock( &p_playlist->object_lock );
i_count = p_playlist->i_size; i_count = p_playlist->i_size;
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
......
/***************************************************************************** /*****************************************************************************
* prefs.h: MacOS X plugin for vlc * prefs.h: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.h,v 1.3 2003/02/21 02:45:21 hartman Exp $ * $Id: prefs.h,v 1.4 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
......
/***************************************************************************** /*****************************************************************************
* prefs.m: MacOS X plugin for vlc * prefs.m: MacOS X plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: prefs.m,v 1.15 2003/02/21 02:45:21 hartman Exp $ * $Id: prefs.m,v 1.16 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
if( p_item ) do if( p_item ) do
{ {
if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" )) if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ) )
{ {
continue; continue;
} }
...@@ -728,7 +728,7 @@ ...@@ -728,7 +728,7 @@
{ {
id o_vlc_control; id o_vlc_control;
NSEnumerator *o_enum; NSEnumerator *o_enum;
BOOL b_advanced_change = FALSE; BOOL b_adv_change = FALSE;
NSWindow *o_pref_panel = [[sender superview] window]; NSWindow *o_pref_panel = [[sender superview] window];
NSString *o_module_name = [[o_pref_panel toolbar] identifier]; NSString *o_module_name = [[o_pref_panel toolbar] identifier];
...@@ -770,10 +770,13 @@ ...@@ -770,10 +770,13 @@
case CONFIG_ITEM_BOOL: case CONFIG_ITEM_BOOL:
{ {
int i_value = [o_vlc_control intValue]; int i_value = [o_vlc_control intValue];
if ( !strcmp( psz_name, "advanced" ) && ( config_GetInt( p_intf, "advanced" ) != i_value ) )
if( !strcmp( psz_name, "advanced" ) &&
( config_GetInt( p_intf, "advanced" ) != i_value ) )
{ {
b_advanced_change = TRUE; b_adv_change = TRUE;
} }
config_PutInt( p_intf, psz_name, i_value ); config_PutInt( p_intf, psz_name, i_value );
} }
break; break;
...@@ -795,11 +798,7 @@ ...@@ -795,11 +798,7 @@
config_SaveConfigFile( p_intf, NULL ); config_SaveConfigFile( p_intf, NULL );
} }
if ( [[sender title] isEqualToString: _NS("Apply")] && !b_advanced_change ) if( ![[sender title] isEqualToString: _NS("Apply")] || b_adv_change )
{
;
}
else
{ {
[o_pref_panel close]; [o_pref_panel close];
...@@ -809,10 +808,6 @@ ...@@ -809,10 +808,6 @@
[self performSelectorOnMainThread: @selector(destroyPrefPanel:) [self performSelectorOnMainThread: @selector(destroyPrefPanel:)
withObject: o_module_name withObject: o_module_name
waitUntilDone: YES]; waitUntilDone: YES];
if ( [[sender title] isEqualToString: _NS("Apply")] && b_advanced_change )
{
[self createPrefPanel:@"main"];
}
} }
else else
{ {
...@@ -820,6 +815,11 @@ ...@@ -820,6 +815,11 @@
target: self selector: @selector(destroyPrefPanel:) target: self selector: @selector(destroyPrefPanel:)
userInfo: o_module_name repeats: NO]; userInfo: o_module_name repeats: NO];
} }
if( [[sender title] isEqualToString: _NS("Apply")] && b_adv_change )
{
[self createPrefPanel: o_module_name];
}
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin * vout.m: MacOS X video output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2003 VideoLAN * Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.34 2003/02/15 12:57:51 hartman Exp $ * $Id: vout.m,v 1.35 2003/02/23 05:53:53 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org> * Florian G. Pflug <fgp@phlo.org>
...@@ -819,7 +819,8 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -819,7 +819,8 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
- (void)updateTitle - (void)updateTitle
{ {
NSMutableString *o_title; NSMutableString * o_title;
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
...@@ -836,11 +837,13 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -836,11 +837,13 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
if (o_title) if( o_title != nil )
{
NSRange prefix_range = [o_title rangeOfString: @"file:"];
if( prefix_range.location != NSNotFound )
{ {
NSRange prefixrange = [o_title rangeOfString: @"file:"]; [o_title deleteCharactersInRange: prefix_range];
if ( prefixrange.location != NSNotFound ) }
[o_title deleteCharactersInRange: prefixrange];
[self setTitleWithRepresentedFilename: o_title]; [self setTitleWithRepresentedFilename: o_title];
} }
......
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