Initial commit of source - working, but needs stubs for Cocoa

This commit is contained in:
Danielle McLean 2023-11-27 15:49:33 +11:00
parent 1e7fd270eb
commit a673f2ef90
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
12 changed files with 1339 additions and 0 deletions

View 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:
...