#pragma once

#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    AUDIO_IDLE = 0,
    AUDIO_CONNECTED,
    AUDIO_PLAYING,
    AUDIO_ERROR,
} audio_state_t;

/**
 * Initialize the audio streaming client.
 * @param uri  WebSocket URI (e.g. "ws://192.168.2.199:8766")
 * @param codec  Pointer to CodecPort instance (passed as void* for C linkage)
 */
void audio_client_init(const char *uri, void *codec);

/** Start the WebSocket connection and playback task. */
void audio_client_start(void);

/** Stop playback and disconnect. */
void audio_client_stop(void);

/** Get current audio client state. */
audio_state_t audio_client_get_state(void);

#ifdef __cplusplus
}
#endif
