sublime_music.ui.state module

class sublime_music.ui.state.RepeatType(value)[source]

Bases: enum.Enum

An enumeration.

NO_REPEAT = 0
REPEAT_QUEUE = 1
REPEAT_SONG = 2
as_mpris_loop_status()[source]
Return type

str

static from_mpris_loop_status(loop_status)[source]
Parameters

loop_status (str) –

Return type

sublime_music.ui.state.RepeatType

property icon: str

Get the icon for the repeat type.

>>> RepeatType.NO_REPEAT.icon, RepeatType.REPEAT_QUEUE.icon
('media-playlist-repeat-symbolic', 'media-playlist-repeat-symbolic')
>>> RepeatType.REPEAT_SONG.icon
'media-playlist-repeat-song-symbolic'
class sublime_music.ui.state.UIState(version=1, playing=False, current_song_index=-1, play_queue=<factory>, old_play_queue=<factory>, _volume=<factory>, is_muted=False, repeat_type=RepeatType.NO_REPEAT, shuffle_on=False, song_progress=datetime.timedelta(0), song_stream_cache_progress=datetime.timedelta(0), current_device='this device', connecting_to_device=False, connected_device_name=None, available_players=<factory>, current_tab='albums', selected_album_id=None, selected_artist_id=None, selected_browse_element_id=None, selected_playlist_id=None, album_sort_direction='ascending', album_page_size=30, album_page=0, current_notification=None, playlist_details_expanded=True, artist_details_expanded=True, loading_play_queue=False, current_album_search_query=<factory>, active_playlist_id=None, _current_song=None)[source]

Bases: object

Represents the UI state of the application.

Parameters
Return type

None

class UINotification(markup: str, actions: Tuple[Tuple[str, Callable[[], NoneType]], ...] = <factory>, icon: Optional[str] = None)[source]

Bases: object

Parameters
Return type

None

__init__(markup, actions=<factory>, icon=None)
Parameters
Return type

None

actions: Tuple[Tuple[str, Callable[[], None]], ...]
icon: Optional[str] = None
markup: str
__init__(version=1, playing=False, current_song_index=-1, play_queue=<factory>, old_play_queue=<factory>, _volume=<factory>, is_muted=False, repeat_type=RepeatType.NO_REPEAT, shuffle_on=False, song_progress=datetime.timedelta(0), song_stream_cache_progress=datetime.timedelta(0), current_device='this device', connecting_to_device=False, connected_device_name=None, available_players=<factory>, current_tab='albums', selected_album_id=None, selected_artist_id=None, selected_browse_element_id=None, selected_playlist_id=None, album_sort_direction='ascending', album_page_size=30, album_page=0, current_notification=None, playlist_details_expanded=True, artist_details_expanded=True, loading_play_queue=False, current_album_search_query=<factory>, active_playlist_id=None, _current_song=None)
Parameters
Return type

None

active_playlist_id: Optional[str] = None
album_page: int = 0
album_page_size: int = 30
album_sort_direction: str = 'ascending'
artist_details_expanded: bool = True
available_players: Dict[Type, Set[Tuple[str, str]]]
connected_device_name: Optional[str] = None
connecting_to_device: bool = False
current_album_search_query: sublime_music.adapters.adapter_base.AlbumSearchQuery
current_device: str = 'this device'
current_notification: Optional[sublime_music.ui.state.UIState.UINotification] = None
property current_song: Optional[sublime_music.adapters.api_objects.Song]
current_song_index: int = -1
current_tab: str = 'albums'
is_muted: bool = False
loading_play_queue: bool = False
migrate()[source]
property next_song_index: Optional[int]
old_play_queue: Tuple[str, ...]
play_queue: Tuple[str, ...]
playing: bool = False
playlist_details_expanded: bool = True
repeat_type: sublime_music.ui.state.RepeatType = 0
selected_album_id: Optional[str] = None
selected_artist_id: Optional[str] = None
selected_browse_element_id: Optional[str] = None
selected_playlist_id: Optional[str] = None
shuffle_on: bool = False
song_progress: datetime.timedelta = datetime.timedelta(0)
song_stream_cache_progress: Optional[datetime.timedelta] = datetime.timedelta(0)
version: int = 1
property volume: float