This group contains all functions of libmp3splt that are meant to be accessed by the user. More...
Functions | |
int | mp3splt_append_plugins_scan_dir (splt_state *state, char *dir) |
int | mp3splt_append_splitpoint (splt_state *state, long split_value, const char *name, int type) |
int | mp3splt_append_tags (splt_state *state, const char *title, const char *artist, const char *album, const char *performer, const char *year, const char *comment, int track, const char *genre) |
int | mp3splt_count_silence_points (splt_state *state, int *error) |
void | mp3splt_erase_all_splitpoints (splt_state *state, int *error) |
void | mp3splt_erase_all_tags (splt_state *state, int *error) |
void | mp3splt_export_to_cue (splt_state *state, const char *out_file, short stop_at_total_time, int *error) |
char ** | mp3splt_find_filenames (splt_state *state, const char *filename, int *num_of_files_found, int *error) |
int | mp3splt_find_plugins (splt_state *state) |
void | mp3splt_free_state (splt_state *state, int *error) |
char * | mp3splt_get_filename_to_split (splt_state *state) |
float | mp3splt_get_float_option (splt_state *state, int option_name, int *error) |
const splt_freedb_results * | mp3splt_get_freedb_search (splt_state *state, const char *search_string, int *error, int search_type, const char search_server[256], int port) |
int | mp3splt_get_int_option (splt_state *state, int option_name, int *error) |
long | mp3splt_get_long_option (splt_state *state, int option_name, int *error) |
const splt_point * | mp3splt_get_splitpoints (splt_state *state, int *splitpoints_number, int *error) |
char * | mp3splt_get_strerror (splt_state *state, int error_code) |
const splt_syncerrors * | mp3splt_get_syncerrors (splt_state *state, int *error) |
const splt_tags * | mp3splt_get_tags (splt_state *state, int *tags_number, int *error) |
void | mp3splt_get_version (char *version) |
const splt_wrap * | mp3splt_get_wrap_files (splt_state *state, int *error) |
splt_state * | mp3splt_new_state (int *error) |
void | mp3splt_put_audacity_labels_splitpoints_from_file (splt_state *state, const char *file, int *error) |
void | mp3splt_put_cddb_splitpoints_from_file (splt_state *state, const char *file, int *error) |
void | mp3splt_put_cue_splitpoints_from_file (splt_state *state, const char *file, int *error) |
int | mp3splt_put_tags_from_string (splt_state *state, const char *tags, int *error) |
int | mp3splt_set_default_comment_tag (splt_state *state, const char *default_comment) |
int | mp3splt_set_default_genre_tag (splt_state *state, const char *default_genre_tag) |
int | mp3splt_set_filename_to_split (splt_state *state, const char *filename) |
int | mp3splt_set_float_option (splt_state *state, int option_name, float value) |
int | mp3splt_set_input_filename_regex (splt_state *state, const char *regex) |
int | mp3splt_set_int_option (splt_state *state, int option_name, int value) |
int | mp3splt_set_long_option (splt_state *state, int option_name, long value) |
int | mp3splt_set_m3u_filename (splt_state *state, const char *filename) |
int | mp3splt_set_message_function (splt_state *state, void(*message_cb)(const char *, splt_message_type)) |
void | mp3splt_set_oformat (splt_state *state, const char *format_string, int *error) |
int | mp3splt_set_path_of_split (splt_state *state, const char *path) |
int | mp3splt_set_progress_function (splt_state *state, void(*progress_cb)(splt_progress *p_bar)) |
int | mp3splt_set_silence_level_function (splt_state *state, void(*get_silence_cb)(long time, float level, void *user_data), void *data) |
int | mp3splt_set_silence_log_filename (splt_state *state, const char *filename) |
int | mp3splt_set_silence_points (splt_state *state, int *error) |
int | mp3splt_set_split_filename_function (splt_state *state, void(*file_cb)(const char *, int b)) |
void | mp3splt_set_trim_silence_points (splt_state *state, int *error) |
int | mp3splt_split (splt_state *state) |
void | mp3splt_stop_split (splt_state *state, int *error) |
void | mp3splt_write_freedb_file_result (splt_state *state, int disc_id, const char *cddb_file, int *error, int cddb_get_type, const char cddb_get_server[256], int port) |
This group contains all functions of libmp3splt that are meant to be accessed by the user.
int mp3splt_append_plugins_scan_dir | ( | splt_state * | state, | |
char * | dir | |||
) |
Tell where to scan for plug-ins.
state | The splt_state The central structure containing all data for our library |
int mp3splt_append_splitpoint | ( | splt_state * | state, | |
long | split_value, | |||
const char * | name, | |||
int | type | |||
) |
puts a splitpoint in the state
Sets a new splitpoint.
state | The central data structure this library keeps all its data in | |
name | The file name if we want to set it, else NULL | |
split_value | The time of this splitpoint in hundreths of seconds. If this walue is LONG_MAX we put the splitpoint to the end of the song (EOF) |
int mp3splt_append_tags | ( | splt_state * | state, | |
const char * | title, | |||
const char * | artist, | |||
const char * | album, | |||
const char * | performer, | |||
const char * | year, | |||
const char * | comment, | |||
int | track, | |||
const char * | genre | |||
) |
int mp3splt_count_silence_points | ( | splt_state * | state, | |
int * | error | |||
) |
count how many silence splitpoints silence detection results in
Definition at line 1558 of file mp3splt.c.
References mp3splt_set_silence_points().
void mp3splt_erase_all_splitpoints | ( | splt_state * | state, | |
int * | error | |||
) |
void mp3splt_erase_all_tags | ( | splt_state * | state, | |
int * | error | |||
) |
void mp3splt_export_to_cue | ( | splt_state * | state, | |
const char * | out_file, | |||
short | stop_at_total_time, | |||
int * | error | |||
) |
Export our split points to a cue file.
out_file | The name of the file to output the split points to | |
state | The splt_state structure containing the split points | |
error | Contains the error code if anything goes wrong | |
stop_at_total_time | If this parameter is !=0 we don't output splitpoints that lie beyond the end of the audio data. Note that the last splitpoint can be slightly beyond the calculated end of audio data. |
Definition at line 1292 of file mp3splt.c.
References splt_cue_export_to_file().
char** mp3splt_find_filenames | ( | splt_state * | state, | |
const char * | filename, | |||
int * | num_of_files_found, | |||
int * | error | |||
) |
TODO: What does this function do.
state | The splt_state The central structure containing all data for our library | |
num_of_files_found | The number of files this library has found | |
error | The error code |
int mp3splt_find_plugins | ( | splt_state * | state | ) |
void mp3splt_free_state | ( | splt_state * | state, | |
int * | error | |||
) |
this function frees all variables malloc'ed by the library
call this function ONLY at the end of the program and don't forget to call it.
error | The code of any error that might have occoured | |
state | the splt_state structure that keeps all data for our library |
char* mp3splt_get_filename_to_split | ( | splt_state * | state | ) |
Reads out the name of the file that is about to be split.
Reads out the path to the input file.
Definition at line 266 of file mp3splt.c.
References splt_t_get_filename_to_split().
const splt_freedb_results* mp3splt_get_freedb_search | ( | splt_state * | state, | |
const char * | search_string, | |||
int * | error, | |||
int | search_type, | |||
const char | search_server[256], | |||
int | port | |||
) |
Do a freedb search.
After dong the search continue by calling mp3splt_write_freedb_file_result().
state | The central structure this library keeps all its data in | |
search_string | The string that is to be searched for | |
error | The error code this action returns in | |
search_type | the type of the search. Usually set to SPLT_SEARCH_TYPE_FREEDB2 | |
search_server | The URL of the search server or NULL to select the default | |
port | The port on the server. -1 means default (Which should be 80). |
Definition at line 1154 of file mp3splt.c.
References splt_state::fdb, and splt_freedb_process_search().
const splt_point* mp3splt_get_splitpoints | ( | splt_state * | state, | |
int * | splitpoints_number, | |||
int * | error | |||
) |
returns a list containing all the splitpoints
returns a pointer to a list of all splitpoints
state | The structure this library keeps all its data in | |
splitpoints_number | Will be set to the number of splitpoints by this function | |
error | Is set to the error code if any error occours |
char* mp3splt_get_strerror | ( | splt_state * | state, | |
int | error_code | |||
) |
Returns the error string that matches an error code.
state | The splt_state The central structure containing all data for our library | |
error | The error code |
const splt_syncerrors* mp3splt_get_syncerrors | ( | splt_state * | state, | |
int * | error | |||
) |
Determines if syncerrors are found.
state | The splt_state structure containing the split points | |
error | The error code |
Definition at line 1357 of file mp3splt.c.
References splt_state::serrors.
const splt_tags* mp3splt_get_tags | ( | splt_state * | state, | |
int * | tags_number, | |||
int * | error | |||
) |
void mp3splt_get_version | ( | char * | version | ) |
returns libmp3splt version, max 20 chars
Definition at line 1566 of file mp3splt.c.
References SPLT_PACKAGE_VERSION.
const splt_wrap* mp3splt_get_wrap_files | ( | splt_state * | state, | |
int * | error | |||
) |
Split a file that has been generated by mp3wrap.
state | The splt_state structure containing the split points | |
error | The error code |
Definition at line 1416 of file mp3splt.c.
References SPLT_OPT_SPLIT_MODE, SPLT_OPTION_WRAP_MODE, SPLT_TRUE, and splt_state::wrap.
splt_state* mp3splt_new_state | ( | int * | error | ) |
Initialisation.
Initialisation and free.
creates and returns the new central splt_state structure this library keeps all its data in.
The next step after initialization is to do a mp3splt_find_plugins() to find any plugins;
At the end of the program all data we allocate here is freed by calling mp3splt_free_state()
error | Contains the error code if an error occours. |
void mp3splt_put_audacity_labels_splitpoints_from_file | ( | splt_state * | state, | |
const char * | file, | |||
int * | error | |||
) |
void mp3splt_put_cddb_splitpoints_from_file | ( | splt_state * | state, | |
const char * | file, | |||
int * | error | |||
) |
void mp3splt_put_cue_splitpoints_from_file | ( | splt_state * | state, | |
const char * | file, | |||
int * | error | |||
) |
Fetch the splitpoints from a cue file.
state | The central structure that keeps all data this library uses | |
file | The name of the input file | |
error | Is set to the error code this action results in |
Definition at line 1039 of file mp3splt.c.
References splt_cue_put_splitpoints().
int mp3splt_put_tags_from_string | ( | splt_state * | state, | |
const char * | tags, | |||
int * | error | |||
) |
int mp3splt_set_filename_to_split | ( | splt_state * | state, | |
const char * | filename | |||
) |
Sets the name of the file that is about to be split.
Sets path to the input file.
state | The central data structure this library keeps its data in | |
filename | The filename we want to save in state |
Definition at line 276 of file mp3splt.c.
References splt_t_set_filename_to_split().
int mp3splt_set_input_filename_regex | ( | splt_state * | state, | |
const char * | regex | |||
) |
Defines the regex that will be used for SPLT_TAGS_FROM_FILENAME_REGEX to get out tags.
Example: (?<artist>.*?) _ (?<album>.*?) will extract 'one artist' and 'one album' from 'one artist _ one album',
int mp3splt_set_m3u_filename | ( | splt_state * | state, | |
const char * | filename | |||
) |
Set the m3u filename.
state | the splt_state structure that keeps all our data | |
filename | Constains the file name that is to be set |
int mp3splt_set_message_function | ( | splt_state * | state, | |
void(*)(const char *, splt_message_type) | message_cb | |||
) |
Register the callback that is called for messages to the client.
Register the function that is to be called if we got a text message.
state | The central structure this library keeps all its data in | |
message_cb | The callback function |
Definition at line 394 of file mp3splt.c.
References splt_struct::put_message, and splt_state::split.
void mp3splt_set_oformat | ( | splt_state * | state, | |
const char * | format_string, | |||
int * | error | |||
) |
int mp3splt_set_path_of_split | ( | splt_state * | state, | |
const char * | path | |||
) |
int mp3splt_set_progress_function | ( | splt_state * | state, | |
void(*)(splt_progress *p_bar) | progress_cb | |||
) |
Register the callback called with progress messages.
Register the progress bar callback.
state | The central structure this library keeps all its data in | |
progress_cb | The callback function |
Definition at line 440 of file mp3splt.c.
References splt_struct::p_bar, splt_progres::progress, and splt_state::split.
int mp3splt_set_silence_level_function | ( | splt_state * | state, | |
void(*)(long time, float level, void *user_data) | get_silence_cb, | |||
void * | data | |||
) |
int mp3splt_set_silence_log_filename | ( | splt_state * | state, | |
const char * | filename | |||
) |
int mp3splt_set_silence_points | ( | splt_state * | state, | |
int * | error | |||
) |
set the silence splitpoints without actually splitting
Definition at line 1468 of file mp3splt.c.
References SPLT_FALSE, SPLT_OPT_SPLIT_MODE, SPLT_OPTION_SILENCE_MODE, and splt_s_set_silence_splitpoints().
Referenced by mp3splt_count_silence_points().
int mp3splt_set_split_filename_function | ( | splt_state * | state, | |
void(*)(const char *, int b) | file_cb | |||
) |
Register the callback called with the split filename after split.
state | The central structure this library keeps all its data in | |
file_cb | The callback function |
Definition at line 417 of file mp3splt.c.
References splt_struct::file_split, and splt_state::split.
void mp3splt_set_trim_silence_points | ( | splt_state * | state, | |
int * | error | |||
) |
set the trim silence splitpoints without actually splitting
Definition at line 1515 of file mp3splt.c.
References SPLT_FALSE, SPLT_OPT_SPLIT_MODE, and SPLT_OPTION_TRIM_SILENCE_MODE.
int mp3splt_split | ( | splt_state * | state | ) |
main function: Call it and it splits the file for you
state-> splitnumber tells how many splits to do
Definition at line 797 of file mp3splt.c.
References splt_struct::real_splitnumber, splt_state::split, splt_struct::splitnumber, SPLT_FALSE, SPLT_OPT_AUTO_ADJUST, SPLT_OPT_INPUT_NOT_SEEKABLE, SPLT_OPT_PARAM_GAP, SPLT_OPT_PARAM_OFFSET, SPLT_OPT_PARAM_THRESHOLD, SPLT_OPT_PRETEND_TO_SPLIT, SPLT_OPT_SPLIT_MODE, SPLT_OPT_TAGS, SPLT_OPTION_ERROR_MODE, SPLT_OPTION_LENGTH_MODE, SPLT_OPTION_NORMAL_MODE, SPLT_OPTION_SILENCE_MODE, SPLT_OPTION_TIME_MODE, SPLT_OPTION_TRIM_SILENCE_MODE, SPLT_OPTION_WRAP_MODE, splt_s_equal_length_split(), splt_s_error_split(), splt_s_silence_split(), splt_s_time_split(), splt_s_trim_silence_split(), splt_s_wrap_split(), splt_t_get_filename_to_split(), splt_t_set_filename_to_split(), SPLT_TAGS_FROM_FILENAME_REGEX, SPLT_TAGS_ORIGINAL_FILE, and SPLT_TRUE.
void mp3splt_stop_split | ( | splt_state * | state, | |
int * | error | |||
) |
void mp3splt_write_freedb_file_result | ( | splt_state * | state, | |
int | disc_id, | |||
const char * | cddb_file, | |||
int * | error, | |||
int | cddb_get_type, | |||
const char | cddb_get_server[256], | |||
int | port | |||
) |
returns the content of a cddb file
must only be called {after} running get_freedb_search otherwise, it will fail (seg fault!?)
you need to write the cddb entry to the disk in a cddb file to use it be able to use it
state | The central structure that keeps all data this library uses | |
error | Is set to the error code this action results in | |
disc_id | The freedb disc ID. | |
cddb_get_type | specifies the type of the get: it can be SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI (that works for both freedb and freedb2 at the moment - 18_10_06) or SPLT_FREEDB_GET_FILE_TYPE_CDDB (that only work for freedb at the moment - 18_10_06) |
Definition at line 1219 of file mp3splt.c.
References splt_freedb_get_file(), and SPLT_OPT_PRETEND_TO_SPLIT.