src/3rdparty/phonon/mmf/mediaobject.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_MEDIAOBJECT_H
    19 #ifndef PHONON_MMF_MEDIAOBJECT_H
    20 #define PHONON_MMF_MEDIAOBJECT_H
    20 #define PHONON_MMF_MEDIAOBJECT_H
    21 
    21 
    22 #include <Phonon/MediaSource>
    22 #include <phonon/mediasource.h>
    23 #include <Phonon/MediaObjectInterface>
    23 #include <phonon/mediaobjectinterface.h>
    24 #include <QScopedPointer>
    24 #include <QScopedPointer>
    25 #include <QTimer>
    25 #include <QTimer>
    26 
    26 
    27 // For recognizer
    27 // For recognizer
    28 #include <apgcli.h>
    28 #include <apgcli.h>
    73     virtual qint32 prefinishMark() const;
    73     virtual qint32 prefinishMark() const;
    74     virtual void setPrefinishMark(qint32);
    74     virtual void setPrefinishMark(qint32);
    75     virtual qint32 transitionTime() const;
    75     virtual qint32 transitionTime() const;
    76     virtual void setTransitionTime(qint32);
    76     virtual void setTransitionTime(qint32);
    77 
    77 
       
    78     // MediaNode
       
    79     void connectMediaObject(MediaObject *mediaObject);
       
    80     void disconnectMediaObject(MediaObject *mediaObject);
       
    81 
    78     /**
    82     /**
    79      * This class owns the AbstractPlayer, and will delete it upon
    83      * This class owns the AbstractPlayer, and will delete it upon
    80      * destruction.
    84      * destruction.
    81      */
    85      */
    82     AbstractPlayer *abstractPlayer() const;
    86     AbstractPlayer *abstractPlayer() const;
    83 
    87 
    84     void setVideoOutput(VideoOutput* videoOutput);
    88     void setVideoOutput(VideoOutput* videoOutput);
    85 
    89 
    86     virtual bool activateOnMediaObject(MediaObject *);
       
    87 
       
    88 public Q_SLOTS:
    90 public Q_SLOTS:
    89     void volumeChanged(qreal volume);
    91     void volumeChanged(qreal volume);
       
    92     void switchToNextSource();
    90 
    93 
    91 Q_SIGNALS:
    94 Q_SIGNALS:
       
    95     void abstractPlayerChanged(AbstractPlayer *player);
    92     void totalTimeChanged(qint64 length);
    96     void totalTimeChanged(qint64 length);
    93     void hasVideoChanged(bool hasVideo);
    97     void hasVideoChanged(bool hasVideo);
    94     void seekableChanged(bool seekable);
    98     void seekableChanged(bool seekable);
    95     // TODO: emit bufferStatus from MediaObject
       
    96     void bufferStatus(int);
    99     void bufferStatus(int);
    97     // TODO: emit aboutToFinish from MediaObject
       
    98     void aboutToFinish();
   100     void aboutToFinish();
    99     // TODO: emit prefinishMarkReached from MediaObject
   101     void prefinishMarkReached(qint32 remaining);
   100     void prefinishMarkReached(qint32);
       
   101     // TODO: emit metaDataChanged from MediaObject
   102     // TODO: emit metaDataChanged from MediaObject
   102     void metaDataChanged(const QMultiMap<QString, QString>& metaData);
   103     void metaDataChanged(const QMultiMap<QString, QString>& metaData);
   103     void currentSourceChanged(const MediaSource& source);
   104     void currentSourceChanged(const MediaSource& source);
   104     void stateChanged(Phonon::State oldState,
   105     void stateChanged(Phonon::State newState,
   105                       Phonon::State newState);
   106                       Phonon::State oldState);
   106     void finished();
   107     void finished();
   107     void tick(qint64 time);
   108     void tick(qint64 time);
   108 
   109 
   109 private:
   110 private:
       
   111     void switchToSource(const MediaSource &source);
   110     void createPlayer(const MediaSource &source);
   112     void createPlayer(const MediaSource &source);
   111     bool openRecognizer();
   113     bool openRecognizer();
   112 
   114 
   113     // Audio / video media type recognition
   115     // Audio / video media type recognition
   114     MediaType fileMediaType(const QString& fileName);
   116     MediaType fileMediaType(const QString& fileName);
   121     // Audio / video media type recognition
   123     // Audio / video media type recognition
   122     bool                                m_recognizerOpened;
   124     bool                                m_recognizerOpened;
   123     RApaLsSession                       m_recognizer;
   125     RApaLsSession                       m_recognizer;
   124     RFs                                 m_fileServer;
   126     RFs                                 m_fileServer;
   125 
   127 
       
   128     MediaSource                         m_source;
       
   129     MediaSource                         m_nextSource;
       
   130     bool                                m_nextSourceSet;
       
   131 
   126     // Storing the file handle here to work around KErrInUse error
   132     // Storing the file handle here to work around KErrInUse error
   127     // from MMF player utility OpenFileL functions
   133     // from MMF player utility OpenFileL functions
   128     RFile                               m_file;
   134     RFile                               m_file;
   129 
   135 
   130     QScopedPointer<AbstractPlayer>      m_player;
   136     QScopedPointer<AbstractPlayer>      m_player;