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: mp+187637@code.launchpad.net

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:
https://code.launchpad.net/~lool/music-app/use-qtpowerd-plugin/+merge/188719

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
=== modified file 'debian/control'
--- debian/control 2013-09-23 19:31:29 +0000
+++ debian/control 2013-09-26 02:25:50 +0000
@@ -8,7 +8,7 @@
88
9Package: music-app9Package: music-app
10Architecture: all10Architecture: all
11Depends: ${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},qmlscene11Depends: ${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
12Description: Music player for Ubuntu Touch12Description: Music player for Ubuntu Touch
13 Touch enabled music player for Ubuntu13 Touch enabled music player for Ubuntu
1414
1515
=== modified file 'music-app.qml'
--- music-app.qml 2013-09-24 13:07:08 +0000
+++ music-app.qml 2013-09-26 02:25:50 +0000
@@ -22,6 +22,7 @@
22import Ubuntu.Components.Popups 0.122import Ubuntu.Components.Popups 0.1
23import Ubuntu.Components.ListItems 0.1 as ListItem23import Ubuntu.Components.ListItems 0.1 as ListItem
24import Ubuntu.Unity.Action 1.0 as UnityActions24import Ubuntu.Unity.Action 1.0 as UnityActions
25import Ubuntu.Powerd 0.1
25import org.nemomobile.grilo 0.126import org.nemomobile.grilo 0.1
26import QtMultimedia 5.027import QtMultimedia 5.0
27import QtQuick.LocalStorage 2.028import QtQuick.LocalStorage 2.0
@@ -56,6 +57,12 @@
56 }57 }
57 }58 }
5859
60 // Powerd connection
61 Connections {
62 id: powerConnection
63 target: Powerd
64 }
65
59 // HUD Actions66 // HUD Actions
60 Action {67 Action {
61 id: nextAction68 id: nextAction
@@ -496,6 +503,8 @@
496 onPlaybackStateChanged: {503 onPlaybackStateChanged: {
497 mainView.isPlaying = player.playbackState === MediaPlayer.PlayingState504 mainView.isPlaying = player.playbackState === MediaPlayer.PlayingState
498 console.log("mainView.isPlaying=" + mainView.isPlaying)505 console.log("mainView.isPlaying=" + mainView.isPlaying)
506
507 powerConnection.keepAlive = mainView.isPlaying
499 }508 }
500 }509 }
501510

Subscribers

People subscribed via source and target branches

to status/vote changes: