OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
spotify.spotify_state_service.SpotifyStateService Class Reference

Cache Spotify playback/library state and keep API work off the UI thread. More...

Inheritance diagram for spotify.spotify_state_service.SpotifyStateService:
ui.media.playback_request_handler_if.PlaybackRequestHandlerIf ui.media.track_request_handler_if.TrackRequestHandlerIf ui.media.seek_request_handler_if.SeekRequestHandlerIf ui.media.volume_request_handler_if.VolumeRequestHandlerIf

Public Member Functions

SpotifyControllerIf controller (self)
 Return the synchronized backend for worker-only integrations.
None start (self)
 Start the playback state worker.
None close (self)
 Stop the background Spotify worker.
MediaState latest_state (self)
 Return the latest cached Spotify media state.
None request_refresh (self)
 Request a refresh subject to rate limiting and request coalescing.
None request_play (self)
 Request media playback.
None request_pause (self)
 Request media playback to pause.
None request_previous_track (self)
 Request the previous track.
None request_next_track (self)
 Request the next track.
None request_rewind (self, float seconds)
 Request a backward seek from the current position.
None request_forward (self, float seconds)
 Request a forward seek from the current position.
None request_seek (self, float position_s)
 Request an absolute position in the current media item.
None request_volume (self, int volume_percent)
 Request a media playback volume.
None request_play_song (self, str artist, str title, Callable[[str], None] report=lambda _message:None, Callable[[str], None]|None on_error=None)
 Resolve and play on the Spotify worker; never block the Tk thread.

Detailed Description

Cache Spotify playback/library state and keep API work off the UI thread.

Member Function Documentation

◆ request_forward()

None spotify.spotify_state_service.SpotifyStateService.request_forward ( self,
float seconds )

Request a forward seek from the current position.

Parameters
secondsNon-negative number of seconds to advance.

Reimplemented from ui.media.seek_request_handler_if.SeekRequestHandlerIf.

◆ request_rewind()

None spotify.spotify_state_service.SpotifyStateService.request_rewind ( self,
float seconds )

Request a backward seek from the current position.

Parameters
secondsNon-negative number of seconds to rewind.

Reimplemented from ui.media.seek_request_handler_if.SeekRequestHandlerIf.

◆ request_seek()

None spotify.spotify_state_service.SpotifyStateService.request_seek ( self,
float position_s )

Request an absolute position in the current media item.

Parameters
position_sZero-based playback position in seconds.

Reimplemented from ui.media.seek_request_handler_if.SeekRequestHandlerIf.

◆ request_volume()

None spotify.spotify_state_service.SpotifyStateService.request_volume ( self,
int volume_percent )

Request a media playback volume.

Parameters
volume_percentRequested volume from 0 through 100.

Reimplemented from ui.media.volume_request_handler_if.VolumeRequestHandlerIf.


The documentation for this class was generated from the following file:
  • controllers/spotify/spotify_state_service.py