[Merge] lp:~timo-jyrinki/qtubuntu-media/port_to_new_audio_role_api into lp:qtubuntu-media
Jim Hodapp
jim.hodapp at canonical.com
Wed Oct 21 22:32:02 UTC 2015
Diff comments:
>
> === modified file 'src/aal/aalmediaplayerservice.cpp'
> --- src/aal/aalmediaplayerservice.cpp 2015-10-20 13:06:11 +0000
> +++ src/aal/aalmediaplayerservice.cpp 2015-10-21 12:23:07 +0000
> @@ -228,21 +228,41 @@
> m_videoOutput->playbackComplete();
> }
>
> +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
> QMediaPlayer::AudioRole AalMediaPlayerService::audioRole() const
> +#else
> +QAudio::Role AalMediaPlayerService::audioRole() const
> +#endif
> {
> if (m_hubPlayerSession == NULL)
> +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
> return QMediaPlayer::MultimediaRole;
> +#else
> + return QAudio::VideoRole;
> +#endif
>
> try {
> +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
> return static_cast<QMediaPlayer::AudioRole>(m_hubPlayerSession->audio_stream_role().get());
> +#else
> + return static_cast<QAudio::Role>(m_hubPlayerSession->audio_stream_role().get());
> +#endif
> }
> catch (const std::runtime_error &e) {
> qWarning() << "Failed to get audio stream role: " << e.what();
> +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
> return QMediaPlayer::MultimediaRole;
> +#else
> + return QAudio::VideoRole;
Not sure what this should be given that VideoRole and MusicRole are split up now. Unless you're deciding to make the VideoRole be singularly equivalent to the old MultimediaRole. Also, is the VideoRole the default role now? MultimediaRole used to be the default.
> +#endif
> }
> }
>
> +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
> void AalMediaPlayerService::setAudioRole(QMediaPlayer::AudioRole audioRole)
> +#else
> +void AalMediaPlayerService::setAudioRole(QAudio::Role audioRole)
> +#endif
> {
> if (m_hubPlayerSession == NULL)
> return;
> @@ -793,7 +813,11 @@
> {
> // If this player is a multimedia audioRole, then it should possible to
> // use it for MPRIS control
> +#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
> if (audioRole() == QMediaPlayer::MultimediaRole)
> +#else
> + if (audioRole() == QAudio::VideoRole)
This should be if (audioRole() == QAudio::VideoRole || audioRole() == QAudio::MusicRole) to be compatible with the old MultimediaRole. MultimediaRole was the default role and the one that general music and video playback used.
> +#endif
> {
> qDebug() << "Setting player as current player";
> try {
--
https://code.launchpad.net/~timo-jyrinki/qtubuntu-media/port_to_new_audio_role_api/+merge/273392
Your team Ubuntu Phablet Team is subscribed to branch lp:qtubuntu-media.
More information about the Ubuntu-reviews
mailing list