MPRIS: Switching from python-sdbus to jeepney, no functionality.
This commit is contained in:
parent
a236370d47
commit
f23530628c
14 changed files with 301 additions and 125 deletions
34
wobuzz/mpris/mpris_player.py
Normal file
34
wobuzz/mpris/mpris_player.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
from jeepney import new_method_return
|
||||
|
||||
from .utils import *
|
||||
|
||||
|
||||
class MPRISPlayer(DBusInterface):
|
||||
def __init__(self, server, interface):
|
||||
super().__init__(server, interface)
|
||||
|
||||
self.metadata = {
|
||||
"mpris:trackid": ("o", "/org/mpris/MediaPlayer2/murx"), # random junk, no functionality
|
||||
"xesam:title": ("s", "Huggenburgl")
|
||||
}
|
||||
|
||||
def get_all(self):
|
||||
body = ({
|
||||
"CanPlay": ("b", True),
|
||||
"Metadata": ("a{sv}", self.metadata)
|
||||
},)
|
||||
|
||||
return body
|
||||
|
||||
def Play(self, msg: Message):
|
||||
print("Play!")
|
||||
|
||||
def PlayPause(self, msg: Message):
|
||||
print("Play/Pause!")
|
||||
|
||||
def Metadata(self, msg: Message):
|
||||
body = (self.metadata,)
|
||||
|
||||
return new_method_return(msg, "a{sv}", body)
|
Loading…
Add table
Add a link
Reference in a new issue