[vlc-commits] skins2: use the "mute" variable

Erwan Tulou git at videolan.org
Wed Mar 20 01:45:26 CET 2013


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Tue Mar 19 23:23:27 2013 +0100| [12ae705d5f244459ab344d50b386bf5d6d70f9d6] | committer: Erwan Tulou

skins2: use the "mute" variable

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=12ae705d5f244459ab344d50b386bf5d6d70f9d6
---

 modules/gui/skins2/src/vlcproc.cpp |   15 +++++++++++----
 modules/gui/skins2/src/vlcproc.hpp |    1 +
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 6531248..d5d17f5 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -155,6 +155,7 @@ VlcProc::VlcProc( intf_thread_t *pIntf ): SkinObject( pIntf ),
     var_AddCallback( p_object, var, onGenericCallback, this );
 
     ADD_CALLBACK( pIntf->p_sys->p_playlist, "volume" )
+    ADD_CALLBACK( pIntf->p_sys->p_playlist, "mute" )
     ADD_CALLBACK( pIntf->p_libvlc, "intf-toggle-fscontrol" )
 
     ADD_CALLBACK( pIntf->p_sys->p_playlist, "random" )
@@ -201,6 +202,8 @@ VlcProc::~VlcProc()
 
     var_DelCallback( getIntf()->p_sys->p_playlist, "volume",
                      onGenericCallback, this );
+    var_DelCallback( getIntf()->p_sys->p_playlist, "mute",
+                     onGenericCallback, this );
     var_DelCallback( getIntf()->p_libvlc, "intf-toggle-fscontrol",
                      onGenericCallback, this );
 
@@ -365,6 +368,7 @@ int VlcProc::onGenericCallback( vlc_object_t *pObj, const char *pVariable,
     }
 
     ADD_CALLBACK_ENTRY( "volume", on_volume_changed, true )
+    ADD_CALLBACK_ENTRY( "mute", on_mute_changed, true )
 
     ADD_CALLBACK_ENTRY( "bit-rate", on_bit_rate_changed, false )
     ADD_CALLBACK_ENTRY( "sample-rate", on_sample_rate_changed, false )
@@ -669,8 +673,12 @@ void VlcProc::on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal )
     playlist_t* pPlaylist = getIntf()->p_sys->p_playlist;
 
     SET_VOLUME( m_cVarVolume, var_GetFloat( pPlaylist, "volume" ), false );
-    bool b_is_muted = playlist_MuteGet( pPlaylist ) > 0;
-    SET_BOOL( m_cVarMute, b_is_muted );
+}
+
+void VlcProc::on_mute_changed( vlc_object_t* p_obj, vlc_value_t newVal )
+{
+    (void)p_obj;
+    SET_BOOL( m_cVarMute, newVal.b_bool );
 }
 
 void VlcProc::on_audio_filter_changed( vlc_object_t* p_obj, vlc_value_t newVal )
@@ -773,8 +781,7 @@ void VlcProc::init_variables()
     SET_BOOL( m_cVarRepeat, var_GetBool( pPlaylist, "repeat" ) );
 
     SET_VOLUME( m_cVarVolume, var_GetFloat( pPlaylist, "volume" ), false );
-    bool b_is_muted = playlist_MuteGet( pPlaylist ) > 0;
-    SET_BOOL( m_cVarMute, b_is_muted );
+    SET_BOOL( m_cVarMute, var_GetBool( pPlaylist, "mute" ) );
 
     update_equalizer();
 }
diff --git a/modules/gui/skins2/src/vlcproc.hpp b/modules/gui/skins2/src/vlcproc.hpp
index 6373102..8c18aee 100644
--- a/modules/gui/skins2/src/vlcproc.hpp
+++ b/modules/gui/skins2/src/vlcproc.hpp
@@ -111,6 +111,7 @@ public:
     void on_repeat_changed( vlc_object_t* p_obj, vlc_value_t newVal );
 
     void on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal );
+    void on_mute_changed( vlc_object_t* p_obj, vlc_value_t newVal );
     void on_audio_filter_changed( vlc_object_t* p_obj, vlc_value_t newVal );
 
     void on_intf_show_changed( vlc_object_t* p_obj, vlc_value_t newVal );



More information about the vlc-commits mailing list