* intf.m: MacOS X interface plugin
*****************************************************************************
* 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>
* Christophe Massiot <massiot@via.ecp.fr>
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
* vout.h: MacOS X interface plugin
*****************************************************************************
* 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>
* Florian G. Pflug <fgp@phlo.org>
- (void)scaleWindowWithFactor: (float)factor;
- (void)toggleFullscreen;
- (BOOL)isFullscreen;
+- (void)updateTitle;
- (BOOL)windowShouldClose:(id)sender;
* vout.m: MacOS X video output plugin
*****************************************************************************
* 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>
* Florian G. Pflug <fgp@phlo.org>
}
}
+- (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. */
- (BOOL)windowShouldClose:(id)sender
{
VLCView * o_view;
NSScreen * o_screen;
vout_thread_t * p_vout;
- NSMutableString *o_title;
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];
[o_view lockFocus];
p_vout->p_sys->p_qdport = [o_view qdPort];
[o_view unlockFocus];
-
-
- 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];
-
- [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];
- }
+
+ [p_vout->p_sys->o_window updateTitle];
+ [p_vout->p_sys->o_window makeKeyAndOrderFront: nil];
}
- (void)destroyWindow:(NSValue *)o_value