NUGU SDK Linux
1.7.6
|
Media player functions. More...
Typedefs | |
typedef struct _nugu_player | NuguPlayer |
player object | |
Functions | |
NUGU_API int | nugu_player_add (NuguPlayer *player) |
Add player object to managed list. More... | |
NUGU_API void | nugu_player_emit_event (NuguPlayer *player, enum nugu_media_event event) |
Emit event to registered callback. More... | |
NUGU_API void | nugu_player_emit_status (NuguPlayer *player, enum nugu_media_status status) |
Emit status to registered callback. More... | |
NUGU_API NuguPlayer * | nugu_player_find (const char *name) |
Find a player object by name in the managed list. More... | |
NUGU_API void | nugu_player_free (NuguPlayer *player) |
Destroy the player object. More... | |
NUGU_API int | nugu_player_get_audio_attribute (NuguPlayer *player) |
Get audio attribute. More... | |
NUGU_API const char * | nugu_player_get_audio_attribute_str (NuguPlayer *player) |
Get audio attribute. More... | |
NUGU_API void * | nugu_player_get_driver_data (NuguPlayer *player) |
Get custom data for driver. More... | |
NUGU_API int | nugu_player_get_duration (NuguPlayer *player) |
Get duration information of player. More... | |
NUGU_API int | nugu_player_get_position (NuguPlayer *player) |
Get current playback position of player. More... | |
NUGU_API enum nugu_media_status | nugu_player_get_status (NuguPlayer *player) |
Get status of player. More... | |
NUGU_API int | nugu_player_get_volume (NuguPlayer *player) |
Get volume of player. More... | |
NUGU_API NuguPlayer * | nugu_player_new (const char *name, NuguPlayerDriver *driver) |
Create new player object. More... | |
NUGU_API int | nugu_player_pause (NuguPlayer *player) |
Pause the player. More... | |
NUGU_API int | nugu_player_remove (NuguPlayer *player) |
Remove player object from managed list. More... | |
NUGU_API int | nugu_player_resume (NuguPlayer *player) |
Resume the player. More... | |
NUGU_API int | nugu_player_seek (NuguPlayer *player, int sec) |
Seek the player. More... | |
NUGU_API int | nugu_player_set_audio_attribute (NuguPlayer *player, NuguAudioAttribute attr) |
Set audio attribute. More... | |
NUGU_API int | nugu_player_set_driver_data (NuguPlayer *player, void *data) |
Set custom data for driver. More... | |
NUGU_API void | nugu_player_set_event_callback (NuguPlayer *player, NuguMediaEventCallback cb, void *userdata) |
Set player event callback. More... | |
NUGU_API int | nugu_player_set_position (NuguPlayer *player, int position) |
Set current playback position of player. More... | |
NUGU_API int | nugu_player_set_source (NuguPlayer *player, const char *url) |
Set source url. More... | |
NUGU_API void | nugu_player_set_status_callback (NuguPlayer *player, NuguMediaStatusCallback cb, void *userdata) |
Set player status callback. More... | |
NUGU_API int | nugu_player_set_volume (NuguPlayer *player, int vol) |
Set volume of player. More... | |
NUGU_API int | nugu_player_start (NuguPlayer *player) |
Start the player. More... | |
NUGU_API int | nugu_player_stop (NuguPlayer *player) |
Stop the player. More... | |
Media player functions.
Manage the functions for media content playback.
NUGU_API NuguPlayer* nugu_player_new | ( | const char * | name, |
NuguPlayerDriver * | driver | ||
) |
Create new player object.
[in] | name | name of player |
[in] | driver | player driver |
NUGU_API void nugu_player_free | ( | NuguPlayer * | player | ) |
NUGU_API int nugu_player_add | ( | NuguPlayer * | player | ) |
Add player object to managed list.
[in] | player | player object |
0 | success |
-1 | failure |
NUGU_API int nugu_player_remove | ( | NuguPlayer * | player | ) |
Remove player object from managed list.
[in] | player | player object |
0 | success |
-1 | failure |
NUGU_API NuguPlayer* nugu_player_find | ( | const char * | name | ) |
Find a player object by name in the managed list.
[in] | name | name of player object |
NUGU_API int nugu_player_set_audio_attribute | ( | NuguPlayer * | player, |
NuguAudioAttribute | attr | ||
) |
Set audio attribute.
[in] | player | player object |
[in] | attr | audio attribute |
0 | success |
-1 | failure |
NUGU_API int nugu_player_get_audio_attribute | ( | NuguPlayer * | player | ) |
Get audio attribute.
[in] | player | player object |
NULL | -1 |
NUGU_API const char* nugu_player_get_audio_attribute_str | ( | NuguPlayer * | player | ) |
Get audio attribute.
[in] | player | player object |
NULL | failure |
NUGU_API int nugu_player_set_source | ( | NuguPlayer * | player, |
const char * | url | ||
) |
Set source url.
[in] | player | player object |
[in] | url | source url |
0 | success |
-1 | failure |
NUGU_API int nugu_player_start | ( | NuguPlayer * | player | ) |
Start the player.
[in] | player | player object |
0 | success |
-1 | failure |
NUGU_API int nugu_player_stop | ( | NuguPlayer * | player | ) |
Stop the player.
[in] | player | player object |
0 | success |
-1 | failure |
NUGU_API int nugu_player_pause | ( | NuguPlayer * | player | ) |
Pause the player.
[in] | player | player object |
0 | success |
-1 | failure |
NUGU_API int nugu_player_resume | ( | NuguPlayer * | player | ) |
Resume the player.
[in] | player | player object |
0 | success |
-1 | failure |
NUGU_API int nugu_player_seek | ( | NuguPlayer * | player, |
int | sec | ||
) |
Seek the player.
[in] | player | player object |
[in] | sec | position in seconds |
0 | success |
-1 | failure |
NUGU_API int nugu_player_set_volume | ( | NuguPlayer * | player, |
int | vol | ||
) |
Set volume of player.
[in] | player | player object |
[in] | vol | volume value |
0 | success |
-1 | failure |
NUGU_API int nugu_player_get_volume | ( | NuguPlayer * | player | ) |
Get volume of player.
[in] | player | player object |
>0 | success (volume) |
-1 | failure |
NUGU_API int nugu_player_get_duration | ( | NuguPlayer * | player | ) |
Get duration information of player.
[in] | player | player object |
>0 | success (duration) |
-1 | failure |
NUGU_API int nugu_player_set_position | ( | NuguPlayer * | player, |
int | position | ||
) |
Set current playback position of player.
[in] | player | nugu player object |
[in] | position | player position |
0 | success |
-1 | failure |
NUGU_API int nugu_player_get_position | ( | NuguPlayer * | player | ) |
Get current playback position of player.
[in] | player | player object |
>0 | success (position) |
-1 | failure |
NUGU_API enum nugu_media_status nugu_player_get_status | ( | NuguPlayer * | player | ) |
Get status of player.
[in] | player | player object |
NUGU_API void nugu_player_set_status_callback | ( | NuguPlayer * | player, |
NuguMediaStatusCallback | cb, | ||
void * | userdata | ||
) |
Set player status callback.
[in] | player | player object |
[in] | cb | callback function |
[in] | userdata | data to pass to the user callback |
NUGU_API void nugu_player_emit_status | ( | NuguPlayer * | player, |
enum nugu_media_status | status | ||
) |
Emit status to registered callback.
[in] | player | player object |
[in] | status | player status |
NUGU_API void nugu_player_set_event_callback | ( | NuguPlayer * | player, |
NuguMediaEventCallback | cb, | ||
void * | userdata | ||
) |
Set player event callback.
[in] | player | player object |
[in] | cb | callback function |
[in] | userdata | data to pass to the user callback |
NUGU_API void nugu_player_emit_event | ( | NuguPlayer * | player, |
enum nugu_media_event | event | ||
) |
Emit event to registered callback.
[in] | player | player object |
[in] | event | player event |
NUGU_API int nugu_player_set_driver_data | ( | NuguPlayer * | player, |
void * | data | ||
) |
Set custom data for driver.
[in] | player | player object |
[in] | data | custom data managed by driver |
0 | success |
-1 | failure |
NUGU_API void* nugu_player_get_driver_data | ( | NuguPlayer * | player | ) |
Get custom data for driver.
[in] | player | player object |