Initial commit of source - working, but needs stubs for Cocoa
This commit is contained in:
parent
1e7fd270eb
commit
a673f2ef90
12 changed files with 1339 additions and 0 deletions
27
src/mpd_now_playable/song.py
Normal file
27
src/mpd_now_playable/song.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from enum import StrEnum
|
||||
from typing import Protocol
|
||||
|
||||
from attrs import define, field
|
||||
|
||||
|
||||
class PlaybackState(StrEnum):
|
||||
play = "play"
|
||||
pause = "pause"
|
||||
stop = "stop"
|
||||
|
||||
|
||||
@define
|
||||
class Song:
|
||||
state: PlaybackState
|
||||
title: str
|
||||
artist: str
|
||||
album: str
|
||||
album_artist: str
|
||||
duration: float
|
||||
elapsed: float
|
||||
art: bytes | None = field(repr=lambda a: "<has art>" if a else "<no art>")
|
||||
|
||||
|
||||
class SongListener(Protocol):
|
||||
def update(self, song: Song | None) -> None:
|
||||
...
|
Loading…
Add table
Add a link
Reference in a new issue