qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60audioplayersession.h
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
    42 #ifndef S60AUDIOPLAYERSESSION_H
    42 #ifndef S60AUDIOPLAYERSESSION_H
    43 #define S60AUDIOPLAYERSESSION_H
    43 #define S60AUDIOPLAYERSESSION_H
    44 
    44 
       
    45 #include <QtCore/qobject.h>
    45 #include "s60mediaplayersession.h"
    46 #include "s60mediaplayersession.h"
    46 
    47 
    47 #ifdef S60_DRM_SUPPORTED
    48 #ifdef S60_DRM_SUPPORTED
    48 #include <drmaudiosampleplayer.h>
    49 #include <drmaudiosampleplayer.h>
    49 typedef CDrmPlayerUtility CAudioPlayer;
    50 typedef CDrmPlayerUtility CAudioPlayer;
    50 typedef MDrmAudioPlayerCallback MAudioPlayerObserver;
    51 typedef MDrmAudioPlayerCallback MAudioPlayerObserver;
    51 #else
    52 #else
    52 #include <mdaaudiosampleplayer.h>  
    53 #include <mdaaudiosampleplayer.h>
    53 typedef CMdaAudioPlayerUtility CAudioPlayer;
    54 typedef CMdaAudioPlayerUtility CAudioPlayer;
    54 typedef MMdaAudioPlayerCallback MAudioPlayerObserver;
    55 typedef MMdaAudioPlayerCallback MAudioPlayerObserver;
    55 #endif
    56 #endif
    56 
    57 
       
    58 #ifdef HAS_AUDIOROUTING
    57 #include <AudioOutput.h>
    59 #include <AudioOutput.h>
    58 #include <MAudioOutputObserver.h>
    60 #include <MAudioOutputObserver.h>
       
    61 #endif //HAS_AUDIOROUTING
    59 
    62 
    60 class S60AudioPlayerSession : public S60MediaPlayerSession
    63 class S60AudioPlayerSession : public S60MediaPlayerSession
    61                             , public MAudioPlayerObserver
    64                             , public MAudioPlayerObserver
    62                             , public MAudioLoadingObserver 
    65                             , public MAudioLoadingObserver
       
    66 #ifdef HAS_AUDIOROUTING
    63                             , public MAudioOutputObserver
    67                             , public MAudioOutputObserver
       
    68 #endif
    64 {
    69 {
    65     Q_OBJECT
    70     Q_OBJECT
    66 
       
    67 public:
    71 public:
    68     S60AudioPlayerSession(QObject *parent);
    72     S60AudioPlayerSession(QObject *parent);
    69     ~S60AudioPlayerSession();
    73     ~S60AudioPlayerSession();
    70     
    74     
    71     //From S60MediaPlayerSession
    75     //From S60MediaPlayerSession
    74 
    78 
    75     // From MAudioLoadingObserver
    79     // From MAudioLoadingObserver
    76     void MaloLoadingStarted();
    80     void MaloLoadingStarted();
    77     void MaloLoadingComplete();
    81     void MaloLoadingComplete();
    78     
    82     
       
    83 #ifdef HAS_AUDIOROUTING    
    79     // From MAudioOutputObserver
    84     // From MAudioOutputObserver
    80     void DefaultAudioOutputChanged( CAudioOutput& aAudioOutput,
    85     void DefaultAudioOutputChanged( CAudioOutput& aAudioOutput,
    81         CAudioOutput::TAudioOutputPreference aNewDefault );
    86         CAudioOutput::TAudioOutputPreference aNewDefault );
       
    87 #endif //HAS_AUDIOROUTING    
    82 
    88 
    83 public:
    89 public:
    84     // From S60MediaPlayerAudioEndpointSelector
    90     // From S60MediaPlayerAudioEndpointSelector
    85     QString activeEndpoint() const;
    91     QString activeEndpoint() const;
    86     QString defaultEndpoint() const;
    92     QString defaultEndpoint() const;
    87 public Q_SLOTS:
    93 public Q_SLOTS:
    88     void setActiveEndpoint(const QString& name);
    94     void setActiveEndpoint(const QString& name);
    89 Q_SIGNALS:
       
    90     void activeEndpointChanged(const QString & name);
       
    91 
    95 
    92 protected:
    96 protected:
    93     //From S60MediaPlayerSession
    97     //From S60MediaPlayerSession
    94     void doLoadL(const TDesC &path);
    98     void doLoadL(const TDesC &path);
    95     void doLoadUrlL(const TDesC &path){Q_UNUSED(path)/*empty implementation*/}
    99     void doLoadUrlL(const TDesC &path){Q_UNUSED(path)/*empty implementation*/}
   112 #else
   116 #else
   113     // From MDrmAudioPlayerCallback
   117     // From MDrmAudioPlayerCallback
   114     void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
   118     void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
   115     void MapcPlayComplete(TInt aError);
   119     void MapcPlayComplete(TInt aError);
   116 #endif
   120 #endif
       
   121     
       
   122 #ifdef HAS_AUDIOROUTING    
   117     QString qStringFromTAudioOutputPreference(CAudioOutput::TAudioOutputPreference output) const;
   123     QString qStringFromTAudioOutputPreference(CAudioOutput::TAudioOutputPreference output) const;
       
   124 #endif //HAS_AUDIOROUTING
   118     
   125     
   119 private:
   126 private:
   120     CAudioPlayer *m_player;
   127     CAudioPlayer *m_player;
       
   128 #ifdef HAS_AUDIOROUTING
   121     CAudioOutput *m_audioOutput;
   129     CAudioOutput *m_audioOutput;
       
   130 #endif //HAS_AUDIOROUTING
   122     QString m_audioEndpoint;
   131     QString m_audioEndpoint;
   123 };
   132 };
   124 
   133 
   125 #endif
   134 #endif