2022-01-18 05:55:16 +01:00
|
|
|
from pathlib import Path
|
|
|
|
|
2022-01-18 20:59:11 +01:00
|
|
|
from libretime_shared.config import BaseConfig, RabbitMQConfig
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from typing_extensions import Literal
|
|
|
|
|
2022-01-18 05:55:16 +01:00
|
|
|
CACHE_DIR = Path.cwd() / "scheduler"
|
|
|
|
RECORD_DIR = Path.cwd() / "recorder"
|
2022-01-18 20:59:11 +01:00
|
|
|
|
2022-01-18 21:10:17 +01:00
|
|
|
PUSH_INTERVAL = 2
|
|
|
|
POLL_INTERVAL = 400
|
|
|
|
|
2022-01-18 20:59:11 +01:00
|
|
|
|
|
|
|
class PlayoutConfig(BaseModel):
|
|
|
|
liquidsoap_host: str = "localhost"
|
|
|
|
liquidsoap_port: int = 1234
|
|
|
|
|
|
|
|
record_file_format: Literal["mp3", "ogg"] = "ogg" # record_file_type
|
|
|
|
record_bitrate: int = 256
|
|
|
|
record_samplerate: int = 44100
|
|
|
|
record_channels: int = 2
|
|
|
|
record_sample_size: int = 16
|
|
|
|
|
|
|
|
|
|
|
|
class Config(BaseConfig):
|
2022-01-24 14:24:16 +01:00
|
|
|
rabbitmq: RabbitMQConfig = RabbitMQConfig()
|
|
|
|
playout: PlayoutConfig = PlayoutConfig()
|