[vlc-commits] Qt4: try to cleanup use of AOUT_VOLUME_* and QT_VOLUME_*
Rémi Denis-Courmont
git at videolan.org
Tue Jul 26 18:35:47 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul 26 19:34:58 2011 +0300| [fb51fe1d54a9efb41241ae77b26873a7b782d29a] | committer: Rémi Denis-Courmont
Qt4: try to cleanup use of AOUT_VOLUME_* and QT_VOLUME_*
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fb51fe1d54a9efb41241ae77b26873a7b782d29a
---
modules/gui/qt4/components/controller_widget.cpp | 4 ++--
modules/gui/qt4/components/controller_widget.hpp | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index 13a1745..e765462 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -152,7 +152,7 @@ void SoundWidget::userUpdateVolume( int i_sliderVolume )
/* Only if volume is set by user action on slider */
setMuted( false );
playlist_t *p_playlist = pl_Get( p_intf );
- int i_res = i_sliderVolume * (AOUT_VOLUME_MAX / 2) / VOLUME_MAX;
+ int i_res = i_sliderVolume * QT_VOLUME_MAX / VOLUME_MAX;
aout_VolumeSet( p_playlist, i_res );
refreshLabels();
}
@@ -165,7 +165,7 @@ void SoundWidget::libUpdateVolume()
playlist_t *p_playlist = pl_Get( p_intf );
i_volume = aout_VolumeGet( p_playlist );
- i_volume = ( ( i_volume + 1 ) * VOLUME_MAX )/ (AOUT_VOLUME_MAX/2);
+ i_volume = ((i_volume + 1) * VOLUME_MAX ) / QT_VOLUME_MAX;
if ( i_volume - volumeSlider->value() != 0 )
{
diff --git a/modules/gui/qt4/components/controller_widget.hpp b/modules/gui/qt4/components/controller_widget.hpp
index c5d6b88..623af09 100644
--- a/modules/gui/qt4/components/controller_widget.hpp
+++ b/modules/gui/qt4/components/controller_widget.hpp
@@ -67,7 +67,7 @@ private slots:
void updateButtonIcons( bool, bool );
};
-#define VOLUME_MAX 200
+#define VOLUME_MAX (QT_VOLUME_MAX * 100 / QT_VOLUME_DEFAULT)
class SoundWidget : public QWidget
{
Q_OBJECT
More information about the vlc-commits
mailing list