package xyz.cottongin.radio247.audio

sealed interface AudioEngineEvent {
    data class MetadataChanged(val metadata: IcyMetadata) : AudioEngineEvent
    data class StreamInfoReceived(val streamInfo: StreamInfo) : AudioEngineEvent
    data class AudioFormatDetected(val sampleRate: Int, val channelCount: Int) : AudioEngineEvent
    data class Error(val cause: EngineError) : AudioEngineEvent
    data object Started : AudioEngineEvent
    data object Stopped : AudioEngineEvent
}

sealed interface EngineError {
    data class ConnectionFailed(val cause: Throwable) : EngineError
    data object StreamEnded : EngineError
    data class DecoderError(val cause: Throwable) : EngineError
    data class AudioOutputError(val cause: Throwable) : EngineError
}
