gmerlin
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.
 
#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.
 

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

Detailed Description

Most of these are called in an aynchronous manner.

Macro Definition Documentation

◆ BG_PLAY_FLAG_IGNORE_IF_PLAYING

#define BG_PLAY_FLAG_IGNORE_IF_PLAYING   (1<<0)

Ignore play command, if the player is already playing.

◆ BG_PLAY_FLAG_IGNORE_IF_STOPPED

#define BG_PLAY_FLAG_IGNORE_IF_STOPPED   (1<<1)

Ignore play command, if the player is stopped.

◆ BG_PLAY_FLAG_INIT_THEN_PAUSE

#define BG_PLAY_FLAG_INIT_THEN_PAUSE   (1<<2)

Initialize but go to pause status after.

◆ BG_PLAY_FLAG_RESUME

#define BG_PLAY_FLAG_RESUME   (1<<3)

If the player is paused, resume currently played track.

Function Documentation

◆ bg_player_play()

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

◆ bg_player_seek()

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

◆ bg_player_seek_rel()

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)

◆ bg_player_set_volume()

void bg_player_set_volume ( bg_player_t * player,
float volume )

Set the volume.

Parameters
playerA player
volumeVolume (in dB, max is 0.0)

◆ bg_player_set_volume_rel()

void bg_player_set_volume_rel ( bg_player_t * player,
float volume )

Set the volume relative.

Parameters
playerA player
volumeVolume offset (in dB)

◆ bg_player_stop()

void bg_player_stop ( bg_player_t * player)

Stop playback.

Parameters
playerA player

◆ bg_player_pause()

void bg_player_pause ( bg_player_t * player)

Toggle pause.

Parameters
playerA player

◆ bg_player_error()

void bg_player_error ( bg_player_t * player)

Trigger an error.

Parameters
playerA player

◆ bg_player_set_oa_plugin()

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

◆ bg_player_set_ov_plugin()

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

◆ bg_player_set_audio_stream()

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)

◆ bg_player_set_video_stream()

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)

◆ bg_player_set_subtitle_stream()

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)

◆ bg_player_change()

void bg_player_change ( bg_player_t * player,
int flags )

Shut down playback.

Parameters
playerA player
flagsA combination of BG_PLAY_FLAG_* flags

◆ bg_player_toggle_mute()

void bg_player_toggle_mute ( bg_player_t * player)

Toggle mute.

Parameters
playerA player

◆ bg_player_set_chapter()

void bg_player_set_chapter ( bg_player_t * player,
int chapter )

Goto a specified chapter.

Parameters
playerA player
chapterChapter index (starting with 0)

◆ bg_player_next_chapter()

void bg_player_next_chapter ( bg_player_t * player)

Goto the next chapter.

Parameters
playerA player

◆ bg_player_prev_chapter()

void bg_player_prev_chapter ( bg_player_t * player)

Goto the previous chapter.

Parameters
playerA player

◆ bg_player_interrupt()

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.

◆ bg_player_interrupt_resume()

void bg_player_interrupt_resume ( bg_player_t * player)

Resume an interrupted playback.

Parameters
playerA player