17 #ifndef __NUGU_PCM_H__
18 #define __NUGU_PCM_H__
37 typedef struct _nugu_pcm
NuguPcm;
372 size_t size,
int is_last);
NUGU_API int nugu_pcm_driver_free(NuguPcmDriver *driver)
Destroy the pcm driver object.
NUGU_API NuguPcmDriver * nugu_pcm_driver_get_default(void)
Get the default pcm driver.
NUGU_API NuguPcmDriver * nugu_pcm_driver_new(const char *name, struct nugu_pcm_driver_ops *ops)
Create new pcm driver object.
NUGU_API int nugu_pcm_driver_remove(NuguPcmDriver *driver)
Remove the driver from driver list.
NUGU_API NuguPcmDriver * nugu_pcm_driver_find(const char *name)
Find a driver by name in the driver list.
struct _nugu_pcm_driver NuguPcmDriver
pcm driver object
Definition: nugu_pcm.h:43
NUGU_API int nugu_pcm_driver_set_default(NuguPcmDriver *driver)
Set the default pcm driver.
NUGU_API int nugu_pcm_driver_register(NuguPcmDriver *driver)
Register the driver to driver list.
NUGU_API NuguPcm * nugu_pcm_new(const char *name, NuguPcmDriver *driver, NuguAudioProperty property)
Create new pcm object.
NUGU_API NuguPcm * nugu_pcm_find(const char *name)
Find a pcm object by name in the managed list.
NUGU_API void nugu_pcm_emit_status(NuguPcm *pcm, enum nugu_media_status status)
Emit status to registered callback.
NUGU_API int nugu_pcm_set_driver_data(NuguPcm *pcm, void *data)
Set custom data for driver.
NUGU_API void nugu_pcm_clear_buffer(NuguPcm *pcm)
Clear pcm buffer.
NUGU_API const char * nugu_pcm_get_audio_attribute_str(NuguPcm *pcm)
Get audio attribute.
NUGU_API int nugu_pcm_resume(NuguPcm *pcm)
Resume pcm playback.
NUGU_API int nugu_pcm_receive_is_last_data(NuguPcm *pcm)
Get flag that all data pushes are complete.
NUGU_API void nugu_pcm_set_event_callback(NuguPcm *pcm, NuguMediaEventCallback cb, void *userdata)
Set pcm event callback.
NUGU_API int nugu_pcm_add(NuguPcm *pcm)
Add pcm object to managed list.
NUGU_API int nugu_pcm_pause(NuguPcm *pcm)
Pause pcm playback.
NUGU_API void nugu_pcm_emit_event(NuguPcm *pcm, enum nugu_media_event event)
Emit event to registered callback.
NUGU_API int nugu_pcm_remove(NuguPcm *pcm)
Remove pcm object from managed list.
NUGU_API int nugu_pcm_start(NuguPcm *pcm)
Start pcm playback.
NUGU_API int nugu_pcm_get_audio_attribute(NuguPcm *pcm)
Get audio attribute.
NUGU_API int nugu_pcm_get_position(NuguPcm *pcm)
Get current playback position of pcm.
NUGU_API int nugu_pcm_push_data_done(NuguPcm *pcm)
Set flag that push for all data is complete.
NUGU_API int nugu_pcm_get_volume(NuguPcm *pcm)
Get volume of pcm.
NUGU_API void nugu_pcm_free(NuguPcm *pcm)
Destroy the pcm object.
NUGU_API int nugu_pcm_set_volume(NuguPcm *pcm, int volume)
Set volume of pcm.
struct _nugu_pcm NuguPcm
pcm object
Definition: nugu_pcm.h:37
NUGU_API void * nugu_pcm_get_driver_data(NuguPcm *pcm)
Get custom data for driver.
NUGU_API int nugu_pcm_get_duration(NuguPcm *pcm)
Get duration information of pcm.
NUGU_API int nugu_pcm_push_data(NuguPcm *pcm, const char *data, size_t size, int is_last)
Push playback pcm data.
NUGU_API size_t nugu_pcm_get_data_size(NuguPcm *pcm)
Get pcm data size.
NUGU_API int nugu_pcm_stop(NuguPcm *pcm)
Stop pcm playback.
NUGU_API int nugu_pcm_set_audio_attribute(NuguPcm *pcm, NuguAudioAttribute attr)
Set audio attribute.
NUGU_API void nugu_pcm_set_status_callback(NuguPcm *pcm, NuguMediaStatusCallback cb, void *userdata)
Set pcm status callback.
NUGU_API int nugu_pcm_get_data(NuguPcm *pcm, char *data, size_t size)
Get all data.
NUGU_API enum nugu_media_status nugu_pcm_get_status(NuguPcm *pcm)
Get status of pcm.
enum nugu_audio_attribute NuguAudioAttribute
NuguAudioAttribute.
Definition: nugu_audio.h:101
audio property
Definition: nugu_audio.h:92
pcm driver operations
Definition: nugu_pcm.h:347
int(* resume)(NuguPcmDriver *driver, NuguPcm *pcm)
called when pcm is resumed
Definition: nugu_pcm.h:390
int(* start)(NuguPcmDriver *driver, NuguPcm *pcm)
Called when pcm is started.
Definition: nugu_pcm.h:365
int(* set_volume)(NuguPcmDriver *driver, NuguPcm *pcm, int volume)
called when pcm is needed to set volume
Definition: nugu_pcm.h:396
int(* get_position)(NuguPcmDriver *driver, NuguPcm *pcm)
Called when a playback position is requested.
Definition: nugu_pcm.h:402
int(* create)(NuguPcmDriver *driver, NuguPcm *pcm, NuguAudioProperty property)
Called when pcm is created.
Definition: nugu_pcm.h:352
int(* push_data)(NuguPcmDriver *driver, NuguPcm *pcm, const char *data, size_t size, int is_last)
Called when a pcm data is pushed to pcm object.
Definition: nugu_pcm.h:371
int(* pause)(NuguPcmDriver *driver, NuguPcm *pcm)
Called when pcm is paused.
Definition: nugu_pcm.h:384
void(* destroy)(NuguPcmDriver *driver, NuguPcm *pcm)
Called when pcm is destroyed.
Definition: nugu_pcm.h:359
int(* stop)(NuguPcmDriver *driver, NuguPcm *pcm)
Called when pcm is stopped.
Definition: nugu_pcm.h:378