17 #ifndef __NUGU_PLAYER_H__
18 #define __NUGU_PLAYER_H__
struct _nugu_player_driver NuguPlayerDriver
player driver object
Definition: nugu_player.h:42
NUGU_API int nugu_player_driver_remove(NuguPlayerDriver *driver)
Remove the driver from driver list.
NUGU_API int nugu_player_driver_free(NuguPlayerDriver *driver)
Destroy the player driver object.
NUGU_API NuguPlayerDriver * nugu_player_driver_get_default(void)
Get the default player driver.
NUGU_API NuguPlayerDriver * nugu_player_driver_find(const char *name)
Find a driver by name in the driver list.
NUGU_API int nugu_player_driver_register(NuguPlayerDriver *driver)
Register the driver to driver list.
NUGU_API int nugu_player_driver_set_default(NuguPlayerDriver *driver)
Set the default player driver.
NUGU_API NuguPlayerDriver * nugu_player_driver_new(const char *name, struct nugu_player_driver_ops *ops)
Create new player driver object.
NUGU_API NuguPlayer * nugu_player_find(const char *name)
Find a player object by name in the managed list.
NUGU_API int nugu_player_start(NuguPlayer *player)
Start the player.
NUGU_API int nugu_player_seek(NuguPlayer *player, int sec)
Seek the player.
NUGU_API void nugu_player_emit_status(NuguPlayer *player, enum nugu_media_status status)
Emit status to registered callback.
NUGU_API int nugu_player_get_position(NuguPlayer *player)
Get current playback position of player.
NUGU_API const char * nugu_player_get_audio_attribute_str(NuguPlayer *player)
Get audio attribute.
NUGU_API void nugu_player_set_event_callback(NuguPlayer *player, NuguMediaEventCallback cb, void *userdata)
Set player event callback.
NUGU_API int nugu_player_set_driver_data(NuguPlayer *player, void *data)
Set custom data for driver.
NUGU_API int nugu_player_remove(NuguPlayer *player)
Remove player object from managed list.
NUGU_API int nugu_player_set_position(NuguPlayer *player, int position)
Set current playback position of player.
NUGU_API NuguPlayer * nugu_player_new(const char *name, NuguPlayerDriver *driver)
Create new player object.
NUGU_API int nugu_player_resume(NuguPlayer *player)
Resume the player.
NUGU_API int nugu_player_stop(NuguPlayer *player)
Stop the player.
NUGU_API int nugu_player_set_source(NuguPlayer *player, const char *url)
Set source url.
struct _nugu_player NuguPlayer
player object
Definition: nugu_player.h:36
NUGU_API void nugu_player_emit_event(NuguPlayer *player, enum nugu_media_event event)
Emit event to registered callback.
NUGU_API int nugu_player_set_volume(NuguPlayer *player, int vol)
Set volume of player.
NUGU_API void * nugu_player_get_driver_data(NuguPlayer *player)
Get custom data for driver.
NUGU_API int nugu_player_pause(NuguPlayer *player)
Pause the player.
NUGU_API int nugu_player_add(NuguPlayer *player)
Add player object to managed list.
NUGU_API int nugu_player_get_volume(NuguPlayer *player)
Get volume of player.
NUGU_API int nugu_player_get_audio_attribute(NuguPlayer *player)
Get audio attribute.
NUGU_API void nugu_player_free(NuguPlayer *player)
Destroy the player object.
NUGU_API enum nugu_media_status nugu_player_get_status(NuguPlayer *player)
Get status of player.
NUGU_API int nugu_player_get_duration(NuguPlayer *player)
Get duration information of player.
NUGU_API void nugu_player_set_status_callback(NuguPlayer *player, NuguMediaStatusCallback cb, void *userdata)
Set player status callback.
NUGU_API int nugu_player_set_audio_attribute(NuguPlayer *player, NuguAudioAttribute attr)
Set audio attribute.
enum nugu_audio_attribute NuguAudioAttribute
NuguAudioAttribute.
Definition: nugu_audio.h:101
player driver operations
Definition: nugu_player.h:321
int(* get_position)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when a playback position is requested.
Definition: nugu_player.h:388
int(* set_volume)(NuguPlayerDriver *driver, NuguPlayer *player, int vol)
Called when volume is changed.
Definition: nugu_player.h:375
void(* destroy)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when player is destroyed.
Definition: nugu_player.h:332
int(* set_source)(NuguPlayerDriver *driver, NuguPlayer *player, const char *url)
Called when set the player source.
Definition: nugu_player.h:338
int(* stop)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when player is stopped.
Definition: nugu_player.h:351
int(* seek)(NuguPlayerDriver *driver, NuguPlayer *player, int sec)
Called when playback position is changed by seek.
Definition: nugu_player.h:369
int(* resume)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when player is resumed.
Definition: nugu_player.h:363
int(* pause)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when player is paused.
Definition: nugu_player.h:357
int(* create)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when player is created.
Definition: nugu_player.h:326
int(* start)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when player is started.
Definition: nugu_player.h:345
int(* get_duration)(NuguPlayerDriver *driver, NuguPlayer *player)
Called when a playback duration is requested.
Definition: nugu_player.h:382