]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/intf.m
ALL:
[vlc] / modules / gui / macosx / intf.m
index 5cae5eeb58292f26fca335d4d5f7a81f00d93c8d..d062ee45f534c2387132e3035b8a910031378562 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.53 2003/02/09 19:28:43 massiot 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>
@@ -426,10 +426,19 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
 
         if( p_playlist != NULL )
         {
-            vlc_mutex_lock( &p_playlist->object_lock );
+            vlc_value_t val;
 
+            if( var_Get( (vlc_object_t *)p_playlist, "intf-change", &val )
+                >= 0 && val.b_bool )
+            {
+                p_intf->p_sys->b_playlist_update = 1;
+                p_intf->p_sys->b_intf_update = VLC_TRUE;
+            }
+            
+            vlc_mutex_lock( &p_playlist->object_lock );
+            
             [self manage: p_playlist];
-
+            
             vlc_mutex_unlock( &p_playlist->object_lock );
             vlc_object_release( p_playlist );
         }
@@ -540,9 +549,11 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
         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;
+        
         msg_Dbg( p_intf, "stream has changed, refreshing interface" );
     }
     else
@@ -591,6 +602,16 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
     }
 
     vlc_mutex_lock( &p_playlist->object_lock );
+    
+    if ( p_intf->p_sys->b_playlist_update )
+    {
+        vlc_value_t val;
+        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;
+    }
 
 #define p_input p_playlist->p_input
 
@@ -598,6 +619,27 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
     {
         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 )
     {
@@ -1406,7 +1448,7 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
 
 - (IBAction)openCrashLog:(id)sender
 {
-    NSString * o_path = [@"~/Library/Logs/CrashReporter/vlc.crash.log"
+    NSString * o_path = [@"~/Library/Logs/CrashReporter/VLC.crash.log"
                                     stringByExpandingTildeInPath];