]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/vout.m
Qt4 - Permit QVLCFrame to have empty default size and pos in read settings.
[vlc] / modules / gui / macosx / vout.m
index fdcae957072984bcc3001f97310c953de037f71e..73f787c9f9f0c624ea36d937e489898419999909 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * vout.m: MacOS X video output module
  *****************************************************************************
- * Copyright (C) 2001-2007 the VideoLAN team
+ * Copyright (C) 2001-2008 the VideoLAN team
  * $Id$
  *
  * Authors: Colin Delacroix <colin@zoy.org>
@@ -155,8 +155,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     return self;
 }
 
-- (BOOL)setVout: (vout_thread_t *) vout s
-         ubView: (NSView *) view
+- (BOOL)setVout: (vout_thread_t *) vout
+        subView: (NSView *) view
           frame: (NSRect *) frame
 {
     int i_device;
@@ -271,7 +271,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 
 - (void)updateTitle
 {
-    NSMutableString * o_title = nil, * o_mrl = nil;
+    NSString * o_title = nil; 
+    NSMutableString * o_mrl = nil;
     input_thread_t * p_input;
 
     if( p_vout == NULL )
@@ -286,14 +287,21 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         return;
     }
 
+    char *psz_nowPlaying = input_item_GetNowPlaying ( input_GetItem( p_input ) );
     char *psz_name = input_item_GetName( input_GetItem( p_input ) );
     char *psz_uri = input_item_GetURI( input_GetItem( p_input ) );
-    if( psz_name != NULL )
-        o_title = [NSMutableString stringWithUTF8String: psz_name];
+    if( psz_nowPlaying != NULL )
+        o_title = [NSString stringWithUTF8String: psz_nowPlaying];
+    else if( psz_name != NULL )
+        o_title = [NSString stringWithUTF8String: psz_name];
+
     if( psz_uri != NULL )
         o_mrl = [NSMutableString stringWithUTF8String: psz_uri];
-    free( psz_name );
-    free( psz_uri );
+
+    FREENULL( psz_nowPlaying );
+    FREENULL( psz_name );
+    FREENULL( psz_uri );
+
     if( o_title == nil )
         o_title = o_mrl;
 
@@ -321,7 +329,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
     }
     else
     {
-        [o_window setTitle: [NSString stringWithCString: VOUT_TITLE]];
+        [o_window setTitle: [NSString stringWithUTF8String: VOUT_TITLE]];
     }
     vlc_object_release( p_input );
 }
@@ -433,6 +441,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
 - (void)manage
 {
     /* Disable Screensaver, when we're playing something, but allow it on pause */
+    if( !VLCIntf || !VLCIntf->p_sys || !VLCIntf->p_sys->i_play_status )
+        return;
+
     if( VLCIntf->p_sys->i_play_status == PLAYING_S )
         UpdateSystemActivity( UsrActivity );
 }