libgroove  5.0.0
encoder.h File Reference

Go to the source code of this file.

Data Structures

struct  GrooveEncoder
 attach a GrooveEncoder to a playlist to keep a buffer of encoded audio full. More...
 

Functions

struct GrooveEncodergroove_encoder_create (void)
 
void groove_encoder_destroy (struct GrooveEncoder *encoder)
 detach before destroying More...
 
int groove_encoder_attach (struct GrooveEncoder *encoder, struct GroovePlaylist *playlist)
 once you attach, you must detach before destroying the playlist at playlist begin, format headers are generated. More...
 
int groove_encoder_detach (struct GrooveEncoder *encoder)
 
int groove_encoder_buffer_get (struct GrooveEncoder *encoder, struct GrooveBuffer **buffer, int block)
 returns < 0 on error, GROOVE_BUFFER_NO on aborted (block=1) or no buffer ready (block=0), GROOVE_BUFFER_YES on buffer returned, and GROOVE_BUFFER_END on end of playlist. More...
 
int groove_encoder_buffer_peek (struct GrooveEncoder *encoder, int block)
 returns < 0 on error, 0 on no buffer ready, 1 on buffer ready if block is 1, block until buffer is ready More...
 
struct GrooveTag * groove_encoder_metadata_get (struct GrooveEncoder *encoder, const char *key, const struct GrooveTag *prev, int flags)
 see docs for groove_file_metadata_get More...
 
int groove_encoder_metadata_set (struct GrooveEncoder *encoder, const char *key, const char *value, int flags)
 see docs for groove_file_metadata_set More...
 
void groove_encoder_position (struct GrooveEncoder *encoder, struct GroovePlaylistItem **item, double *seconds)
 get the position of the encode head both the current playlist item and the position in seconds in the playlist item are given. More...
 
int groove_encoder_set_gain (struct GrooveEncoder *encoder, double gain)
 See the gain property of GrooveSink. More...
 

Function Documentation

int groove_encoder_attach ( struct GrooveEncoder encoder,
struct GroovePlaylist playlist 
)

once you attach, you must detach before destroying the playlist at playlist begin, format headers are generated.

when end of playlist is reached, format trailers are generated.

Examples:
transcode.c.
int groove_encoder_buffer_get ( struct GrooveEncoder encoder,
struct GrooveBuffer **  buffer,
int  block 
)

returns < 0 on error, GROOVE_BUFFER_NO on aborted (block=1) or no buffer ready (block=0), GROOVE_BUFFER_YES on buffer returned, and GROOVE_BUFFER_END on end of playlist.

buffer is always set to either a valid GrooveBuffer or NULL.

Examples:
transcode.c.
int groove_encoder_buffer_peek ( struct GrooveEncoder encoder,
int  block 
)

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

struct GrooveEncoder* groove_encoder_create ( void  )
Examples:
transcode.c.
void groove_encoder_destroy ( struct GrooveEncoder encoder)

detach before destroying

Examples:
transcode.c.
int groove_encoder_detach ( struct GrooveEncoder encoder)
Examples:
transcode.c.
struct GrooveTag* groove_encoder_metadata_get ( struct GrooveEncoder encoder,
const char *  key,
const struct GrooveTag *  prev,
int  flags 
)

see docs for groove_file_metadata_get

int groove_encoder_metadata_set ( struct GrooveEncoder encoder,
const char *  key,
const char *  value,
int  flags 
)

see docs for groove_file_metadata_set

Examples:
transcode.c.
void groove_encoder_position ( struct GrooveEncoder encoder,
struct GroovePlaylistItem **  item,
double *  seconds 
)

get the position of the encode 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

int groove_encoder_set_gain ( struct GrooveEncoder encoder,
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