def _get_player_from_bus_names(self, names): """ Returns list of `PlayerInfo` objects according to names. The bus names in names with prefix of MPRIS2_PREFIX will be treated as MPRIS2 players. The suffix of these names will be treated as player name Arguments: - `names`: list of bus names """ return [ PlayerInfo.from_name(name[len(MPRIS2_PREFIX):]) for name in names if name.startswith(MPRIS2_PREFIX) and name != DAEMON_MPRIS2_NAME ]
def __init__(self): super().__init__('Mpd') self._player = None self._init_address() self._client = None self._player_info = PlayerInfo(name=PLAYER_NAME, appname='mpd', binname='mpd', cmd='mpd') self._player = None self._io_watch = None self._fetch_queue = [] self._on_idle = False
def do_list_active_players(self): ret = [] for v in self._players.values(): ret.append(PlayerInfo(v.name)) return ret
def _get_player_from_bus_names(self, names): return [ PlayerInfo.from_name(name[len(MPRIS1_PREFIX):]) for name in names if name.startswith(MPRIS1_PREFIX) and not name.startswith(MPRIS1_PREFIX + 'MediaPlayer2.') ]
def player_info_from_name(name): return PlayerInfo(name, icon=name)
def do_list_active_players(self): return [PlayerInfo(v.name) for v in self._players.values()]
def player_info_from_name(name): """ Returns a dict representing a player info by the given name """ return PlayerInfo(name, icon=name)