gmerlin
Macros | Functions
Commands, which can be sent to the player

Macros

#define BG_PLAY_FLAG_IGNORE_IF_PLAYING   (1<<0)
 Ignore play command, if the player is already playing. More...
 
#define BG_PLAY_FLAG_IGNORE_IF_STOPPED   (1<<1)
 Ignore play command, if the player is stopped. More...
 
#define BG_PLAY_FLAG_INIT_THEN_PAUSE   (1<<2)
 Initialize but go to pause status after. More...
 
#define BG_PLAY_FLAG_RESUME   (1<<3)
 If the player is paused, resume currently played track. More...
 

Functions

void bg_player_play (bg_player_t *player, bg_plugin_handle_t *handle, int track, int flags, const char *track_name)
 Play a track. More...
 
void bg_player_seek (bg_player_t *player, gavl_time_t time, int scale)
 Seek to a specific time. More...
 
void bg_player_seek_rel (bg_player_t *player, gavl_time_t time)
 Seek relative by a specific time. More...
 
void bg_player_set_volume (bg_player_t *player, float volume)
 Set the volume. More...
 
void bg_player_set_volume_rel (bg_player_t *player, float volume)
 Set the volume relative. More...
 
void bg_player_stop (bg_player_t *player)
 Stop playback. More...
 
void bg_player_pause (bg_player_t *player)
 Toggle pause. More...
 
void bg_player_error (bg_player_t *player)
 Trigger an error. More...
 
void bg_player_set_oa_plugin (bg_player_t *player, bg_plugin_handle_t *handle)
 Set audio output plugin. More...
 
void bg_player_set_ov_plugin (bg_player_t *player, bg_plugin_handle_t *handle)
 Set video output plugin. More...
 
void bg_player_set_audio_stream (bg_player_t *player, int stream)
 Set audio stream. More...
 
void bg_player_set_video_stream (bg_player_t *player, int stream)
 Set video stream. More...
 
void bg_player_set_subtitle_stream (bg_player_t *player, int stream)
 Set subtitle stream. More...
 
void bg_player_change (bg_player_t *player, int flags)
 Shut down playback. More...
 
void bg_player_toggle_mute (bg_player_t *player)
 Toggle mute. More...
 
void bg_player_set_chapter (bg_player_t *player, int chapter)
 Goto a specified chapter. More...
 
void bg_player_next_chapter (bg_player_t *player)
 Goto the next chapter. More...
 
void bg_player_prev_chapter (bg_player_t *player)
 Goto the previous chapter. More...
 
void bg_player_interrupt (bg_player_t *player)
 Interrupt playback. More...
 
void bg_player_interrupt_resume (bg_player_t *player)
 Resume an interrupted playback. More...
 

Detailed Description

Most of these are called in an aynchronous manner.

Macro Definition Documentation

#define BG_PLAY_FLAG_IGNORE_IF_PLAYING   (1<<0)

Ignore play command, if the player is already playing.

#define BG_PLAY_FLAG_IGNORE_IF_STOPPED   (1<<1)

Ignore play command, if the player is stopped.

#define BG_PLAY_FLAG_INIT_THEN_PAUSE   (1<<2)

Initialize but go to pause status after.

#define BG_PLAY_FLAG_RESUME   (1<<3)

If the player is paused, resume currently played track.

Function Documentation

void bg_player_play ( bg_player_t *  player,
bg_plugin_handle_t handle,
int  track,
int  flags,
const char *  track_name 
)

Play a track.

Parameters
playerA player
handleHandle of an open input plugin
trackTrack index to select (starting with 0)
flagsA combination of BG_PLAY_FLAG_* flags
track_nameName of the track to broadcast
void bg_player_seek ( bg_player_t *  player,
gavl_time_t  time,
int  scale 
)

Seek to a specific time.

Parameters
playerA player
timeTime to seek to
scaleTimescale by which the time is scaled
void bg_player_seek_rel ( bg_player_t *  player,
gavl_time_t  time 
)

Seek relative by a specific time.

Parameters
playerA player
timeTime offset (can be negative to seek backwards)
void bg_player_set_volume ( bg_player_t *  player,
float  volume 
)

Set the volume.

Parameters
playerA player
volumeVolume (in dB, max is 0.0)
void bg_player_set_volume_rel ( bg_player_t *  player,
float  volume 
)

Set the volume relative.

Parameters
playerA player
volumeVolume offset (in dB)
void bg_player_stop ( bg_player_t *  player)

Stop playback.

Parameters
playerA player
void bg_player_pause ( bg_player_t *  player)

Toggle pause.

Parameters
playerA player
void bg_player_error ( bg_player_t *  player)

Trigger an error.

Parameters
playerA player
void bg_player_set_oa_plugin ( bg_player_t *  player,
bg_plugin_handle_t handle 
)

Set audio output plugin.

Parameters
playerA player
handleA plugin handle
void bg_player_set_ov_plugin ( bg_player_t *  player,
bg_plugin_handle_t handle 
)

Set video output plugin.

Parameters
playerA player
handleA plugin handle
void bg_player_set_audio_stream ( bg_player_t *  player,
int  stream 
)

Set audio stream.

Parameters
playerA player
streamStream index (starts with 0, -1 means no audio playback)
void bg_player_set_video_stream ( bg_player_t *  player,
int  stream 
)

Set video stream.

Parameters
playerA player
streamStream index (starts with 0, -1 means no video playback)
void bg_player_set_subtitle_stream ( bg_player_t *  player,
int  stream 
)

Set subtitle stream.

Parameters
playerA player
streamStream index (starts with 0, -1 means no subtitle playback)
void bg_player_change ( bg_player_t *  player,
int  flags 
)

Shut down playback.

Parameters
playerA player
flagsA combination of BG_PLAY_FLAG_* flags
void bg_player_toggle_mute ( bg_player_t *  player)

Toggle mute.

Parameters
playerA player
void bg_player_set_chapter ( bg_player_t *  player,
int  chapter 
)

Goto a specified chapter.

Parameters
playerA player
chapterChapter index (starting with 0)
void bg_player_next_chapter ( bg_player_t *  player)

Goto the next chapter.

Parameters
playerA player
void bg_player_prev_chapter ( bg_player_t *  player)

Goto the previous chapter.

Parameters
playerA player
void bg_player_interrupt ( bg_player_t *  player)

Interrupt playback.

Parameters
playerA player

This function works synchonously, this means it is garantueed, that all playback threads are stopped until bg_player_interrupt_resume is called.

void bg_player_interrupt_resume ( bg_player_t *  player)

Resume an interrupted playback.

Parameters
playerA player