2020-12-19 14:57:37 +00:00
|
|
|
from enum import Enum
|
|
|
|
from plan import PlanItem
|
|
|
|
from typing import List, Optional
|
|
|
|
|
|
|
|
from typing_extensions import TypedDict
|
|
|
|
|
2021-04-08 19:53:51 +00:00
|
|
|
|
2020-12-19 14:57:37 +00:00
|
|
|
class ServerState(TypedDict):
|
2021-04-08 19:53:51 +00:00
|
|
|
server_version: str
|
|
|
|
server_name: str
|
|
|
|
host: str
|
|
|
|
port: int
|
|
|
|
num_channels: int
|
|
|
|
|
2020-12-19 14:57:37 +00:00
|
|
|
|
|
|
|
class RepeatMode(Enum):
|
2021-04-08 19:53:51 +00:00
|
|
|
none = 0
|
|
|
|
one = 1
|
|
|
|
all = 2
|
|
|
|
|
2020-12-19 14:57:37 +00:00
|
|
|
|
|
|
|
class PlayerState(TypedDict):
|
2021-04-08 19:53:51 +00:00
|
|
|
initialised: bool
|
|
|
|
loaded_item: Optional[PlanItem]
|
|
|
|
channel: int
|
|
|
|
playing: bool
|
|
|
|
paused: bool
|
|
|
|
loaded: bool
|
|
|
|
pos: float
|
|
|
|
pos_offset: float
|
|
|
|
pos_true: float
|
|
|
|
remaining: float
|
|
|
|
length: float
|
|
|
|
auto_advance: bool
|
|
|
|
repeat: RepeatMode
|
|
|
|
play_on_load: bool
|
|
|
|
output: Optional[str]
|
|
|
|
show_plan: List[PlanItem]
|
|
|
|
last_updated: str
|