libgroove  5.0.0
player.h File Reference

Go to the source code of this file.

Data Structures

union  GroovePlayerEvent
 
struct  GroovePlayer
 

Enumerations

enum  GroovePlayerEventType {
  GROOVE_EVENT_NOWPLAYING, GROOVE_EVENT_BUFFERUNDERRUN, GROOVE_EVENT_DEVICEREOPENED, GROOVE_EVENT_DEVICE_REOPEN_ERROR,
  GROOVE_EVENT_WAKEUP
}
 use this to make a playlist utilize your speakers More...
 

Functions

struct GroovePlayergroove_player_create (void)
 
void groove_player_destroy (struct GroovePlayer *player)
 
int groove_player_attach (struct GroovePlayer *player, struct GroovePlaylist *playlist)
 Attaches the player to the playlist instance and opens the device to begin playback. More...
 
int groove_player_detach (struct GroovePlayer *player)
 returns 0 on success, < 0 on error More...
 
void groove_player_position (struct GroovePlayer *player, struct GroovePlaylistItem **item, double *seconds)
 get the position of the play head both the current playlist item and the position in seconds in the playlist item are given. More...
 
int groove_player_event_get (struct GroovePlayer *player, union GroovePlayerEvent *event, int block)
 returns < 0 on error, 0 on no event ready, 1 on got event More...
 
int groove_player_event_peek (struct GroovePlayer *player, int block)
 returns < 0 on error, 0 on no event ready, 1 on event ready if block is 1, block until event is ready More...
 
void groove_player_event_wakeup (struct GroovePlayer *player)
 wakes up a blocking call to groove_player_event_get or groove_player_event_peek with a GROOVE_EVENT_WAKEUP. More...
 
int groove_player_set_gain (struct GroovePlayer *player, double gain)
 See the gain property of GrooveSink. More...
 
struct GrooveAudioFormat groove_player_get_device_audio_format (struct GroovePlayer *player)
 When you set the use_exact_audio_format field to 1, the audio device is closed and re-opened as necessary. More...
 

Enumeration Type Documentation

use this to make a playlist utilize your speakers

Enumerator
GROOVE_EVENT_NOWPLAYING 

when the currently playing track changes.

GROOVE_EVENT_BUFFERUNDERRUN 

when something tries to read from an empty buffer

GROOVE_EVENT_DEVICEREOPENED 

when the audio device is re-opened due to audio format changing

GROOVE_EVENT_DEVICE_REOPEN_ERROR 

when the audio device gets an error re-opening

GROOVE_EVENT_WAKEUP 

user requested wakeup

Function Documentation

int groove_player_attach ( struct GroovePlayer player,
struct GroovePlaylist playlist 
)

Attaches the player to the playlist instance and opens the device to begin playback.

Internally this creates a GrooveSink and sends the samples to the device. you must detach a player before destroying it or the playlist it is attached to returns 0 on success, < 0 on error

Examples:
playlist.c.
struct GroovePlayer* groove_player_create ( void  )
Examples:
playlist.c.
void groove_player_destroy ( struct GroovePlayer player)
Examples:
playlist.c.
int groove_player_detach ( struct GroovePlayer player)

returns 0 on success, < 0 on error

Examples:
playlist.c.
int groove_player_event_get ( struct GroovePlayer player,
union GroovePlayerEvent event,
int  block 
)

returns < 0 on error, 0 on no event ready, 1 on got event

Examples:
playlist.c.
int groove_player_event_peek ( struct GroovePlayer player,
int  block 
)

returns < 0 on error, 0 on no event ready, 1 on event ready if block is 1, block until event is ready

void groove_player_event_wakeup ( struct GroovePlayer player)

wakes up a blocking call to groove_player_event_get or groove_player_event_peek with a GROOVE_EVENT_WAKEUP.

struct GrooveAudioFormat groove_player_get_device_audio_format ( struct GroovePlayer player)

When you set the use_exact_audio_format field to 1, the audio device is closed and re-opened as necessary.

When this happens, a GROOVE_EVENT_DEVICEREOPENED event is emitted, and you can use this function to discover the audio format of the device.

void groove_player_position ( struct GroovePlayer player,
struct GroovePlaylistItem **  item,
double *  seconds 
)

get the position of the play head both the current playlist item and the position in seconds in the playlist item are given.

item will be set to NULL if the playlist is empty you may pass NULL for item or seconds

Examples:
playlist.c.
int groove_player_set_gain ( struct GroovePlayer player,
double  gain 
)

See the gain property of GrooveSink.

It is recommended that you leave this at 1.0 and instead adjust the gain of the playlist. returns 0 on success, < 0 on error