libMusicForge
Loading...
Searching...
No Matches
musicforge.providers.mpd.MpdPlaybackSource Class Reference

Read-only asynchronous MPD playback observer. More...

Public Member Functions

None __init__ (self, str host="127.0.0.1", int port=6600, str|None password=None, float timeout=5.0)
 Initialize the configured instance.
TrackIdentity|None current_track (self)
 Return the playing or paused track; None when stopped or unavailable.

Public Attributes

 host
 port
 password
tuple timeout

Protected Member Functions

TrackIdentity|None _query (self)
dict[str, list[str]] _command (self, asyncio.StreamReader reader, asyncio.StreamWriter writer, str command, str|None argument=None)

Detailed Description

Read-only asynchronous MPD playback observer.

Constructor & Destructor Documentation

◆ __init__()

None musicforge.providers.mpd.MpdPlaybackSource.__init__ ( self,
str host = "127.0.0.1",
int port = 6600,
str | None password = None,
float timeout = 5.0 )

Initialize the configured instance.

Parameters
selfCurrent instance.
hostMPD server address.
portMPD TCP port.
passwordOptional MPD password.
timeoutQuery timeout in seconds.

Member Function Documentation

◆ _command()

dict[str, list[str]] musicforge.providers.mpd.MpdPlaybackSource._command ( self,
asyncio.StreamReader reader,
asyncio.StreamWriter writer,
str command,
str | None argument = None )
protected

◆ _query()

TrackIdentity | None musicforge.providers.mpd.MpdPlaybackSource._query ( self)
protected

◆ current_track()

TrackIdentity | None musicforge.providers.mpd.MpdPlaybackSource.current_track ( self)

Return the playing or paused track; None when stopped or unavailable.

Parameters
selfCurrent instance.
Returns
Observed track, or None if unavailable.

Connection/protocol failures raise MpdError rather than being mistaken for a stopped player.

Member Data Documentation

◆ host

musicforge.providers.mpd.MpdPlaybackSource.host

◆ password

musicforge.providers.mpd.MpdPlaybackSource.password

◆ port

musicforge.providers.mpd.MpdPlaybackSource.port

◆ timeout

tuple musicforge.providers.mpd.MpdPlaybackSource.timeout
Initial value:
= (
host,
port,
password,
timeout,
)

The documentation for this class was generated from the following file: