-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathaudioplayer_dbus.patch
executable file
·84 lines (80 loc) · 2.25 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--- AudioPlayer.qml.orig 2014-06-09 21:09:01.847914809 +0200
+++ AudioPlayer.qml 2014-06-18 20:12:53.196146039 +0200
@@ -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 {
@@ -252,8 +253,9 @@ DockedPanel {
'trackCount': model.count,
'duration' : currentItem.duration * 1000
}
+ mediaPlayerNotification.call("nowPlaying", [currentItem.title, currentItem.album, currentItem.author])
}
- bluetoothMediaPlayer.metadata = metadata
+ //bluetoothMediaPlayer.metadata = metadata
}
onStateChanged: {
@@ -297,6 +299,7 @@ DockedPanel {
model.shuffled = shuffle
}
}
+/*
BluetoothMediaPlayer {
id: bluetoothMediaPlayer
@@ -340,6 +343,7 @@ DockedPanel {
}
}
}
+*/
Column {
id: column
@@ -461,4 +465,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":
+ audio.playNext()
+ break
+ case "toggle_pause":
+ if (isPaused) {
+ player._play()
+ isPaused = false
+ } else {
+ player.pause()
+ isPaused = true
+ }
+ break
+ case "prev":
+ audio.playPrevious()
+ break
+ }
+ }
+ }
+
+ DBusInterface {
+ id: mediaPlayerNotification
+
+ destination: "com.jolla.mediaplayer.notification"
+ iface: "com.jolla.mediaplayer.notification.Interface"
+ path: "/com/jolla/mediaplayer/notification"
+ }
+
}