src/3rdparty/phonon/mmf/abstractplayer.h
changeset 18 2f34d5167611
parent 3 41300fa6a67c
child 8 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 18:2f34d5167611
    17 */
    17 */
    18 
    18 
    19 #ifndef PHONON_MMF_ABSTRACTPLAYER_H
    19 #ifndef PHONON_MMF_ABSTRACTPLAYER_H
    20 #define PHONON_MMF_ABSTRACTPLAYER_H
    20 #define PHONON_MMF_ABSTRACTPLAYER_H
    21 
    21 
    22 #include <Phonon/phononnamespace.h>
    22 #include <phonon/phononnamespace.h>
    23 #include <Phonon/MediaSource.h>
    23 #include <phonon/mediasource.h>
    24 
    24 
    25 #include <QObject>
    25 #include <QObject>
    26 
    26 
    27 #include "videooutput.h"
    27 #include "videooutput.h"
    28 
    28 
    51     // Required although this class has no signals or slots
    51     // Required although this class has no signals or slots
    52     // Without this, qobject_cast will fail
    52     // Without this, qobject_cast will fail
    53     Q_OBJECT
    53     Q_OBJECT
    54 
    54 
    55 public:
    55 public:
    56     AbstractPlayer();
    56     AbstractPlayer(const AbstractPlayer *player);
    57     explicit AbstractPlayer(const AbstractPlayer& player);
    57 
       
    58     virtual void open(const Phonon::MediaSource&, RFile&) = 0;
    58 
    59 
    59     // MediaObjectInterface (implemented)
    60     // MediaObjectInterface (implemented)
    60     qint32 tickInterval() const;
    61     qint32 tickInterval() const;
    61     void setTickInterval(qint32);
    62     void setTickInterval(qint32);
    62     void setTransitionTime(qint32);
    63     void setTransitionTime(qint32);
    73     virtual bool isSeekable() const = 0;
    74     virtual bool isSeekable() const = 0;
    74     virtual qint64 currentTime() const = 0;
    75     virtual qint64 currentTime() const = 0;
    75     virtual Phonon::ErrorType errorType() const;
    76     virtual Phonon::ErrorType errorType() const;
    76     virtual QString errorString() const;
    77     virtual QString errorString() const;
    77     virtual qint64 totalTime() const = 0;
    78     virtual qint64 totalTime() const = 0;
    78     virtual Phonon::MediaSource source() const = 0;
       
    79     // This is a temporary hack to work around KErrInUse from MMF
       
    80     // client utility OpenFileL calls
       
    81     //virtual void setSource(const Phonon::MediaSource &) = 0;
       
    82     virtual void setFileSource(const Phonon::MediaSource&, RFile&) = 0;
       
    83     virtual void setNextSource(const Phonon::MediaSource &) = 0;
       
    84 
    79 
    85     virtual void volumeChanged(qreal volume);
    80     virtual void volumeChanged(qreal volume);
    86 
    81 
    87     void setVideoOutput(VideoOutput* videoOutput);
    82     void setVideoOutput(VideoOutput* videoOutput);
    88 
    83 
    89     /**
    84     /**
    90      * Records error and changes state to ErrorState
    85      * Records error message and changes state to ErrorState
    91      */
    86      */
    92     void setError(Phonon::ErrorType error,
    87     void setError(const QString &errorMessage);
    93                   const QString &errorMessage = QString());
    88 
       
    89     /**
       
    90      * Records error message and changes state to ErrorState
       
    91      *
       
    92      * Appends a human-readable version of symbianErrorCode to the error message,
       
    93      * e.g.
       
    94      * @code
       
    95      *      setError("Opening file failed", KErrPermissionDenied)
       
    96      * @endcode
       
    97      * results in the following error message:
       
    98      *      "Opening file failed: permission denied"
       
    99      */
       
   100     void setError(const QString &errorMessage, int symbianErrorCode);
    94 
   101 
    95     Phonon::State state() const;
   102     Phonon::State state() const;
    96 
   103 
    97 Q_SIGNALS:
   104 Q_SIGNALS:
    98     void totalTimeChanged(qint64 length);
   105     void totalTimeChanged(qint64 length);
    99     void finished();
   106     void finished();
   100     void tick(qint64 time);
   107     void tick(qint64 time);
   101     void stateChanged(Phonon::State oldState,
   108     void bufferStatus(int percentFilled);
   102                       Phonon::State newState);
   109     void stateChanged(Phonon::State newState,
       
   110                       Phonon::State oldState);
   103     void metaDataChanged(const QMultiMap<QString, QString>& metaData);
   111     void metaDataChanged(const QMultiMap<QString, QString>& metaData);
       
   112     void aboutToFinish();
       
   113     void prefinishMarkReached(qint32 remaining);
   104 
   114 
   105 protected:
   115 protected:
   106     /**
   116     /**
   107      * Defined private state enumeration in order to add GroundState
   117      * Defined private state enumeration in order to add GroundState
   108      */
   118      */