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

ALL:

 - when a new stream is being loaded we select the current title in the
   playlist.
 - Cleaned up some of my previous commited code dealing with updating
   the window title.
parent 17e02520
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin * intf.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -68,6 +68,7 @@ struct intf_sys_t ...@@ -68,6 +68,7 @@ struct intf_sys_t
vlc_bool_t b_intf_update; vlc_bool_t b_intf_update;
vlc_bool_t b_play_status; vlc_bool_t b_play_status;
vlc_bool_t b_playlist_update; vlc_bool_t b_playlist_update;
vlc_bool_t b_current_title_update;
/* menus handlers */ /* menus handlers */
vlc_bool_t b_chapter_update; vlc_bool_t b_chapter_update;
......
...@@ -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.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> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -549,24 +549,11 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -549,24 +549,11 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
p_intf->p_sys->b_chapter_update = 1; p_intf->p_sys->b_chapter_update = 1;
p_intf->p_sys->b_audio_update = 1; p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_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_intf->p_sys->i_part = 0;
p_playlist->p_input->stream.b_changed = 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" ); msg_Dbg( p_intf, "stream has changed, refreshing interface" );
} }
else else
...@@ -622,7 +609,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -622,7 +609,6 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
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]; [o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE; p_intf->p_sys->b_playlist_update = VLC_FALSE;
} }
...@@ -634,6 +620,27 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -634,6 +620,27 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
vlc_mutex_lock( &p_input->stream.stream_lock ); 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 ) if( p_intf->p_sys->b_intf_update )
{ {
vlc_bool_t b_input = VLC_FALSE; vlc_bool_t b_input = VLC_FALSE;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.h: MacOS X interface plugin * playlist.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
...@@ -57,5 +57,6 @@ ...@@ -57,5 +57,6 @@
- (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)playlistUpdated; - (void)playlistUpdated;
- (void)updateState;
@end @end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin * playlist.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * 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> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* *
...@@ -300,6 +300,40 @@ ...@@ -300,6 +300,40 @@
[o_table_view reloadData]; [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 @end
@implementation VLCPlaylist (NSTableDataSource) @implementation VLCPlaylist (NSTableDataSource)
......
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