libmp3splt  0.9.2
Lossless library for splitting audio formats like mp3, ogg vorbis and FLAC.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
splt_plugin_func Struct Reference

#include <mp3splt.h>

Data Fields

void(* splt_pl_init )(splt_state *state, splt_code *error)
 
void(* splt_pl_end )(splt_state *state, splt_code *error)
 
int(* splt_pl_check_plugin_is_for_file )(splt_state *state, splt_code *error)
 
void(* splt_pl_set_plugin_info )(splt_plugin_info *information, splt_code *error)
 
double(* splt_pl_split )(splt_state *state, const char *final_fname, double begin_point, double end_point, splt_code *error, int save_end_point)
 
void(* splt_pl_set_original_tags )(splt_state *state, splt_code *error)
 
void(* splt_pl_clear_original_tags )(splt_original_tags *original_tags)
 
int(* splt_pl_scan_silence )(splt_state *state, splt_code *error)
 
int(* splt_pl_scan_trim_silence )(splt_state *state, splt_code *error)
 
void(* splt_pl_search_syncerrors )(splt_state *state, splt_code *error)
 
int(* splt_pl_offset_split )(splt_state *state, const char *output_fname, off_t begin, off_t end)
 
void(* splt_pl_dewrap )(splt_state *state, int listonly, const char *dir, splt_code *error)
 
void(* splt_pl_import_internal_sheets )(splt_state *state, splt_code *error)
 

Detailed Description

Libmp3splt plugin API.

Warning
The plugin API might still change.

In order to create a plugin for libmp3splt, the following functions can be implemented.
Mandatory functions are splt_pl_init, splt_pl_end, splt_pl_check_plugin_is_for_file, splt_pl_set_plugin_info and splt_pl_split.

Examples can be found for the mp3, ogg vorbis FLAC implementations.

Definition at line 2174 of file mp3splt.h.

Field Documentation

void(* splt_plugin_func::splt_pl_init)(splt_state *state, splt_code *error)

Initialise the plugin.

Mandatory.

Create the plugin data, open the input file and read headers.
Use the state->codec pointer to store the plugin data.

Parameters
[in]stateMain state.
[out]errorFill in possible error.

Definition at line 2184 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_end)(splt_state *state, splt_code *error)

Unitialise the plugin.

Mandatory.

Close the input file, free the plugin data.

Parameters
[in]stateMain state.
[out]errorFill in possible error.

Definition at line 2193 of file mp3splt.h.

int(* splt_plugin_func::splt_pl_check_plugin_is_for_file)(splt_state *state, splt_code *error)

Checks if the plugin matches the input file.

Mandatory.

If stdin is supported, don't forget to check if the input filename is stdin.

Parameters
[in]stateMain state.
[out]errorFill in possible error.
Returns
SPLT_TRUE if the plugin matches the input file.

Definition at line 2203 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_set_plugin_info)(splt_plugin_info *information, splt_code *error)

Set plugin information into the information structure.

Mandatory.

Information like the plugin version, plugin name and file extension must be filled.

Parameters
[in]splt_plugin_infoPlugin information to be filled. Parameter is already allocated.
[out]errorFill in possible error.

Definition at line 2212 of file mp3splt.h.

double(* splt_plugin_func::splt_pl_split)(splt_state *state, const char *final_fname, double begin_point, double end_point, splt_code *error, int save_end_point)

Main split function.

Mandatory.

Parameters
[in]stateMain state.
[in]final_fnameOutput filename to be written for this split.
[in]begin_pointBegin point where the split starts as seconds.hundreths.
[in]end_pointEnd point where the split ends as seconds.hundreths.
[out]errorFill in possible error.
[in]save_end_pointIs equal to SPLT_TRUE if optimisation can be done for saving the end point seek for the next call to this function. This avoids looking for the next begin point seek since it will be equal to the previous saved end point seek.
Returns
The real end point split; in most cases, it is equal to the end_point.

Definition at line 2226 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_set_original_tags)(splt_state *state, splt_code *error)

Set the original tags into the state from the input file.

splt_tu_set_original_tags_field has to be used to set the original tags.
You can also save all the original tags in the state using splt_tu_set_original_tags_data, in case you want to write them all in the output file, for the tags that are not supported by the library's structure.

Parameters
[in]stateMain state.
[out]errorFill in possible error.

Definition at line 2239 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_clear_original_tags)(splt_original_tags *original_tags)

Frees the memory of the tags previously set in the splt_pl_set_original_tags function.

Free the original_tags->all_original_tags data previously set with splt_tu_set_original_tags_data.

Parameters
[in]original_tagsOriginal tags structure containing the original tags data to be freed.

Definition at line 2248 of file mp3splt.h.

int(* splt_plugin_func::splt_pl_scan_silence)(splt_state *state, splt_code *error)

Scan the input file for silence.

The input file has to be scanned for silence and for each time/audio level, a generic silence processor will be called.
The processor handles the mp3splt silence detection logic.

Parameters
[in]stateMain state.
[out]errorFill in possible error.
Returns
The number of silence spots found.

Definition at line 2260 of file mp3splt.h.

int(* splt_plugin_func::splt_pl_scan_trim_silence)(splt_state *state, splt_code *error)

Scan the input file for trimming using silence detection.

The implementation of this function is straight forward after implementing splt_pl_scan_silence, since the silence detection is the same.
Only the generic silence processor changes.

Parameters
[in]stateMain state.
[out]errorFill in possible error.
Returns
The number of silence spots found.

Definition at line 2272 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_search_syncerrors)(splt_state *state, splt_code *error)

Search for synchronisation errors.

Currently only mp3 supports synchronisation errors split.

Parameters
[in]stateMain state.
[out]errorFill in possible error.

Definition at line 2281 of file mp3splt.h.

int(* splt_plugin_func::splt_pl_offset_split)(splt_state *state, const char *output_fname, off_t begin, off_t end)

Split the input filename by offsets.

Currently only used when splitting mp3 files using the synchronisation error mode.

Parameters
[in]stateMain state.
[in]output_fnameOutput filename.
[in]beginBegin offset of the portion to be split.
[in]endEnd offset of the portion to be split.
Returns
Possible error.

Definition at line 2293 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_dewrap)(splt_state *state, int listonly, const char *dir, splt_code *error)

Unwrap the input file into the directory dir.

Currently only mp3 supports wrapped files.

Parameters
[in]stateMain state.
[in]listonlyIf equal to SPLT_TRUE, then the wrapped files found are stored in the state without actually splitting.
[in]dirOutput directory where the wrapped files have to be stored.
[out]errorFill in possible error.

Definition at line 2305 of file mp3splt.h.

void(* splt_plugin_func::splt_pl_import_internal_sheets)(splt_state *state, splt_code *error)

Import splitpoints from internal sheets.

Parameters
[in]stateMain state.
[out]errorFill in possible error.

Definition at line 2312 of file mp3splt.h.


The documentation for this struct was generated from the following file: