diff options
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 28 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractmediaplayer.h | 1 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractplayer.cpp | 14 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractplayer.h | 7 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/dummyplayer.cpp | 10 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/dummyplayer.h | 3 |
6 files changed, 34 insertions, 29 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 82dcd7c..b9adbe5 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -41,7 +41,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer() : , m_error(NoError) , m_playPending(false) , m_tickTimer(new QTimer(this)) - , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) { connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); @@ -53,7 +52,6 @@ MMF::AbstractMediaPlayer::AbstractMediaPlayer(const AbstractPlayer& player) : , m_error(NoError) , m_playPending(false) , m_tickTimer(new QTimer(this)) - , m_volume(InitialVolume) , m_mmfMaxVolume(NullMaxVolume) { connect(m_tickTimer.data(), SIGNAL(timeout()), this, SLOT(tick())); @@ -330,7 +328,7 @@ void MMF::AbstractMediaPlayer::volumeChanged(qreal volume) TRACE_CONTEXT(AbstractMediaPlayer::volumeChanged, EAudioInternal); TRACE_ENTRY("state %d", m_state); - m_volume = volume; + AbstractPlayer::volumeChanged(volume); doVolumeChanged(); TRACE_EXIT_0(); @@ -418,17 +416,21 @@ void MMF::AbstractMediaPlayer::changeState(PrivateState newState) m_state = newState; - // Check whether play() was called while clip was being loaded. If so, - // playback should be started now if ( - LoadingState == oldPhononState - and StoppedState == newPhononState - and m_playPending - ) { - TRACE_0("play was called while loading; starting playback now"); - m_playPending = false; - play(); - } + LoadingState == oldPhononState + and StoppedState == newPhononState + ) { + // Ensure initial volume is set on MMF API before starting playback + doVolumeChanged(); + + // Check whether play() was called while clip was being loaded. If so, + // playback should be started now + if (m_playPending) { + TRACE_0("play was called while loading; starting playback now"); + m_playPending = false; + play(); + } + } TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index e69f325..0487386 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -139,7 +139,6 @@ private: QScopedPointer<QTimer> m_tickTimer; - qreal m_volume; int m_mmfMaxVolume; MediaSource m_source; diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 6ed5d51..99393b2 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -31,15 +31,17 @@ using namespace Phonon::MMF; MMF::AbstractPlayer::AbstractPlayer() : m_videoOutput(0) + , m_volume(InitialVolume) , m_tickInterval(DefaultTickInterval) , m_transitionTime(0) - , m_prefinishMark(0) + , m_prefinishMark(0) { } MMF::AbstractPlayer::AbstractPlayer(const AbstractPlayer& player) : m_videoOutput(player.m_videoOutput) + , m_volume(player.m_volume) , m_tickInterval(player.tickInterval()) , m_transitionTime(player.transitionTime()) , m_prefinishMark(player.prefinishMark()) @@ -84,6 +86,16 @@ void MMF::AbstractPlayer::setTransitionTime(qint32 time) //----------------------------------------------------------------------------- +// VolumeObserver +//----------------------------------------------------------------------------- + +void MMF::AbstractPlayer::volumeChanged(qreal volume) +{ + m_volume = volume; +} + + +//----------------------------------------------------------------------------- // Video output //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 72d0a3b..f28322e 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -86,6 +86,9 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&) = 0; virtual void setNextSource(const Phonon::MediaSource &) = 0; + // VolumeObserver + virtual void volumeChanged(qreal volume); + void setVideoOutput(VideoOutput* videoOutput); Q_SIGNALS: @@ -105,7 +108,9 @@ private: protected: // Not owned VideoOutput* m_videoOutput; - + + qreal m_volume; + private: qint32 m_tickInterval; qint32 m_transitionTime; diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index dc55af7..688199a 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -115,16 +115,6 @@ void MMF::DummyPlayer::setNextSource(const MediaSource &) //----------------------------------------------------------------------------- -// VolumeObserver -//----------------------------------------------------------------------------- - -void MMF::DummyPlayer::volumeChanged(qreal) -{ - -} - - -//----------------------------------------------------------------------------- // AbstractPlayer //----------------------------------------------------------------------------- diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h index b2725df..3b66f1a 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.h +++ b/src/3rdparty/phonon/mmf/dummyplayer.h @@ -62,9 +62,6 @@ public: virtual void setFileSource(const Phonon::MediaSource&, RFile&); virtual void setNextSource(const MediaSource &source); - // VolumeObserver - virtual void volumeChanged(qreal volume); - // AbstractPlayer virtual void doSetTickInterval(qint32 interval); |