* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.26 2003/02/13 00:09:51 hartman Exp $
+ * $Id: intf.h,v 1.27 2003/02/13 14:16:41 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
vlc_bool_t b_intf_update;
vlc_bool_t b_play_status;
vlc_bool_t b_playlist_update;
+ vlc_bool_t b_current_title_update;
/* menus handlers */
vlc_bool_t b_chapter_update;
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.56 2003/02/13 02:00:56 hartman Exp $
+ * $Id: intf.m,v 1.57 2003/02/13 14:16:41 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
+ p_intf->p_sys->b_current_title_update = 1;
p_intf->p_sys->i_part = 0;
p_playlist->p_input->stream.b_changed = 0;
- id o_awindow = [NSApp keyWindow];
- NSArray *o_windows = [NSApp windows];
- NSEnumerator *o_enumerator = [o_windows objectEnumerator];
-
- while ((o_awindow = [o_enumerator nextObject]))
- {
- if( [[o_awindow className] isEqualToString: @"VLCWindow"] )
- {
- vlc_mutex_unlock( &p_playlist->object_lock );
- [o_awindow updateTitle];
- vlc_mutex_lock( &p_playlist->object_lock );
- }
- }
-
msg_Dbg( p_intf, "stream has changed, refreshing interface" );
}
else
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;
}
{
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];
+
+ while ((o_awindow = [o_enumerator nextObject]))
+ {
+ if( [[o_awindow className] isEqualToString: @"VLCWindow"] )
+ {
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ [o_awindow updateTitle];
+ vlc_mutex_lock( &p_playlist->object_lock );
+ }
+ }
+ vlc_mutex_unlock( &p_playlist->object_lock );
+ [o_playlist updateState];
+ vlc_mutex_lock( &p_playlist->object_lock );
+ p_intf->p_sys->b_current_title_update = FALSE;
+ }
if( p_intf->p_sys->b_intf_update )
{
* playlist.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: playlist.h,v 1.4 2003/01/20 03:45:06 hartman Exp $
+ * $Id: playlist.h,v 1.5 2003/02/13 14:16:41 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
- (void)appendArray:(NSArray*)o_array atPos:(int)i_pos enqueue:(BOOL)b_enqueue;
- (void)playlistUpdated;
+- (void)updateState;
@end
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: playlist.m,v 1.10 2003/02/13 01:14:55 hartman Exp $
+ * $Id: playlist.m,v 1.11 2003/02/13 14:16:41 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
[o_table_view reloadData];
}
+- (void)updateState
+{
+ int i_row;
+
+ 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;
+ }
+
+ i_row = p_playlist->i_index;
+ vlc_object_release( p_playlist );
+
+ [o_table_view selectRow: i_row byExtendingSelection: NO];
+ [o_table_view scrollRowToVisible: i_row];
+
+ vout_thread_t * p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
+ FIND_ANYWHERE );
+
+ if ( p_vout == NULL )
+ {
+ [[NSApp keyWindow] makeFirstResponder:o_table_view];
+ return;
+ }
+ else if ( !p_vout->b_fullscreen )
+ {
+ [[NSApp keyWindow] makeFirstResponder:o_table_view];
+ }
+ vlc_object_release( (vlc_object_t *)p_vout );
+}
+
@end
@implementation VLCPlaylist (NSTableDataSource)