def Get(self, interface, property_name):
if property_name in ["CanQuit", "CanRaise", "CanSeek",
"CanControl", "HasRatingsExtension"]:
return GLib.Variant("b", True)
elif property_name == "HasTrackList":
return GLib.Variant("b", False)
elif property_name == "Identity":
return GLib.Variant("s", "Cozy")
elif property_name == "DesktopEntry":
return GLib.Variant("s", "com.github.geigi.cozy")
elif property_name == "SupportedUriSchemes":
return GLib.Variant("as", ["file"])
elif property_name == "SupportedMimeTypes":
return GLib.Variant("as", ["application/ogg",
"audio/x-vorbis+ogg",
"audio/x-flac",
"audio/mpeg"])
elif property_name == "PlaybackStatus":
return GLib.Variant("s", self.__get_status())
elif property_name == "Metadata":
return GLib.Variant("a{sv}", self.__metadata)
elif property_name == "Position":
return GLib.Variant(
"x",
get_current_duration())
elif property_name in ["CanGoNext", "CanGoPrevious",
"CanPlay", "CanPause"]:
return GLib.Variant("b", get_current_track() is not None)
评论列表
文章目录