Merge lp:~vthompson/music-app/use-qtpowerd-plugin into lp:music-app/trusty

Proposed by Victor Thompson
Status: Rejected
Rejected by: David Planella
Proposed branch: lp:~vthompson/music-app/use-qtpowerd-plugin
Merge into: lp:music-app/trusty
Diff against target: 45 lines (+10/-1)
2 files modified
debian/control (+1/-1)
music-app.qml (+9/-0)
To merge this branch: bzr merge lp:~vthompson/music-app/use-qtpowerd-plugin
Reviewer Review Type Date Requested Status
Loïc Minier Disapprove
Music App Developers Pending
Review via email:

Commit message

Use Powerd QML bindings to prevent app from being suspended.

Description of the change

Use Powerd QML bindings to prevent app from being suspended. MP is open now to discuss how the plugin will be used.

To post a comment you must log in.
Revision history for this message
Daniel Holm (danielholm) wrote :

What is MP? And "how the plugin will be used", was that these one-liner codes to hold the Powerd for the music?

Revision history for this message
Victor Thompson (vthompson) wrote :

Sorry, MP is just shorthand for 'merge proposal'. And, yes, right now the intent is to just store a boolean property that will toggle the two API calls when called (see the qtpowerd implementation).

Revision history for this message
Daniel Holm (danielholm) wrote :

Ah, thank you. Well "powerConnection.keepAlive = mainView.isPlaying" would work, wouldn't it? It's plain and simple.

Revision history for this message
Loïc Minier (lool) wrote :

Hey Victor,

Thanks a lot for working on this! I installed qtpowerd from coreapps-drivers daily PPA and patched music-app as above, but that didn't work.

First, I had to explicitly enable the QtDBus module in the .pro file for the .so to load; second, I get:
file:///usr/share/music-app/music-app.qml:509: Error: Cannot assign to non-existent property "keepAlive"
when playing state changes, and in "powerd-cli listen" I see no event coming in.

I can confirm however that this *is* the right approach, as taking an active lock over SSH ("powerd-cli active") is enough for music to keep playing when screen is turned off (if I don't take it, music plays but stutters).

Revision history for this message
Loïc Minier (lool) wrote :

Good news, I got this working here; I see the lock appear and disappear in "powerd-cli list"!

I'll push the qtpowerd changes ASAP; the approach in this MP might work, but I think there's a simpler one.

Revision history for this message
Loïc Minier (lool) wrote :

I can't mark this as superseded, but would someone please do so? I've proposed an updated version at:

review: Disapprove
Revision history for this message
David Planella (dpm) wrote :

Hm, it seems Launchpad merged this automatically just after Loïc's comment?

I'm a bit confused, especially as no Jenkins tests were triggered at all.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-09-23 19:31:29 +0000
3+++ debian/control 2013-09-26 02:25:50 +0000
4@@ -8,7 +8,7 @@
6 Package: music-app
7 Architecture: all
8-Depends: ${misc:Depends},grilo-plugins-0.2-mediascanner,qtdeclarative5-qtgrilo0.1,qtdeclarative5-localstorage-plugin,qtdeclarative5-particles-plugin,qtdeclarative5-qtmultimedia-plugin,qtdeclarative5-qtquick2-plugin,qtdeclarative5-ubuntu-ui-toolkit-plugin|qt-components-ubuntu,qtdeclarative5-window-plugin,qtdeclarative5-xmllistmodel-plugin,${shlibs:Depends},qmlscene
9+Depends: ${misc:Depends},grilo-plugins-0.2-mediascanner,qtdeclarative5-qtgrilo0.1,qtdeclarative5-qtpowerd0.1,qtdeclarative5-localstorage-plugin,qtdeclarative5-particles-plugin,qtdeclarative5-qtmultimedia-plugin,qtdeclarative5-qtquick2-plugin,qtdeclarative5-ubuntu-ui-toolkit-plugin|qt-components-ubuntu,qtdeclarative5-window-plugin,qtdeclarative5-xmllistmodel-plugin,${shlibs:Depends},qmlscene
10 Description: Music player for Ubuntu Touch
11 Touch enabled music player for Ubuntu
14=== modified file 'music-app.qml'
15--- music-app.qml 2013-09-24 13:07:08 +0000
16+++ music-app.qml 2013-09-26 02:25:50 +0000
17@@ -22,6 +22,7 @@
18 import Ubuntu.Components.Popups 0.1
19 import Ubuntu.Components.ListItems 0.1 as ListItem
20 import Ubuntu.Unity.Action 1.0 as UnityActions
21+import Ubuntu.Powerd 0.1
22 import org.nemomobile.grilo 0.1
23 import QtMultimedia 5.0
24 import QtQuick.LocalStorage 2.0
25@@ -56,6 +57,12 @@
26 }
27 }
29+ // Powerd connection
30+ Connections {
31+ id: powerConnection
32+ target: Powerd
33+ }
35 // HUD Actions
36 Action {
37 id: nextAction
38@@ -496,6 +503,8 @@
39 onPlaybackStateChanged: {
40 mainView.isPlaying = player.playbackState === MediaPlayer.PlayingState
41 console.log("mainView.isPlaying=" + mainView.isPlaying)
43+ powerConnection.keepAlive = mainView.isPlaying
44 }
45 }


People subscribed via source and target branches

to status/vote changes: