]> git.sesse.net Git - vlc/commitdiff
* Fix on the fly Opaqueness changing
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 18 Aug 2005 21:26:23 +0000 (21:26 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 18 Aug 2005 21:26:23 +0000 (21:26 +0000)
modules/gui/macosx/extended.m

index d415cd774ad23e2ec59d0a3e095afba3dc66d6eb..5a0d1220f48245608874bf82c3161efb1271ece0 100644 (file)
@@ -318,20 +318,21 @@ static VLCExtended *_o_sharedInstance = nil;
     }
 }
 
+/* change the opaqueness of the vouts */
 - (IBAction)adjImg_opaque:(id)sender
 {
-    /* change the opaqueness of the vouts */
+    vlc_value_t val;
+    id o_window = [NSApp keyWindow];
+    NSArray *o_windows = [NSApp orderedWindows];
+    NSEnumerator *o_enumerator = [o_windows objectEnumerator];
     playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, \
         FIND_ANYWHERE );
-    vout_thread_t * p_vout = (vout_thread_t *)vlc_object_find( p_playlist, \
-        VLC_OBJECT_VOUT, FIND_ANYWHERE );
-    vout_thread_t * p_real_vout;
+    vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+    vout_thread_t *p_real_vout;
     
-    vlc_value_t val;
     val.f_float = [o_sld_opaque floatValue] / 100;
 
-    /* Try to set on the fly */
-    if( p_vout )
+    if( p_vout != NULL )
     {
         if( p_vout->i_object_type == VLC_OBJECT_OPENGL )
         {
@@ -341,13 +342,15 @@ static VLCExtended *_o_sharedInstance = nil;
         {
             p_real_vout = p_vout;
         }
-        
-        /* FIXME: insert the correct pointer here */
-        /*[p_vout->p_sys->o_window setAlpha: var_CreateGetFloat( p_vout, \
-            "macosx-opaqueness")];*/
-        
-        var_Set( p_vout, "macosx-opaqueness", val );
-        vlc_object_release( p_real_vout );
+        var_Set( p_real_vout, "macosx-opaqueness", val );
+    
+        while ((o_window = [o_enumerator nextObject]))
+        {
+            if( [[o_window className] isEqualToString: @"VLCWindow"] )
+            {
+                [o_window setAlphaValue: val.f_float];
+            }
+        }
         vlc_object_release( p_vout );
     }