Merge lp:~tiagosh/telephony-service/support_new_audio_role_api into lp:telephony-service

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 1150
Merged at revision: 1149
Proposed branch: lp:~tiagosh/telephony-service/support_new_audio_role_api
Merge into: lp:telephony-service
Diff against target: 27 lines (+8/-0)
1 file modified
libtelephonyservice/ringtone.cpp (+8/-0)
To merge this branch: bzr merge lp:~tiagosh/telephony-service/support_new_audio_role_api
Reviewer Review Type Date Requested Status
Gustavo Pichorim Boiko (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+279267@code.launchpad.net

Commit message

Support new audio role api.

Description of the change

Support new audio role api.

To post a comment you must log in.
1150. By Tiago Salem Herrmann

Change QMediaPlayer to QAudio

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libtelephonyservice/ringtone.cpp'
2--- libtelephonyservice/ringtone.cpp 2015-11-03 17:32:53 +0000
3+++ libtelephonyservice/ringtone.cpp 2015-12-02 13:17:25 +0000
4@@ -46,7 +46,11 @@
5 // pick up the new ringtone in case it changed in the meantime
6 mCallAudioPlaylist.addMedia(QUrl::fromLocalFile(GreeterContacts::instance()->incomingCallSound()));
7 mCallAudioPlayer = new QMediaPlayer(this);
8+#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
9 mCallAudioPlayer->setAudioRole(QMediaPlayer::AlertRole);
10+#else
11+ mCallAudioPlayer->setAudioRole(QAudio::RingtoneRole);
12+#endif
13 mCallAudioPlayer->setPlaylist(&mCallAudioPlaylist);
14 mCallAudioPlayer->play();
15 }
16@@ -74,7 +78,11 @@
17
18 if (!mMessageAudioPlayer) {
19 mMessageAudioPlayer = new QMediaPlayer(this);
20+#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
21 mMessageAudioPlayer->setAudioRole(QMediaPlayer::AlertRole);
22+#else
23+ mMessageAudioPlayer->setAudioRole(QAudio::NotificationRole);
24+#endif
25 }
26
27 // WORKAROUND: there is a bug in qmediaplayer/(media-hub?) that never goes into Stopped mode.

Subscribers

People subscribed via source and target branches