MPRIS: Got everything necessary working. (I think.)

This commit is contained in:
The Wobbler 2025-04-18 19:35:13 +02:00
parent f23530628c
commit 1f149a25a3
10 changed files with 333 additions and 58 deletions

View file

@ -7,10 +7,52 @@ class MPRISRoot(DBusInterface):
def get_all(self):
body = ({
"CanQuit": ("b", True),
"CanRaise": ("b", True)
"Fullscreen": ("b", False),
"CanSetFullscreen": ("b", False),
"CanRaise": ("b", True),
"HasTrackList": ("b", False),
"Identity": ("s", "Wobuzz"),
"DesktopEntry": ("s", "wobuzz"),
"SupportedUriSchemes": ("as", ["file"]),
"SupportedMimeTypes": ("as", ["audio/mpeg"])
},)
return body
# ======== Methods ========
def Raise(self, msg):
print("Raise!")
self.server.app.gui.window.activateWindow()
self.server.app.gui.window.showMaximized()
def Quit(self, msg):
self.server.app.gui.window.close()
# ======== Properties ========
def CanQuit(self, msg: Message):
return "b", True
def Fullscreen(self, msg: Message):
return "b", False
def CanSetFullscreen(self, msg: Message):
return "b", False
def CanRaise(self, msg: Message):
return "b", True
def HasTrackList(self, msg: Message):
return "b", False
def Identity(self, msg: Message):
return "s", "Wobuzz"
def DesktopEntry(self, msg: Message):
return "s", "wobuzz"
def SupportedUriSchemes(self, msg: Message):
return "as", ["file"]
def SupportedMimeTypes(self, msg: Message):
return "as", ["audio/mpeg"]