Commit 17e02520 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

*ALL: update the title of the window everytime the stream changes.

parent d75f0d6f
...@@ -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.55 2003/02/13 00:09:51 hartman Exp $ * $Id: intf.m,v 1.56 2003/02/13 02:00:56 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>
...@@ -552,6 +552,21 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg ) ...@@ -552,6 +552,21 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
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
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin * vout.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: vout.h,v 1.8 2003/02/08 21:43:26 hartman Exp $ * $Id: vout.h,v 1.9 2003/02/13 02:00:56 hartman 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>
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
- (void)scaleWindowWithFactor: (float)factor; - (void)scaleWindowWithFactor: (float)factor;
- (void)toggleFullscreen; - (void)toggleFullscreen;
- (BOOL)isFullscreen; - (BOOL)isFullscreen;
- (void)updateTitle;
- (BOOL)windowShouldClose:(id)sender; - (BOOL)windowShouldClose:(id)sender;
......
...@@ -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.31 2003/02/11 15:35:29 hartman Exp $ * $Id: vout.m,v 1.32 2003/02/13 02:00:56 hartman 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>
...@@ -800,6 +800,40 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -800,6 +800,40 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
} }
} }
- (void)updateTitle
{
NSMutableString *o_title;
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 );
o_title = [NSMutableString stringWithUTF8String:
p_playlist->pp_items[p_playlist->i_index]->psz_name];
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
if (o_title)
{
NSRange prefixrange = [o_title rangeOfString: @"file:"];
if ( prefixrange.location != NSNotFound )
[o_title deleteCharactersInRange: prefixrange];
[self setTitleWithRepresentedFilename: o_title];
}
else
{
[self setTitle:
[NSString stringWithCString: VOUT_TITLE " (QuickTime)"]];
}
}
/* This is actually the same as VLCControls::stop. */ /* This is actually the same as VLCControls::stop. */
- (BOOL)windowShouldClose:(id)sender - (BOOL)windowShouldClose:(id)sender
{ {
...@@ -930,12 +964,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -930,12 +964,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
VLCView * o_view; VLCView * o_view;
NSScreen * o_screen; NSScreen * o_screen;
vout_thread_t * p_vout; vout_thread_t * p_vout;
NSMutableString *o_title;
vlc_bool_t b_main_screen; vlc_bool_t b_main_screen;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
p_vout = (vout_thread_t *)[o_value pointerValue]; p_vout = (vout_thread_t *)[o_value pointerValue];
...@@ -1020,35 +1049,9 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -1020,35 +1049,9 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
[o_view lockFocus]; [o_view lockFocus];
p_vout->p_sys->p_qdport = [o_view qdPort]; p_vout->p_sys->p_qdport = [o_view qdPort];
[o_view unlockFocus]; [o_view unlockFocus];
[p_vout->p_sys->o_window updateTitle];
if( p_playlist == NULL ) [p_vout->p_sys->o_window makeKeyAndOrderFront: nil];
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
o_title = [NSMutableString stringWithUTF8String:
p_playlist->pp_items[p_playlist->i_index]->psz_name];
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
if (o_title)
{
NSRange prefixrange = [o_title rangeOfString: @"file:"];
if ( prefixrange.location != NSNotFound )
[o_title deleteCharactersInRange: prefixrange];
[p_vout->p_sys->o_window setTitleWithRepresentedFilename: o_title];
[p_vout->p_sys->o_window makeKeyAndOrderFront: nil];
}
else
{
[p_vout->p_sys->o_window setTitle:
[NSString stringWithCString: VOUT_TITLE " (QuickTime)"]];
[p_vout->p_sys->o_window makeKeyAndOrderFront: nil];
}
} }
- (void)destroyWindow:(NSValue *)o_value - (void)destroyWindow:(NSValue *)o_value
......
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