From 52896a65c30cb41cc6ab2ff6b6157d85d0c1edfb Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Thu, 18 Aug 2005 21:26:23 +0000 Subject: [PATCH] * Fix on the fly Opaqueness changing --- modules/gui/macosx/extended.m | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/gui/macosx/extended.m b/modules/gui/macosx/extended.m index d415cd774a..5a0d1220f4 100644 --- a/modules/gui/macosx/extended.m +++ b/modules/gui/macosx/extended.m @@ -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 ); } -- GitLab