Playerctl.PlayerManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
A list of player names that are currently available to control. |
||
r |
A list of player objects managed by this manager |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a new name has appeared and is available to connect to. |
|
Emitted when the name has vanished and is no longer available to be controlled by playerctl. |
|
Emitted when a new player will be managed by this manager through a call to |
|
Emitted when a player has disconnected and will no longer be managed by this manager. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Playerctl.PlayerManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Raises:
- Returns:
A new
Playerctl.PlayerManager
.- Return type:
Create a new player manager that contains a list of player names available in the
Playerctl.PlayerManager
:player-names
property. You can create new players from the names with thePlayerctl.Player.new_from_name
() function and then start managing them with thePlayerctl.PlayerManager.manage_player
() function.
- manage_player(player)¶
- Parameters:
player (
Playerctl.Player
) – APlayerctl.Player
to manage
Add the given player to the list of managed players. Takes a reference to the player (so you can unref it after you call this function). The player will automatically be unreffed and removed from the list of
Playerctl.PlayerManager
:players
when it disconnects and thePlayerctl.PlayerManager
::player-vanished
signal will be emitted on the manager.
- move_player_to_top(player)¶
- Parameters:
player (
Playerctl.Player
) – APlayerctl.Player
in the list ofPlayerctl.PlayerManager
:players
Moves the player to the top of the list of
Playerctl.PlayerManager
:players
. If this manager has a sort function set withPlayerctl.PlayerManager.set_sort_func
(), the list of players will be sorted afterward, but will be on top of equal players in the sorted order.
- set_sort_func(sort_func, *sort_data)¶
- Parameters:
sort_func (
GLib.CompareDataFunc
) – The compare function to be used to sort thePlayerctl.PlayerManager
:players
.sort_data (
object
orNone
) – User data for the sort function.
Keeps the
Playerctl.PlayerManager
:players
list of this manager in sorted order which is useful for using this list as a priority queue.
Signal Details¶
- Playerctl.PlayerManager.signals.name_appeared(player_manager, name)¶
- Signal Name:
name-appeared
- Flags:
- Parameters:
player_manager (
Playerctl.PlayerManager
) – The object which received the signalname (
Playerctl.PlayerName
) – APlayerctl.PlayerName
containing information about the name that has appeared.
Emitted when a new name has appeared and is available to connect to. Use
Playerctl.Player.new_from_name
() to connect to the player andPlayerctl.PlayerManager.manage_player
() to add it to the managed list of players.
- Playerctl.PlayerManager.signals.name_vanished(player_manager, name)¶
- Signal Name:
name-vanished
- Flags:
- Parameters:
player_manager (
Playerctl.PlayerManager
) – The object which received the signalname (
Playerctl.PlayerName
) – ThePlayerctl.PlayerName
containing connection information about the name that is going away.
Emitted when the name has vanished and is no longer available to be controlled by playerctl. If the player is managed, it will automatically be removed from the list of players and the
Playerctl.PlayerManager
::player-vanished
signal will be emitted automatically.
- Playerctl.PlayerManager.signals.player_appeared(player_manager, player)¶
- Signal Name:
player-appeared
- Flags:
- Parameters:
player_manager (
Playerctl.PlayerManager
) – The object which received the signalplayer (
Playerctl.Player
) – ThePlayerctl.Player
that will be managed by this manager
Emitted when a new player will be managed by this manager through a call to
Playerctl.PlayerManager.manage_player
().
- Playerctl.PlayerManager.signals.player_vanished(player_manager, player)¶
- Signal Name:
player-vanished
- Flags:
- Parameters:
player_manager (
Playerctl.PlayerManager
) – The object which received the signalplayer (
Playerctl.Player
) – ThePlayerctl.Player
that will no longer be managed by this manager
Emitted when a player has disconnected and will no longer be managed by this manager. The player is removed from the list of players automatically.
Property Details¶
- Playerctl.PlayerManager.props.player_names¶
-
A list of fully qualified player names that are currently available to control.