sublime_music.dbus.manager module

class sublime_music.dbus.manager.DBusManager(connection, do_on_method_call, on_set_property, get_config_and_player_manager)[source]

Bases: object

Parameters
__init__(connection, do_on_method_call, on_set_property, get_config_and_player_manager)[source]
Parameters
current_state: Dict = {}
diff_parse_re = re.compile("root\\['(.*?)'\\]\\['(.*?)'\\](?:\\[.*\\])?")
get_active_playlist(active_playlist_id)[source]
Parameters

active_playlist_id (Optional[str]) –

Return type

Tuple[bool, gi.overrides.GLib.Variant]

static get_dbus_playlist(play_queue)[source]

Gets a playlist formatted for DBus. If multiples of the same element exist in the queue, it will use /0 after the song ID to differentiate between the instances.

>>> DBusManager.get_dbus_playlist(("2", "1", "3", "1"))
['/song/2/0', '/song/1/0', '/song/3/0', '/song/1/1']
Parameters

play_queue (Tuple[str, ...]) –

Return type

List[str]

get_mpris_metadata(idx, play_queue)[source]
Parameters
Return type

Dict[str, Any]

on_get_property(connection, sender, path, interface, property_name)[source]
Parameters
  • connection (gi.repository.Gio.DBusConnection) –

  • sender (str) –

  • path (str) –

  • interface (str) –

  • property_name (str) –

Return type

gi.overrides.GLib.Variant

on_method_call(connection, sender, path, interface, method, params, invocation)[source]
Parameters
  • connection (gi.repository.Gio.DBusConnection) –

  • sender (str) –

  • path (str) –

  • interface (str) –

  • method (str) –

  • params (gi.overrides.GLib.Variant) –

  • invocation (gi.repository.Gio.DBusMethodInvocation) –

property_dict()[source]
Return type

Dict[str, dict[str, Any]]

property_diff()[source]
second_microsecond_conversion = 1000000
shutdown()[source]
static to_variant(value)[source]
Parameters

value (Any) –

Return type

gi.overrides.GLib.Variant

sublime_music.dbus.manager.dbus_propagate(param_self=None)[source]

Wraps a function which causes changes to DBus properties.

Parameters

param_self (Optional[Any]) –

Return type

Callable