mp3splt-gtk
mp3splt.h
Go to the documentation of this file.
1 /**********************************************************
2  *
3  * libmp3splt -- library based on mp3splt,
4  * for mp3/ogg splitting without decoding
5  *
6  * Copyright (c) 2002-2005 M. Trotta - <mtrotta@users.sourceforge.net>
7  * Copyright (c) 2005-2012 Alexandru Munteanu - io_fx@yahoo.fr
8  *
9  * http://mp3splt.sourceforge.net
10  *
11  *********************************************************/
12 
13 /**********************************************************
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28  * 02111-1307,
29  * USA.
30  *
31  *********************************************************/
32 
33 #ifndef MP3SPLT_MP3SPLT_H
34 
35 #include <sys/types.h>
36 #include <stdlib.h>
37 #include <stdio.h>
38 
39 //libtool 1.4e is buggy on mingw if we include ltdl.h
40 #ifndef __WIN32__
41 #include <ltdl.h>
42 #endif
43 
59 #define SPLT_TRUE 1
60 
63 #define SPLT_FALSE 0
64 
65 /******************************/
66 /* Structures for the freedb */
67 
74 typedef struct {
78  char *name;
82  int id;
96  int *revisions;
98 
105 typedef struct {
113  int number;
115 
119 #define SPLT_MAXCD 512
120 
121 //maximum length of the disc id
122 #define SPLT_DISCIDLEN 8
123 
124 //structure for the freedb search
125 struct splt_cd {
126  char discid[SPLT_DISCIDLEN+1];
127  char category[20];
128 };
129 
130 typedef struct {
131  struct splt_cd discs[SPLT_MAXCD];
132  int foundcd;
133 } splt_cd_state;
134 
135 //structure containing everything used for the
136 //freedb search
137 typedef struct {
138  //we stock here the results of the freedb search
139  splt_freedb_results *search_results;
140  //we stock the state of the CD
141  //(for the freedb search)
142  splt_cd_state *cdstate;
143 } splt_freedb;
144 
145 /******************************/
146 /* Structures for the wrap */
147 
153 typedef struct {
161  char **wrap_files;
162 } splt_wrap;
163 
164 /************************************/
165 /* Structures for the syncerrors */
166 
172 typedef struct {
173  off_t *serrors_points;
179 
180 /***************************************/
181 /* Structures for the output format */
182 
183 #define SPLT_MAXOLEN 255
184 #define SPLT_OUTNUM 20
185 
186 //structure defining the output format
187 typedef struct {
188  //format as @n_@t.. as a string
189  char *format_string;
190  //when we have @n option on output format
191  char output_format_digits;
192  int output_alpha_format_digits;
193  //format for the cddb cue output
194  char format[SPLT_OUTNUM+1][SPLT_MAXOLEN];
195 } splt_oformat;
196 
197 /***************************/
198 /* Structures for the tags */
199 
209 typedef struct {
213  char *title;
217  char *artist;
221  char *album;
229  char *performer;
233  char *year;
237  char *comment;
241  int track;
245  char *genre;
246 
247  /*
248  * @brief tags version (for mp3): 1 or 2 or 1 & 2
249  */
250  int tags_version;
251 
252  int set_original_tags;
253 } splt_tags;
254 
255 typedef struct {
256  splt_tags tags;
257  void *all_original_tags;
258  int last_plugin_used;
260 
267 typedef struct {
271  long value;
275  char *name;
280  int type;
281 } splt_point;
282 
283 /*****************************/
284 /* Structure for the silence */
285 
286 struct splt_ssplit {
287  double begin_position;
288  double end_position;
289  long len;
290  struct splt_ssplit *next;
291 };
292 
293 /**********************************/
294 /* Structure for the split */
295 
305 typedef struct splt_progres {
312  char filename_shorted[512];
338  void (*progress)(struct splt_progres*, void *);
339  void *progress_cb_data;
340 } splt_progress;
341 
343 typedef struct {
347  char hostname[256];
349  int port;
353  char user[256];
355  char password[256];
356 } splt_proxy;
357 
359 typedef enum {
369 
371 typedef struct {
397  void (*file_split)(const char *,int, void *);
398  void *file_split_cb_data;
399 
403  void (*get_silence_level)(long time, float level, void *user_data);
407  void (*put_message)(const char *, splt_message_type, void *);
408  void *put_message_cb_data;
415  splt_tags tags_like_x;
416 } splt_struct;
417 
418 /**********************************/
419 /* Options structure */
420 
426 typedef enum {
460 
466 typedef enum {
478 
482 #define SPLT_DEFAULT_PARAM_THRESHOLD -48.0
483 
486 #define SPLT_DEFAULT_PARAM_OFFSET 0.8
487 
490 #define SPLT_DEFAULT_PARAM_MINIMUM_LENGTH 0.0
491 
494 #define SPLT_DEFAULT_PARAM_MINIMUM_TRACK_LENGTH 0.0
495 
498 #define SPLT_DEFAULT_PARAM_MIN_TRACK_JOIN 0.0
499 
502 #define SPLT_DEFAULT_PARAM_GAP 30
503 
506 #define SPLT_DEFAULT_PARAM_TRACKS 0
507 
510 #define SPLT_DEFAULT_PARAM_SHOTS 25
511 
517 typedef enum {
537 
538 #define SPLT_ORIGINAL_TAGS_DEFAULT "%[@o,@N=1]"
539 
540 #define SPLT_DEFAULT_OUTPUT "@f_@mm_@ss_@hh__@Mm_@Ss_@Hh"
541 
546 #define SPLT_DEFAULT_CDDB_CUE_OUTPUT "@A - @n - @t"
547 
551 #define SPLT_DEFAULT_SYNCERROR_OUTPUT "@f_error_@n"
552 
556 #define SPLT_DEFAULT_SILENCE_OUTPUT "@f_silence_@n"
557 
561 #define SPLT_DEFAULT_TRIM_SILENCE_OUTPUT "@f_trimmed"
562 
564 typedef struct {
574 
583 
584  int xing;
585 
588 
591 
597 
605  float split_time;
606  long overlap_time;
618 
626 
627  //PARAMETERS---------------------------------------
628  //PARAMETERS for option_auto_adjust and option_silence_mode:
642 
643  //PARAMETERS for option_silence_mode:
669 
676 
685 
688 
691 
694 
695  //PARAMETERS for option_auto_adjust:
703 
709 
712 
717 
729  int replace_tags_in_tags;
730 } splt_options;
731 
732 /**********************************/
733 /* Main structure */
734 
735 //internal structures
736 typedef struct
737 {
748 } splt_internal;
749 
754 typedef struct
755 {
756  float version;
757  char *name;
758  char *extension;
759  char *upper_extension;
761 
763 typedef struct {
764  int (*check_plugin_is_for_file)(void *state, int *error);
765  void (*set_plugin_info)(splt_plugin_info *info, int *error);
766  void (*search_syncerrors)(void *state, int *error);
767  void (*dewrap)(void *state, int listonly, const char *dir, int *error);
768  void (*set_total_time)(void *state, int *error);
769  int (*simple_split)(void *state, const char *output_fname, off_t begin, off_t end);
770  double (*split)(void *state, const char *final_fname, double begin_point,
771  double end_point, int *error, int save_end_point);
772  int (*scan_silence)(void *state, int *error);
773  int (*scan_trim_silence)(void *state, int *error);
774  void (*set_original_tags)(void *state, int *error);
775  void (*clear_original_tags)(splt_original_tags *original_tags);
776  void (*init)(void *state, int *error);
777  void (*end)(void *state, int *error);
779 
781 typedef struct
782 {
783  splt_plugin_info info;
791 
793 typedef struct
794 {
797  int number_of_dirs_to_scan;
802 } splt_plugins;
803 
805 typedef struct
806 {
807  char *error_data;
808  char *strerror_msg;
809 } splt_error;
810 
812 typedef struct {
813 
820 
821  //if this is non null, we write a m3u from the split files
822  char *m3u_filename;
823 
826 
827  char *default_comment_tag;
828  char *default_genre_tag;
829 
832 
849  unsigned long syncerrors;
852 
855 
858 
859  //proxy infos
860  //splt_proxy proxy;
861 
863  void *codec;
864 
867 
870  int current_plugin;
871 
874 } splt_state;
875 
876 /*****************************************/
877 /* Confirmations, errors and messages */
878 
880 typedef enum {
881  SPLT_OK = 0,
882 
883  SPLT_OK_SPLIT = 1,
884  SPLT_SPLITPOINT_BIGGER_THAN_LENGTH = 4,
885  SPLT_SILENCE_OK = 5,
886  SPLT_TIME_SPLIT_OK = 6,
887  SPLT_NO_SILENCE_SPLITPOINTS_FOUND = 7,
888  SPLT_OK_SPLIT_EOF = 8,
889  SPLT_LENGTH_SPLIT_OK = 9,
890  SPLT_TRIM_SILENCE_OK = 10,
891 
892  SPLT_FREEDB_OK = 100,
893  SPLT_FREEDB_FILE_OK = 101,
894  SPLT_CDDB_OK = 102,
895  SPLT_CUE_OK = 103,
896  SPLT_FREEDB_MAX_CD_REACHED = 104,
897  SPLT_AUDACITY_OK = 105,
898 
899  SPLT_DEWRAP_OK = 200,
900 
901  SPLT_SYNC_OK = 300,
902  SPLT_MIGHT_BE_VBR = 301,
903 
904  SPLT_ERR_SYNC = -300,
905  SPLT_ERR_NO_SYNC_FOUND = -301,
906  SPLT_ERR_TOO_MANY_SYNC_ERR = -302,
907 
908  SPLT_OUTPUT_FORMAT_OK = 400,
909  SPLT_OUTPUT_FORMAT_AMBIGUOUS = 401,
910 
911  SPLT_REGEX_OK = 800,
912 
913  SPLT_ERROR_SPLITPOINTS = -1,
914  SPLT_ERROR_CANNOT_OPEN_FILE = -2,
915  SPLT_ERROR_INVALID = -3,
916  SPLT_ERROR_EQUAL_SPLITPOINTS = -5,
917  SPLT_ERROR_SPLITPOINTS_NOT_IN_ORDER = -6,
918  SPLT_ERROR_NEGATIVE_SPLITPOINT = -7,
919  SPLT_ERROR_INCORRECT_PATH = -8,
920  SPLT_ERROR_INCOMPATIBLE_OPTIONS = -10,
921  SPLT_ERROR_INPUT_OUTPUT_SAME_FILE = -12,
922  SPLT_ERROR_CANNOT_ALLOCATE_MEMORY = -15,
923  SPLT_ERROR_CANNOT_OPEN_DEST_FILE = -16,
924  SPLT_ERROR_CANT_WRITE_TO_OUTPUT_FILE = -17,
925  SPLT_ERROR_WHILE_READING_FILE = -18,
926  SPLT_ERROR_SEEKING_FILE = -19,
927  SPLT_ERROR_BEGIN_OUT_OF_FILE = -20,
928  SPLT_ERROR_INEXISTENT_FILE = -21,
929  SPLT_SPLIT_CANCELLED = -22,
930  SPLT_ERROR_LIBRARY_LOCKED = -24,
931  SPLT_ERROR_STATE_NULL = -25,
932  SPLT_ERROR_NEGATIVE_TIME_SPLIT = -26,
933  SPLT_ERROR_CANNOT_CREATE_DIRECTORY = -27,
934  SPLT_ERROR_CANNOT_CLOSE_FILE = -28,
935  SPLT_ERROR_NO_PLUGIN_FOUND = -29,
936  SPLT_ERROR_CANNOT_INIT_LIBLTDL = -30,
937  SPLT_ERROR_CRC_FAILED = -31,
938  SPLT_ERROR_NO_PLUGIN_FOUND_FOR_FILE = -32,
939  SPLT_ERROR_PLUGIN_ERROR = -33,
940  SPLT_ERROR_TIME_SPLIT_VALUE_INVALID = -34,
941  SPLT_ERROR_LENGTH_SPLIT_VALUE_INVALID = -35,
942  SPLT_ERROR_CANNOT_GET_TOTAL_TIME = -36,
943  SPLT_ERROR_LIBID3 = -37,
944 
945  SPLT_FREEDB_ERROR_INITIALISE_SOCKET = -101,
946  SPLT_FREEDB_ERROR_CANNOT_GET_HOST = -102,
947  SPLT_FREEDB_ERROR_CANNOT_OPEN_SOCKET = -103,
948  SPLT_FREEDB_ERROR_CANNOT_CONNECT = -104,
949  SPLT_FREEDB_ERROR_CANNOT_SEND_MESSAGE = -105,
950  SPLT_FREEDB_ERROR_INVALID_SERVER_ANSWER = -106,
951  SPLT_FREEDB_ERROR_SITE_201 = -107,
952  SPLT_FREEDB_ERROR_SITE_200 = -108,
953  SPLT_FREEDB_ERROR_BAD_COMMUNICATION = -109,
954  SPLT_FREEDB_ERROR_GETTING_INFOS = -110,
955  SPLT_FREEDB_NO_CD_FOUND = -111,
956  SPLT_FREEDB_ERROR_CANNOT_RECV_MESSAGE = -112,
957  SPLT_INVALID_CUE_FILE = -115,
958  SPLT_INVALID_CDDB_FILE = -116,
959  SPLT_FREEDB_NO_SUCH_CD_IN_DATABASE = -118,
960  SPLT_FREEDB_ERROR_SITE = -119,
961  SPLT_FREEDB_ERROR_CANNOT_DISCONNECT = -120,
962 
963  SPLT_DEWRAP_ERR_FILE_LENGTH = -200,
964  SPLT_DEWRAP_ERR_VERSION_OLD = -201,
965  SPLT_DEWRAP_ERR_NO_FILE_OR_BAD_INDEX = -202,
966  SPLT_DEWRAP_ERR_FILE_DAMAGED_INCOMPLETE = -203,
967  SPLT_DEWRAP_ERR_FILE_NOT_WRAPED_DAMAGED = -204,
968 
969  SPLT_OUTPUT_FORMAT_ERROR = -400,
970 
971  SPLT_ERROR_INEXISTENT_SPLITPOINT = -500,
972 
973  SPLT_PLUGIN_ERROR_UNSUPPORTED_FEATURE = -600,
974 
975  SPLT_INVALID_AUDACITY_FILE = -700,
976 
977  SPLT_INVALID_REGEX = -800,
978  SPLT_REGEX_NO_MATCH = -801,
979  SPLT_REGEX_UNAVAILABLE = -802,
980 } splt_code;
981 
982 //internal
983 #define SPLT_INTERNAL_PROGRESS_RATE 1
984 #define SPLT_INTERNAL_FRAME_MODE_ENABLED 2
985 
986 //progress messages
992 typedef enum {
1010 
1019 typedef enum {
1025  /*
1026  * If quiet; we don't do CRC check or human interaction
1027  */
1028  SPLT_OPT_QUIET_MODE,
1169  SPLT_OPT_REPLACE_TAGS_IN_TAGS,
1265 
1266 typedef enum {
1267  SPLT_NO_CONVERSION,
1268  SPLT_TO_LOWERCASE,
1269  SPLT_TO_UPPERCASE,
1270  SPLT_TO_FIRST_UPPERCASE,
1271  SPLT_TO_WORD_FIRST_UPPERCASE
1272 } splt_str_format;
1273 
1278 typedef enum {
1279  /* a regular splitpoint */
1280  SPLT_SPLITPOINT,
1281  /* a skippoint */
1282  SPLT_SKIPPOINT,
1284 
1285 
1286 #define SPLT_UNDEFINED_GENRE "Other"
1287 
1288 #define SPLT_ID3V1_NUMBER_OF_GENRES 127
1289 
1292 static const char splt_id3v1_genres[SPLT_ID3V1_NUMBER_OF_GENRES][25] = {
1293  {"Blues"},
1294  {"Classic Rock"}, {"Country"}, {"Dance"},
1295  {"Disco"},{"Funk"},{"Grunge"},{"Hip-Hop"},{"Jazz"},
1296  {"Metal"},{"New Age"},{"Oldies"}, {"Other"}, {"Pop"},
1297  {"R&B"}, {"Rap"}, {"Reggae"}, {"Rock"}, {"Techno"},
1298  {"Industrial"}, {"Alternative"}, {"Ska"}, {"Death metal"},
1299  {"Pranks"}, {"Soundtrack"}, {"Euro-Techno"},
1300  {"Ambient"}, {"Trip-hop"}, {"Vocal"}, {"Jazz+Funk"},
1301  {"Fusion"}, {"Trance"}, {"Classical"}, {"Instrumental"},
1302  {"Acid"}, {"House"}, {"Game"}, {"Sound clip"}, {"Gospel"},
1303  {"Noise"}, {"Alt. Rock"}, {"Bass"}, {"Soul"}, {"Punk"},
1304  {"Space"}, {"Meditative"}, {"Instrumental pop"},
1305  {"Instrumental rock"}, {"Ethnic"}, {"Gothic"},{"Darkwave"},
1306  {"Techno-Industrial"},{"Electronic"},{"Pop-Folk"},{"Eurodance"},
1307  {"Dream"},{"Southern Rock"},{"Comedy"}, {"Cult"},{"Gangsta"},
1308  {"Top 40"},{"Christian Rap"},{"Pop/Funk"}, {"Jungle"},
1309  {"Native American"},{"Cabaret"},{"New Wave"}, {"Psychedelic"},
1310  {"Rave"},{"Showtunes"},{"Trailer"}, {"Lo-Fi"},{"Tribal"},
1311  {"Acid Punk"},{"Acid Jazz"}, {"Polka"}, {"Retro"},
1312  {"Musical"},{"Rock & Roll"},{"Hard Rock"},
1313 
1314  {"Folk"}, {"Folk-Rock"}, {"National Folk"}, {"Swing"},
1315  {"Fast Fusion"}, {"Bebob"}, {"Latin"}, {"Revival"},
1316  {"Celtic"}, {"Bluegrass"}, {"Avantgarde"}, {"Gothic Rock"},
1317  {"Progressive Rock"}, {"Psychedelic Rock"}, {"Symphonic Rock"},
1318  {"Slow Rock"}, {"Big Band"}, {"Chorus"}, {"Easy Listening"},
1319  {"Acoustic"}, {"Humour"}, {"Speech"}, {"Chanson"}, {"Opera"},
1320  {"Chamber Music"}, {"Sonata"}, {"Symphony"}, {"Booty Bass"},
1321  {"Primus"}, {"Porn Groove"}, {"Satire"}, {"Slow Jam"},
1322  {"Club"}, {"Tango"}, {"Samba"}, {"Folklore"}, {"Ballad"},
1323  {"Power Ballad"}, {"Rhythmic Soul"}, {"Freestyle"}, {"Duet"},
1324  {"Punk Rock"}, {"Drum Solo"}, {"A capella"}, {"Euro-House"},
1325  {"Dance Hall"},
1326 
1327  {"misc"},
1328 };
1329 
1334 /*
1335  * freedb2 search type
1336  */
1337 #define SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI 1
1338 /*
1339  * freedb search type
1340  */
1341 #define SPLT_FREEDB_SEARCH_TYPE_CDDB 2
1342 /*
1343  * freedb get file type
1344  * we retrieve the file by using the cddb.cgi script
1345  * (usually on port 80)
1346  */
1347 #define SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI 3
1348 /*
1349  * we retrieve the file by using the freedb cddb protocol
1350  * (usually on port 8880)
1351  */
1352 #define SPLT_FREEDB_GET_FILE_TYPE_CDDB 4
1353 
1356 #define SPLT_FREEDB_CDDB_CGI_PORT 80
1357 
1360 #define SPLT_FREEDB_CDDB_PORT 8880
1361 
1364 #define SPLT_FREEDB_CGI_SITE "freedb.org/~cddb/cddb.cgi"
1365 #define SPLT_FREEDB2_CGI_SITE "tracktype.org/~cddb/cddb.cgi"
1366 
1367 //package information constants
1368 #ifndef SPLT_PACKAGE_NAME
1369 
1372 #define SPLT_PACKAGE_NAME "libmp3splt"
1373 #endif
1374 #ifndef SPLT_PACKAGE_VERSION
1375 
1378 #define SPLT_PACKAGE_VERSION "0.7.3"
1379 #endif
1380 
1383 #define SPLT_AUTHOR "Matteo Trotta | Munteanu Alexandru"
1384 #define SPLT_EMAIL "<mtrotta@users.sourceforge.net> | <io_fx@yahoo.fr>"
1385 
1388 #define SPLT_WEBSITE "http://mp3splt.sourceforge.net"
1389 
1390 /* other useful variables */
1391 
1392 #define MP3SPLT_LIB_GETTEXT_DOMAIN "libmp3splt"
1393 
1394 //backslash character
1395 #ifndef SPLT_DIRCHAR
1396 #ifdef __WIN32__
1397 #define SPLT_DIRCHAR '\\'
1398 #define SPLT_DIRSTR "\\"
1399 #define SPLT_NDIRCHAR '/'
1400 #else
1401 #define SPLT_DIRCHAR '/'
1402 #define SPLT_DIRSTR "/"
1403 #define SPLT_NDIRCHAR '\\'
1404 #endif
1405 #endif
1406 
1424 splt_state *mp3splt_new_state(int *error);
1425 
1426 //find plugins
1427 int mp3splt_find_plugins(splt_state *state);
1428 
1429 //this function frees the left variables in the library
1430 //don't forget to call this function ONLY at the end of the program
1431 //returns possible error
1432 void mp3splt_free_state(splt_state *state, int *error);
1433 
1434 /************************************/
1446 int mp3splt_set_path_of_split(splt_state *state, const char *path);
1447 
1454 int mp3splt_set_filename_to_split(splt_state *state, const char *filename);
1455 
1466 
1467 int mp3splt_set_m3u_filename(splt_state *state, const char *filename);
1468 int mp3splt_set_silence_log_filename(splt_state *state, const char *filename);
1469 
1477 int mp3splt_set_input_filename_regex(splt_state *state, const char *regex);
1478 
1479 int mp3splt_set_default_comment_tag(splt_state *state, const char *default_comment_tag);
1480 
1481 int mp3splt_set_default_genre_tag(splt_state *state, const char *default_genre_tag);
1482 
1484 
1485 /************************************/
1498  void (*message_cb)(const char *, splt_message_type, void *), void *cb_data);
1499 
1507  void (*file_cb)(const char *, int, void *), void *data);
1508 
1516  void (*progress_cb)(splt_progress *p_bar, void *), void *cb_data);
1517 
1518 int mp3splt_set_silence_level_function(splt_state *state,
1519  void (*get_silence_cb)(long time, float level, void *user_data),
1520  void *user_data);
1521 
1523 
1524 /************************************/
1538  long split_value, const char *name, int type);
1539 
1549  int *splitpoints_number, int *error);
1550 
1557  int *error);
1559 
1560 /************************************/
1561 /* Tags */
1562 
1563 //puts a tag
1564 int mp3splt_append_tags(splt_state *state,
1565  const char *title, const char *artist,
1566  const char *album, const char *performer,
1567  const char *year, const char *comment,
1568  int track, const char *genre);
1569 
1570 //returns a pointer to all the current tags
1571 const splt_tags *mp3splt_get_tags(splt_state *state,
1572  int *tags_number, int *error);
1573 
1574 //puts tags from a string
1575 int mp3splt_put_tags_from_string(splt_state *state, const char *tags,
1576  int *error);
1577 
1578 void mp3splt_erase_all_tags(splt_state *state,
1579  int *error);
1580 
1581 /************************************/
1582 /* Options */
1583 
1584 int mp3splt_set_int_option(splt_state *state, int option_name, int value);
1585 int mp3splt_set_long_option(splt_state *state, int option_name, long value);
1586 int mp3splt_set_float_option(splt_state *state, int option_name, float value);
1587 
1588 int mp3splt_get_int_option(splt_state *state, int option_name, int *error);
1589 long mp3splt_get_long_option(splt_state *state, int option_name, int *error);
1590 float mp3splt_get_float_option(splt_state *state, int option_name, int *error);
1591 
1592 /************************************/
1593 /* Split functions */
1594 
1595 //split a ogg or mp3 file
1596 //returns possible error
1597 int mp3splt_split(splt_state *state);
1598 
1599 //cancel split function
1600 //returns possible error
1601 void mp3splt_stop_split(splt_state *state,
1602  int *error);
1603 
1604 /************************************/
1605 /* Cddb and Cue functions */
1606 
1607 //get the cue splitpoints from a file and puts them in the state
1608 void mp3splt_put_cue_splitpoints_from_file(splt_state *state,
1609  const char *cue_file, int *error);
1610 
1611 //read cddb splitpoints from file and puts them in the state
1612 void mp3splt_put_cddb_splitpoints_from_file(splt_state *state,
1613  const char *cddb_file, int *error);
1614 
1615 void mp3splt_put_audacity_labels_splitpoints_from_file(splt_state *state,
1616  const char *file, int *error);
1617 
1618 /************************************/
1619 /* Freedb functions */
1620 
1621 //returns the freedb results and possible eerror
1626  const char *searched_string,
1627  int *error,
1628  int search_type,
1629  const char *search_server,
1630  int port);
1631 
1632 void mp3splt_write_freedb_file_result(splt_state *state,
1633  int disc_id,
1634  const char *cddb_file,
1635  int *error,
1636  int cddb_get_type,
1637  const char *cddb_get_server,
1638  int port);
1639 
1640 void mp3splt_export_to_cue(splt_state *state, const char *out_file,
1641  short stop_at_total_time, int *error);
1642 
1643 void mp3splt_set_oformat(splt_state *state,
1644  const char *format_string, int *error);
1645 
1646 /************************************/
1647 /* Other utilities */
1648 
1649 //counts the number of tracks found with silence detection
1650 int mp3splt_count_silence_points(splt_state *state, int *error);
1651 
1652 int mp3splt_set_silence_points(splt_state *state, int *error);
1653 void mp3splt_set_trim_silence_points(splt_state *state, int *error);
1654 
1655 //returns the version of libmp3splt
1656 void mp3splt_get_version(char *version);
1657 
1658 //result must be freed
1659 char *mp3splt_get_strerror(splt_state *state, int error_code);
1660 
1661 //returns the number of syncerrors
1662 //puts possible error in error variable
1663 const splt_syncerrors *mp3splt_get_syncerrors(splt_state *state,
1664  int *error);
1665 
1666 //returns the wrapped files found
1667 const splt_wrap *mp3splt_get_wrap_files(splt_state *state, int *error);
1668 
1669 int mp3splt_append_plugins_scan_dir(splt_state *state, char *dir);
1670 
1671 #ifdef __WIN32__
1672 char *mp3splt_win32_utf16_to_utf8(const wchar_t *source);
1673 #endif
1674 
1675 char **mp3splt_find_filenames(splt_state *state, const char *filename,
1676  int *num_of_files_found, int *error);
1677 
1678 int mp3splt_u_check_if_directory(const char *fname);
1679 
1680 void mp3splt_free_one_tag(splt_tags *tags);
1681 splt_tags *mp3splt_parse_filename_regex(splt_state *state, int *error);
1682 
1683 int mp3splt_library_is_locked(splt_state *state);
1684 
1685 #define MP3SPLT_MP3SPLT_H
1686 
1687 #endif
1688