diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-09-29 08:40:42 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-09-29 15:44:42 (GMT) |
commit | a9ea6e24db0e25ec8c84c9a29356aac999421d07 (patch) | |
tree | 04cc7cb1206268282f1eecc52425bef0cad0f6b1 /src/3rdparty/phonon/mmf/abstractplayer.h | |
parent | 17c17adbd706d32723ecedeb207c7e467f9fa8eb (diff) | |
download | Qt-a9ea6e24db0e25ec8c84c9a29356aac999421d07.zip Qt-a9ea6e24db0e25ec8c84c9a29356aac999421d07.tar.gz Qt-a9ea6e24db0e25ec8c84c9a29356aac999421d07.tar.bz2 |
Changes for fixing media object.
This brings tst_MediaObject to 15/7, from previously not running. Changes
involves:
* Skipping .qrc related tests
* Loading/mimetype detction from file:/ URIs
* State fixes
* As part of previous point, move state and error handling down in
AbstractPlayer.
Diffstat (limited to 'src/3rdparty/phonon/mmf/abstractplayer.h')
-rw-r--r-- | src/3rdparty/phonon/mmf/abstractplayer.h | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 72d0a3b..9f9057d 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -75,9 +75,8 @@ public: virtual bool hasVideo() const = 0; virtual bool isSeekable() const = 0; virtual qint64 currentTime() const = 0; - virtual Phonon::State state() const = 0; - virtual QString errorString() const = 0; - virtual Phonon::ErrorType errorType() const = 0; + virtual Phonon::ErrorType errorType() const; + virtual QString errorString() const; virtual qint64 totalTime() const = 0; virtual Phonon::MediaSource source() const = 0; // This is a temporary hack to work around KErrInUse from MMF @@ -88,6 +87,12 @@ public: void setVideoOutput(VideoOutput* videoOutput); + /** + * Records error and changes state to ErrorState + */ + void setError(Phonon::ErrorType error); + + Phonon::State state() const; Q_SIGNALS: void totalTimeChanged(qint64 length); void finished(); @@ -97,8 +102,41 @@ Q_SIGNALS: protected: + /** + * Defined private state enumeration in order to add GroundState + */ + enum PrivateState { + LoadingState = Phonon::LoadingState, + StoppedState = Phonon::StoppedState, + PlayingState = Phonon::PlayingState, + BufferingState = Phonon::BufferingState, + PausedState = Phonon::PausedState, + ErrorState = Phonon::ErrorState, + GroundState + }; + + /** + * Converts PrivateState into the corresponding Phonon::State + */ + Phonon::State phononState() const; + + /** + * Converts PrivateState into the corresponding Phonon::State + */ + static Phonon::State phononState(PrivateState state); + virtual void videoOutputChanged(); + PrivateState privateState() const; + + virtual void changeState(PrivateState newState) = 0; + + /** + * Modifies m_state directly. Typically you want to call changeState(), + * which performs the business logic. + */ + void setState(PrivateState newState); + private: virtual void doSetTickInterval(qint32 interval) = 0; @@ -107,6 +145,8 @@ protected: VideoOutput* m_videoOutput; private: + PrivateState m_state; + Phonon::ErrorType m_error; qint32 m_tickInterval; qint32 m_transitionTime; qint32 m_prefinishMark; |