NUGU SDK Linux  1.7.6
Media player

Media player functions. More...

+ Collaboration diagram for Media player:

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 NuguPlayernugu_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 NuguPlayernugu_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...
 

Detailed Description

Media player functions.

Manage the functions for media content playback.

Function Documentation

◆ nugu_player_new()

NUGU_API NuguPlayer* nugu_player_new ( const char *  name,
NuguPlayerDriver driver 
)

Create new player object.

Parameters
[in]namename of player
[in]driverplayer driver
Returns
player object
See also
nugu_player_free()

◆ nugu_player_free()

NUGU_API void nugu_player_free ( NuguPlayer player)

Destroy the player object.

Parameters
[in]playerplayer object
See also
nugu_player_new()

◆ nugu_player_add()

NUGU_API int nugu_player_add ( NuguPlayer player)

Add player object to managed list.

Parameters
[in]playerplayer object
Returns
result
Return values
0success
-1failure
See also
nugu_player_find()
nugu_player_remove()

◆ nugu_player_remove()

NUGU_API int nugu_player_remove ( NuguPlayer player)

Remove player object from managed list.

Parameters
[in]playerplayer object
Returns
result
Return values
0success
-1failure
See also
nugu_player_find()
nugu_player_add()

◆ nugu_player_find()

NUGU_API NuguPlayer* nugu_player_find ( const char *  name)

Find a player object by name in the managed list.

Parameters
[in]namename of player object
Returns
player object
See also
nugu_player_add()
nugu_player_remove()

◆ nugu_player_set_audio_attribute()

NUGU_API int nugu_player_set_audio_attribute ( NuguPlayer player,
NuguAudioAttribute  attr 
)

Set audio attribute.

Parameters
[in]playerplayer object
[in]attraudio attribute
Returns
result
Return values
0success
-1failure

◆ nugu_player_get_audio_attribute()

NUGU_API int nugu_player_get_audio_attribute ( NuguPlayer player)

Get audio attribute.

Parameters
[in]playerplayer object
Returns
audio attribute
Return values
NULL-1

◆ nugu_player_get_audio_attribute_str()

NUGU_API const char* nugu_player_get_audio_attribute_str ( NuguPlayer player)

Get audio attribute.

Parameters
[in]playerplayer object
Returns
audio attribute string
Return values
NULLfailure

◆ nugu_player_set_source()

NUGU_API int nugu_player_set_source ( NuguPlayer player,
const char *  url 
)

Set source url.

Parameters
[in]playerplayer object
[in]urlsource url
Returns
result
Return values
0success
-1failure

◆ nugu_player_start()

NUGU_API int nugu_player_start ( NuguPlayer player)

Start the player.

Parameters
[in]playerplayer object
Returns
result
Return values
0success
-1failure
See also
nugu_player_stop()
nugu_player_pause()

◆ nugu_player_stop()

NUGU_API int nugu_player_stop ( NuguPlayer player)

Stop the player.

Parameters
[in]playerplayer object
Returns
result
Return values
0success
-1failure
See also
nugu_player_start()

◆ nugu_player_pause()

NUGU_API int nugu_player_pause ( NuguPlayer player)

Pause the player.

Parameters
[in]playerplayer object
Returns
result
Return values
0success
-1failure
See also
nugu_player_resume()

◆ nugu_player_resume()

NUGU_API int nugu_player_resume ( NuguPlayer player)

Resume the player.

Parameters
[in]playerplayer object
Returns
result
Return values
0success
-1failure
See also
nugu_player_pause()
nugu_player_stop()

◆ nugu_player_seek()

NUGU_API int nugu_player_seek ( NuguPlayer player,
int  sec 
)

Seek the player.

Parameters
[in]playerplayer object
[in]secposition in seconds
Returns
result
Return values
0success
-1failure

◆ nugu_player_set_volume()

NUGU_API int nugu_player_set_volume ( NuguPlayer player,
int  vol 
)

Set volume of player.

Parameters
[in]playerplayer object
[in]volvolume value
Returns
result
Return values
0success
-1failure
See also
nugu_player_get_volume()

◆ nugu_player_get_volume()

NUGU_API int nugu_player_get_volume ( NuguPlayer player)

Get volume of player.

Parameters
[in]playerplayer object
Returns
result
Return values
>0success (volume)
-1failure
See also
nugu_player_set_volume()

◆ nugu_player_get_duration()

NUGU_API int nugu_player_get_duration ( NuguPlayer player)

Get duration information of player.

Parameters
[in]playerplayer object
Returns
result
Return values
>0success (duration)
-1failure

◆ nugu_player_set_position()

NUGU_API int nugu_player_set_position ( NuguPlayer player,
int  position 
)

Set current playback position of player.

Parameters
[in]playernugu player object
[in]positionplayer position
Returns
result
Return values
0success
-1failure

◆ nugu_player_get_position()

NUGU_API int nugu_player_get_position ( NuguPlayer player)

Get current playback position of player.

Parameters
[in]playerplayer object
Returns
result
Return values
>0success (position)
-1failure

◆ nugu_player_get_status()

NUGU_API enum nugu_media_status nugu_player_get_status ( NuguPlayer player)

Get status of player.

Parameters
[in]playerplayer object
Returns
status

◆ nugu_player_set_status_callback()

NUGU_API void nugu_player_set_status_callback ( NuguPlayer player,
NuguMediaStatusCallback  cb,
void *  userdata 
)

Set player status callback.

Parameters
[in]playerplayer object
[in]cbcallback function
[in]userdatadata to pass to the user callback

◆ nugu_player_emit_status()

NUGU_API void nugu_player_emit_status ( NuguPlayer player,
enum nugu_media_status  status 
)

Emit status to registered callback.

Parameters
[in]playerplayer object
[in]statusplayer status

◆ nugu_player_set_event_callback()

NUGU_API void nugu_player_set_event_callback ( NuguPlayer player,
NuguMediaEventCallback  cb,
void *  userdata 
)

Set player event callback.

Parameters
[in]playerplayer object
[in]cbcallback function
[in]userdatadata to pass to the user callback

◆ nugu_player_emit_event()

NUGU_API void nugu_player_emit_event ( NuguPlayer player,
enum nugu_media_event  event 
)

Emit event to registered callback.

Parameters
[in]playerplayer object
[in]eventplayer event

◆ nugu_player_set_driver_data()

NUGU_API int nugu_player_set_driver_data ( NuguPlayer player,
void *  data 
)

Set custom data for driver.

Parameters
[in]playerplayer object
[in]datacustom data managed by driver
Returns
result
Return values
0success
-1failure
See also
nugu_player_get_driver_data()

◆ nugu_player_get_driver_data()

NUGU_API void* nugu_player_get_driver_data ( NuguPlayer player)

Get custom data for driver.

Parameters
[in]playerplayer object
Returns
data
See also
nugu_player_set_driver_data()