[vlc-commits] aout_MuteGet: fix name and add VLC_OBJECT() magic cast

Rémi Denis-Courmont git at videolan.org
Tue Jul 3 17:04:15 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul  2 17:51:43 2012 +0300| [035898d1b1d3732ec7a872152ec5528da48b4e90] | committer: Rémi Denis-Courmont

aout_MuteGet: fix name and add VLC_OBJECT() magic cast

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

 include/vlc_aout_intf.h                          |    3 ++-
 lib/audio.c                                      |    2 +-
 modules/control/hotkeys.c                        |    2 +-
 modules/gui/macosx/CoreInteraction.m             |    2 +-
 modules/gui/qt4/components/controller_widget.cpp |    2 +-
 modules/gui/skins2/src/vlcproc.cpp               |    4 ++--
 src/audio_output/intf.c                          |    4 +++-
 src/libvlccore.sym                               |    2 +-
 8 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/include/vlc_aout_intf.h b/include/vlc_aout_intf.h
index e889ef1..dd23541 100644
--- a/include/vlc_aout_intf.h
+++ b/include/vlc_aout_intf.h
@@ -40,7 +40,8 @@ VLC_API int aout_MuteToggle( vlc_object_t * );
 #define aout_MuteToggle(a) aout_MuteToggle(VLC_OBJECT(a))
 VLC_API int aout_MuteSet( vlc_object_t *, bool );
 #define aout_MuteSet(a, b) aout_MuteSet(VLC_OBJECT(a), b)
-VLC_API bool aout_IsMuted( vlc_object_t * );
+VLC_API int aout_MuteGet( vlc_object_t * );
+#define aout_MuteGet(a) aout_MuteGet(VLC_OBJECT(a))
 
 VLC_API void aout_EnableFilter( vlc_object_t *, const char *, bool );
 #define aout_EnableFilter( o, n, b ) \
diff --git a/lib/audio.c b/lib/audio.c
index 91e96b1..a26733e 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -318,7 +318,7 @@ void libvlc_audio_toggle_mute( libvlc_media_player_t *mp )
 
 int libvlc_audio_get_mute( libvlc_media_player_t *mp )
 {
-    return aout_IsMuted( VLC_OBJECT(mp) );
+    return aout_MuteGet( mp );
 }
 
 void libvlc_audio_set_mute( libvlc_media_player_t *mp, int mute )
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index d7e1eee..868d523 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -203,7 +203,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
         case ACTIONID_VOL_MUTE:
             if( aout_MuteToggle( p_playlist ) == 0 && p_vout != NULL )
             {
-                if( aout_IsMuted( VLC_OBJECT(p_playlist) ) )
+                if( aout_MuteGet( p_playlist ) > 0 )
                 {
                     ClearChannels( p_intf, p_vout );
                     DisplayIcon( p_vout, OSD_MUTE_ICON );
diff --git a/modules/gui/macosx/CoreInteraction.m b/modules/gui/macosx/CoreInteraction.m
index 0602a6f..c9144bf 100644
--- a/modules/gui/macosx/CoreInteraction.m
+++ b/modules/gui/macosx/CoreInteraction.m
@@ -504,7 +504,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
         return NO;
 
     BOOL b_is_muted = NO;
-    b_is_muted = aout_IsMuted( VLC_OBJECT(pl_Get( p_intf )) );
+    b_is_muted = aout_MuteGet( pl_Get( p_intf ) ) > 0;
 
     return b_is_muted;
 }
diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index 25163cd..f0df353 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -185,7 +185,7 @@ void SoundWidget::valueChangedFilter( int i_val )
 void SoundWidget::updateMuteStatus()
 {
     playlist_t *p_playlist = pl_Get( p_intf );
-    b_is_muted = aout_IsMuted( VLC_OBJECT(p_playlist) );
+    b_is_muted = aout_MuteGet( p_playlist ) > 0;
 
     SoundSlider *soundSlider = qobject_cast<SoundSlider *>(volumeSlider);
     if( soundSlider )
diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
index 9c15e88..119b095 100644
--- a/modules/gui/skins2/src/vlcproc.cpp
+++ b/modules/gui/skins2/src/vlcproc.cpp
@@ -695,7 +695,7 @@ void VlcProc::on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal )
 
     audio_volume_t volume = aout_VolumeGet( pPlaylist );
     SET_VOLUME( m_cVarVolume, volume, false );
-    bool b_is_muted = aout_IsMuted( VLC_OBJECT(pPlaylist) );
+    bool b_is_muted = aout_MuteGet( pPlaylist ) > 0;
     SET_BOOL( m_cVarMute, b_is_muted );
 }
 
@@ -800,7 +800,7 @@ void VlcProc::init_variables()
 
     audio_volume_t volume = aout_VolumeGet( pPlaylist );
     SET_VOLUME( m_cVarVolume, volume, false );
-    bool b_is_muted = aout_IsMuted( VLC_OBJECT(pPlaylist) );
+    bool b_is_muted = aout_MuteGet( pPlaylist ) > 0;
     SET_BOOL( m_cVarMute, b_is_muted );
 
     update_equalizer();
diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c
index 1182ea6..044618e 100644
--- a/src/audio_output/intf.c
+++ b/src/audio_output/intf.c
@@ -195,10 +195,12 @@ int aout_MuteToggle (vlc_object_t *obj)
     return commitVolume (obj, aout, vol, mute);
 }
 
+#undef aout_MuteGet
 /**
  * Gets the output mute status.
+ * \return 0 if not muted, 1 if muted, -1 if undefined.
  */
-bool aout_IsMuted (vlc_object_t *obj)
+int aout_MuteGet (vlc_object_t *obj)
 {
     audio_output_t *aout;
     bool mute;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 45c8494..60c4ebd 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -19,7 +19,7 @@ aout_VolumeSet
 aout_VolumeUp
 aout_MuteToggle
 aout_MuteSet
-aout_IsMuted
+aout_MuteGet
 aout_VolumeSoftInit
 aout_VolumeHardInit
 block_Alloc



More information about the vlc-commits mailing list