diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-06-19 22:03:07 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2009-06-19 22:03:07 +0000 |
| commit | 5bf1064719a6e0584ad44fcb18a8c2f1c9ca1803 (patch) | |
| tree | 88538467a399026521a2344fc0b93e76d7666168 | |
| parent | 31d3fbf7548209bcbf0c2b6ab3fce8d4b8ce7f0c (diff) | |
| download | qmmp-5bf1064719a6e0584ad44fcb18a8c2f1c9ca1803.tar.gz qmmp-5bf1064719a6e0584ad44fcb18a8c2f1c9ca1803.tar.bz2 qmmp-5bf1064719a6e0584ad44fcb18a8c2f1c9ca1803.zip | |
fixed audio skipping when using soft volume
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@973 90c681e8-e032-0410-971d-27865f9a5e38
| -rw-r--r-- | src/qmmp/volumecontrol.cpp | 10 | ||||
| -rw-r--r-- | src/qmmp/volumecontrol.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/qmmp/volumecontrol.cpp b/src/qmmp/volumecontrol.cpp index 4de0dc8a6..70d0b7a70 100644 --- a/src/qmmp/volumecontrol.cpp +++ b/src/qmmp/volumecontrol.cpp @@ -31,6 +31,7 @@ VolumeControl::VolumeControl(QObject *parent) { m_left = 0; m_right = 0; + m_prev_block = FALSE; } VolumeControl::~VolumeControl() @@ -71,12 +72,15 @@ void VolumeControl::checkVolume() r = (r > 100) ? 100 : r; l = (l < 0) ? 0 : l; r = (r < 0) ? 0 : r; - if (m_left != l || m_right != r) + if (m_left != l || m_right != r) //volume has been changed { m_left = l; m_right = r; emit volumeChanged(m_left, m_right); } + else if(m_prev_block && !signalsBlocked ()) //signals have been unblocked + emit volumeChanged(m_left, m_right); + m_prev_block = signalsBlocked (); } SoftwareVolume *SoftwareVolume::m_instance = 0; @@ -87,9 +91,11 @@ SoftwareVolume::SoftwareVolume(QObject *parent) QSettings settings(Qmmp::configFile(), QSettings::IniFormat); m_left = settings.value("Volume/left", 80).toInt(); m_right = settings.value("Volume/right", 80).toInt(); + blockSignals(TRUE); + checkVolume(); + blockSignals(FALSE); QTimer::singleShot(125, this, SLOT(checkVolume())); m_instance = this; - //checkVolume(); } SoftwareVolume::~SoftwareVolume() diff --git a/src/qmmp/volumecontrol.h b/src/qmmp/volumecontrol.h index 68e0536fc..c08833e4e 100644 --- a/src/qmmp/volumecontrol.h +++ b/src/qmmp/volumecontrol.h @@ -83,6 +83,7 @@ protected: private: int m_left, m_right; + bool m_prev_block; }; /*! @brief The SoftwareVolume class provides access to the software volume control. |
