Merge lp:~phablet-team/qtubuntu-media/fix-1528898 into lp:qtubuntu-media/stable
- fix-1528898
- Merge into stable
Proposed by
Jim Hodapp
Status: | Superseded |
---|---|
Proposed branch: | lp:~phablet-team/qtubuntu-media/fix-1528898 |
Merge into: | lp:qtubuntu-media/stable |
Prerequisite: | lp:~phablet-team/qtubuntu-media/fix-removemedia |
Diff against target: |
495 lines (+213/-53) 11 files modified
debian/changelog (+109/-42) src/aal/aalmediaplayercontrol.cpp (+8/-0) src/aal/aalmediaplayercontrol.h (+5/-0) src/aal/aalmediaplayerservice.cpp (+24/-0) src/aal/aalmediaplayerservice.h (+5/-0) src/aal/aalmediaplaylistcontrol.cpp (+27/-3) src/aal/aalmediaplaylistcontrol.h (+1/-0) src/aal/aalmediaplaylistprovider.cpp (+23/-7) src/aal/aalmediaplaylistprovider.h (+3/-0) src/aal/aalutility.cpp (+7/-0) tests/unit/service.h (+1/-1) |
To merge this branch: | bzr merge lp:~phablet-team/qtubuntu-media/fix-1528898 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alfonso Sanchez-Beato | Approve | ||
Andrew Hayzen (community) | Approve | ||
Review via email: mp+281550@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-01-12.
Commit message
Fix bug #1528898
Description of the change
Fix bug #1528898
To post a comment you must log in.
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
See inline comment.
review:
Needs Fixing
- 98. By Jim Hodapp
-
Make sure that selecting a random track from the songs list still works as expected.
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
Looks good, but I have spotted a small formatting issue, see comment.
- 99. By Jim Hodapp
-
Get rid of spurious '+'
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
LGTM
review:
Approve
- 100. By Jim Hodapp
-
Merged with trunk
Unmerged revisions
- 100. By Jim Hodapp
-
Merged with trunk
- 99. By Jim Hodapp
-
Get rid of spurious '+'
- 98. By Jim Hodapp
-
Make sure that selecting a random track from the songs list still works as expected.
- 97. By Jim Hodapp
-
Fix bug #1528898
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2016-01-04 14:09:33 +0000 | |||
3 | +++ debian/changelog 2016-01-12 14:48:24 +0000 | |||
4 | @@ -1,3 +1,10 @@ | |||
5 | 1 | qtubuntu-media (0.8.0+16.04.20160105-0ubuntu1) xenial; urgency=medium | ||
6 | 2 | |||
7 | 3 | [ CI Train Bot ] | ||
8 | 4 | * No-change rebuild. | ||
9 | 5 | |||
10 | 6 | -- Thomas Voß <ci-train-bot@canonical.com> Tue, 05 Jan 2016 13:07:12 +0000 | ||
11 | 7 | |||
12 | 1 | qtubuntu-media (0.8.0+15.04.20160104-0ubuntu1) vivid; urgency=medium | 8 | qtubuntu-media (0.8.0+15.04.20160104-0ubuntu1) vivid; urgency=medium |
13 | 2 | 9 | ||
14 | 3 | * Fix removeMedia(start, end) so that it always removes the correct | 10 | * Fix removeMedia(start, end) so that it always removes the correct |
15 | @@ -29,44 +36,93 @@ | |||
16 | 29 | 36 | ||
17 | 30 | -- Jim Hodapp <ci-train-bot@canonical.com> Wed, 18 Nov 2015 16:32:22 +0000 | 37 | -- Jim Hodapp <ci-train-bot@canonical.com> Wed, 18 Nov 2015 16:32:22 +0000 |
18 | 31 | 38 | ||
57 | 32 | qtubuntu-media (0.7.1+15.04.20151023.3-0ubuntu1) vivid; urgency=medium | 39 | qtubuntu-media (0.7.1+16.04.20151104.1-0ubuntu1) xenial; urgency=medium |
58 | 33 | 40 | ||
59 | 34 | [ CI Train Bot ] | 41 | [ Timo Jyrinki ] |
60 | 35 | * New rebuild forced. | 42 | * Port to the new Audio Role API (LP: #1493851) (LP: #1493851) |
61 | 36 | 43 | ||
62 | 37 | [ Jim Hodapp ] | 44 | -- CI Train Bot <ci-train-bot@canonical.com> Wed, 04 Nov 2015 08:31:35 +0000 |
63 | 38 | * Added addTracks support for batch track adding. Improved the | 45 | |
64 | 39 | robustness of the QMediaPlaylist integration tests. | 46 | qtubuntu-media (0.7.1+15.10.20151020.1-0ubuntu1) wily; urgency=medium |
65 | 40 | 47 | ||
66 | 41 | -- Jim Hodapp <ci-train-bot@canonical.com> Fri, 23 Oct 2015 16:43:38 +0000 | 48 | [ Alfonso Sanchez-Beato ] |
67 | 42 | 49 | * Make sure the that the current player instance is controlable by | |
68 | 43 | qtubuntu-media (0.7.1+15.04.20151014-0ubuntu1) vivid; urgency=medium | 50 | MPRIS controls if the type of player is appropriate for playlist |
69 | 44 | 51 | control. Also, don't add a track to the tracklist when | |
70 | 45 | [ Alfonso Sanchez-Beato ] | 52 | AalMediaPlayerService::setMedia() is called. (LP: #1500859) |
71 | 46 | * Make sure the that the current player instance is controlable by | 53 | |
72 | 47 | MPRIS controls if the type of player is appropriate for playlist | 54 | [ Jim Hodapp ] |
73 | 48 | control. Also, don't add a track to the tracklist when | 55 | * Make sure the that the current player instance is controlable by |
74 | 49 | AalMediaPlayerService::setMedia() is called. (LP: #1500859) | 56 | MPRIS controls if the type of player is appropriate for playlist |
75 | 50 | 57 | control. Also, don't add a track to the tracklist when | |
76 | 51 | [ Jim Hodapp ] | 58 | AalMediaPlayerService::setMedia() is called. (LP: #1500859) |
77 | 52 | * Make sure the that the current player instance is controlable by | 59 | |
78 | 53 | MPRIS controls if the type of player is appropriate for playlist | 60 | [ CI Train Bot ] |
79 | 54 | control. Also, don't add a track to the tracklist when | 61 | * No-change rebuild. |
80 | 55 | AalMediaPlayerService::setMedia() is called. (LP: #1500859) | 62 | |
81 | 56 | 63 | -- Alfonso Sanchez-Beato <alfonso.sanchez-beato@canonical.com> Tue, 20 Oct 2015 13:10:40 +0000 | |
82 | 57 | -- CI Train Bot <ci-train-bot@canonical.com> Wed, 14 Oct 2015 20:58:46 +0000 | 64 | |
83 | 58 | 65 | qtubuntu-media (0.7.1+15.10.20151019.1-0ubuntu1) wily; urgency=medium | |
84 | 59 | qtubuntu-media (0.7.1+15.04.20150828-0ubuntu1) vivid; urgency=medium | 66 | |
85 | 60 | 67 | [ CI Train Bot ] | |
86 | 61 | [ Jim Hodapp ] | 68 | * New rebuild forced. |
87 | 62 | * Bump version for vivid sync | 69 | |
88 | 63 | 70 | [ Jim Hodapp ] | |
89 | 64 | [ CI Train Bot ] | 71 | * Get rid of the unnecessary dependency on libmediascanner. Update |
90 | 65 | * New rebuild forced. | 72 | mock service interface with changes from media-hub. (LP: #1500859) |
91 | 66 | 73 | ||
92 | 67 | -- CI Train Bot <ci-train-bot@canonical.com> Fri, 28 Aug 2015 13:52:24 +0000 | 74 | -- Jim Hodapp <ci-train-bot@canonical.com> Mon, 19 Oct 2015 16:21:01 +0000 |
93 | 68 | 75 | ||
94 | 69 | qtubuntu-media (0.7.1+15.04.20150710-0ubuntu1) vivid; urgency=medium | 76 | qtubuntu-media (0.7.1+15.10.20150903.1-0ubuntu1) wily; urgency=medium |
95 | 77 | |||
96 | 78 | [ Alfonso Sanchez-Beato ] | ||
97 | 79 | * [ Jim Hodapp ] Added background playlist support connecting | ||
98 | 80 | qtmultimedia with media-hub. added: | ||
99 | 81 | src/aal/aalmediaplaylistcontrol.cpp | ||
100 | 82 | src/aal/aalmediaplaylistcontrol.h | ||
101 | 83 | src/aal/aalmediaplaylistprovider.cpp | ||
102 | 84 | src/aal/aalmediaplaylistprovider.h src/aal/aalutility.cpp | ||
103 | 85 | src/aal/aalutility.h src/aal/private/ | ||
104 | 86 | src/aal/private/qmediaplaylistnavigator_p.h | ||
105 | 87 | src/aal/private/qmediaplaylistprovider_p.h | ||
106 | 88 | src/aal/qmediaplaylistcontrol_p.h tests/integration/ | ||
107 | 89 | tests/integration/integration.pro tests/integration/testdata/ | ||
108 | 90 | tests/integration/testdata/testfile.mp4 | ||
109 | 91 | tests/integration/testdata/testfile.ogg | ||
110 | 92 | tests/integration/tst_mediaplaylist.cpp | ||
111 | 93 | tests/integration/tst_mediaplaylist.h tests/tests.pro tests/unit/ | ||
112 | 94 | tests/unit/player_mock.cpp tests/unit/player_mock.h | ||
113 | 95 | tests/unit/tst_mediaplaylistcontrol.cpp | ||
114 | 96 | tests/unit/tst_mediaplaylistcontrol.h renamed: unittests/ => tests/ | ||
115 | 97 | unittests/player.cpp => tests/unit/player.cpp unittests/player.h => | ||
116 | 98 | tests/unit/player.h unittests/service.cpp => tests/unit/service.cpp | ||
117 | 99 | unittests/service.h => tests/unit/service.h | ||
118 | 100 | unittests/setup_mediascanner.sh => tests/unit/setup_mediascanner.sh | ||
119 | 101 | unittests/tst_mediaplayerplugin.cpp => | ||
120 | 102 | tests/unit/tst_mediaplayerplugin.cpp | ||
121 | 103 | unittests/tst_mediaplayerplugin.h => | ||
122 | 104 | tests/unit/tst_mediaplayerplugin.h | ||
123 | 105 | unittests/tst_metadatareadercontrol.cpp => | ||
124 | 106 | tests/unit/tst_metadatareadercontrol.cpp | ||
125 | 107 | unittests/tst_metadatareadercontrol.h => | ||
126 | 108 | tests/unit/tst_metadatareadercontrol.h unittests/unittests.pro => | ||
127 | 109 | tests/unit/unit.pro | ||
128 | 110 | |||
129 | 111 | -- CI Train Bot <ci-train-bot@canonical.com> Thu, 03 Sep 2015 08:25:29 +0000 | ||
130 | 112 | |||
131 | 113 | qtubuntu-media (0.7.1+15.10.20150710-0ubuntu2~gcc5.2) wily; urgency=medium | ||
132 | 114 | |||
133 | 115 | * No-change test rebuild for g++5 ABI transition | ||
134 | 116 | |||
135 | 117 | -- Matthias Klose <doko@ubuntu.com> Thu, 30 Jul 2015 12:09:11 +0200 | ||
136 | 118 | |||
137 | 119 | qtubuntu-media (0.7.1+15.10.20150710-0ubuntu2~gcc5.1) wily; urgency=medium | ||
138 | 120 | |||
139 | 121 | * No-change test rebuild for g++5 ABI transition | ||
140 | 122 | |||
141 | 123 | -- Steve Langasek <steve.langasek@ubuntu.com> Wed, 22 Jul 2015 23:30:42 +0000 | ||
142 | 124 | |||
143 | 125 | qtubuntu-media (0.7.1+15.10.20150710-0ubuntu1) wily; urgency=medium | ||
144 | 70 | 126 | ||
145 | 71 | [ CI Train Bot ] | 127 | [ CI Train Bot ] |
146 | 72 | * New rebuild forced. | 128 | * New rebuild forced. |
147 | @@ -77,7 +133,7 @@ | |||
148 | 77 | 133 | ||
149 | 78 | -- CI Train Bot <ci-train-bot@canonical.com> Fri, 10 Jul 2015 18:12:45 +0000 | 134 | -- CI Train Bot <ci-train-bot@canonical.com> Fri, 10 Jul 2015 18:12:45 +0000 |
150 | 79 | 135 | ||
152 | 80 | qtubuntu-media (0.7.1+15.04.20150602.3-0ubuntu1) vivid; urgency=medium | 136 | qtubuntu-media (0.7.1+15.10.20150602.3-0ubuntu1) wily; urgency=medium |
153 | 81 | 137 | ||
154 | 82 | [ CI Train Bot ] | 138 | [ CI Train Bot ] |
155 | 83 | * New rebuild forced. | 139 | * New rebuild forced. |
156 | @@ -88,7 +144,7 @@ | |||
157 | 88 | 144 | ||
158 | 89 | -- CI Train Bot <ci-train-bot@canonical.com> Tue, 02 Jun 2015 19:37:22 +0000 | 145 | -- CI Train Bot <ci-train-bot@canonical.com> Tue, 02 Jun 2015 19:37:22 +0000 |
159 | 90 | 146 | ||
161 | 91 | qtubuntu-media (0.7.1+15.04.20150602.1-0ubuntu1) vivid; urgency=medium | 147 | qtubuntu-media (0.7.1+15.10.20150602.1-0ubuntu1) wily; urgency=medium |
162 | 92 | 148 | ||
163 | 93 | [ CI Train Bot ] | 149 | [ CI Train Bot ] |
164 | 94 | * New rebuild forced. | 150 | * New rebuild forced. |
165 | @@ -98,7 +154,7 @@ | |||
166 | 98 | 154 | ||
167 | 99 | -- CI Train Bot <ci-train-bot@canonical.com> Tue, 02 Jun 2015 16:55:53 +0000 | 155 | -- CI Train Bot <ci-train-bot@canonical.com> Tue, 02 Jun 2015 16:55:53 +0000 |
168 | 100 | 156 | ||
170 | 101 | qtubuntu-media (0.7.1+15.04.20150527.2-0ubuntu1) vivid; urgency=medium | 157 | qtubuntu-media (0.7.1+15.10.20150527.2-0ubuntu1) wily; urgency=medium |
171 | 102 | 158 | ||
172 | 103 | [ CI Train Bot ] | 159 | [ CI Train Bot ] |
173 | 104 | * New rebuild forced. | 160 | * New rebuild forced. |
174 | @@ -110,7 +166,7 @@ | |||
175 | 110 | 166 | ||
176 | 111 | -- CI Train Bot <ci-train-bot@canonical.com> Wed, 27 May 2015 18:38:32 +0000 | 167 | -- CI Train Bot <ci-train-bot@canonical.com> Wed, 27 May 2015 18:38:32 +0000 |
177 | 112 | 168 | ||
179 | 113 | qtubuntu-media (0.7.1+15.04.20150522-0ubuntu1) vivid; urgency=medium | 169 | qtubuntu-media (0.7.1+15.10.20150522-0ubuntu1) wily; urgency=medium |
180 | 114 | 170 | ||
181 | 115 | [ Jim Hodapp ] | 171 | [ Jim Hodapp ] |
182 | 116 | * Make sure that stopped and ready (same state for QMediaPlayer) are | 172 | * Make sure that stopped and ready (same state for QMediaPlayer) are |
183 | @@ -118,6 +174,17 @@ | |||
184 | 118 | 174 | ||
185 | 119 | -- CI Train Bot <ci-train-bot@canonical.com> Fri, 22 May 2015 17:36:57 +0000 | 175 | -- CI Train Bot <ci-train-bot@canonical.com> Fri, 22 May 2015 17:36:57 +0000 |
186 | 120 | 176 | ||
187 | 177 | qtubuntu-media (0.7.1+15.04.20151023.3-0ubuntu1) vivid; urgency=medium | ||
188 | 178 | |||
189 | 179 | [ CI Train Bot ] | ||
190 | 180 | * New rebuild forced. | ||
191 | 181 | |||
192 | 182 | [ Jim Hodapp ] | ||
193 | 183 | * Added addTracks support for batch track adding. Improved the | ||
194 | 184 | robustness of the QMediaPlaylist integration tests. | ||
195 | 185 | |||
196 | 186 | -- Jim Hodapp <ci-train-bot@canonical.com> Fri, 23 Oct 2015 16:43:38 +0000 | ||
197 | 187 | |||
198 | 121 | qtubuntu-media (0.7.1+15.04.20150513.1-0ubuntu1) vivid; urgency=medium | 188 | qtubuntu-media (0.7.1+15.04.20150513.1-0ubuntu1) vivid; urgency=medium |
199 | 122 | 189 | ||
200 | 123 | [ CI Train Bot ] | 190 | [ CI Train Bot ] |
201 | 124 | 191 | ||
202 | === modified file 'src/aal/aalmediaplayercontrol.cpp' | |||
203 | --- src/aal/aalmediaplayercontrol.cpp 2015-11-04 17:17:50 +0000 | |||
204 | +++ src/aal/aalmediaplayercontrol.cpp 2016-01-12 14:48:24 +0000 | |||
205 | @@ -61,12 +61,20 @@ | |||
206 | 61 | return m_status; | 61 | return m_status; |
207 | 62 | } | 62 | } |
208 | 63 | 63 | ||
209 | 64 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
210 | 64 | QMediaPlayer::AudioRole AalMediaPlayerControl::audioRole() const | 65 | QMediaPlayer::AudioRole AalMediaPlayerControl::audioRole() const |
211 | 66 | #else | ||
212 | 67 | QAudio::Role AalMediaPlayerControl::audioRole() const | ||
213 | 68 | #endif | ||
214 | 65 | { | 69 | { |
215 | 66 | return m_service->audioRole(); | 70 | return m_service->audioRole(); |
216 | 67 | } | 71 | } |
217 | 68 | 72 | ||
218 | 73 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
219 | 69 | void AalMediaPlayerControl::setAudioRole(QMediaPlayer::AudioRole audioRole) | 74 | void AalMediaPlayerControl::setAudioRole(QMediaPlayer::AudioRole audioRole) |
220 | 75 | #else | ||
221 | 76 | void AalMediaPlayerControl::setAudioRole(QAudio::Role audioRole) | ||
222 | 77 | #endif | ||
223 | 70 | { | 78 | { |
224 | 71 | qDebug() << __PRETTY_FUNCTION__; | 79 | qDebug() << __PRETTY_FUNCTION__; |
225 | 72 | m_service->setAudioRole(audioRole); | 80 | m_service->setAudioRole(audioRole); |
226 | 73 | 81 | ||
227 | === modified file 'src/aal/aalmediaplayercontrol.h' | |||
228 | --- src/aal/aalmediaplayercontrol.h 2015-07-24 18:44:13 +0000 | |||
229 | +++ src/aal/aalmediaplayercontrol.h 2016-01-12 14:48:24 +0000 | |||
230 | @@ -32,8 +32,13 @@ | |||
231 | 32 | 32 | ||
232 | 33 | virtual QMediaPlayer::State state() const; | 33 | virtual QMediaPlayer::State state() const; |
233 | 34 | virtual QMediaPlayer::MediaStatus mediaStatus() const; | 34 | virtual QMediaPlayer::MediaStatus mediaStatus() const; |
234 | 35 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
235 | 35 | virtual QMediaPlayer::AudioRole audioRole() const; | 36 | virtual QMediaPlayer::AudioRole audioRole() const; |
236 | 36 | virtual void setAudioRole(QMediaPlayer::AudioRole audioRole); | 37 | virtual void setAudioRole(QMediaPlayer::AudioRole audioRole); |
237 | 38 | #else | ||
238 | 39 | virtual QAudio::Role audioRole() const; | ||
239 | 40 | virtual void setAudioRole(QAudio::Role audioRole); | ||
240 | 41 | #endif | ||
241 | 37 | virtual qint64 duration() const; | 42 | virtual qint64 duration() const; |
242 | 38 | virtual qint64 position() const; | 43 | virtual qint64 position() const; |
243 | 39 | virtual void setPosition(qint64); | 44 | virtual void setPosition(qint64); |
244 | 40 | 45 | ||
245 | === modified file 'src/aal/aalmediaplayerservice.cpp' | |||
246 | --- src/aal/aalmediaplayerservice.cpp 2015-11-02 14:26:44 +0000 | |||
247 | +++ src/aal/aalmediaplayerservice.cpp 2016-01-12 14:48:24 +0000 | |||
248 | @@ -228,21 +228,41 @@ | |||
249 | 228 | m_videoOutput->playbackComplete(); | 228 | m_videoOutput->playbackComplete(); |
250 | 229 | } | 229 | } |
251 | 230 | 230 | ||
252 | 231 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
253 | 231 | QMediaPlayer::AudioRole AalMediaPlayerService::audioRole() const | 232 | QMediaPlayer::AudioRole AalMediaPlayerService::audioRole() const |
254 | 233 | #else | ||
255 | 234 | QAudio::Role AalMediaPlayerService::audioRole() const | ||
256 | 235 | #endif | ||
257 | 232 | { | 236 | { |
258 | 233 | if (m_hubPlayerSession == NULL) | 237 | if (m_hubPlayerSession == NULL) |
259 | 238 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
260 | 234 | return QMediaPlayer::MultimediaRole; | 239 | return QMediaPlayer::MultimediaRole; |
261 | 240 | #else | ||
262 | 241 | return QAudio::VideoRole; | ||
263 | 242 | #endif | ||
264 | 235 | 243 | ||
265 | 236 | try { | 244 | try { |
266 | 245 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
267 | 237 | return static_cast<QMediaPlayer::AudioRole>(m_hubPlayerSession->audio_stream_role().get()); | 246 | return static_cast<QMediaPlayer::AudioRole>(m_hubPlayerSession->audio_stream_role().get()); |
268 | 247 | #else | ||
269 | 248 | return static_cast<QAudio::Role>(m_hubPlayerSession->audio_stream_role().get()); | ||
270 | 249 | #endif | ||
271 | 238 | } | 250 | } |
272 | 239 | catch (const std::runtime_error &e) { | 251 | catch (const std::runtime_error &e) { |
273 | 240 | qWarning() << "Failed to get audio stream role: " << e.what(); | 252 | qWarning() << "Failed to get audio stream role: " << e.what(); |
274 | 253 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
275 | 241 | return QMediaPlayer::MultimediaRole; | 254 | return QMediaPlayer::MultimediaRole; |
276 | 255 | #else | ||
277 | 256 | return QAudio::VideoRole; | ||
278 | 257 | #endif | ||
279 | 242 | } | 258 | } |
280 | 243 | } | 259 | } |
281 | 244 | 260 | ||
282 | 261 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
283 | 245 | void AalMediaPlayerService::setAudioRole(QMediaPlayer::AudioRole audioRole) | 262 | void AalMediaPlayerService::setAudioRole(QMediaPlayer::AudioRole audioRole) |
284 | 263 | #else | ||
285 | 264 | void AalMediaPlayerService::setAudioRole(QAudio::Role audioRole) | ||
286 | 265 | #endif | ||
287 | 246 | { | 266 | { |
288 | 247 | if (m_hubPlayerSession == NULL) | 267 | if (m_hubPlayerSession == NULL) |
289 | 248 | return; | 268 | return; |
290 | @@ -756,7 +776,11 @@ | |||
291 | 756 | { | 776 | { |
292 | 757 | // If this player is a multimedia audioRole, then it should possible to | 777 | // If this player is a multimedia audioRole, then it should possible to |
293 | 758 | // use it for MPRIS control | 778 | // use it for MPRIS control |
294 | 779 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
295 | 759 | if (audioRole() == QMediaPlayer::MultimediaRole) | 780 | if (audioRole() == QMediaPlayer::MultimediaRole) |
296 | 781 | #else | ||
297 | 782 | if (audioRole() == QAudio::VideoRole || audioRole() == QAudio::MusicRole) | ||
298 | 783 | #endif | ||
299 | 760 | { | 784 | { |
300 | 761 | qDebug() << "Setting player as current player"; | 785 | qDebug() << "Setting player as current player"; |
301 | 762 | try { | 786 | try { |
302 | 763 | 787 | ||
303 | === modified file 'src/aal/aalmediaplayerservice.h' | |||
304 | --- src/aal/aalmediaplayerservice.h 2015-10-09 20:06:40 +0000 | |||
305 | +++ src/aal/aalmediaplayerservice.h 2016-01-12 14:48:24 +0000 | |||
306 | @@ -74,8 +74,13 @@ | |||
307 | 74 | // Call this before attempting to play the same video a second time (after EOS) | 74 | // Call this before attempting to play the same video a second time (after EOS) |
308 | 75 | void resetVideoSink(); | 75 | void resetVideoSink(); |
309 | 76 | 76 | ||
310 | 77 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) | ||
311 | 77 | QMediaPlayer::AudioRole audioRole() const; | 78 | QMediaPlayer::AudioRole audioRole() const; |
312 | 78 | void setAudioRole(QMediaPlayer::AudioRole audioRole); | 79 | void setAudioRole(QMediaPlayer::AudioRole audioRole); |
313 | 80 | #else | ||
314 | 81 | QAudio::Role audioRole() const; | ||
315 | 82 | void setAudioRole(QAudio::Role audioRole); | ||
316 | 83 | #endif | ||
317 | 79 | 84 | ||
318 | 80 | void setMedia(const QUrl &url); | 85 | void setMedia(const QUrl &url); |
319 | 81 | void setMediaPlaylist(const QMediaPlaylist& playlist); | 86 | void setMediaPlaylist(const QMediaPlaylist& playlist); |
320 | 82 | 87 | ||
321 | === modified file 'src/aal/aalmediaplaylistcontrol.cpp' | |||
322 | --- src/aal/aalmediaplaylistcontrol.cpp 2016-01-04 14:07:05 +0000 | |||
323 | +++ src/aal/aalmediaplaylistcontrol.cpp 2016-01-12 14:48:24 +0000 | |||
324 | @@ -293,12 +293,33 @@ | |||
325 | 293 | } | 293 | } |
326 | 294 | } | 294 | } |
327 | 295 | 295 | ||
328 | 296 | void AalMediaPlaylistControl::onRemoveTracks(int start, int end) | ||
329 | 297 | { | ||
330 | 298 | // If the current track and everything after has been removed | ||
331 | 299 | // then we need to set the currentIndex to 0 otherwise it is | ||
332 | 300 | // left at the position it was before removing | ||
333 | 301 | if (start <= m_currentIndex | ||
334 | 302 | and m_currentIndex <= end | ||
335 | 303 | and (end + 1) == m_playlistProvider->mediaCount() | ||
336 | 304 | and start != 0) | ||
337 | 305 | { | ||
338 | 306 | m_currentIndex = 0; | ||
339 | 307 | setCurrentIndex(0); | ||
340 | 308 | |||
341 | 309 | // When repeat is off we have reached the end of playback so stop | ||
342 | 310 | if (playbackMode() == QMediaPlaylist::Sequential) | ||
343 | 311 | { | ||
344 | 312 | qDebug() << "Repeat is off, so stopping playback"; | ||
345 | 313 | m_hubPlayerSession->stop(); | ||
346 | 314 | } | ||
347 | 315 | } | ||
348 | 316 | } | ||
349 | 317 | |||
350 | 296 | void AalMediaPlaylistControl::onCurrentIndexChanged() | 318 | void AalMediaPlaylistControl::onCurrentIndexChanged() |
351 | 297 | { | 319 | { |
354 | 298 | int index = aalMediaPlaylistProvider()->indexOfTrack(m_currentId); | 320 | const int index = aalMediaPlaylistProvider()->indexOfTrack(m_currentId); |
353 | 299 | |||
355 | 300 | if (index != m_currentIndex) { | 321 | if (index != m_currentIndex) { |
357 | 301 | qDebug() << "Index changed to " << index; | 322 | qDebug() << "Index changed to" << index; |
358 | 302 | m_currentIndex = index; | 323 | m_currentIndex = index; |
359 | 303 | Q_EMIT currentIndexChanged(m_currentIndex); | 324 | Q_EMIT currentIndexChanged(m_currentIndex); |
360 | 304 | } | 325 | } |
361 | @@ -362,6 +383,9 @@ | |||
362 | 362 | 383 | ||
363 | 363 | connect(aalMediaPlaylistProvider(), &AalMediaPlaylistProvider::mediaRemoved, | 384 | connect(aalMediaPlaylistProvider(), &AalMediaPlaylistProvider::mediaRemoved, |
364 | 364 | this, &AalMediaPlaylistControl::onMediaRemoved); | 385 | this, &AalMediaPlaylistControl::onMediaRemoved); |
365 | 386 | |||
366 | 387 | connect(aalMediaPlaylistProvider(), &AalMediaPlaylistProvider::removeTracks, | ||
367 | 388 | this, &AalMediaPlaylistControl::onRemoveTracks); | ||
368 | 365 | } | 389 | } |
369 | 366 | 390 | ||
370 | 367 | void AalMediaPlaylistControl::disconnect_signals() | 391 | void AalMediaPlaylistControl::disconnect_signals() |
371 | 368 | 392 | ||
372 | === modified file 'src/aal/aalmediaplaylistcontrol.h' | |||
373 | --- src/aal/aalmediaplaylistcontrol.h 2015-12-24 15:40:01 +0000 | |||
374 | +++ src/aal/aalmediaplaylistcontrol.h 2016-01-12 14:48:24 +0000 | |||
375 | @@ -64,6 +64,7 @@ | |||
376 | 64 | void onTrackChanged(const core::ubuntu::media::Track::Id& id); | 64 | void onTrackChanged(const core::ubuntu::media::Track::Id& id); |
377 | 65 | void onStartMoveTrack(int from, int to); | 65 | void onStartMoveTrack(int from, int to); |
378 | 66 | void onMediaRemoved(int start, int end); | 66 | void onMediaRemoved(int start, int end); |
379 | 67 | void onRemoveTracks(int start, int end); | ||
380 | 67 | void onCurrentIndexChanged(); | 68 | void onCurrentIndexChanged(); |
381 | 68 | 69 | ||
382 | 69 | private: | 70 | private: |
383 | 70 | 71 | ||
384 | === modified file 'src/aal/aalmediaplaylistprovider.cpp' | |||
385 | --- src/aal/aalmediaplaylistprovider.cpp 2015-12-22 17:57:01 +0000 | |||
386 | +++ src/aal/aalmediaplaylistprovider.cpp 2016-01-12 14:48:24 +0000 | |||
387 | @@ -22,6 +22,9 @@ | |||
388 | 22 | 22 | ||
389 | 23 | #include <QDebug> | 23 | #include <QDebug> |
390 | 24 | 24 | ||
391 | 25 | // Uncomment for more verbose debugging to stdout/err | ||
392 | 26 | //#define VERBOSE_DEBUG | ||
393 | 27 | |||
394 | 25 | namespace media = core::ubuntu::media; | 28 | namespace media = core::ubuntu::media; |
395 | 26 | 29 | ||
396 | 27 | Q_DECLARE_METATYPE(core::ubuntu::media::Track::Id) | 30 | Q_DECLARE_METATYPE(core::ubuntu::media::Track::Id) |
397 | @@ -145,7 +148,9 @@ | |||
398 | 145 | 148 | ||
399 | 146 | media::TrackList::ContainerURI uris; | 149 | media::TrackList::ContainerURI uris; |
400 | 147 | for (const auto mediaContent : contentList) { | 150 | for (const auto mediaContent : contentList) { |
401 | 151 | #ifdef VERBOSE_DEBUG | ||
402 | 148 | qDebug() << "Adding track " << AalUtility::unescape(mediaContent).toString(); | 152 | qDebug() << "Adding track " << AalUtility::unescape(mediaContent).toString(); |
403 | 153 | #endif | ||
404 | 149 | uris.push_back(AalUtility::unescape_str(mediaContent)); | 154 | uris.push_back(AalUtility::unescape_str(mediaContent)); |
405 | 150 | } | 155 | } |
406 | 151 | 156 | ||
407 | @@ -322,14 +327,25 @@ | |||
408 | 322 | 327 | ||
409 | 323 | bool AalMediaPlaylistProvider::removeMedia(int start, int end) | 328 | bool AalMediaPlaylistProvider::removeMedia(int start, int end) |
410 | 324 | { | 329 | { |
416 | 325 | // It's important that we remove tracks from end to start as removing tracks can | 330 | // If we are removing everything then just use clear() |
417 | 326 | // change the relative index value in track_index_lut relative to the Track::Id | 331 | if (start == 0 and (end + 1) == mediaCount()) |
418 | 327 | for (int i=end; i>=start; i--) | 332 | { |
419 | 328 | { | 333 | return clear(); |
420 | 329 | if (!removeMedia(i)) | 334 | } |
421 | 335 | else | ||
422 | 336 | { | ||
423 | 337 | // Signal AalMediaPlaylistControl | ||
424 | 338 | Q_EMIT removeTracks(start, end); | ||
425 | 339 | |||
426 | 340 | // It's important that we remove tracks from end to start as removing tracks can | ||
427 | 341 | // change the relative index value in track_index_lut relative to the Track::Id | ||
428 | 342 | for (int i=end; i>=start; i--) | ||
429 | 330 | { | 343 | { |
432 | 331 | qWarning() << "Failed to remove the full range of tracks requested"; | 344 | if (!removeMedia(i)) |
433 | 332 | return false; | 345 | { |
434 | 346 | qWarning() << "Failed to remove the full range of tracks requested"; | ||
435 | 347 | return false; | ||
436 | 348 | } | ||
437 | 333 | } | 349 | } |
438 | 334 | } | 350 | } |
439 | 335 | 351 | ||
440 | 336 | 352 | ||
441 | === modified file 'src/aal/aalmediaplaylistprovider.h' | |||
442 | --- src/aal/aalmediaplaylistprovider.h 2015-11-13 15:48:06 +0000 | |||
443 | +++ src/aal/aalmediaplaylistprovider.h 2016-01-12 14:48:24 +0000 | |||
444 | @@ -64,6 +64,9 @@ | |||
445 | 64 | Q_SIGNALS: | 64 | Q_SIGNALS: |
446 | 65 | void startMoveTrack(int from, int to); | 65 | void startMoveTrack(int from, int to); |
447 | 66 | void currentIndexChanged(); | 66 | void currentIndexChanged(); |
448 | 67 | // Emitted when removing a range of tracks less than mediaCount() | ||
449 | 68 | // so that AalMediaPlaylistControl can take appropriate action | ||
450 | 69 | void removeTracks(int start, int end); | ||
451 | 67 | 70 | ||
452 | 68 | private: | 71 | private: |
453 | 69 | void setPlayerSession(const std::shared_ptr<core::ubuntu::media::Player>& playerSession); | 72 | void setPlayerSession(const std::shared_ptr<core::ubuntu::media::Player>& playerSession); |
454 | 70 | 73 | ||
455 | === modified file 'src/aal/aalutility.cpp' | |||
456 | --- src/aal/aalutility.cpp 2015-06-09 20:53:02 +0000 | |||
457 | +++ src/aal/aalutility.cpp 2016-01-12 14:48:24 +0000 | |||
458 | @@ -18,17 +18,24 @@ | |||
459 | 18 | 18 | ||
460 | 19 | #include <QDebug> | 19 | #include <QDebug> |
461 | 20 | 20 | ||
462 | 21 | // Uncomment for more verbose debugging to stdout/err | ||
463 | 22 | //#define VERBOSE_DEBUG | ||
464 | 23 | |||
465 | 21 | QUrl AalUtility::unescape(const QMediaContent &media) | 24 | QUrl AalUtility::unescape(const QMediaContent &media) |
466 | 22 | { | 25 | { |
467 | 23 | if (media.isNull()) | 26 | if (media.isNull()) |
468 | 24 | return QUrl(); | 27 | return QUrl(); |
469 | 25 | 28 | ||
470 | 26 | if (media.canonicalUrl().isLocalFile()) { | 29 | if (media.canonicalUrl().isLocalFile()) { |
471 | 30 | #ifdef VERBOSE_DEBUG | ||
472 | 27 | qDebug() << "Local file URI: " << QUrl::fromPercentEncoding(media.canonicalUrl().toString().toUtf8()); | 31 | qDebug() << "Local file URI: " << QUrl::fromPercentEncoding(media.canonicalUrl().toString().toUtf8()); |
473 | 32 | #endif | ||
474 | 28 | return QUrl::fromPercentEncoding(media.canonicalUrl().toString().toUtf8()); | 33 | return QUrl::fromPercentEncoding(media.canonicalUrl().toString().toUtf8()); |
475 | 29 | } | 34 | } |
476 | 30 | else { | 35 | else { |
477 | 36 | #ifdef VERBOSE_DEBUG | ||
478 | 31 | qDebug() << "Remote stream URI: " << QUrl::fromEncoded(media.canonicalUrl().toString().toUtf8()); | 37 | qDebug() << "Remote stream URI: " << QUrl::fromEncoded(media.canonicalUrl().toString().toUtf8()); |
479 | 38 | #endif | ||
480 | 32 | return QUrl::fromEncoded(media.canonicalUrl().toString().toUtf8()); | 39 | return QUrl::fromEncoded(media.canonicalUrl().toString().toUtf8()); |
481 | 33 | } | 40 | } |
482 | 34 | } | 41 | } |
483 | 35 | 42 | ||
484 | === modified file 'tests/unit/service.h' | |||
485 | --- tests/unit/service.h 2015-09-08 19:31:18 +0000 | |||
486 | +++ tests/unit/service.h 2016-01-12 14:48:24 +0000 | |||
487 | @@ -50,7 +50,7 @@ | |||
488 | 50 | virtual void destroy_session(const std::string& uuid, const Player::Configuration&); | 50 | virtual void destroy_session(const std::string& uuid, const Player::Configuration&); |
489 | 51 | virtual std::shared_ptr<Player> create_fixed_session(const std::string& name, const Player::Configuration&); | 51 | virtual std::shared_ptr<Player> create_fixed_session(const std::string& name, const Player::Configuration&); |
490 | 52 | virtual std::shared_ptr<Player> resume_session(Player::PlayerKey); | 52 | virtual std::shared_ptr<Player> resume_session(Player::PlayerKey); |
492 | 53 | virtual void set_current_player(Player::PlayerKey key); | 53 | virtual void set_current_player(Player::PlayerKey); |
493 | 54 | virtual void pause_other_sessions(Player::PlayerKey); | 54 | virtual void pause_other_sessions(Player::PlayerKey); |
494 | 55 | }; | 55 | }; |
495 | 56 | } | 56 | } |
LGTM :-)