Merge lp:~aacid/unity8/new_and_old_audio_role into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 2012
Merged at revision: 2028
Proposed branch: lp:~aacid/unity8/new_and_old_audio_role
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/use_quick_24
Diff against target: 112 lines (+45/-7)
4 files modified
qml/Components/NotificationAudio.qml (+42/-0)
qml/Components/ScreenGrabber.qml (+1/-3)
qml/Notifications/Notification.qml (+2/-3)
tests/qmltests/Notifications/tst_OptionToggle.qml (+0/-1)
To merge this branch: bzr merge lp:~aacid/unity8/new_and_old_audio_role
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Timo Jyrinki Pending
Review via email: mp+275735@code.launchpad.net

This proposal supersedes a proposal from 2015-10-22.

Commit message

Add an Item that proxies for old and new audio roles

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Michał Sawicz (saviq) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2005
http://jenkins.qa.ubuntu.com/job/unity8-ci/6516/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4772
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/899
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1228
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/544
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1123
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1124
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/755
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/756
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3848
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4769
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4769/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24476
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/531
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/899
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/899/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24480

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6516/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

> This should be Notification, not Alarm.
Fixed

Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

> Could make that a binding instead of onCompleted, wdyt?
I think the code is harder to understand since you need to see that the binding code will only be executed once which is not trivial with a binding but quite clear with onCompleted.

I'd prefer to leave it like this.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2007
http://jenkins.qa.ubuntu.com/job/unity8-ci/6523/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4782
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/906
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1235
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/551
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1130
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1131
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/762
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/763
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3854
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4779
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4779/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24494
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/534
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/906
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/906/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24496

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6523/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2008
http://jenkins.qa.ubuntu.com/job/unity8-ci/6526/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4787
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/909/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1238
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/554
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1133
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1134
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/765
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/766
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3859
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4784
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4784/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24514
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/537/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/909
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/909/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24515

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6526/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2009
http://jenkins.qa.ubuntu.com/job/unity8-ci/6530/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4796
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/913/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1242
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/558
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1137
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1138
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/769
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/770
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3864
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4793
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4793/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24525
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/539/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/913
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/913/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24527

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6530/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) : Posted in a previous version of this proposal
review: Approve (code)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2012. By Albert Astals Cid

log--

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 :

FAILED: Continuous integration, rev:2012
http://jenkins.qa.ubuntu.com/job/unity8-ci/6603/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4938
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/18/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1315/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/18
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1210
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1211
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/17
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/17
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3966
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4935
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4935/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24740
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-mako/9/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/18
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/18/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24737

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6603/rebuild

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

FAILED: Continuous integration, rev:2012
http://jenkins.qa.ubuntu.com/job/unity8-ci/6621/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4967
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/36/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1333
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/36
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1228
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1229
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/35
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/35
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3989
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4964
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4964/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24788
    ABORTED: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-mako/24/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/36
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/36/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24790

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6621/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
xenial broken
 * Did you make sure that the branch does not contain spurious tags?
Y

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'qml/Components/NotificationAudio.qml'
2--- qml/Components/NotificationAudio.qml 1970-01-01 00:00:00 +0000
3+++ qml/Components/NotificationAudio.qml 2015-10-29 14:19:48 +0000
4@@ -0,0 +1,42 @@
5+/*
6+ * Copyright (C) 2015 Canonical, Ltd.
7+ *
8+ * This program is free software; you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License as published by
10+ * the Free Software Foundation; version 3.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ */
20+
21+import QtQuick 2.4
22+
23+Item {
24+ id: root
25+ property string source: ""
26+ readonly property var playbackState: priv.audio ? priv.audio.playbackState : 0
27+
28+ function play() {
29+ priv.audio.play();
30+ }
31+ function stop() {
32+ priv.audio.stop();
33+ }
34+
35+ QtObject {
36+ id: priv
37+ property var audio: {
38+ try {
39+ return Qt.createQmlObject("import QtMultimedia 5.6; Audio { source: root.source; audioRole: MediaPlayer.NotificationRole }", priv)
40+ } catch(err) {
41+ console.log("Upstream audioRole enum not available, falling back to old role name.");
42+ return Qt.createQmlObject("import QtMultimedia 5.0; Audio { source: root.source; audioRole: MediaPlayer.alert }", priv)
43+ }
44+ }
45+ }
46+}
47
48=== modified file 'qml/Components/ScreenGrabber.qml'
49--- qml/Components/ScreenGrabber.qml 2015-10-29 14:19:47 +0000
50+++ qml/Components/ScreenGrabber.qml 2015-10-29 14:19:48 +0000
51@@ -15,7 +15,6 @@
52 */
53
54 import QtQuick 2.4
55-import QtMultimedia 5.0
56 import ScreenGrabber 0.1
57 import GlobalShortcut 1.0
58
59@@ -40,9 +39,8 @@
60 onTriggered: capture()
61 }
62
63- Audio {
64+ NotificationAudio {
65 id: shutterSound
66- audioRole: MediaPlayer.alert
67 source: "/system/media/audio/ui/camera_click.ogg"
68 }
69
70
71=== modified file 'qml/Notifications/Notification.qml'
72--- qml/Notifications/Notification.qml 2015-10-29 14:19:47 +0000
73+++ qml/Notifications/Notification.qml 2015-10-29 14:19:48 +0000
74@@ -15,13 +15,13 @@
75 */
76
77 import QtQuick 2.4
78-import QtMultimedia 5.0
79 import Powerd 0.1
80 import Ubuntu.Components 1.3
81 import Ubuntu.Components.ListItems 1.3 as ListItem
82 import Unity.Notifications 1.0
83 import QMenuModel 0.1
84 import Utils 0.1
85+import "../Components"
86
87 Item {
88 id: notification
89@@ -80,10 +80,9 @@
90 return result;
91 }
92
93- Audio {
94+ NotificationAudio {
95 id: sound
96 objectName: "sound"
97- audioRole: MediaPlayer.alert
98 source: hints["suppress-sound"] !== "true" && hints["sound-file"] !== undefined ? hints["sound-file"] : ""
99 }
100
101
102=== modified file 'tests/qmltests/Notifications/tst_OptionToggle.qml'
103--- tests/qmltests/Notifications/tst_OptionToggle.qml 2015-10-29 14:19:47 +0000
104+++ tests/qmltests/Notifications/tst_OptionToggle.qml 2015-10-29 14:19:48 +0000
105@@ -24,7 +24,6 @@
106 import Ubuntu.Components 1.3
107 import Unity.Test 0.1
108 import Unity.Notifications 1.0
109-import QtMultimedia 5.0
110
111 Row {
112 id: rootRow

Subscribers

People subscribed via source and target branches