from bumble import hci
from bumble.profiles import bap
from dataclasses import dataclass

# Define some base dataclasses to hold the relevant parameters
@dataclass
class AuracastGlobalConfig:
    device_name: str = 'Auracaster'
    transport: str = ''
    auracast_device_address: hci.Address = hci.Address('F0:F1:F2:F3:F4:F5')
    auracast_sampling_rate_khz: int =24000
    octets_per_frame: int = 100 # bitrate = octets_per_frame * 8 / frame len
    frame_duration_us: int = 10000
    presentation_delay_us: int = 40000 


@dataclass
class AuracastBigConfig:
    broadcast_id: int =123456
    broadcast_code: str = None # a hexstr
    broadcast_language: str = 'en'
    broadcast_name: str = 'Broadcast0'
    broadcast_program_info: str = 'Some Announcements'
    broacast_wav_file_path: str = './auracast/announcement_48_10_96000_en.wav'

global_base_config = AuracastGlobalConfig()

# Instanciate some example configurations
broadcast_de = AuracastBigConfig(
    broadcast_id=12,
    broadcast_language='de',
    broadcast_name = 'Broadcast0',
    broacast_wav_file_path = './auracast/announcement_48_10_96000_de.wav',
)

broadcast_en = AuracastBigConfig(
    broadcast_id=123,
    broadcast_language='eng',
    broadcast_name = 'Broadcast1',
    broacast_wav_file_path = './auracast/announcement_48_10_96000_en.wav',
)

broadcast_fr = AuracastBigConfig(
    broadcast_id=1234,
    broadcast_language='fr',
    broadcast_name = 'Broadcast2',
    broacast_wav_file_path = './auracast/announcement_48_10_96000_fr.wav',
)