* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.60 2003/02/19 14:49:25 hartman Exp $
+ * $Id: intf.m,v 1.68 2003/03/13 16:09:21 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
[o_msgs_panel setDelegate: self];
[o_msgs_panel setTitle: _NS("Messages")];
[o_msgs_panel setExcludedFromWindowsMenu: TRUE];
- [o_msgs_btn_ok setTitle: _NS("Close")];
[o_msgs_btn_crashlog setTitle: _NS("Open CrashLog")];
/* main menu */
[o_mi_show_all setTitle: _NS("Show All")];
[o_mi_quit setTitle: _NS("Quit VLC")];
- [o_mu_file setTitle: _NS("File")];
+ [o_mu_file setTitle: _ANS("1:File")];
[o_mi_open_generic setTitle: _NS("Open...")];
[o_mi_open_file setTitle: _NS("Open File...")];
[o_mi_open_disc setTitle: _NS("Open Disc...")];
[NSTimer scheduledTimerWithTimeInterval: 0.5
target: self selector: @selector(manageIntf:)
- userInfo: nil repeats: TRUE];
+ userInfo: nil repeats: FALSE];
[NSThread detachNewThreadSelector: @selector(manage)
toTarget: self withObject: nil];
+
+ vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW );
}
- (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename
return( TRUE );
}
+- (id)getControls
+{
+ if ( o_controls )
+ {
+ return o_controls;
+ }
+ return nil;
+}
+
- (void)manage
{
NSDate * o_sleep_date;
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 );
[self manage: p_playlist];
- (void)manage:(playlist_t *)p_playlist
{
+ vlc_value_t val;
+
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
if( p_input )
p_intf->p_sys->b_aout_update = 1;
b_need_menus = VLC_TRUE;
}
+
vlc_object_release( (vlc_object_t *)p_aout );
}
+
aout_VolumeGet( p_intf, &i_volume );
p_intf->p_sys->b_mute = ( i_volume == 0 );
vout_Destroy( p_vout );
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;
return;
}
- vlc_mutex_lock( &p_playlist->object_lock );
-
if ( p_intf->p_sys->b_playlist_update )
{
vlc_value_t val;
- val.b_bool = 0;
+ val.b_bool = 0;
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
-
- if( p_input != NULL )
- {
- vlc_mutex_lock( &p_input->stream.stream_lock );
- }
-
if( p_intf->p_sys->b_current_title_update )
{
- id o_awindow = [NSApp keyWindow];
- NSArray *o_windows = [NSApp windows];
- NSEnumerator *o_enumerator = [o_windows objectEnumerator];
+ id o_vout_wnd;
+
+ 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_awindow updateTitle];
- vlc_mutex_lock( &p_playlist->object_lock );
+ [o_vout_wnd updateTitle];
}
}
- vlc_mutex_unlock( &p_playlist->object_lock );
- [o_playlist updateState];
- vlc_mutex_lock( &p_playlist->object_lock );
- if( p_input != NULL )
- {
- vlc_mutex_unlock( &p_input->stream.stream_lock );
- [o_info updateInfo];
- vlc_mutex_lock( &p_input->stream.stream_lock );
- }
+
+ [o_playlist updateRowSelection];
+ [o_info updateInfo];
+
p_intf->p_sys->b_current_title_update = FALSE;
}
+ vlc_mutex_lock( &p_playlist->object_lock );
+
+#define p_input p_playlist->p_input
+
+ if( p_input != NULL )
+ {
+ vlc_mutex_lock( &p_input->stream.stream_lock );
+ }
+
if( p_intf->p_sys->b_intf_update )
{
vlc_bool_t b_input = VLC_FALSE;
vlc_object_release( p_playlist );
[self updateMessageArray];
+
+ [NSTimer scheduledTimerWithTimeInterval: 0.5
+ target: self selector: @selector(manageIntf:)
+ userInfo: nil repeats: FALSE];
}
- (void)updateMessageArray
[o_msg_lock lock];
- if( [o_msg_arr count] + 2 > 200 )
+ if( [o_msg_arr count] + 2 > 400 )
{
unsigned rid[] = { 0, 1 };
[o_msg_arr removeObjectsFromIndices: (unsigned *)&rid