libmp3splt  0.9.0
Lossless library for splitting audio formats like mp3 and ogg vorbis.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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-2013 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 
80 #ifndef MP3SPLT_MP3SPLT_H
81 
82 #include <sys/types.h>
83 
84 #include "version.h"
85 
89 #define SPLT_TRUE 1
90 
93 #define SPLT_FALSE 0
94 
106 typedef enum {
107  SPLT_OK = 0,
108 
109  SPLT_OK_SPLIT = 1,
110  SPLT_SPLITPOINT_BIGGER_THAN_LENGTH = 4,
111  SPLT_SILENCE_OK = 5,
112  SPLT_TIME_SPLIT_OK = 6,
113  SPLT_NO_SILENCE_SPLITPOINTS_FOUND = 7,
114  SPLT_OK_SPLIT_EOF = 8,
115  SPLT_LENGTH_SPLIT_OK = 9,
116  SPLT_TRIM_SILENCE_OK = 10,
117 
118  SPLT_FREEDB_OK = 100,
119  SPLT_FREEDB_FILE_OK = 101,
120  SPLT_CDDB_OK = 102,
121  SPLT_CUE_OK = 103,
122  SPLT_FREEDB_MAX_CD_REACHED = 104,
123  SPLT_AUDACITY_OK = 105,
124 
125  SPLT_DEWRAP_OK = 200,
126 
127  SPLT_SYNC_OK = 300,
128  SPLT_MIGHT_BE_VBR = 301,
129 
130  SPLT_ERR_SYNC = -300,
131  SPLT_ERR_NO_SYNC_FOUND = -301,
132  SPLT_ERR_TOO_MANY_SYNC_ERR = -302,
133 
134  SPLT_OUTPUT_FORMAT_OK = 400,
135  SPLT_OUTPUT_FORMAT_AMBIGUOUS = 401,
136 
137  SPLT_REGEX_OK = 800,
138 
139  SPLT_ERROR_SPLITPOINTS = -1,
140  SPLT_ERROR_CANNOT_OPEN_FILE = -2,
141  SPLT_ERROR_INVALID = -3,
142  SPLT_ERROR_EQUAL_SPLITPOINTS = -5,
143  SPLT_ERROR_SPLITPOINTS_NOT_IN_ORDER = -6,
144  SPLT_ERROR_NEGATIVE_SPLITPOINT = -7,
145  SPLT_ERROR_INCORRECT_PATH = -8,
146  SPLT_ERROR_INCOMPATIBLE_OPTIONS = -10,
147  SPLT_ERROR_INPUT_OUTPUT_SAME_FILE = -12,
148  SPLT_ERROR_CANNOT_ALLOCATE_MEMORY = -15,
149  SPLT_ERROR_CANNOT_OPEN_DEST_FILE = -16,
150  SPLT_ERROR_CANT_WRITE_TO_OUTPUT_FILE = -17,
151  SPLT_ERROR_WHILE_READING_FILE = -18,
152  SPLT_ERROR_SEEKING_FILE = -19,
153  SPLT_ERROR_BEGIN_OUT_OF_FILE = -20,
154  SPLT_ERROR_INEXISTENT_FILE = -21,
155  SPLT_SPLIT_CANCELLED = -22,
156  SPLT_ERROR_LIBRARY_LOCKED = -24,
157  SPLT_ERROR_STATE_NULL = -25,
158  SPLT_ERROR_NEGATIVE_TIME_SPLIT = -26,
159  SPLT_ERROR_CANNOT_CREATE_DIRECTORY = -27,
160  SPLT_ERROR_CANNOT_CLOSE_FILE = -28,
161  SPLT_ERROR_NO_PLUGIN_FOUND = -29,
162  SPLT_ERROR_CANNOT_INIT_LIBLTDL = -30,
163  SPLT_ERROR_CRC_FAILED = -31,
164  SPLT_ERROR_NO_PLUGIN_FOUND_FOR_FILE = -32,
165  SPLT_ERROR_PLUGIN_ERROR = -33,
166  SPLT_ERROR_TIME_SPLIT_VALUE_INVALID = -34,
167  SPLT_ERROR_LENGTH_SPLIT_VALUE_INVALID = -35,
168  SPLT_ERROR_CANNOT_GET_TOTAL_TIME = -36,
169  SPLT_ERROR_LIBID3 = -37,
170 
171  SPLT_FREEDB_ERROR_INITIALISE_SOCKET = -101,
172  SPLT_FREEDB_ERROR_CANNOT_GET_HOST = -102,
173  SPLT_FREEDB_ERROR_CANNOT_OPEN_SOCKET = -103,
174  SPLT_FREEDB_ERROR_CANNOT_CONNECT = -104,
175  SPLT_FREEDB_ERROR_CANNOT_SEND_MESSAGE = -105,
176  SPLT_FREEDB_ERROR_INVALID_SERVER_ANSWER = -106,
177  SPLT_FREEDB_ERROR_SITE_201 = -107,
178  SPLT_FREEDB_ERROR_SITE_200 = -108,
179  SPLT_FREEDB_ERROR_BAD_COMMUNICATION = -109,
180  SPLT_FREEDB_ERROR_GETTING_INFOS = -110,
181  SPLT_FREEDB_NO_CD_FOUND = -111,
182  SPLT_FREEDB_ERROR_CANNOT_RECV_MESSAGE = -112,
183  SPLT_INVALID_CUE_FILE = -115,
184  SPLT_INVALID_CDDB_FILE = -116,
185  SPLT_FREEDB_NO_SUCH_CD_IN_DATABASE = -118,
186  SPLT_FREEDB_ERROR_SITE = -119,
187  SPLT_FREEDB_ERROR_CANNOT_DISCONNECT = -120,
188  SPLT_FREEDB_ERROR_PROXY_NOT_SUPPORTED = -121,
189 
190  SPLT_DEWRAP_ERR_FILE_LENGTH = -200,
191  SPLT_DEWRAP_ERR_VERSION_OLD = -201,
192  SPLT_DEWRAP_ERR_NO_FILE_OR_BAD_INDEX = -202,
193  SPLT_DEWRAP_ERR_FILE_DAMAGED_INCOMPLETE = -203,
194  SPLT_DEWRAP_ERR_FILE_NOT_WRAPED_DAMAGED = -204,
195 
196  SPLT_OUTPUT_FORMAT_ERROR = -400,
197 
198  SPLT_ERROR_INEXISTENT_SPLITPOINT = -500,
199 
200  SPLT_PLUGIN_ERROR_UNSUPPORTED_FEATURE = -600,
201 
202  SPLT_INVALID_AUDACITY_FILE = -700,
203 
204  SPLT_INVALID_REGEX = -800,
205  SPLT_REGEX_NO_MATCH = -801,
206  SPLT_REGEX_UNAVAILABLE = -802,
207 } splt_code;
208 
210 
215 
223 typedef struct _splt_state splt_state;
224 
236 
246 
256 splt_code mp3splt_append_plugins_scan_dir(splt_state *state, const char *directory);
257 
268 
270 
285 char *mp3splt_get_strerror(splt_state *state, splt_code error);
286 
288 
304 typedef enum {
674 } splt_options;
675 
679 typedef enum {
714 
718 typedef enum {
732 
736 typedef enum {
755 
759 #define SPLT_DEFAULT_PARAM_THRESHOLD -48.0
760 
763 #define SPLT_DEFAULT_PARAM_OFFSET 0.8
764 
767 #define SPLT_DEFAULT_PARAM_MINIMUM_LENGTH 0.0
768 
771 #define SPLT_DEFAULT_PARAM_MINIMUM_TRACK_LENGTH 0.0
772 
775 #define SPLT_DEFAULT_PARAM_MIN_TRACK_JOIN 0.0
776 
779 #define SPLT_DEFAULT_PARAM_GAP 30
780 
783 #define SPLT_DEFAULT_PARAM_TRACKS 0
784 
787 #define SPLT_DEFAULT_PARAM_SHOTS 25
788 
791 #define SPLT_DEFAULT_KEEP_SILENCE_LEFT 0
792 
795 #define SPLT_DEFAULT_KEEP_SILENCE_RIGHT 0
796 
800 typedef enum {
818 
823 #define SPLT_DEFAULT_OUTPUT "@f_@mm_@ss_@h0h__@Mm_@Ss_@H0h"
824 
829 #define SPLT_DEFAULT_CDDB_CUE_OUTPUT "@A - @n - @t"
830 
834 #define SPLT_DEFAULT_SYNCERROR_OUTPUT "@f_error_@n"
835 
839 #define SPLT_DEFAULT_SILENCE_OUTPUT "@f_silence_@n"
840 
844 #define SPLT_DEFAULT_TRIM_SILENCE_OUTPUT "@f_trimmed"
845 
851 typedef enum {
873 
882 splt_code mp3splt_set_int_option(splt_state *state, splt_options option, int value);
883 
892 splt_code mp3splt_set_long_option(splt_state *state, splt_options option, long value);
893 
902 splt_code mp3splt_set_float_option(splt_state *state, splt_options option, float value);
903 
912 int mp3splt_get_int_option(splt_state *state, splt_options option, splt_code *error);
913 
922 long mp3splt_get_long_option(splt_state *state, splt_options option, splt_code *error);
923 
932 float mp3splt_get_float_option(splt_state *state, splt_options option, splt_code *error);
933 
941 splt_code mp3splt_set_oformat(splt_state *state, const char *format);
942 
944 
958 splt_code mp3splt_set_filename_to_split(splt_state *state, const char *filename);
959 
967 splt_code mp3splt_set_path_of_split(splt_state *state, const char *path_of_split);
968 
980 const char *mp3splt_get_filename_to_split(splt_state *state);
981 
994 splt_code mp3splt_set_m3u_filename(splt_state *state, const char *m3u_filename);
995 
1021 splt_code mp3splt_set_silence_log_filename(splt_state *state, const char *filename);
1022 
1055 splt_code mp3splt_set_silence_full_log_filename(splt_state *state, const char *filename);
1056 
1058 
1070 typedef enum {
1080 
1098  void (*message_cb)(const char *message, splt_message_type type, void *cb_data), void *cb_data);
1099 
1114  void (*file_cb)(const char *filename, void *cb_data),
1115  void *cb_data);
1116 
1138  void (*write_cb)(const void *ptr, size_t size, size_t nmemb, void *cb_data),
1139  void *cb_data);
1140 
1145 typedef enum {
1164 
1180 typedef struct splt_progres splt_progress;
1181 
1196  void (*progress_cb)(splt_progress *p_bar, void *cb_data), void *cb_data);
1197 
1201 int mp3splt_progress_get_type(const splt_progress *p_bar);
1202 
1207 
1212 
1217 
1222 
1227 
1232 
1249  void (*get_silence_cb)(long time, float level, void *user_data),
1250  void *user_data);
1251 
1253 
1264 typedef enum {
1275 
1284 typedef struct _splt_point splt_point;
1285 
1299 splt_point *mp3splt_point_new(long splitpoint_value, splt_code *error);
1300 
1308 splt_code mp3splt_point_set_name(splt_point *splitpoint, const char *name);
1309 
1318 
1329 
1337 typedef struct _splt_points splt_points;
1338 
1350 
1358 void mp3splt_points_init_iterator(splt_points *splitpoints);
1359 
1370 const splt_point *mp3splt_points_next(splt_points *splitpoints);
1371 
1380 long mp3splt_point_get_value(const splt_point *point);
1381 
1392 
1401 char *mp3splt_point_get_name(const splt_point *point);
1402 
1410 
1412 
1422 #define SPLT_UNDEFINED_GENRE "Other"
1423 
1428 #define SPLT_ID3V1_NUMBER_OF_GENRES 127
1429 
1433 extern const char splt_id3v1_genres[SPLT_ID3V1_NUMBER_OF_GENRES][25];
1434 
1438 typedef enum {
1439  SPLT_TAGS_TITLE = 1,
1440  SPLT_TAGS_ARTIST = 2,
1441  SPLT_TAGS_ALBUM = 3,
1442  SPLT_TAGS_YEAR = 4,
1443  SPLT_TAGS_COMMENT = 5,
1444  SPLT_TAGS_TRACK = 6,
1445  SPLT_TAGS_GENRE = 7,
1446  SPLT_TAGS_PERFORMER = 8,
1452 } splt_tag_key;
1453 
1463 typedef struct _splt_tags splt_tags;
1464 
1475 
1496 
1510 
1515 typedef struct _splt_tags_group splt_tags_group;
1516 
1528 
1536 
1545 
1555 
1559 char *mp3splt_tags_get(splt_tags *tags, splt_tag_key key);
1560 
1589 int mp3splt_put_tags_from_string(splt_state *state, const char *tags, splt_code *error);
1590 
1600 
1608 
1622 splt_code mp3splt_set_input_filename_regex(splt_state *state, const char *regex);
1623 
1633 splt_code mp3splt_set_default_comment_tag(splt_state *state, const char *default_comment_tag);
1634 
1644 splt_code mp3splt_set_default_genre_tag(splt_state *state, const char *default_genre_tag);
1645 
1659 
1667 void mp3splt_free_one_tag(splt_tags *tags);
1668 
1670 
1690 
1700 
1712 char **mp3splt_find_filenames(splt_state *state, const char *filename,
1713  int *num_of_files_found, splt_code *error);
1714 
1716 
1728 typedef enum {
1729  CUE_IMPORT,
1730  CDDB_IMPORT,
1731  AUDACITY_LABELS_IMPORT
1733 
1744 splt_code mp3splt_import(splt_state *state, splt_import_type type, const char *file);
1745 
1751 #define SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI 1
1752 
1758 #define SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI 3
1759 
1765 #define SPLT_FREEDB_GET_FILE_TYPE_CDDB 4
1766 
1773 #define SPLT_FREEDB_CDDB_CGI_PORT 80
1774 
1782 #define SPLT_FREEDB2_CGI_SITE "tracktype.org/~cddb/cddb.cgi"
1783 
1792 typedef struct _splt_freedb_results splt_freedb_results;
1793 
1801 typedef struct _splt_freedb_one_result splt_freedb_one_result;
1802 
1811 splt_code mp3splt_use_proxy(splt_state *state, const char *proxy_address, int proxy_port);
1812 
1825  const char *base64_authentification);
1826 
1837 char *mp3splt_encode_in_base64(splt_state *state, const char *input, int *error);
1838 
1845 void mp3splt_clear_proxy(splt_state *state);
1846 
1864  const char *searched_string, splt_code *error,
1865  int search_type, const char *search_server, int port);
1866 
1875 
1887 
1893 
1897 const char *mp3splt_freedb_get_name(const splt_freedb_one_result *result);
1898 
1903 
1921  int disc_id, const char *output_file,
1922  int cddb_get_type, const char *cddb_get_server, int port);
1923 
1925 
1937 typedef enum {
1938  CUE_EXPORT
1940 
1952  const char *file, int stop_at_total_time);
1953 
1955 
1970 typedef struct _splt_wrap splt_wrap;
1971 
1978 typedef struct _splt_one_wrap splt_one_wrap;
1979 
1992 
2001 
2011 
2015 char *mp3splt_wrap_get_wrapped_file(const splt_one_wrap *one_wrap);
2016 
2018 
2032 int mp3splt_set_silence_points(splt_state *state, splt_code *error);
2033 
2041 
2045 char *mp3splt_get_version();
2046 
2047 #ifdef __WIN32__
2048 
2051 char *mp3splt_win32_utf16_to_utf8(const wchar_t *source);
2052 #endif
2053 
2057 int mp3splt_check_if_directory(const char *filename);
2058 
2059 #ifndef SPLT_DIRCHAR
2060 #ifdef __WIN32__
2061 #define SPLT_DIRCHAR '\\'
2062 #define SPLT_DIRSTR "\\"
2063 #else
2064 
2067 #define SPLT_DIRCHAR '/'
2068 
2071 #define SPLT_DIRSTR "/"
2072 #endif
2073 #endif
2074 
2076 
2085 typedef struct {
2089  float version;
2093  char *name;
2097  char *extension;
2103 
2107 typedef struct _splt_original_tags splt_original_tags;
2108 
2123 typedef struct {
2133  void (*splt_pl_init)(splt_state *state, splt_code *error);
2142  void (*splt_pl_end)(splt_state *state, splt_code *error);
2152  int (*splt_pl_check_plugin_is_for_file)(splt_state *state, splt_code *error);
2161  void (*splt_pl_set_plugin_info)(splt_plugin_info *information, splt_code *error);
2175  double (*splt_pl_split)(splt_state *state, const char *final_fname, double begin_point,
2176  double end_point, splt_code *error, int save_end_point);
2188  void (*splt_pl_set_original_tags)(splt_state *state, splt_code *error);
2197  void (*splt_pl_clear_original_tags)(splt_original_tags *original_tags);
2209  int (*splt_pl_scan_silence)(splt_state *state, splt_code *error);
2221  int (*splt_pl_scan_trim_silence)(splt_state *state, splt_code *error);
2230  void (*splt_pl_search_syncerrors)(splt_state *state, splt_code *error);
2242  int (*splt_pl_offset_split)(splt_state *state, const char *output_fname, off_t begin, off_t end);
2254  void (*splt_pl_dewrap)(splt_state *state, int listonly, const char *dir, splt_code *error);
2256 
2258 
2262 #define MP3SPLT_MP3SPLT_H
2263 #endif
2264 
struct _splt_wrap splt_wrap
Structure containg the wrapped filenames found inside the input filename.
Definition: mp3splt.h:1970
splt_code mp3splt_stop_split(splt_state *state)
Stop the main split process.
Structure containing plugin information, like the version, the name and file extension.
Definition: mp3splt.h:2085
Pretend to split the file, without actually creating output files.
Definition: mp3splt.h:313
int mp3splt_get_int_option(splt_state *state, splt_options option, splt_code *error)
Returns the value of an int option from the state.
const splt_freedb_one_result * mp3splt_freedb_next(splt_freedb_results *freedb_results)
Returns the next freedb result from the freedb_results.
Keep the tags issued from CDDB, CUE, tracktype.org or set by the user with mp3splt_append_tags.
Definition: mp3splt.h:808
char * mp3splt_get_strerror(splt_state *state, splt_code error)
Returns the error message of the error.
splt_code mp3splt_find_plugins(splt_state *state)
Finds the plugins in the plugins directories.
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.
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.
float version
Plugin version.
Definition: mp3splt.h:2089
char * mp3splt_encode_in_base64(splt_state *state, const char *input, int *error)
Encode the input in base64.
const splt_one_wrap * mp3splt_wrap_next(splt_wrap *wrap)
Returns the next wrapped file from the wrap.
Keep the input &quot;as is&quot; without further change.
Definition: mp3splt.h:855
char * upper_extension
File extension handled by the plugin as uppercase.
Definition: mp3splt.h:2101
Number of files to be created when splitting by equal time length with SPLT_OPTION_LENGTH_MODE.
Definition: mp3splt.h:468
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_tags * mp3splt_tags_new(splt_code *error)
Creates a new tags structure.
splt_code mp3splt_use_proxy(splt_state *state, const char *proxy_address, int proxy_port)
Use proxy when accessing the internet.
Info message.
Definition: mp3splt.h:1074
The default output; depends of the type of the split.
Definition: mp3splt.h:748
UTF-16 encoding for ID3v2 tags.
Definition: mp3splt.h:730
Do not set any tags.
Definition: mp3splt.h:812
float mp3splt_progress_get_silence_db_level(const splt_progress *p_bar)
int mp3splt_progress_get_max_splits(const splt_progress *p_bar)
struct _splt_point splt_point
Structure defining one splitpoint.
Definition: mp3splt.h:1284
Convert all characters of the input to uppercase.
Definition: mp3splt.h:863
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.
The time to auto-adjust before and after splitpoint when having the SPLT_OPT_AUTO_ADJUST option...
Definition: mp3splt.h:440
splt_code mp3splt_remove_tags_of_skippoints(splt_state *state)
Removes all the tags of the state for the skippoints.
struct splt_progres splt_progress
Structure containing all information needed to display a progress bar.
Definition: mp3splt.h:1180
Minimum number of silence seconds to be considered a valid splitpoint.
Definition: mp3splt.h:526
splt_output_filenames_options
Values for the SPLT_OPT_OUTPUT_FILENAMES option.
Definition: mp3splt.h:736
Output or not a message that the CUE file has been created.
Definition: mp3splt.h:637
Defines the encoding of the input tags - used only for generating ID3V2 tags.
Definition: mp3splt.h:662
Trim silence detection split mode.
Definition: mp3splt.h:698
splt_tags_group * mp3splt_get_tags_group(splt_state *state, splt_code *error)
Returns all the tags of the state.
splt_code mp3splt_use_base64_authentification(splt_state *state, const char *base64_authentification)
Use proxy with base64 authentification.
splt_code mp3splt_free_state(splt_state *state)
Free the memory of the state.
Splitpoint used only to end the previous segment.
Definition: mp3splt.h:1273
splt_points * mp3splt_get_splitpoints(splt_state *state, splt_code *error)
Returns all the splitpoints of the state.
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...
int mp3splt_progress_get_silence_found_tracks(const splt_progress *p_bar)
Normal split mode - using splitpoints provided with mp3splt_append_splitpoint.
Definition: mp3splt.h:683
Replace underscores with space when setting tags from filename regex with SPLT_TAGS_FROM_FILENAME_REG...
Definition: mp3splt.h:591
Output format of the artist extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition: mp3splt.h:555
int mp3splt_freedb_get_id(const splt_freedb_one_result *result)
Returns the ID of the result.
int mp3splt_freedb_get_number_of_revisions(const splt_freedb_one_result *result)
Returns the number of revisions of the result.
Wrap split mode - split the files created with mp3wrap or albumwrap.
Definition: mp3splt.h:688
Convert the first character of each word to uppercase.
Definition: mp3splt.h:871
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.
const splt_point * mp3splt_points_next(splt_points *splitpoints)
Returns the next splitpoint from the splitpoints.
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.
int mp3splt_set_silence_points(splt_state *state, splt_code *error)
Scan for silence and set silence splitpoints in the state.
splt_export_type
Type of the export.
Definition: mp3splt.h:1937
struct _splt_tags splt_tags
Structure containing the tags for one output file.
Definition: mp3splt.h:1463
Synchronisation error split mode (mp3 only).
Definition: mp3splt.h:703
splt_code mp3splt_append_plugins_scan_dir(splt_state *state, const char *directory)
Appends an additional directory where plugins are searched.
The type of the split.
Definition: mp3splt.h:337
Defines the encoding of the ID3V2 tags.
Definition: mp3splt.h:654
UTF-8 encoding for ID3v2 tags.
Definition: mp3splt.h:726
void mp3splt_free_one_tag(splt_tags *tags)
Free the memory of one splt_tags.
Minimum number of seconds to be considered a valid track.
Definition: mp3splt.h:535
#define SPLT_ID3V1_NUMBER_OF_GENRES
Number of ID3v1 genres.
Definition: mp3splt.h:1428
If we return debug messages or not.
Definition: mp3splt.h:329
Output format of the comment extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition: mp3splt.h:582
Enables or disables replacing tags in tags.
Definition: mp3splt.h:478
Defines how the output filenames are created.
Definition: mp3splt.h:373
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.
For mp3 files, if we write the Xing header.
Definition: mp3splt.h:353
splt_point * mp3splt_point_new(long splitpoint_value, splt_code *error)
Creates a new splitpoint with the splitpoint_value.
char * mp3splt_get_version()
Returns the version of libmp3splt.
splt_code mp3splt_set_filename_to_split(splt_state *state, const char *filename)
Sets the input filename to split.
splt_code mp3splt_split(splt_state *state)
Executes the main split process.
splt_split_mode_options
Split mode.
Definition: mp3splt.h:679
char * mp3splt_progress_get_filename_shorted(const splt_progress *p_bar)
struct _splt_points splt_points
Structure containing several splt_point.
Definition: mp3splt.h:1337
The desired number of shots when having a SPLT_OPTION_SILENCE_MODE or SPLT_OPTION_TRIM_SILENCE_MODE s...
Definition: mp3splt.h:423
Create an indefinite number of smaller files with a fixed time length specified by SPLT_OPT_SPLIT_TIM...
Definition: mp3splt.h:708
char * mp3splt_point_get_name(const splt_point *point)
Returns the name of the splitpoint point.
char * extension
File extension handled by the plugin.
Definition: mp3splt.h:2097
Searching for synchronisation errors - when using SPLT_OPTION_ERROR_MODE.
Definition: mp3splt.h:1157
splt_message_type
Type of the message sent to the client.
Definition: mp3splt.h:1070
The threshold level (dB) to be considered as silence.
Definition: mp3splt.h:507
Silence detection split mode.
Definition: mp3splt.h:693
char * name
Plugin name.
Definition: mp3splt.h:2093
splt_progress_messages
Type of messages sent to the client using the callback registered with mp3splt_set_progress_function...
Definition: mp3splt.h:1145
float mp3splt_get_float_option(splt_state *state, splt_options option, splt_code *error)
Returns the value of a float option from the state.
Keep the tags of the original input file.
Definition: mp3splt.h:804
When importing a cue file, use the REM NAME comment for each TRACK to set the splitpoint names instea...
Definition: mp3splt.h:629
When adding cue or cddb tags, keep the option SPLT_TAGS_ORIGINAL.
Definition: mp3splt.h:646
void mp3splt_points_init_iterator(splt_points *splitpoints)
Initialisation of the iterator for use with mp3splt_points_next.
const char * mp3splt_freedb_get_name(const splt_freedb_one_result *result)
Returns the name of the result.
splt_code mp3splt_set_oformat(splt_state *state, const char *format)
Set the output format when using SPLT_OUTPUT_FORMAT.
int mp3splt_check_if_directory(const char *filename)
Returns SPLT_TRUE if filename is a directory.
splt_code mp3splt_append_splitpoint(splt_state *state, splt_point *splitpoint)
Append a new splitpoint to the state.
splt_tags_options
Values for the SPLT_OPT_TAGS option.
Definition: mp3splt.h:800
The desired number of tracks when having a SPLT_OPTION_SILENCE_MODE split.
Definition: mp3splt.h:411
Offset of cutpoint inside the silence part when having a SPLT_OPTION_SILENCE_MODE or SPLT_OPT_AUTO_AD...
Definition: mp3splt.h:517
For mp3 files, force to use the frame mode or not.
Definition: mp3splt.h:384
splt_code mp3splt_erase_all_tags(splt_state *state)
Erase all the tags from the state.
Use this to set original tags.
Definition: mp3splt.h:1451
Debug message.
Definition: mp3splt.h:1078
float mp3splt_progress_get_percent_progress(const splt_progress *p_bar)
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
Split options.
Definition: mp3splt.h:304
splt_tag_key
Key tags useful with mp3splt_append_tags.
Definition: mp3splt.h:1438
If quiet return less messages and don&#39;t do mp3 CRC check.
Definition: mp3splt.h:321
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.
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.
For mp3 files, tags version to be written in output files.
Definition: mp3splt.h:459
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.
Output format of the title extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition: mp3splt.h:573
char * mp3splt_wrap_get_wrapped_file(const splt_one_wrap *one_wrap)
Returns the wrapped file from one_wrap.
long mp3splt_point_get_value(const splt_point *point)
Returns the time value of the splitpoint point.
splt_import_type
Type of the import.
Definition: mp3splt.h:1728
const char * mp3splt_get_filename_to_split(splt_state *state)
Returns the filename to be split from the state.
struct _splt_freedb_results splt_freedb_results
Structure containing the freedb search results.
Definition: mp3splt.h:1792
splt_code mp3splt_tags_set(splt_tags *tags,...)
Set tags values in the tags.
struct _splt_original_tags splt_original_tags
Structure containing the original tags of the input file.
Definition: mp3splt.h:2107
If this option is SPLT_TRUE, we create directories from the output filenames without parsing for ille...
Definition: mp3splt.h:365
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.
When using the SPLT_OPT_PARAM_REMOVE_SILENCE, this option allows you to keep some number of seconds o...
Definition: mp3splt.h:620
splt_state * mp3splt_new_state(splt_code *error)
Creates a new splt_state structure.
If we use silence detection to auto-adjust splitpoints.
Definition: mp3splt.h:392
splt_code mp3splt_read_original_tags(splt_state *state)
Parses the original tags from the input file and stores them for the future split.
splt_tags * mp3splt_tags_group_next(splt_tags_group *tags_group)
Returns the next tags from the tags_group.
Libmp3splt plugin API.
Definition: mp3splt.h:2123
The names of the splitpoints provided by mp3splt_append_splitpoint are used to generate the output fi...
Definition: mp3splt.h:753
splt_type_of_splitpoint mp3splt_point_get_type(const splt_point *point)
Returns the type of the splitpoint point.
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_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.
splt_code mp3splt_point_set_name(splt_point *splitpoint, const char *name)
Sets the name on the splitpoint.
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.
int mp3splt_progress_get_type(const splt_progress *p_bar)
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.
Creating the output file.
Definition: mp3splt.h:1153
Used to remove silence between the split tracks when having a SPLT_OPTION_SILENCE_MODE split...
Definition: mp3splt.h:431
Defines the minimum theoretical time length to be created when using SPLT_OPTION_TIME_MODE.
Definition: mp3splt.h:673
What tags to put in the output split files.
Definition: mp3splt.h:345
struct _splt_one_wrap splt_one_wrap
Structure containing one wrapped file All members are private.
Definition: mp3splt.h:1978
struct _splt_freedb_one_result splt_freedb_one_result
Structure containing only one freedb result.
Definition: mp3splt.h:1801
Convert all characters of the input to lowercase.
Definition: mp3splt.h:859
Convert just the first character to uppercase.
Definition: mp3splt.h:867
Split in SPLT_OPT_LENGTH_SPLIT_FILE_NUMBER pieces of equal time length.
Definition: mp3splt.h:712
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_code mp3splt_append_tags(splt_state *state, splt_tags *tags)
Append the tags in the state.
Preparing to split a song.
Definition: mp3splt.h:1149
splt_code mp3splt_point_set_type(splt_point *splitpoint, splt_type_of_splitpoint type)
Sets the name on the splitpoint.
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.
Latin1 (ISO-8859-1) encoding for ID3v2 tags.
Definition: mp3splt.h:722
Minimum number of seconds to be considered a valid track.
Definition: mp3splt.h:546
void mp3splt_tags_group_init_iterator(splt_tags_group *tags_group)
Initialisation of the iterator for use with mp3splt_tags_group_next.
splt_code mp3splt_erase_all_splitpoints(splt_state *state)
Erase all splitpoints from the state.
Time to be added to each end splitpoint in order to overlap the resulting files (in hundreths of seco...
Definition: mp3splt.h:487
Time of the output files for the SPLT_OPTION_TIME_MODE split (in hundreths of seconds).
Definition: mp3splt.h:496
int mp3splt_progress_get_current_split(const splt_progress *p_bar)
char * mp3splt_tags_get(splt_tags *tags, splt_tag_key key)
Returns the value of key from the tags.
struct _splt_tags_group splt_tags_group
Structure containing a group of tags.
Definition: mp3splt.h:1515
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.
void mp3splt_freedb_init_iterator(splt_freedb_results *freedb_results)
Initialisation of the iterator for use with mp3splt_freedb_next.
When importing CUE files, sets the filename to split as the FILE CUE tag value if specified...
Definition: mp3splt.h:600
struct _splt_state splt_state
Main structure used in libmp3splt.
Definition: mp3splt.h:223
void mp3splt_clear_proxy(splt_state *state)
Clears the proxy data from the state.
splt_code mp3splt_set_int_option(splt_state *state, splt_options option, int value)
Sets the value of an int option in the state.
splt_code mp3splt_set_long_option(splt_state *state, splt_options option, long value)
Sets the value of a long option in the state.
When using the SPLT_OPT_PARAM_REMOVE_SILENCE, this option allows you to keep some number of seconds o...
Definition: mp3splt.h:610
void mp3splt_wrap_init_iterator(splt_wrap *wrap)
Initialisation of the iterator for use with mp3splt_wrap_next.
Sets tags from filename using regular expression provided by mp3splt_set_input_filename_regex.
Definition: mp3splt.h:816
splt_id3v2_encoding
Values for the SPLT_OPT_ID3V2_ENCODING.
Definition: mp3splt.h:718
const char splt_id3v1_genres[SPLT_ID3V1_NUMBER_OF_GENRES][25]
ID3v1 genres.
splt_code
Confirmation and error codes.
Definition: mp3splt.h:106
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.
splt_type_of_splitpoint
Type of the splitpoint.
Definition: mp3splt.h:1264
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.
If the input is not seekable.
Definition: mp3splt.h:402
Enables or disables writing the log file containing splitpoints found with silence detection...
Definition: mp3splt.h:449
splt_code mp3splt_set_trim_silence_points(splt_state *state)
Scan for silence and set silence trim splitpoints in the state.
Regular splitpoint.
Definition: mp3splt.h:1268
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:851
Output filename format specified by mp3splt_set_oformat.
Definition: mp3splt.h:740
Scanning for silence - when using SPLT_OPTION_SILENCE_MODE, SPLT_OPT_AUTO_ADJUST, mp3splt_set_silence...
Definition: mp3splt.h:1162
Output format of the album extracted from filename when using SPLT_TAGS_FROM_FILENAME_REGEX.
Definition: mp3splt.h:564