Merge lp:~phablet-team/unity8/sms-notif-lp1544477 into lp:unity8
- sms-notif-lp1544477
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Albert Astals Cid |
Approved revision: | 2604 |
Merged at revision: | 2601 |
Proposed branch: | lp:~phablet-team/unity8/sms-notif-lp1544477 |
Merge into: | lp:unity8 |
Diff against target: |
205 lines (+73/-34) 3 files modified
plugins/Dash/DashAudioPlayer.qml (+45/-21) qml/Components/NotificationAudio.qml (+20/-3) tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml (+8/-10) |
To merge this branch: | bzr merge lp:~phablet-team/unity8/sms-notif-lp1544477 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Albert Astals Cid (community) | Approve | ||
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Review via email: mp+303791@code.launchpad.net |
Commit message
Make sure we emit sounds when taking a screenshot even after media-hub
has restarted (LP: #1544477)
Description of the change
Make sure we emit sounds when taking a screenshot even after media-hub
has restarted (LP: #1544477)
- 2600. By Alfonso Sanchez-Beato
-
Add reference to QtMultimedia bug
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
It is quite difficult to solve in qtmultimedia in a general way. It is also unclear whether upstream would take those patches or not. Anyway, I have opened bug #1616425 to track this as we might try that in the future.
Yes, probably plugins/
- 2601. By Alfonso Sanchez-Beato
-
Make sure we can play music from the scopes after media-hub restarts.
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
Branch refreshed after fixing DashAudioPlayer.qml
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2601
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
FAILURE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2602. By Alfonso Sanchez-Beato
-
Adapt unit test to DashAudioPlayer changes
- 2603. By Alfonso Sanchez-Beato
-
One more fix for PreviewAudioPla
yback test - 2604. By Alfonso Sanchez-Beato
-
Change verify to compare in test
Albert Astals Cid (aacid) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
Waiting for it before top-approving, but passes fine locally
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2603
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Albert Astals Cid (aacid) wrote : | # |
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
Almost, known unstable unrelated tests failed
Preview Diff
1 | === modified file 'plugins/Dash/DashAudioPlayer.qml' | |||
2 | --- plugins/Dash/DashAudioPlayer.qml 2015-12-22 09:12:32 +0000 | |||
3 | +++ plugins/Dash/DashAudioPlayer.qml 2016-08-26 08:08:57 +0000 | |||
4 | @@ -20,16 +20,22 @@ | |||
5 | 20 | import Dash 0.1 | 20 | import Dash 0.1 |
6 | 21 | 21 | ||
7 | 22 | QtObject { | 22 | QtObject { |
14 | 23 | readonly property real progress: audio.position / audio.duration | 23 | id: root |
15 | 24 | readonly property bool playing: audio.playbackState === Audio.PlayingState | 24 | readonly property real progress: priv.audio ? priv.audio.position / priv.audio.duration : 0.0 |
16 | 25 | readonly property bool paused: audio.playbackState === Audio.PausedState | 25 | readonly property bool playing: priv.audio ? priv.audio.playbackState === Audio.PlayingState : false |
17 | 26 | readonly property bool stopped: audio.playbackState === Audio.StoppedState | 26 | readonly property bool paused: priv.audio ? priv.audio.playbackState === Audio.PausedState : false |
18 | 27 | readonly property alias position: audio.position | 27 | readonly property bool stopped: priv.audio ? priv.audio.playbackState === Audio.StoppedState : true |
19 | 28 | readonly property url currentSource: audio.playlist.currentItemSource | 28 | readonly property int position: priv.audio ? priv.audio.position : 0 |
20 | 29 | readonly property url currentSource: priv.audio ? priv.audio.playlist.currentItemSource : "" | ||
21 | 30 | readonly property Playlist playlist: priv.audio ? priv.audio.playlist : null | ||
22 | 29 | 31 | ||
23 | 30 | function playSource(newSource, newPlaylist) { | 32 | function playSource(newSource, newPlaylist) { |
24 | 33 | if (!priv.audio) { | ||
25 | 34 | console.info("DashAudioPlayer: creating player"); | ||
26 | 35 | priv.audio = priv.audioComponent.createObject(root); | ||
27 | 36 | } | ||
28 | 31 | stop(); | 37 | stop(); |
30 | 32 | audio.playlist.clear(); | 38 | priv.audio.playlist.clear(); |
31 | 33 | if (newPlaylist) { | 39 | if (newPlaylist) { |
32 | 34 | // Look for newSource in newPlaylist | 40 | // Look for newSource in newPlaylist |
33 | 35 | var sourceIndex = -1; | 41 | var sourceIndex = -1; |
34 | @@ -48,35 +54,53 @@ | |||
35 | 48 | for (var i in newPlaylist) { | 54 | for (var i in newPlaylist) { |
36 | 49 | urls.push(newPlaylist[i]); | 55 | urls.push(newPlaylist[i]); |
37 | 50 | } | 56 | } |
40 | 51 | audio.playlist.addItems(urls); | 57 | priv.audio.playlist.addItems(urls); |
41 | 52 | audio.playlist.currentIndex = sourceIndex; | 58 | priv.audio.playlist.currentIndex = sourceIndex; |
42 | 53 | } else { | 59 | } else { |
45 | 54 | audio.playlist.addItem(newSource); | 60 | priv.audio.playlist.addItem(newSource); |
46 | 55 | audio.playlist.currentIndex = 0; | 61 | priv.audio.playlist.currentIndex = 0; |
47 | 56 | } | 62 | } |
48 | 57 | play(); | 63 | play(); |
49 | 58 | } | 64 | } |
50 | 59 | 65 | ||
51 | 60 | function stop() { | 66 | function stop() { |
53 | 61 | audio.stop(); | 67 | if (priv.audio) { |
54 | 68 | priv.audio.stop(); | ||
55 | 69 | } | ||
56 | 62 | } | 70 | } |
57 | 63 | 71 | ||
58 | 64 | function play() { | 72 | function play() { |
60 | 65 | audio.play(); | 73 | if (priv.audio) { |
61 | 74 | priv.audio.play(); | ||
62 | 75 | } | ||
63 | 66 | } | 76 | } |
64 | 67 | 77 | ||
65 | 68 | function pause() { | 78 | function pause() { |
67 | 69 | audio.pause(); | 79 | if (priv.audio) { |
68 | 80 | priv.audio.pause(); | ||
69 | 81 | } | ||
70 | 70 | } | 82 | } |
71 | 71 | 83 | ||
77 | 72 | property QtObject audio: Audio { | 84 | property QtObject priv: QtObject { |
78 | 73 | id: audio | 85 | id: priv |
79 | 74 | objectName: "audio" | 86 | property Audio audio: null |
80 | 75 | playlist: Playlist { | 87 | property Component audioComponent: Component { |
81 | 76 | objectName: "playlist" | 88 | Audio { |
82 | 89 | playlist: Playlist { | ||
83 | 90 | objectName: "playlist" | ||
84 | 91 | } | ||
85 | 92 | /* Remove player in case of error so it gets recreated next time | ||
86 | 93 | * we need it. Happens if backend media player restarted, for | ||
87 | 94 | * instance. qtmultimedia should probably handle this | ||
88 | 95 | * transparently (LP: #1616425). | ||
89 | 96 | */ | ||
90 | 97 | onError: { | ||
91 | 98 | console.warn("DashAudioPlayer: error event (" + | ||
92 | 99 | priv.audio.errorString + "), destroying"); | ||
93 | 100 | priv.audio.destroy(); | ||
94 | 101 | } | ||
95 | 102 | } | ||
96 | 77 | } | 103 | } |
97 | 78 | |||
98 | 79 | onErrorStringChanged: console.warn("Dash Audio player error:", errorString) | ||
99 | 80 | } | 104 | } |
100 | 81 | 105 | ||
101 | 82 | function lengthToString(s) { | 106 | function lengthToString(s) { |
102 | 83 | 107 | ||
103 | === modified file 'qml/Components/NotificationAudio.qml' | |||
104 | --- qml/Components/NotificationAudio.qml 2016-04-29 20:06:54 +0000 | |||
105 | +++ qml/Components/NotificationAudio.qml 2016-08-26 08:08:57 +0000 | |||
106 | @@ -23,6 +23,10 @@ | |||
107 | 23 | readonly property var playbackState: priv.audio ? priv.audio.playbackState : 0 | 23 | readonly property var playbackState: priv.audio ? priv.audio.playbackState : 0 |
108 | 24 | 24 | ||
109 | 25 | function play() { | 25 | function play() { |
110 | 26 | if (!priv.audio) { | ||
111 | 27 | console.info("NotificationAudio: creating player"); | ||
112 | 28 | priv.audio = priv.audioComponent.createObject(root); | ||
113 | 29 | } | ||
114 | 26 | if (priv.audio) { | 30 | if (priv.audio) { |
115 | 27 | priv.audio.play(); | 31 | priv.audio.play(); |
116 | 28 | } | 32 | } |
117 | @@ -35,9 +39,22 @@ | |||
118 | 35 | 39 | ||
119 | 36 | QtObject { | 40 | QtObject { |
120 | 37 | id: priv | 41 | id: priv |
124 | 38 | property var audio: Audio { | 42 | property Audio audio: null |
125 | 39 | source: root.source | 43 | property Component audioComponent: Component { |
126 | 40 | audioRole: MediaPlayer.NotificationRole | 44 | Audio { |
127 | 45 | source: root.source | ||
128 | 46 | audioRole: MediaPlayer.NotificationRole | ||
129 | 47 | /* Remove player in case of error so it gets recreated next time | ||
130 | 48 | * we need it. Happens if backend media player restarted, for | ||
131 | 49 | * instance. qtmultimedia should probably handle this | ||
132 | 50 | * transparently (LP: #1616425). | ||
133 | 51 | */ | ||
134 | 52 | onError: { | ||
135 | 53 | console.warn("NotificationAudio: error event (" + | ||
136 | 54 | priv.audio.errorString + "), destroying"); | ||
137 | 55 | priv.audio.destroy(); | ||
138 | 56 | } | ||
139 | 57 | } | ||
140 | 41 | } | 58 | } |
141 | 42 | } | 59 | } |
142 | 43 | } | 60 | } |
143 | 44 | 61 | ||
144 | === modified file 'tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml' | |||
145 | --- tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml 2016-02-15 15:27:09 +0000 | |||
146 | +++ tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml 2016-08-26 08:08:57 +0000 | |||
147 | @@ -127,8 +127,6 @@ | |||
148 | 127 | var track1PlayButton = findChild(track1Item, "playButton"); | 127 | var track1PlayButton = findChild(track1Item, "playButton"); |
149 | 128 | var track2PlayButton = findChild(track2Item, "playButton"); | 128 | var track2PlayButton = findChild(track2Item, "playButton"); |
150 | 129 | 129 | ||
151 | 130 | var audio = DashAudioPlayer.audio; | ||
152 | 131 | |||
153 | 132 | // All progress bars must be hidden in the beginning | 130 | // All progress bars must be hidden in the beginning |
154 | 133 | compare(track0ProgressBar.visible, false); | 131 | compare(track0ProgressBar.visible, false); |
155 | 134 | compare(track1ProgressBar.visible, false); | 132 | compare(track1ProgressBar.visible, false); |
156 | @@ -137,7 +135,7 @@ | |||
157 | 137 | // Playing track 0 should make progress bar 0 visible | 135 | // Playing track 0 should make progress bar 0 visible |
158 | 138 | mouseClick(track0PlayButton); | 136 | mouseClick(track0PlayButton); |
159 | 139 | 137 | ||
161 | 140 | tryCompare(audio, "playbackState", Audio.PlayingState); | 138 | compare(DashAudioPlayer.playing, true); |
162 | 141 | checkPlayerSource(0); | 139 | checkPlayerSource(0); |
163 | 142 | 140 | ||
164 | 143 | tryCompare(track0ProgressBar, "visible", true); | 141 | tryCompare(track0ProgressBar, "visible", true); |
165 | @@ -146,25 +144,25 @@ | |||
166 | 146 | 144 | ||
167 | 147 | // Clicking the button again should pause it. The progress bar should stay visible | 145 | // Clicking the button again should pause it. The progress bar should stay visible |
168 | 148 | mouseClick(track0PlayButton); | 146 | mouseClick(track0PlayButton); |
170 | 149 | tryCompare(audio, "playbackState", Audio.PausedState); | 147 | compare(DashAudioPlayer.paused, true); |
171 | 150 | checkPlayerSource(0); | 148 | checkPlayerSource(0); |
172 | 151 | tryCompare(track0ProgressBar, "visible", true); | 149 | tryCompare(track0ProgressBar, "visible", true); |
173 | 152 | 150 | ||
174 | 153 | // Continue playback | 151 | // Continue playback |
175 | 154 | mouseClick(track0PlayButton); | 152 | mouseClick(track0PlayButton); |
177 | 155 | tryCompare(audio, "playbackState", Audio.PlayingState); | 153 | compare(DashAudioPlayer.playing, true); |
178 | 156 | checkPlayerSource(0); | 154 | checkPlayerSource(0); |
179 | 157 | 155 | ||
180 | 158 | // Playing track 1 should make progress bar 1 visible and hide progress bar 0 again | 156 | // Playing track 1 should make progress bar 1 visible and hide progress bar 0 again |
181 | 159 | mouseClick(track1PlayButton); | 157 | mouseClick(track1PlayButton); |
182 | 160 | 158 | ||
184 | 161 | tryCompare(audio, "playbackState", Audio.PlayingState); | 159 | compare(DashAudioPlayer.playing, true); |
185 | 162 | checkPlayerSource(1); | 160 | checkPlayerSource(1); |
186 | 163 | 161 | ||
187 | 164 | // Check the playlist is song 0, 1, 2 | 162 | // Check the playlist is song 0, 1, 2 |
191 | 165 | checkPlayerUrls(tracksModel2["tracks"][0].source, audio.playlist.itemSource(0)); | 163 | checkPlayerUrls(tracksModel2["tracks"][0].source, DashAudioPlayer.playlist.itemSource(0)); |
192 | 166 | checkPlayerUrls(tracksModel2["tracks"][1].source, audio.playlist.itemSource(1)); | 164 | checkPlayerUrls(tracksModel2["tracks"][1].source, DashAudioPlayer.playlist.itemSource(1)); |
193 | 167 | checkPlayerUrls(tracksModel2["tracks"][2].source, audio.playlist.itemSource(2)); | 165 | checkPlayerUrls(tracksModel2["tracks"][2].source, DashAudioPlayer.playlist.itemSource(2)); |
194 | 168 | 166 | ||
195 | 169 | tryCompare(track0ProgressBar, "visible", false); | 167 | tryCompare(track0ProgressBar, "visible", false); |
196 | 170 | tryCompare(track1ProgressBar, "visible", true); | 168 | tryCompare(track1ProgressBar, "visible", true); |
197 | @@ -173,7 +171,7 @@ | |||
198 | 173 | // Playing track 2 should make progress bar 1 visible and hide progress bar 0 again | 171 | // Playing track 2 should make progress bar 1 visible and hide progress bar 0 again |
199 | 174 | mouseClick(track2PlayButton); | 172 | mouseClick(track2PlayButton); |
200 | 175 | 173 | ||
202 | 176 | tryCompare(audio, "playbackState", Audio.PlayingState); | 174 | compare(DashAudioPlayer.playing, true); |
203 | 177 | checkPlayerSource(2); | 175 | checkPlayerSource(2); |
204 | 178 | 176 | ||
205 | 179 | tryCompare(track0ProgressBar, "visible", false); | 177 | tryCompare(track0ProgressBar, "visible", false); |
Isn't this something we can fix in qtmultimedia? Or is it just easier to wokraround here?
If so I guess we need a similar fix in ./plugins/ Dash/DashAudioP layer.qml ?