libmp3splt: include/libmp3splt/mp3splt.h Source File

| libmp3splt 0.9.3.1519 Lossless library for splitting audio formats like mp3, ogg vorbis and FLAC. |

Loading...
Searching...
No Matches
mp3splt.h
Go to the documentation of this file.
1/**********************************************************
2 *
3 * libmp3splt -- library based on mp3splt v2.1c,
4 * for mp3/ogg splitting without decoding
5 *
6 * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net>
7 * Copyright (c) 2005-2014 Alexandru Munteanu - m@ioalex.net
8 *
9 * And others ... see the AUTHORS file provided with libmp3splt source.
10 *
11 * http://mp3splt.sourceforge.net
12 *
13 *********************************************************/
14
15/**********************************************************
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
30 * USA.
31 *
32 *********************************************************/
33
39
72
76
80
81#ifndef MP3SPLT_MP3SPLT_H
82
83#include <sys/types.h>
84
85#include "version.h"
86
90#define SPLT_TRUE 1
94#define SPLT_FALSE 0
95
101
107 typedef enum {
108 SPLT_OK = 0,
109
110 SPLT_OK_SPLIT = 1,
111 SPLT_SPLITPOINT_BIGGER_THAN_LENGTH = 4,
112 SPLT_SILENCE_OK = 5,
113 SPLT_TIME_SPLIT_OK = 6,
114 SPLT_NO_SILENCE_SPLITPOINTS_FOUND = 7,
115 SPLT_OK_SPLIT_EOF = 8,
116 SPLT_LENGTH_SPLIT_OK = 9,
117 SPLT_TRIM_SILENCE_OK = 10,
118
119 SPLT_FREEDB_OK = 100,
120 SPLT_FREEDB_FILE_OK = 101,
121 SPLT_CDDB_OK = 102,
122 SPLT_CUE_OK = 103,
123 SPLT_FREEDB_MAX_CD_REACHED = 104,
124 SPLT_AUDACITY_OK = 105,
125
126 SPLT_DEWRAP_OK = 200,
127
128 SPLT_SYNC_OK = 300,
129 SPLT_MIGHT_BE_VBR = 301,
130
131 SPLT_ERR_SYNC = -300,
132 SPLT_ERR_NO_SYNC_FOUND = -301,
133 SPLT_ERR_TOO_MANY_SYNC_ERR = -302,
134
135 SPLT_OUTPUT_FORMAT_OK = 400,
136 SPLT_OUTPUT_FORMAT_AMBIGUOUS = 401,
137
138 SPLT_REGEX_OK = 800,
139
140 SPLT_ERROR_SPLITPOINTS = -1,
141 SPLT_ERROR_CANNOT_OPEN_FILE = -2,
142 SPLT_ERROR_INVALID = -3,
143 SPLT_ERROR_EQUAL_SPLITPOINTS = -5,
144 SPLT_ERROR_SPLITPOINTS_NOT_IN_ORDER = -6,
145 SPLT_ERROR_NEGATIVE_SPLITPOINT = -7,
146 SPLT_ERROR_INCORRECT_PATH = -8,
147 SPLT_ERROR_INCOMPATIBLE_OPTIONS = -10,
148 SPLT_ERROR_INPUT_OUTPUT_SAME_FILE = -12,
149 SPLT_ERROR_CANNOT_ALLOCATE_MEMORY = -15,
150 SPLT_ERROR_CANNOT_OPEN_DEST_FILE = -16,
151 SPLT_ERROR_CANT_WRITE_TO_OUTPUT_FILE = -17,
152 SPLT_ERROR_WHILE_READING_FILE = -18,
153 SPLT_ERROR_SEEKING_FILE = -19,
154 SPLT_ERROR_BEGIN_OUT_OF_FILE = -20,
155 SPLT_ERROR_INEXISTENT_FILE = -21,
156 SPLT_SPLIT_CANCELLED = -22,
157 SPLT_ERROR_LIBRARY_LOCKED = -24,
158 SPLT_ERROR_STATE_NULL = -25,
159 SPLT_ERROR_NEGATIVE_TIME_SPLIT = -26,
160 SPLT_ERROR_CANNOT_CREATE_DIRECTORY = -27,
161 SPLT_ERROR_CANNOT_CLOSE_FILE = -28,
162 SPLT_ERROR_NO_PLUGIN_FOUND = -29,
163 SPLT_ERROR_CANNOT_INIT_LIBLTDL = -30,
164 SPLT_ERROR_CRC_FAILED = -31,
165 SPLT_ERROR_NO_PLUGIN_FOUND_FOR_FILE = -32,
166 SPLT_ERROR_PLUGIN_ERROR = -33,
167 SPLT_ERROR_TIME_SPLIT_VALUE_INVALID = -34,
168 SPLT_ERROR_LENGTH_SPLIT_VALUE_INVALID = -35,
169 SPLT_ERROR_CANNOT_GET_TOTAL_TIME = -36,
170 SPLT_ERROR_LIBID3 = -37,
171 SPLT_ERROR_FAILED_BITRESERVOIR = -38,
172
173 SPLT_FREEDB_ERROR_INITIALISE_SOCKET = -101,
174 SPLT_FREEDB_ERROR_CANNOT_GET_HOST = -102,
175 SPLT_FREEDB_ERROR_CANNOT_OPEN_SOCKET = -103,
176 SPLT_FREEDB_ERROR_CANNOT_CONNECT = -104,
177 SPLT_FREEDB_ERROR_CANNOT_SEND_MESSAGE = -105,
178 SPLT_FREEDB_ERROR_INVALID_SERVER_ANSWER = -106,
179 SPLT_FREEDB_ERROR_SITE_201 = -107,
180 SPLT_FREEDB_ERROR_SITE_200 = -108,
181 SPLT_FREEDB_ERROR_BAD_COMMUNICATION = -109,
182 SPLT_FREEDB_ERROR_GETTING_INFOS = -110,
183 SPLT_FREEDB_NO_CD_FOUND = -111,
184 SPLT_FREEDB_ERROR_CANNOT_RECV_MESSAGE = -112,
185 SPLT_INVALID_CUE_FILE = -115,
186 SPLT_INVALID_CDDB_FILE = -116,
187 SPLT_FREEDB_NO_SUCH_CD_IN_DATABASE = -118,
188 SPLT_FREEDB_ERROR_SITE = -119,
189 SPLT_FREEDB_ERROR_CANNOT_DISCONNECT = -120,
190 SPLT_FREEDB_ERROR_PROXY_NOT_SUPPORTED = -121,
191 SPLT_ERROR_INTERNAL_SHEET = -122,
192 SPLT_ERROR_INTERNAL_SHEET_TYPE_NOT_SUPPORTED = -123,
193
194 SPLT_DEWRAP_ERR_FILE_LENGTH = -200,
195 SPLT_DEWRAP_ERR_VERSION_OLD = -201,
196 SPLT_DEWRAP_ERR_NO_FILE_OR_BAD_INDEX = -202,
197 SPLT_DEWRAP_ERR_FILE_DAMAGED_INCOMPLETE = -203,
198 SPLT_DEWRAP_ERR_FILE_NOT_WRAPED_DAMAGED = -204,
199
200 SPLT_OUTPUT_FORMAT_ERROR = -400,
201
202 SPLT_ERROR_INEXISTENT_SPLITPOINT = -500,
203
204 SPLT_PLUGIN_ERROR_UNSUPPORTED_FEATURE = -600,
205
206 SPLT_INVALID_AUDACITY_FILE = -700,
207
208 SPLT_INVALID_REGEX = -800,
209 SPLT_REGEX_NO_MATCH = -801,
210 SPLT_REGEX_UNAVAILABLE = -802,
211
212 SPLT_ERROR_NO_AUTO_ADJUST_FOUND = -900,
213
214 SPLT_ERROR_INVALID_CODE = -1000,
215} splt_code;
216
218
223 */
224
231 typedef struct _splt_state splt_state;
232
243 splt_state *mp3splt_new_state(splt_code *error);
244
253 splt_code mp3splt_free_state(splt_state *state);
254
264 splt_code mp3splt_append_plugins_scan_dir(splt_state *state, const char *directory);
265
275 splt_code mp3splt_find_plugins(splt_state *state);
276
278
282
293 char *mp3splt_get_strerror(splt_state *state, splt_code error);
294
296
302
312 typedef enum {
321 SPLT_OPT_PRETEND_TO_SPLIT = 1,
329 SPLT_OPT_QUIET_MODE,
337 SPLT_OPT_DEBUG_MODE,
345 SPLT_OPT_SPLIT_MODE,
353 SPLT_OPT_TAGS,
361 SPLT_OPT_XING,
373 SPLT_OPT_CREATE_DIRS_FROM_FILENAMES,
381 SPLT_OPT_OUTPUT_FILENAMES,
392 SPLT_OPT_FRAME_MODE,
400 SPLT_OPT_AUTO_ADJUST,
410 SPLT_OPT_INPUT_NOT_SEEKABLE,
419 SPLT_OPT_PARAM_NUMBER_TRACKS,
431 SPLT_OPT_PARAM_SHOTS,
439 SPLT_OPT_PARAM_REMOVE_SILENCE,
448 SPLT_OPT_PARAM_GAP,
457 SPLT_OPT_ENABLE_SILENCE_LOG,
467 SPLT_OPT_FORCE_TAGS_VERSION,
476 SPLT_OPT_LENGTH_SPLIT_FILE_NUMBER,
486 SPLT_OPT_REPLACE_TAGS_IN_TAGS,
495 SPLT_OPT_OVERLAP_TIME,
504 SPLT_OPT_SPLIT_TIME,
515 SPLT_OPT_PARAM_THRESHOLD,
525 SPLT_OPT_PARAM_OFFSET,
534 SPLT_OPT_PARAM_MIN_LENGTH,
543 SPLT_OPT_PARAM_MIN_TRACK_LENGTH,
554 SPLT_OPT_PARAM_MIN_TRACK_JOIN,
563 SPLT_OPT_ARTIST_TAG_FORMAT,
572 SPLT_OPT_ALBUM_TAG_FORMAT,
581 SPLT_OPT_TITLE_TAG_FORMAT,
590 SPLT_OPT_COMMENT_TAG_FORMAT,
599 SPLT_OPT_REPLACE_UNDERSCORES_TAG_FORMAT,
608 SPLT_OPT_SET_FILE_FROM_CUE_IF_FILE_TAG_FOUND,
618 SPLT_OPT_KEEP_SILENCE_LEFT,
628 SPLT_OPT_KEEP_SILENCE_RIGHT,
637 SPLT_OPT_CUE_SET_SPLITPOINT_NAMES_FROM_REM_NAME,
645 SPLT_OPT_CUE_DISABLE_CUE_FILE_CREATED_MESSAGE,
654 SPLT_OPT_CUE_CDDB_ADD_TAGS_WITH_KEEP_ORIGINAL_TAGS,
662 SPLT_OPT_ID3V2_ENCODING,
670 SPLT_OPT_INPUT_TAGS_ENCODING,
681 SPLT_OPT_TIME_MINIMUM_THEORETICAL_LENGTH,
690 SPLT_OPT_WARN_IF_NO_AUTO_ADJUST_FOUND,
699 SPLT_OPT_STOP_IF_NO_AUTO_ADJUST_FOUND,
709 SPLT_OPT_DECODE_AND_WRITE_FLAC_MD5SUM_FOR_CREATED_FILES,
718 SPLT_OPT_HANDLE_BIT_RESERVOIR,
719} splt_options;
720
724 typedef enum {
728 SPLT_OPTION_NORMAL_MODE,
733 SPLT_OPTION_WRAP_MODE,
738 SPLT_OPTION_SILENCE_MODE,
743 SPLT_OPTION_TRIM_SILENCE_MODE,
748 SPLT_OPTION_ERROR_MODE,
753 SPLT_OPTION_TIME_MODE,
757 SPLT_OPTION_LENGTH_MODE,
758} splt_split_mode_options;
759
763 typedef enum {
767 SPLT_ID3V2_LATIN1,
771 SPLT_ID3V2_UTF8,
775 SPLT_ID3V2_UTF16,
776} splt_id3v2_encoding;
777
781 typedef enum {
785 SPLT_OUTPUT_FORMAT,
793 SPLT_OUTPUT_DEFAULT,
798 SPLT_OUTPUT_CUSTOM
799} splt_output_filenames_options;
800
804#define SPLT_DEFAULT_PARAM_THRESHOLD -48.0
808#define SPLT_DEFAULT_PARAM_OFFSET 0.8
812#define SPLT_DEFAULT_PARAM_MINIMUM_LENGTH 0.0
816#define SPLT_DEFAULT_PARAM_MINIMUM_TRACK_LENGTH 0.0
820#define SPLT_DEFAULT_PARAM_MIN_TRACK_JOIN 0.0
824#define SPLT_DEFAULT_PARAM_GAP 30
828#define SPLT_DEFAULT_PARAM_TRACKS 0
832#define SPLT_DEFAULT_PARAM_SHOTS 25
836#define SPLT_DEFAULT_KEEP_SILENCE_LEFT 0
840#define SPLT_DEFAULT_KEEP_SILENCE_RIGHT 0
841
845 typedef enum {
849 SPLT_TAGS_ORIGINAL_FILE,
853 SPLT_CURRENT_TAGS,
857 SPLT_NO_TAGS,
861 SPLT_TAGS_FROM_FILENAME_REGEX,
862} splt_tags_options;
863
868#define SPLT_DEFAULT_OUTPUT "@f_@mm_@ss_@h0h__@Mm_@Ss_@H0h"
869
874#define SPLT_DEFAULT_CDDB_CUE_OUTPUT "@A - @n - @t"
879#define SPLT_DEFAULT_SYNCERROR_OUTPUT "@f_error_@n"
884#define SPLT_DEFAULT_SILENCE_OUTPUT "@f_silence_@n"
889#define SPLT_DEFAULT_TRIM_SILENCE_OUTPUT "@f_trimmed"
890
896 typedef enum {
900 SPLT_NO_CONVERSION,
904 SPLT_TO_LOWERCASE,
908 SPLT_TO_UPPERCASE,
912 SPLT_TO_FIRST_UPPERCASE,
916 SPLT_TO_WORD_FIRST_UPPERCASE
917} splt_str_format;
918
927 splt_code mp3splt_set_int_option(splt_state *state, splt_options option, int value);
928
937 splt_code mp3splt_set_long_option(splt_state *state, splt_options option, long value);
938
947 splt_code mp3splt_set_float_option(splt_state *state, splt_options option, float value);
948
957 int mp3splt_get_int_option(splt_state *state, splt_options option, splt_code *error);
958
967 long mp3splt_get_long_option(splt_state *state, splt_options option, splt_code *error);
968
977 float mp3splt_get_float_option(splt_state *state, splt_options option, splt_code *error);
978
986 splt_code mp3splt_set_oformat(splt_state *state, const char *format);
987
989
995
1003 splt_code mp3splt_set_filename_to_split(splt_state *state, const char *filename);
1004
1012 splt_code mp3splt_set_path_of_split(splt_state *state, const char *path_of_split);
1013
1025 const char *mp3splt_get_filename_to_split(splt_state *state);
1026
1039 splt_code mp3splt_set_m3u_filename(splt_state *state, const char *m3u_filename);
1040
1066 splt_code mp3splt_set_silence_log_filename(splt_state *state, const char *filename);
1067
1100 splt_code mp3splt_set_silence_full_log_filename(splt_state *state, const char *filename);
1101
1103
1109
1113 * @see #mp3splt_set_message_function
1114 */
1115typedef enum {
1119 SPLT_MESSAGE_INFO,
1123 SPLT_MESSAGE_WARNING,
1127 SPLT_MESSAGE_DEBUG
1128} splt_message_type;
1129
1146 splt_code mp3splt_set_message_function(splt_state *state,
1147 void (*message_cb)(const char *message, splt_message_type type, void *cb_data), void *cb_data);
1148
1162 splt_code mp3splt_set_split_filename_function(splt_state *state,
1163 void (*file_cb)(const char *filename, void *cb_data),
1164 void *cb_data);
1165
1186 splt_code mp3splt_set_pretend_to_split_write_function(splt_state *state,
1187 void (*write_cb)(const void *ptr, size_t size, size_t nmemb, void *cb_data),
1188 void *cb_data);
1189
1192 * #mp3splt_set_progress_function.
1193 */
1194typedef enum {
1198 SPLT_PROGRESS_PREPARE,
1202 SPLT_PROGRESS_CREATE,
1206 SPLT_PROGRESS_SEARCH_SYNC,
1211 SPLT_PROGRESS_SCAN_SILENCE
1212} splt_progress_messages;
1213
1229typedef struct splt_progres splt_progress;
1230
1244 splt_code mp3splt_set_progress_function(splt_state *state,
1245 void (*progress_cb)(splt_progress *p_bar, void *cb_data), void *cb_data);
1246
1250int mp3splt_progress_get_type(const splt_progress *p_bar);
1251
1255char *mp3splt_progress_get_filename_shorted(const splt_progress *p_bar);
1256
1260int mp3splt_progress_get_current_split(const splt_progress *p_bar);
1261
1265int mp3splt_progress_get_max_splits(const splt_progress *p_bar);
1266
1270int mp3splt_progress_get_silence_found_tracks(const splt_progress *p_bar);
1271
1275float mp3splt_progress_get_silence_db_level(const splt_progress *p_bar);
1276
1280float mp3splt_progress_get_percent_progress(const splt_progress *p_bar);
1281
1297 splt_code mp3splt_set_silence_level_function(splt_state *state,
1298 void (*get_silence_cb)(long time, float level, void *user_data),
1299 void *user_data);
1300
1302
1308
1311 * @see #mp3splt_append_splitpoint, #mp3splt_point_get_type
1312 */
1313typedef enum {
1317 SPLT_SPLITPOINT,
1322 SPLT_SKIPPOINT,
1323} splt_type_of_splitpoint;
1324
1333typedef struct _splt_point splt_point;
1334
1348 splt_point *mp3splt_point_new(long splitpoint_value, splt_code *error);
1349
1357 splt_code mp3splt_point_set_name(splt_point *splitpoint, const char *name);
1358
1366 splt_code mp3splt_point_set_type(splt_point *splitpoint, splt_type_of_splitpoint type);
1367
1377 splt_code mp3splt_append_splitpoint(splt_state *state, splt_point *splitpoint);
1378
1386typedef struct _splt_points splt_points;
1387
1398 splt_points *mp3splt_get_splitpoints(splt_state *state, splt_code *error);
1399
1407void mp3splt_points_init_iterator(splt_points *splitpoints);
1408
1419const splt_point *mp3splt_points_next(splt_points *splitpoints);
1420
1429long mp3splt_point_get_value(const splt_point *point);
1430
1440 splt_type_of_splitpoint mp3splt_point_get_type(const splt_point *point);
1441
1450char *mp3splt_point_get_name(const splt_point *point);
1451
1458 splt_code mp3splt_erase_all_splitpoints(splt_state *state);
1459
1461
1467
1471#define SPLT_UNDEFINED_GENRE "Other"
1472
1477#define SPLT_ID3V1_NUMBER_OF_GENRES 127
1478
1482extern const char splt_id3v1_genres[SPLT_ID3V1_NUMBER_OF_GENRES][25];
1483
1485 * @brief Key tags useful with #mp3splt_append_tags.
1486 */
1487typedef enum {
1488 SPLT_TAGS_TITLE = 1,
1489 SPLT_TAGS_ARTIST = 2,
1490 SPLT_TAGS_ALBUM = 3,
1491 SPLT_TAGS_YEAR = 4,
1492 SPLT_TAGS_COMMENT = 5,
1493 SPLT_TAGS_TRACK = 6,
1494 SPLT_TAGS_GENRE = 7,
1495 SPLT_TAGS_PERFORMER = 8,
1500 SPLT_TAGS_ORIGINAL = 900
1501} splt_tag_key;
1502
1512typedef struct _splt_tags splt_tags;
1513
1523 splt_tags *mp3splt_tags_new(splt_code *error);
1524
1544 splt_code mp3splt_tags_set(splt_tags *tags, ...);
1545
1558 splt_code mp3splt_append_tags(splt_state *state, splt_tags *tags);
1559
1564typedef struct _splt_tags_group splt_tags_group;
1565
1576 splt_tags_group *mp3splt_get_tags_group(splt_state *state, splt_code *error);
1577
1584 splt_code mp3splt_remove_tags_of_skippoints(splt_state *state);
1585
1593void mp3splt_tags_group_init_iterator(splt_tags_group *tags_group);
1594
1603 splt_tags *mp3splt_tags_group_next(splt_tags_group *tags_group);
1604
1608char *mp3splt_tags_get(splt_tags *tags, splt_tag_key key);
1609
1638int mp3splt_put_tags_from_string(splt_state *state, const char *tags, splt_code *error);
1639
1648 splt_code mp3splt_read_original_tags(splt_state *state);
1649
1656 splt_code mp3splt_erase_all_tags(splt_state *state);
1657
1671 splt_code mp3splt_set_input_filename_regex(splt_state *state, const char *regex);
1672
1682 splt_code mp3splt_set_default_comment_tag(splt_state *state, const char *default_comment_tag);
1683
1693 splt_code mp3splt_set_default_genre_tag(splt_state *state, const char *default_genre_tag);
1694
1707 splt_tags *mp3splt_parse_filename_regex(splt_state *state, splt_code *error);
1708
1716void mp3splt_free_one_tag(splt_tags *tags);
1717
1719
1725
1738 splt_code mp3splt_split(splt_state *state);
1739
1748 splt_code mp3splt_stop_split(splt_state *state);
1749
1761char **mp3splt_find_filenames(splt_state *state, const char *filename,
1762 int *num_of_files_found, splt_code *error);
1763
1765
1771
1775 * @see #mp3splt_import
1776 */
1777typedef enum {
1778 CUE_IMPORT,
1779 CDDB_IMPORT,
1780 AUDACITY_LABELS_IMPORT,
1781 PLUGIN_INTERNAL_IMPORT
1782} splt_import_type;
1783
1794 splt_code mp3splt_import(splt_state *state, splt_import_type type, const char *file);
1795
1801#define SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI 1
1802
1808#define SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI 3
1809
1815#define SPLT_FREEDB_GET_FILE_TYPE_CDDB 4
1816
1823#define SPLT_FREEDB_CDDB_CGI_PORT 80
1824
1832#define SPLT_FREEDB2_CGI_SITE "tracktype.org/~cddb/cddb.cgi"
1833
1842typedef struct _splt_freedb_results splt_freedb_results;
1843
1851typedef struct _splt_freedb_one_result splt_freedb_one_result;
1852
1861 splt_code mp3splt_use_proxy(splt_state *state, const char *proxy_address, int proxy_port);
1862
1874 splt_code mp3splt_use_base64_authentification(splt_state *state,
1875 const char *base64_authentification);
1876
1887char *mp3splt_encode_in_base64(splt_state *state, const char *input, int *error);
1888
1895void mp3splt_clear_proxy(splt_state *state);
1896
1913 splt_freedb_results *mp3splt_get_freedb_search(splt_state *state,
1914 const char *searched_string, splt_code *error,
1915 int search_type, const char *search_server, int port);
1916
1924void mp3splt_freedb_init_iterator(splt_freedb_results *freedb_results);
1925
1936const splt_freedb_one_result *mp3splt_freedb_next(splt_freedb_results *freedb_results);
1937
1942int mp3splt_freedb_get_id(const splt_freedb_one_result *result);
1943
1947const char *mp3splt_freedb_get_name(const splt_freedb_one_result *result);
1948
1952int mp3splt_freedb_get_number_of_revisions(const splt_freedb_one_result *result);
1953
1970 splt_code mp3splt_write_freedb_file_result(splt_state *state,
1971 int disc_id, const char *output_file,
1972 int cddb_get_type, const char *cddb_get_server, int port);
1973
1975
1981
1985 * @see #mp3splt_export
1986 */
1987typedef enum {
1988 CUE_EXPORT
1989} splt_export_type;
1990
2001 splt_code mp3splt_export(splt_state *state, splt_export_type type,
2002 const char *file, int stop_at_total_time);
2003
2005
2011
2020typedef struct _splt_wrap splt_wrap;
2021
2028typedef struct _splt_one_wrap splt_one_wrap;
2029
2041 splt_wrap *mp3splt_get_wrap_files(splt_state *state, splt_code *error);
2042
2050void mp3splt_wrap_init_iterator(splt_wrap *wrap);
2051
2060const splt_one_wrap *mp3splt_wrap_next(splt_wrap *wrap);
2061
2065char *mp3splt_wrap_get_wrapped_file(const splt_one_wrap *one_wrap);
2066
2068
2074
2082int mp3splt_set_silence_points(splt_state *state, splt_code *error);
2083
2090 splt_code mp3splt_set_trim_silence_points(splt_state *state);
2091
2095char *mp3splt_get_version();
2096
2097#ifdef __WIN32__
2101char *mp3splt_win32_utf16_to_utf8(const wchar_t *source);
2102#endif
2103
2107int mp3splt_check_if_directory(const char *filename);
2108
2109#ifndef SPLT_DIRCHAR
2110#ifdef __WIN32__
2111#define SPLT_DIRCHAR '\\'
2112#define SPLT_DIRSTR "\\"
2113#else
2117#define SPLT_DIRCHAR '/'
2121#define SPLT_DIRSTR "/"
2122#endif
2123#endif
2124
2126
2131
2133 * @brief Structure containing plugin information, like the version, the name and file extension.
2134 */
2135typedef struct {
2139 float version;
2143 char *name;
2147 char *extension;
2151 char *upper_extension;
2152} splt_plugin_info;
2153
2157typedef struct _splt_original_tags splt_original_tags;
2158
2172 * implementations.
2173 */
2174typedef struct {
2184 void (*splt_pl_init)(splt_state *state, splt_code *error);
2193 void (*splt_pl_end)(splt_state *state, splt_code *error);
2203 int (*splt_pl_check_plugin_is_for_file)(splt_state *state, splt_code *error);
2212 void (*splt_pl_set_plugin_info)(splt_plugin_info *information, splt_code *error);
2226 double (*splt_pl_split)(splt_state *state, const char *final_fname, double begin_point,
2227 double end_point, splt_code *error, int save_end_point);
2239 void (*splt_pl_set_original_tags)(splt_state *state, splt_code *error);
2248 void (*splt_pl_clear_original_tags)(splt_original_tags *original_tags);
2260 int (*splt_pl_scan_silence)(splt_state *state, splt_code *error);
2272 int (*splt_pl_scan_trim_silence)(splt_state *state, splt_code *error);
2281 void (*splt_pl_search_syncerrors)(splt_state *state, splt_code *error);
2293 int (*splt_pl_offset_split)(splt_state *state, const char *output_fname, off_t begin, off_t end);
2305 void (*splt_pl_dewrap)(splt_state *state, int listonly, const char *dir, splt_code *error);
2312 void (*splt_pl_import_internal_sheets)(splt_state *state, splt_code *error);
2313} splt_plugin_func;
2314
2316
2320#define MP3SPLT_MP3SPLT_H
2321#endif
2322
mp3splt_progress_get_current_split
int mp3splt_progress_get_current_split(const splt_progress *p_bar)
mp3splt_progress_get_type
int mp3splt_progress_get_type(const splt_progress *p_bar)
mp3splt_progress_get_max_splits
int mp3splt_progress_get_max_splits(const splt_progress *p_bar)
mp3splt_progress_get_percent_progress
float mp3splt_progress_get_percent_progress(const splt_progress *p_bar)
splt_progress_messages
splt_progress_messages
Type of messages sent to the client using the callback registered with mp3splt_set_progress_function.
Definition mp3splt.h:1192
mp3splt_progress_get_silence_db_level
float mp3splt_progress_get_silence_db_level(const splt_progress *p_bar)
mp3splt_set_silence_level_function
splt_code mp3splt_set_silence_level_function(splt_state *state, void(*get_silence_cb)(long time, float level, void *user_data), void *user_data)
Register callback function that is called when looking for silence detection.
splt_progress
struct splt_progres splt_progress
Structure containing all information needed to display a progress bar.
Definition mp3splt.h:1227
mp3splt_set_split_filename_function
splt_code mp3splt_set_split_filename_function(splt_state *state, void(*file_cb)(const char *filename, void *cb_data), void *cb_data)
Register callback function that is called when an output file is created.
mp3splt_set_pretend_to_split_write_function
splt_code mp3splt_set_pretend_to_split_write_function(splt_state *state, void(*write_cb)(const void *ptr, size_t size, size_t nmemb, void *cb_data), void *cb_data)
Register callback function that is called when SPLT_OPT_PRETEND_TO_SPLIT is SPLT_TRUE.
mp3splt_progress_get_silence_found_tracks
int mp3splt_progress_get_silence_found_tracks(const splt_progress *p_bar)
mp3splt_set_progress_function
splt_code mp3splt_set_progress_function(splt_state *state, void(*progress_cb)(splt_progress *p_bar, void *cb_data), void *cb_data)
Register callback function called to keep track of the current progress.
splt_message_type
splt_message_type
Type of the message sent to the client.
Definition mp3splt.h:1113
mp3splt_progress_get_filename_shorted
char * mp3splt_progress_get_filename_shorted(const splt_progress *p_bar)
mp3splt_set_message_function
splt_code mp3splt_set_message_function(splt_state *state, void(*message_cb)(const char *message, splt_message_type type, void *cb_data), void *cb_data)
Register callback function used to send text messages to the client.
SPLT_PROGRESS_CREATE
@ SPLT_PROGRESS_CREATE
Creating the output file.
Definition mp3splt.h:1200
SPLT_PROGRESS_PREPARE
@ SPLT_PROGRESS_PREPARE
Preparing to split a song.
Definition mp3splt.h:1196
SPLT_PROGRESS_SEARCH_SYNC
@ SPLT_PROGRESS_SEARCH_SYNC
Searching for synchronisation errors - when using SPLT_OPTION_ERROR_MODE.
Definition mp3splt.h:1204
SPLT_PROGRESS_SCAN_SILENCE
@ SPLT_PROGRESS_SCAN_SILENCE
Scanning for silence - when using SPLT_OPTION_SILENCE_MODE, SPLT_OPT_AUTO_ADJUST, mp3splt_set_silence...
Definition mp3splt.h:1209
SPLT_MESSAGE_DEBUG
@ SPLT_MESSAGE_DEBUG
Debug message.
Definition mp3splt.h:1125
SPLT_MESSAGE_WARNING
@ SPLT_MESSAGE_WARNING
Warning message.
Definition mp3splt.h:1121
SPLT_MESSAGE_INFO
@ SPLT_MESSAGE_INFO
Info message.
Definition mp3splt.h:1117
mp3splt_get_strerror
char * mp3splt_get_strerror(splt_state *state, splt_code error)
Returns the error message of the error.
splt_code
splt_code
Confirmation and error codes.
Definition mp3splt.h:107
mp3splt_export
splt_code mp3splt_export(splt_state *state, splt_export_type type, const char *file, int stop_at_total_time)
Export splitpoints from the state into the file saved as type.
splt_export_type
splt_export_type
Type of the export.
Definition mp3splt.h:1985
mp3splt_set_path_of_split
splt_code mp3splt_set_path_of_split(splt_state *state, const char *path_of_split)
Sets the output directory where the split files will be created.
mp3splt_set_silence_full_log_filename
splt_code mp3splt_set_silence_full_log_filename(splt_state *state, const char *filename)
Full log filename for the SPLT_OPTION_SILENCE_MODE split mode that will be created.
mp3splt_set_m3u_filename
splt_code mp3splt_set_m3u_filename(splt_state *state, const char *m3u_filename)
Output filename for a M3U file that will be created in the output path.
mp3splt_get_filename_to_split
const char * mp3splt_get_filename_to_split(splt_state *state)
Returns the filename to be split from the state.
mp3splt_set_silence_log_filename
splt_code mp3splt_set_silence_log_filename(splt_state *state, const char *filename)
Log filename for the SPLT_OPTION_SILENCE_MODE split mode that will be created.
mp3splt_set_filename_to_split
splt_code mp3splt_set_filename_to_split(splt_state *state, const char *filename)
Sets the input filename to split.
mp3splt_use_proxy
splt_code mp3splt_use_proxy(splt_state *state, const char *proxy_address, int proxy_port)
Use proxy when accessing the internet.
mp3splt_encode_in_base64
char * mp3splt_encode_in_base64(splt_state *state, const char *input, int *error)
Encode the input in base64.
mp3splt_freedb_get_number_of_revisions
int mp3splt_freedb_get_number_of_revisions(const splt_freedb_one_result *result)
Returns the number of revisions of the result.
mp3splt_clear_proxy
void mp3splt_clear_proxy(splt_state *state)
Clears the proxy data from the state.
mp3splt_write_freedb_file_result
splt_code mp3splt_write_freedb_file_result(splt_state *state, int disc_id, const char *output_file, int cddb_get_type, const char *cddb_get_server, int port)
Downloads the CDDB file of the disc_id and writes it to a file.
mp3splt_freedb_get_id
int mp3splt_freedb_get_id(const splt_freedb_one_result *result)
Returns the ID of the result.
mp3splt_import
splt_code mp3splt_import(splt_state *state, splt_import_type type, const char *file)
Import splitpoints from the file having the type into the state.
mp3splt_freedb_init_iterator
void mp3splt_freedb_init_iterator(splt_freedb_results *freedb_results)
Initialisation of the iterator for use with mp3splt_freedb_next.
mp3splt_freedb_next
const splt_freedb_one_result * mp3splt_freedb_next(splt_freedb_results *freedb_results)
Returns the next freedb result from the freedb_results.
splt_import_type
splt_import_type
Type of the import.
Definition mp3splt.h:1775
mp3splt_get_freedb_search
splt_freedb_results * mp3splt_get_freedb_search(splt_state *state, const char *searched_string, splt_code *error, int search_type, const char *search_server, int port)
Search on the internet for the searched_string and returns the results.
splt_freedb_one_result
struct _splt_freedb_one_result splt_freedb_one_result
Structure containing only one freedb result.
Definition mp3splt.h:1849
mp3splt_freedb_get_name
const char * mp3splt_freedb_get_name(const splt_freedb_one_result *result)
Returns the name of the result.
splt_freedb_results
struct _splt_freedb_results splt_freedb_results
Structure containing the freedb search results.
Definition mp3splt.h:1840
mp3splt_use_base64_authentification
splt_code mp3splt_use_base64_authentification(splt_state *state, const char *base64_authentification)
Use proxy with base64 authentification.
splt_tags_options
splt_tags_options
Values for the SPLT_OPT_TAGS option.
Definition mp3splt.h:845
mp3splt_get_int_option
int mp3splt_get_int_option(splt_state *state, splt_options option, splt_code *error)
Returns the value of an int option from the state.
mp3splt_get_long_option
long mp3splt_get_long_option(splt_state *state, splt_options option, splt_code *error)
Returns the value of a long option from the state.
splt_str_format
splt_str_format
Values for SPLT_OPT_ARTIST_TAG_FORMAT, SPLT_OPT_ALBUM_TAG_FORMAT, SPLT_OPT_TITLE_TAG_FORMAT and SPLT_...
Definition mp3splt.h:896
splt_id3v2_encoding
splt_id3v2_encoding
Values for the SPLT_OPT_ID3V2_ENCODING.
Definition mp3splt.h:763
mp3splt_set_oformat
splt_code mp3splt_set_oformat(splt_state *state, const char *format)
Set the output format when using SPLT_OUTPUT_FORMAT.
mp3splt_set_long_option
splt_code mp3splt_set_long_option(splt_state *state, splt_options option, long value)
Sets the value of a long option in the state.
splt_split_mode_options
splt_split_mode_options
Split mode.
Definition mp3splt.h:724
splt_output_filenames_options
splt_output_filenames_options
Values for the SPLT_OPT_OUTPUT_FILENAMES option.
Definition mp3splt.h:781
mp3splt_set_int_option
splt_code mp3splt_set_int_option(splt_state *state, splt_options option, int value)
Sets the value of an int option in the state.
mp3splt_set_float_option
splt_code mp3splt_set_float_option(splt_state *state, splt_options option, float value)
Sets the value of a float option in the state.
splt_options
splt_options
Split options.
Definition mp3splt.h:312
mp3splt_get_float_option
float mp3splt_get_float_option(splt_state *state, splt_options option, splt_code *error)
Returns the value of a float option from the state.
SPLT_TAGS_FROM_FILENAME_REGEX
@ SPLT_TAGS_FROM_FILENAME_REGEX
Sets tags from filename using regular expression provided by mp3splt_set_input_filename_regex.
Definition mp3splt.h:861
SPLT_TAGS_ORIGINAL_FILE
@ SPLT_TAGS_ORIGINAL_FILE
Keep the tags of the original input file.
Definition mp3splt.h:849
SPLT_NO_TAGS
@ SPLT_NO_TAGS
Do not set any tags.
Definition mp3splt.h:857
SPLT_CURRENT_TAGS
@ SPLT_CURRENT_TAGS
Keep the tags issued from CDDB, CUE, tracktype.org or set by the user with mp3splt_append_tags.
Definition mp3splt.h:853
SPLT_TO_LOWERCASE
@ SPLT_TO_LOWERCASE
Convert all characters of the input to lowercase.
Definition mp3splt.h:904
SPLT_NO_CONVERSION
@ SPLT_NO_CONVERSION
Keep the input "as is" without further change.
Definition mp3splt.h:900
SPLT_TO_WORD_FIRST_UPPERCASE
@ SPLT_TO_WORD_FIRST_UPPERCASE
Convert the first character of each word to uppercase.
Definition mp3splt.h:916
SPLT_TO_FIRST_UPPERCASE
@ SPLT_TO_FIRST_UPPERCASE
Convert just the first character to uppercase.
Definition mp3splt.h:912
SPLT_TO_UPPERCASE
@ SPLT_TO_UPPERCASE
Convert all characters of the input to uppercase.
Definition mp3splt.h:908
SPLT_ID3V2_UTF16
@ SPLT_ID3V2_UTF16
UTF-16 encoding for ID3v2 tags.
Definition mp3splt.h:775
SPLT_ID3V2_LATIN1
@ SPLT_ID3V2_LATIN1
Latin1 (ISO-8859-1) encoding for ID3v2 tags.
Definition mp3splt.h:767
SPLT_ID3V2_UTF8
@ SPLT_ID3V2_UTF8
UTF-8 encoding for ID3v2 tags.
Definition mp3splt.h:771
SPLT_OPTION_TIME_MODE
@ SPLT_OPTION_TIME_MODE
Create an indefinite number of smaller files with a fixed time length specified by SPLT_OPT_SPLIT_TIM...
Definition mp3splt.h:753
SPLT_OPTION_TRIM_SILENCE_MODE
@ SPLT_OPTION_TRIM_SILENCE_MODE
Trim silence detection split mode.
Definition mp3splt.h:743
SPLT_OPTION_WRAP_MODE
@ SPLT_OPTION_WRAP_MODE
Wrap split mode - split the files created with mp3wrap or albumwrap.
Definition mp3splt.h:733
SPLT_OPTION_ERROR_MODE
@ SPLT_OPTION_ERROR_MODE
Synchronisation error split mode (mp3 only).
Definition mp3splt.h:748
SPLT_OPTION_NORMAL_MODE
@ SPLT_OPTION_NORMAL_MODE
Normal split mode - using splitpoints provided with mp3splt_append_splitpoint.
Definition mp3splt.h:728
SPLT_OPTION_LENGTH_MODE
@ SPLT_OPTION_LENGTH_MODE
Split in SPLT_OPT_LENGTH_SPLIT_FILE_NUMBER pieces of equal time length.
Definition mp3splt.h:757
SPLT_OPTION_SILENCE_MODE
@ SPLT_OPTION_SILENCE_MODE
Silence detection split mode.
Definition mp3splt.h:738
SPLT_OUTPUT_CUSTOM
@ SPLT_OUTPUT_CUSTOM
The names of the splitpoints provided by mp3splt_append_splitpoint are used to generate the output fi...
Definition mp3splt.h:798
SPLT_OUTPUT_DEFAULT
@ SPLT_OUTPUT_DEFAULT
The default output; depends of the type of the split.
Definition mp3splt.h:793
SPLT_OUTPUT_FORMAT
@ SPLT_OUTPUT_FORMAT
Output filename format specified by mp3splt_set_oformat.
Definition mp3splt.h:785
SPLT_OPT_FORCE_TAGS_VERSION
@ SPLT_OPT_FORCE_TAGS_VERSION
For mp3 files, tags version to be written in output files.
Definition mp3splt.h:467
SPLT_OPT_PARAM_NUMBER_TRACKS
@ SPLT_OPT_PARAM_NUMBER_TRACKS
The desired number of tracks when having a SPLT_OPTION_SILENCE_MODE split.
Definition mp3splt.h:419
SPLT_OPT_PRETEND_TO_SPLIT
@ SPLT_OPT_PRETEND_TO_SPLIT
Pretend to split the file, without actually creating output files.
Definition mp3splt.h:321
SPLT_OPT_INPUT_NOT_SEEKABLE
@ SPLT_OPT_INPUT_NOT_SEEKABLE
If the input is not seekable.
Definition mp3splt.h:410
SPLT_OPT_PARAM_MIN_TRACK_JOIN
@ SPLT_OPT_PARAM_MIN_TRACK_JOIN
Minimum number of seconds to be considered a valid track.
Definition mp3splt.h:554
SPLT_OPT_CUE_SET_SPLITPOINT_NAMES_FROM_REM_NAME
@ SPLT_OPT_CUE_SET_SPLITPOINT_NAMES_FROM_REM_NAME
When importing a cue file, use the REM NAME comment for each TRACK to set the splitpoint names instea...
Definition mp3splt.h:637
SPLT_OPT_ARTIST_TAG_FORMAT
@ SPLT_OPT_ARTIST_TAG_FORMAT
Output format of the artist extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition mp3splt.h:563
SPLT_OPT_QUIET_MODE
@ SPLT_OPT_QUIET_MODE
If quiet return less messages and don't do mp3 CRC check.
Definition mp3splt.h:329
SPLT_OPT_AUTO_ADJUST
@ SPLT_OPT_AUTO_ADJUST
If we use silence detection to auto-adjust splitpoints.
Definition mp3splt.h:400
SPLT_OPT_FRAME_MODE
@ SPLT_OPT_FRAME_MODE
For mp3 files, force to use the frame mode or not.
Definition mp3splt.h:392
SPLT_OPT_DEBUG_MODE
@ SPLT_OPT_DEBUG_MODE
If we return debug messages or not.
Definition mp3splt.h:337
SPLT_OPT_ENABLE_SILENCE_LOG
@ SPLT_OPT_ENABLE_SILENCE_LOG
Enables or disables writing the log file containing splitpoints found with silence detection.
Definition mp3splt.h:457
SPLT_OPT_STOP_IF_NO_AUTO_ADJUST_FOUND
@ SPLT_OPT_STOP_IF_NO_AUTO_ADJUST_FOUND
If SPLT_TRUE, stop with error when no auto-adjust silence is found when using the SPLT_OPT_AUTO_ADJUS...
Definition mp3splt.h:699
SPLT_OPT_DECODE_AND_WRITE_FLAC_MD5SUM_FOR_CREATED_FILES
@ SPLT_OPT_DECODE_AND_WRITE_FLAC_MD5SUM_FOR_CREATED_FILES
If SPLT_TRUE, decode flac frames before writing them in the output file and compute the md5sum to be ...
Definition mp3splt.h:709
SPLT_OPT_PARAM_OFFSET
@ SPLT_OPT_PARAM_OFFSET
Offset of cutpoint inside the silence part when having a SPLT_OPTION_SILENCE_MODE or SPLT_OPT_AUTO_AD...
Definition mp3splt.h:525
SPLT_OPT_SPLIT_TIME
@ SPLT_OPT_SPLIT_TIME
Time of the output files for the SPLT_OPTION_TIME_MODE split (in hundreths of seconds).
Definition mp3splt.h:504
SPLT_OPT_CREATE_DIRS_FROM_FILENAMES
@ SPLT_OPT_CREATE_DIRS_FROM_FILENAMES
If this option is SPLT_TRUE, we create directories from the output filenames without parsing for ille...
Definition mp3splt.h:373
SPLT_OPT_OVERLAP_TIME
@ SPLT_OPT_OVERLAP_TIME
Time to be added to each end splitpoint in order to overlap the resulting files (in hundreths of seco...
Definition mp3splt.h:495
SPLT_OPT_SET_FILE_FROM_CUE_IF_FILE_TAG_FOUND
@ SPLT_OPT_SET_FILE_FROM_CUE_IF_FILE_TAG_FOUND
When importing CUE files, sets the filename to split as the FILE CUE tag value if specified.
Definition mp3splt.h:608
SPLT_OPT_TITLE_TAG_FORMAT
@ SPLT_OPT_TITLE_TAG_FORMAT
Output format of the title extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition mp3splt.h:581
SPLT_OPT_ALBUM_TAG_FORMAT
@ SPLT_OPT_ALBUM_TAG_FORMAT
Output format of the album extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition mp3splt.h:572
SPLT_OPT_CUE_DISABLE_CUE_FILE_CREATED_MESSAGE
@ SPLT_OPT_CUE_DISABLE_CUE_FILE_CREATED_MESSAGE
Output or not a message that the CUE file has been created.
Definition mp3splt.h:645
SPLT_OPT_XING
@ SPLT_OPT_XING
For mp3 files, if we write the Xing header.
Definition mp3splt.h:361
SPLT_OPT_KEEP_SILENCE_RIGHT
@ SPLT_OPT_KEEP_SILENCE_RIGHT
When using the SPLT_OPT_PARAM_REMOVE_SILENCE, this option allows you to keep some number of seconds o...
Definition mp3splt.h:628
SPLT_OPT_ID3V2_ENCODING
@ SPLT_OPT_ID3V2_ENCODING
Defines the encoding of the ID3V2 tags.
Definition mp3splt.h:662
SPLT_OPT_TAGS
@ SPLT_OPT_TAGS
What tags to put in the output split files.
Definition mp3splt.h:353
SPLT_OPT_INPUT_TAGS_ENCODING
@ SPLT_OPT_INPUT_TAGS_ENCODING
Defines the encoding of the input tags - used only for generating ID3V2 tags.
Definition mp3splt.h:670
SPLT_OPT_KEEP_SILENCE_LEFT
@ SPLT_OPT_KEEP_SILENCE_LEFT
When using the SPLT_OPT_PARAM_REMOVE_SILENCE, this option allows you to keep some number of seconds o...
Definition mp3splt.h:618
SPLT_OPT_WARN_IF_NO_AUTO_ADJUST_FOUND
@ SPLT_OPT_WARN_IF_NO_AUTO_ADJUST_FOUND
If SPLT_TRUE, raise a warning when no auto-adjust silence is found when using the SPLT_OPT_AUTO_ADJUS...
Definition mp3splt.h:690
SPLT_OPT_SPLIT_MODE
@ SPLT_OPT_SPLIT_MODE
The type of the split.
Definition mp3splt.h:345
SPLT_OPT_PARAM_SHOTS
@ SPLT_OPT_PARAM_SHOTS
The desired number of shots when having a SPLT_OPTION_SILENCE_MODE or SPLT_OPTION_TRIM_SILENCE_MODE s...
Definition mp3splt.h:431
SPLT_OPT_REPLACE_UNDERSCORES_TAG_FORMAT
@ SPLT_OPT_REPLACE_UNDERSCORES_TAG_FORMAT
Replace underscores with space when setting tags from filename regex with SPLT_TAGS_FROM_FILENAME_REG...
Definition mp3splt.h:599
SPLT_OPT_PARAM_REMOVE_SILENCE
@ SPLT_OPT_PARAM_REMOVE_SILENCE
Used to remove silence between the split tracks when having a SPLT_OPTION_SILENCE_MODE split.
Definition mp3splt.h:439
SPLT_OPT_PARAM_MIN_TRACK_LENGTH
@ SPLT_OPT_PARAM_MIN_TRACK_LENGTH
Minimum number of seconds to be considered a valid track.
Definition mp3splt.h:543
SPLT_OPT_REPLACE_TAGS_IN_TAGS
@ SPLT_OPT_REPLACE_TAGS_IN_TAGS
Enables or disables replacing tags in tags.
Definition mp3splt.h:486
SPLT_OPT_PARAM_THRESHOLD
@ SPLT_OPT_PARAM_THRESHOLD
The threshold level (dB) to be considered as silence.
Definition mp3splt.h:515
SPLT_OPT_PARAM_MIN_LENGTH
@ SPLT_OPT_PARAM_MIN_LENGTH
Minimum number of silence seconds to be considered a valid splitpoint.
Definition mp3splt.h:534
SPLT_OPT_LENGTH_SPLIT_FILE_NUMBER
@ SPLT_OPT_LENGTH_SPLIT_FILE_NUMBER
Number of files to be created when splitting by equal time length with SPLT_OPTION_LENGTH_MODE.
Definition mp3splt.h:476
SPLT_OPT_HANDLE_BIT_RESERVOIR
@ SPLT_OPT_HANDLE_BIT_RESERVOIR
If SPLT_TRUE, handles bit-reservoir for gapless playback when splitting.
Definition mp3splt.h:718
SPLT_OPT_PARAM_GAP
@ SPLT_OPT_PARAM_GAP
The time to auto-adjust before and after splitpoint when having the SPLT_OPT_AUTO_ADJUST option.
Definition mp3splt.h:448
SPLT_OPT_COMMENT_TAG_FORMAT
@ SPLT_OPT_COMMENT_TAG_FORMAT
Output format of the comment extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition mp3splt.h:590
SPLT_OPT_CUE_CDDB_ADD_TAGS_WITH_KEEP_ORIGINAL_TAGS
@ SPLT_OPT_CUE_CDDB_ADD_TAGS_WITH_KEEP_ORIGINAL_TAGS
When adding cue or cddb tags, keep the option SPLT_TAGS_ORIGINAL.
Definition mp3splt.h:654
SPLT_OPT_TIME_MINIMUM_THEORETICAL_LENGTH
@ SPLT_OPT_TIME_MINIMUM_THEORETICAL_LENGTH
Defines the minimum theoretical time length to be created when using SPLT_OPTION_TIME_MODE.
Definition mp3splt.h:681
SPLT_OPT_OUTPUT_FILENAMES
@ SPLT_OPT_OUTPUT_FILENAMES
Defines how the output filenames are created.
Definition mp3splt.h:381
mp3splt_get_version
char * mp3splt_get_version()
Returns the version of libmp3splt.
mp3splt_check_if_directory
int mp3splt_check_if_directory(const char *filename)
Returns SPLT_TRUE if filename is a directory.
mp3splt_set_silence_points
int mp3splt_set_silence_points(splt_state *state, splt_code *error)
Scan for silence and set silence splitpoints in the state.
mp3splt_set_trim_silence_points
splt_code mp3splt_set_trim_silence_points(splt_state *state)
Scan for silence and set silence trim splitpoints in the state.
splt_plugin_func::splt_pl_import_internal_sheets
void(* splt_pl_import_internal_sheets)(splt_state *state, splt_code *error)
Import splitpoints from internal sheets.
Definition mp3splt.h:2310
splt_plugin_func::splt_pl_split
double(* 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.
Definition mp3splt.h:2224
splt_plugin_func::splt_pl_scan_silence
int(* splt_pl_scan_silence)(splt_state *state, splt_code *error)
Scan the input file for silence.
Definition mp3splt.h:2258
splt_plugin_func::splt_pl_scan_trim_silence
int(* splt_pl_scan_trim_silence)(splt_state *state, splt_code *error)
Scan the input file for trimming using silence detection.
Definition mp3splt.h:2270
splt_plugin_func::splt_pl_set_original_tags
void(* splt_pl_set_original_tags)(splt_state *state, splt_code *error)
Set the original tags into the state from the input file.
Definition mp3splt.h:2237
splt_plugin_info::upper_extension
char * upper_extension
File extension handled by the plugin as uppercase.
Definition mp3splt.h:2149
splt_plugin_func::splt_pl_end
void(* splt_pl_end)(splt_state *state, splt_code *error)
Unitialise the plugin.
Definition mp3splt.h:2191
splt_plugin_func::splt_pl_init
void(* splt_pl_init)(splt_state *state, splt_code *error)
Initialise the plugin.
Definition mp3splt.h:2182
splt_plugin_func::splt_pl_offset_split
int(* splt_pl_offset_split)(splt_state *state, const char *output_fname, off_t begin, off_t end)
Split the input filename by offsets.
Definition mp3splt.h:2291
splt_plugin_info::version
float version
Plugin version.
Definition mp3splt.h:2137
splt_plugin_func::splt_pl_search_syncerrors
void(* splt_pl_search_syncerrors)(splt_state *state, splt_code *error)
Search for synchronisation errors.
Definition mp3splt.h:2279
splt_original_tags
struct _splt_original_tags splt_original_tags
Structure containing the original tags of the input file.
Definition mp3splt.h:2155
splt_plugin_func::splt_pl_dewrap
void(* splt_pl_dewrap)(splt_state *state, int listonly, const char *dir, splt_code *error)
Unwrap the input file into the directory dir.
Definition mp3splt.h:2303
splt_plugin_func::splt_pl_check_plugin_is_for_file
int(* splt_pl_check_plugin_is_for_file)(splt_state *state, splt_code *error)
Checks if the plugin matches the input file.
Definition mp3splt.h:2201
splt_plugin_info::extension
char * extension
File extension handled by the plugin.
Definition mp3splt.h:2145
splt_plugin_info::name
char * name
Plugin name.
Definition mp3splt.h:2141
splt_plugin_func::splt_pl_clear_original_tags
void(* 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.
Definition mp3splt.h:2246
splt_plugin_func::splt_pl_set_plugin_info
void(* splt_pl_set_plugin_info)(splt_plugin_info *information, splt_code *error)
Set plugin information into the information structure.
Definition mp3splt.h:2210
mp3splt_split
splt_code mp3splt_split(splt_state *state)
Executes the main split process.
mp3splt_stop_split
splt_code mp3splt_stop_split(splt_state *state)
Stop the main split process.
mp3splt_find_filenames
char ** mp3splt_find_filenames(splt_state *state, const char *filename, int *num_of_files_found, splt_code *error)
Recursive search of all the filenames matching the loaded plugins.
mp3splt_get_splitpoints
splt_points * mp3splt_get_splitpoints(splt_state *state, splt_code *error)
Returns all the splitpoints of the state.
splt_point
struct _splt_point splt_point
Structure defining one splitpoint.
Definition mp3splt.h:1331
mp3splt_point_get_value
long mp3splt_point_get_value(const splt_point *point)
Returns the time value of the splitpoint point.
mp3splt_point_get_type
splt_type_of_splitpoint mp3splt_point_get_type(const splt_point *point)
Returns the type of the splitpoint point.
splt_type_of_splitpoint
splt_type_of_splitpoint
Type of the splitpoint.
Definition mp3splt.h:1311
mp3splt_erase_all_splitpoints
splt_code mp3splt_erase_all_splitpoints(splt_state *state)
Erase all splitpoints from the state.
mp3splt_points_next
const splt_point * mp3splt_points_next(splt_points *splitpoints)
Returns the next splitpoint from the splitpoints.
mp3splt_point_get_name
char * mp3splt_point_get_name(const splt_point *point)
Returns the name of the splitpoint point.
mp3splt_point_new
splt_point * mp3splt_point_new(long splitpoint_value, splt_code *error)
Creates a new splitpoint with the splitpoint_value.
splt_points
struct _splt_points splt_points
Structure containing several splt_point.
Definition mp3splt.h:1384
mp3splt_point_set_type
splt_code mp3splt_point_set_type(splt_point *splitpoint, splt_type_of_splitpoint type)
Sets the name on the splitpoint.
mp3splt_point_set_name
splt_code mp3splt_point_set_name(splt_point *splitpoint, const char *name)
Sets the name on the splitpoint.
mp3splt_points_init_iterator
void mp3splt_points_init_iterator(splt_points *splitpoints)
Initialisation of the iterator for use with mp3splt_points_next.
mp3splt_append_splitpoint
splt_code mp3splt_append_splitpoint(splt_state *state, splt_point *splitpoint)
Append a new splitpoint to the state.
SPLT_SKIPPOINT
@ SPLT_SKIPPOINT
Splitpoint used only to end the previous segment.
Definition mp3splt.h:1320
SPLT_SPLITPOINT
@ SPLT_SPLITPOINT
Regular splitpoint.
Definition mp3splt.h:1315
splt_state
struct _splt_state splt_state
Main structure used in libmp3splt.
Definition mp3splt.h:231
mp3splt_append_plugins_scan_dir
splt_code mp3splt_append_plugins_scan_dir(splt_state *state, const char *directory)
Appends an additional directory where plugins are searched.
mp3splt_find_plugins
splt_code mp3splt_find_plugins(splt_state *state)
Finds the plugins in the plugins directories.
mp3splt_new_state
splt_state * mp3splt_new_state(splt_code *error)
Creates a new splt_state structure.
mp3splt_free_state
splt_code mp3splt_free_state(splt_state *state)
Free the memory of the state.
mp3splt_tags_group_next
splt_tags * mp3splt_tags_group_next(splt_tags_group *tags_group)
Returns the next tags from the tags_group.
mp3splt_put_tags_from_string
int mp3splt_put_tags_from_string(splt_state *state, const char *tags, splt_code *error)
Fill the state with tags parsed from the tags string.
splt_tags
struct _splt_tags splt_tags
Structure containing the tags for one output file.
Definition mp3splt.h:1510
mp3splt_get_tags_group
splt_tags_group * mp3splt_get_tags_group(splt_state *state, splt_code *error)
Returns all the tags of the state.
SPLT_ID3V1_NUMBER_OF_GENRES
#define SPLT_ID3V1_NUMBER_OF_GENRES
Number of ID3v1 genres.
Definition mp3splt.h:1475
mp3splt_set_default_comment_tag
splt_code mp3splt_set_default_comment_tag(splt_state *state, const char *default_comment_tag)
Default comment tag when using SPLT_TAGS_FROM_FILENAME_REGEX and no comment found.
mp3splt_set_default_genre_tag
splt_code mp3splt_set_default_genre_tag(splt_state *state, const char *default_genre_tag)
Default genre tag when using SPLT_TAGS_FROM_FILENAME_REGEX and no genre found.
splt_id3v1_genres
const char splt_id3v1_genres[SPLT_ID3V1_NUMBER_OF_GENRES][25]
ID3v1 genres.
splt_tag_key
splt_tag_key
Key tags useful with mp3splt_append_tags.
Definition mp3splt.h:1485
mp3splt_append_tags
splt_code mp3splt_append_tags(splt_state *state, splt_tags *tags)
Append the tags in the state.
splt_tags_group
struct _splt_tags_group splt_tags_group
Structure containing a group of tags.
Definition mp3splt.h:1562
mp3splt_tags_set
splt_code mp3splt_tags_set(splt_tags *tags,...)
Set tags values in the tags.
mp3splt_set_input_filename_regex
splt_code mp3splt_set_input_filename_regex(splt_state *state, const char *regex)
Defines the regex that will be used for SPLT_TAGS_FROM_FILENAME_REGEX.
mp3splt_remove_tags_of_skippoints
splt_code mp3splt_remove_tags_of_skippoints(splt_state *state)
Removes all the tags of the state for the skippoints.
mp3splt_parse_filename_regex
splt_tags * mp3splt_parse_filename_regex(splt_state *state, splt_code *error)
Parse the filename provided with mp3splt_set_filename_to_split using regex provided by mp3splt_set_in...
mp3splt_tags_group_init_iterator
void mp3splt_tags_group_init_iterator(splt_tags_group *tags_group)
Initialisation of the iterator for use with mp3splt_tags_group_next.
mp3splt_tags_new
splt_tags * mp3splt_tags_new(splt_code *error)
Creates a new tags structure.
mp3splt_read_original_tags
splt_code mp3splt_read_original_tags(splt_state *state)
Parses the original tags from the input file and stores them for the future split.
mp3splt_free_one_tag
void mp3splt_free_one_tag(splt_tags *tags)
Free the memory of one splt_tags.
mp3splt_erase_all_tags
splt_code mp3splt_erase_all_tags(splt_state *state)
Erase all the tags from the state.
mp3splt_tags_get
char * mp3splt_tags_get(splt_tags *tags, splt_tag_key key)
Returns the value of key from the tags.
SPLT_TAGS_ORIGINAL
@ SPLT_TAGS_ORIGINAL
Use this to set original tags.
Definition mp3splt.h:1498
splt_one_wrap
struct _splt_one_wrap splt_one_wrap
Structure containing one wrapped file All members are private.
Definition mp3splt.h:2026
splt_wrap
struct _splt_wrap splt_wrap
Structure containg the wrapped filenames found inside the input filename.
Definition mp3splt.h:2018
mp3splt_wrap_get_wrapped_file
char * mp3splt_wrap_get_wrapped_file(const splt_one_wrap *one_wrap)
Returns the wrapped file from one_wrap.
mp3splt_wrap_next
const splt_one_wrap * mp3splt_wrap_next(splt_wrap *wrap)
Returns the next wrapped file from the wrap.
mp3splt_get_wrap_files
splt_wrap * mp3splt_get_wrap_files(splt_state *state, splt_code *error)
Returns the wrapped files found from the input filename set with mp3splt_set_filename_to_split.
mp3splt_wrap_init_iterator
void mp3splt_wrap_init_iterator(splt_wrap *wrap)
Initialisation of the iterator for use with mp3splt_wrap_next.
splt_plugin_func
Libmp3splt plugin API.
Definition mp3splt.h:2172
splt_plugin_info
Structure containing plugin information, like the version, the name and file extension.
Definition mp3splt.h:2133