diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-18 12:39:40 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-11-18 12:39:40 (GMT) |
commit | d46da3a141ad05c9f7cd7ea94e254980748329da (patch) | |
tree | 72beadfabcf66d725b10bbc5ce3d8c38137ed888 /src/3rdparty/phonon/mmf/audiooutput.cpp | |
parent | 62e641691b9a3eadc8b9fb2e31150cdf5b66115d (diff) | |
parent | 6f6b2ab07c0dbd0ebdb25f1fbe537ea12bdffee4 (diff) | |
download | Qt-d46da3a141ad05c9f7cd7ea94e254980748329da.zip Qt-d46da3a141ad05c9f7cd7ea94e254980748329da.tar.gz Qt-d46da3a141ad05c9f7cd7ea94e254980748329da.tar.bz2 |
Merge remote branch 'mainline/4.6' into 4.6
Diffstat (limited to 'src/3rdparty/phonon/mmf/audiooutput.cpp')
-rw-r--r-- | src/3rdparty/phonon/mmf/audiooutput.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp index 82af9f1..d6e0c13 100644 --- a/src/3rdparty/phonon/mmf/audiooutput.cpp +++ b/src/3rdparty/phonon/mmf/audiooutput.cpp @@ -24,7 +24,6 @@ along with this library. If not, see <http://www.gnu.org/licenses/>. #include "defs.h" #include "mediaobject.h" #include "utils.h" -#include "volumeobserver.h" QT_BEGIN_NAMESPACE @@ -41,7 +40,6 @@ using namespace Phonon::MMF; MMF::AudioOutput::AudioOutput(Backend *, QObject *parent) : MediaNode(parent) , m_volume(InitialVolume) - , m_observer(0) { } @@ -59,12 +57,9 @@ qreal MMF::AudioOutput::volume() const void MMF::AudioOutput::setVolume(qreal volume) { TRACE_CONTEXT(AudioOutput::setVolume, EAudioApi); - TRACE_ENTRY("observer 0x%08x volume %f", m_observer, volume); + TRACE_ENTRY("volume %f", volume); if (volume != m_volume) { - if (m_observer) { - m_observer->volumeChanged(volume); - } m_volume = volume; TRACE("emit volumeChanged(%f)", volume) @@ -86,17 +81,12 @@ bool MMF::AudioOutput::setOutputDevice(int index) return true; } -void MMF::AudioOutput::setVolumeObserver(VolumeObserver* observer) -{ - m_observer = observer; - if (m_observer) { - m_observer->volumeChanged(m_volume); - } -} - bool MMF::AudioOutput::activateOnMediaObject(MediaObject *mo) { - setVolumeObserver(mo); + // Ensure that the MediaObject has the correct initial volume + mo->volumeChanged(m_volume); + // Connect MediaObject to receive future volume changes + connect(this, SIGNAL(volumeChanged(qreal)), mo, SLOT(volumeChanged(qreal))); return true; } |