[vlc-devel] commit: macosx: Make sure the volume slider is activated when vlc starts. ( Pierre d'Herbemont )
git version control
git at videolan.org
Sun Jul 13 20:00:27 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sun Jul 13 20:02:46 2008 +0200| [8d88a428061d251ed1ef62d1461c0486a6af33cc]
macosx: Make sure the volume slider is activated when vlc starts.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8d88a428061d251ed1ef62d1461c0486a6af33cc
---
modules/gui/macosx/intf.m | 37 +++++++++++++++++--------------------
1 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 459ca86..17b163f 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -449,6 +449,7 @@ static VLCMain *_o_sharedMainInstance = nil;
var_Create( p_intf, "intf-change", VLC_VAR_BOOL );
[self setSubmenusEnabled: FALSE];
+ [o_volumeslider setEnabled: YES];
[self manageVolumeSlider];
[o_window setDelegate: self];
@@ -1286,10 +1287,7 @@ static VLCMain *_o_sharedMainInstance = nil;
p_intf->p_sys->b_intf_show = false;
}
- p_playlist = pl_Yield( p_intf );
- p_input = vlc_object_find( p_playlist, VLC_OBJECT_INPUT,
- FIND_CHILD );
-
+ p_input = pl_CurrentInput( p_intf );
if( p_input && vlc_object_alive (p_input) )
{
vlc_value_t val;
@@ -1338,21 +1336,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_embedded_window setTime: o_time position: f_updated];
}
- if( p_intf->p_sys->b_volume_update )
- {
- NSString *o_text;
- int i_volume_step = 0;
- o_text = [NSString stringWithFormat: _NS("Volume: %d%%"), i_lastShownVolume * 400 / AOUT_VOLUME_MAX];
- if( i_lastShownVolume != -1 )
- [self setScrollField:o_text stopAfter:1000000];
- i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
- [o_volumeslider setFloatValue: (float)i_lastShownVolume / i_volume_step];
- [o_volumeslider setEnabled: TRUE];
- [[[self getControls] getFSPanel] setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
- p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
- p_intf->p_sys->b_volume_update = FALSE;
- }
-
/* Manage Playing status */
var_Get( p_input, "state", &val );
if( p_intf->p_sys->i_play_status != val.i_int )
@@ -1374,7 +1357,21 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_embedded_window playStatusUpdated: p_intf->p_sys->i_play_status];
[self setSubmenusEnabled: FALSE];
}
- pl_Release( p_intf );
+
+ if( p_intf->p_sys->b_volume_update )
+ {
+ NSString *o_text;
+ int i_volume_step = 0;
+ o_text = [NSString stringWithFormat: _NS("Volume: %d%%"), i_lastShownVolume * 400 / AOUT_VOLUME_MAX];
+ if( i_lastShownVolume != -1 )
+ [self setScrollField:o_text stopAfter:1000000];
+ i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
+ [o_volumeslider setFloatValue: (float)i_lastShownVolume / i_volume_step];
+ [o_volumeslider setEnabled: TRUE];
+ [[[self getControls] getFSPanel] setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
+ p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
+ p_intf->p_sys->b_volume_update = FALSE;
+ }
end:
[self updateMessageArray];
More information about the vlc-devel
mailing list