def __on_current_changed(self):
current_track_id = get_current_track().id
if current_track_id and current_track_id >= 0:
self.__cozy_id = current_track_id
else:
self.__cozy_id = 0
# We only need to recalculate a new trackId at song changes.
self.__track_id = self.__get_media_id(self.__cozy_id)
self.__rating = None
self.__update_metadata()
properties = {"Metadata": GLib.Variant("a{sv}", self.__metadata),
"CanPlay": GLib.Variant("b", True),
"CanPause": GLib.Variant("b", True),
"CanGoNext": GLib.Variant("b", True),
"CanGoPrevious": GLib.Variant("b", True)}
try:
self.PropertiesChanged(self.__MPRIS_PLAYER_IFACE, properties, [])
except Exception as e:
print("MPRIS::__on_current_changed(): %s" % e)
评论列表
文章目录