qtmobility/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp
changeset 5 453da2cfceef
parent 4 90517678cc4f
child 8 71781823f776
equal deleted inserted replaced
4:90517678cc4f 5:453da2cfceef
    72     , m_audioEndpointSelector(NULL)
    72     , m_audioEndpointSelector(NULL)
    73 { 
    73 { 
    74     m_control = new S60MediaPlayerControl(*this, this);
    74     m_control = new S60MediaPlayerControl(*this, this);
    75     m_mediaRecognizer = new S60MediaRecognizer(this);  
    75     m_mediaRecognizer = new S60MediaRecognizer(this);  
    76     m_metaData = new S60MediaMetaDataProvider(*this);
    76     m_metaData = new S60MediaMetaDataProvider(*this);
       
    77     m_audioEndpointSelector = new S60MediaPlayerAudioEndpointSelector(m_control, this);
    77 }
    78 }
    78 
    79 
    79 S60MediaPlayerService::~S60MediaPlayerService()
    80 S60MediaPlayerService::~S60MediaPlayerService()
    80 {
    81 {
    81     delete m_videoWidget;
    82     delete m_videoWidget;
    82     delete m_videoRenderer;
    83     delete m_videoRenderer;
    83     delete m_videoWindow;
    84     delete m_videoWindow;
    84     delete m_videoOutput;
    85     delete m_videoOutput;
    85     delete m_metaData;
       
    86 }
    86 }
    87 
    87 
    88 QMediaControl *S60MediaPlayerService::control(const char *name) const
    88 QMediaControl *S60MediaPlayerService::control(const char *name) const
    89 {
    89 {
    90     if (qstrcmp(name, QMediaPlayerControl_iid) == 0)
    90     if (qstrcmp(name, QMediaPlayerControl_iid) == 0)
   125             m_videoWindow = new S60VideoOverlay;
   125             m_videoWindow = new S60VideoOverlay;
   126         return m_videoWindow;
   126         return m_videoWindow;
   127     }
   127     }
   128 
   128 
   129     if (qstrcmp(name, QAudioEndpointSelector_iid) == 0) {
   129     if (qstrcmp(name, QAudioEndpointSelector_iid) == 0) {
   130         if (!m_audioEndpointSelector)
       
   131             m_audioEndpointSelector = new S60MediaPlayerAudioEndpointSelector(m_control);
       
   132         return m_audioEndpointSelector;
   130         return m_audioEndpointSelector;
   133     }
   131     }
   134 
   132 
   135     return 0;
   133     return 0;
   136 
   134 
   207                 m_control, SIGNAL(availablePlaybackRangesChanged(const QMediaTimeRange&)));
   205                 m_control, SIGNAL(availablePlaybackRangesChanged(const QMediaTimeRange&)));
   208         connect(m_videoPlayerSession, SIGNAL(error(int, const QString &)),
   206         connect(m_videoPlayerSession, SIGNAL(error(int, const QString &)),
   209                 m_control, SIGNAL(error(int, const QString &)));
   207                 m_control, SIGNAL(error(int, const QString &)));
   210         connect(m_videoPlayerSession, SIGNAL(metaDataChanged()), 
   208         connect(m_videoPlayerSession, SIGNAL(metaDataChanged()), 
   211                 m_metaData, SIGNAL(metaDataChanged()));
   209                 m_metaData, SIGNAL(metaDataChanged()));
       
   210         connect(m_videoPlayerSession, SIGNAL(activeEndpointChanged(const QString&)), 
       
   211                 m_audioEndpointSelector, SIGNAL(activeEndpointChanged(const QString&)));
   212     }
   212     }
   213     
   213     
   214     m_videoPlayerSession->setVolume(m_control->mediaControlSettings().volume());
   214     m_videoPlayerSession->setVolume(m_control->mediaControlSettings().volume());
   215     m_videoPlayerSession->setMuted(m_control->mediaControlSettings().isMuted());
   215     m_videoPlayerSession->setMuted(m_control->mediaControlSettings().isMuted());
       
   216     m_videoPlayerSession->setAudioEndpoint(m_control->mediaControlSettings().audioEndpoint());
   216     return m_videoPlayerSession;
   217     return m_videoPlayerSession;
   217 }
   218 }
   218 
   219 
   219 S60MediaPlayerSession* S60MediaPlayerService::AudioPlayerSession()
   220 S60MediaPlayerSession* S60MediaPlayerService::AudioPlayerSession()
   220 {
   221 {
   241                 m_control, SIGNAL(availablePlaybackRangesChanged(const QMediaTimeRange&)));
   242                 m_control, SIGNAL(availablePlaybackRangesChanged(const QMediaTimeRange&)));
   242         connect(m_audioPlayerSession, SIGNAL(error(int, const QString &)),
   243         connect(m_audioPlayerSession, SIGNAL(error(int, const QString &)),
   243                 m_control, SIGNAL(error(int, const QString &)));
   244                 m_control, SIGNAL(error(int, const QString &)));
   244         connect(m_audioPlayerSession, SIGNAL(metaDataChanged()), 
   245         connect(m_audioPlayerSession, SIGNAL(metaDataChanged()), 
   245                 m_metaData, SIGNAL(metaDataChanged()));
   246                 m_metaData, SIGNAL(metaDataChanged()));
       
   247         connect(m_audioPlayerSession, SIGNAL(activeEndpointChanged(const QString&)), 
       
   248                 m_audioEndpointSelector, SIGNAL(activeEndpointChanged(const QString&)));
   246     }
   249     }
   247     
   250     
   248     m_audioPlayerSession->setVolume(m_control->mediaControlSettings().volume());
   251     m_audioPlayerSession->setVolume(m_control->mediaControlSettings().volume());
   249     m_audioPlayerSession->setMuted(m_control->mediaControlSettings().isMuted());
   252     m_audioPlayerSession->setMuted(m_control->mediaControlSettings().isMuted());
       
   253     m_audioPlayerSession->setAudioEndpoint(m_control->mediaControlSettings().audioEndpoint());
   250     return m_audioPlayerSession;
   254     return m_audioPlayerSession;
   251 }
   255 }