forked from ruedigergad/SkippingStones
-
Notifications
You must be signed in to change notification settings - Fork 0
/
audioplayer_dbus.patch
executable file
·65 lines (63 loc) · 1.79 KB
/
audioplayer_dbus.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--- AudioPlayer.qml.orig 2014-02-11 23:17:53.925093609 +0100
+++ AudioPlayer.qml 2014-02-12 16:37:40.807202918 +0100
@@ -5,6 +5,7 @@ import Sailfish.Silica 1.0
import Sailfish.Silica.theme 1.0
import Sailfish.Media 1.0
import com.jolla.mediaplayer 1.0
+import org.nemomobile.dbus 1.0
import org.nemomobile.policy 1.0
DockedPanel {
@@ -130,6 +131,7 @@ DockedPanel {
} else {
audio.play()
}
+ mediaPlayerNotification.call("nowPlaying", [currentItem.title, currentItem.album, currentItem.author])
showControls()
}
@@ -382,4 +384,46 @@ DockedPanel {
}
}
}
+
+ DBusAdaptor {
+ id: mediaPlayerRemoteControl
+
+ property bool isPaused: false
+
+ service: "com.jolla.mediaplayer.remotecontrol"
+ iface: "com.jolla.mediaplayer.remotecontrol.Interface"
+ path: "/com/jolla/mediaplayer/remotecontrol"
+
+ signal executeCommand(string command)
+
+ onExecuteCommand: {
+ console.log("Trying to execute command: " + command)
+ switch (command) {
+ case "next":
+ songList.playNext()
+ break
+ case "toggle_pause":
+ if (isPaused) {
+ player._play()
+ isPaused = false
+ } else {
+ player.pause()
+ isPaused = true
+ }
+ break
+ case "prev":
+ songList.playPrevious()
+ break
+ }
+ }
+ }
+
+ DBusInterface {
+ id: mediaPlayerNotification
+
+ destination: "com.jolla.mediaplayer.notification"
+ iface: "com.jolla.mediaplayer.notification.Interface"
+ path: "/com/jolla/mediaplayer/notification"
+ }
+
}