Import splitpoints
[Using libmp3splt]

Defines

#define SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI   1
#define SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI   3
#define SPLT_FREEDB_GET_FILE_TYPE_CDDB   4
#define SPLT_FREEDB_CDDB_CGI_PORT   80
#define SPLT_FREEDB2_CGI_SITE   "tracktype.org/~cddb/cddb.cgi"

Typedefs

typedef struct _splt_freedb_results splt_freedb_results
typedef struct
_splt_freedb_one_result 
splt_freedb_one_result

Enumerations

enum  splt_import_type { CUE_IMPORT, CDDB_IMPORT, AUDACITY_LABELS_IMPORT }

Functions

splt_code mp3splt_import (splt_state *state, splt_import_type type, const char *file)
splt_code mp3splt_use_proxy (splt_state *state, const char *proxy_address, int proxy_port)
splt_code mp3splt_use_base64_authentification (splt_state *state, const char *base64_authentification)
char * mp3splt_encode_in_base64 (splt_state *state, const char *input, int *error)
void mp3splt_clear_proxy (splt_state *state)
splt_freedb_resultsmp3splt_get_freedb_search (splt_state *state, const char *searched_string, splt_code *error, int search_type, const char *search_server, int port)
void mp3splt_freedb_init_iterator (splt_freedb_results *freedb_results)
const splt_freedb_one_resultmp3splt_freedb_next (splt_freedb_results *freedb_results)
int mp3splt_freedb_get_id (const splt_freedb_one_result *result)
const char * mp3splt_freedb_get_name (const splt_freedb_one_result *result)
int mp3splt_freedb_get_number_of_revisions (const splt_freedb_one_result *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)

Define Documentation

#define SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI   1

Search CDDB file using CDDB CGI protocol (tracktype.org).

See also:
mp3splt_get_freedb_search

Definition at line 1751 of file mp3splt.h.

#define SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI   3

Get CDDB file using CDDB CGI protocol (tracktype.org or freedb.org).

See also:
mp3splt_write_freedb_file_result

Definition at line 1758 of file mp3splt.h.

#define SPLT_FREEDB_GET_FILE_TYPE_CDDB   4

Get CDDB file using freedb.org CDDB protocol.

See also:
mp3splt_write_freedb_file_result

Definition at line 1765 of file mp3splt.h.

#define SPLT_FREEDB_CDDB_CGI_PORT   80

Default port.

See also:
mp3splt_get_freedb_search
mp3splt_write_freedb_file_result

Definition at line 1773 of file mp3splt.h.

#define SPLT_FREEDB2_CGI_SITE   "tracktype.org/~cddb/cddb.cgi"

Typedef Documentation

typedef struct _splt_freedb_results splt_freedb_results

Structure containing the freedb search results.

All members are private.

See also:
mp3splt_get_freedb_search
mp3splt_freedb_init_iterator
mp3splt_freedb_next

Definition at line 1792 of file mp3splt.h.

typedef struct _splt_freedb_one_result splt_freedb_one_result

Structure containing only one freedb result.

See also:
mp3splt_freedb_get_id
mp3splt_freedb_get_name
mp3splt_freedb_get_number_of_revisions

Definition at line 1801 of file mp3splt.h.


Enumeration Type Documentation

Type of the import.

See also:
mp3splt_import

Definition at line 1728 of file mp3splt.h.


Function Documentation

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.

Parameters:
[in] state Main state.
[in] type Type of the import.
[in] file File to import.
Returns:
Possible error.
See also:
mp3splt_split
splt_code mp3splt_use_proxy ( splt_state state,
const char *  proxy_address,
int  proxy_port 
)

Use proxy when accessing the internet.

Parameters:
[in] state Main state.
[in] proxy_address Proxy address.
[in] proxy_port Port of the proxy_address.
Returns:
Possible error.
splt_code mp3splt_use_base64_authentification ( splt_state state,
const char *  base64_authentification 
)

Use proxy with base64 authentification.

Parameters:
[in] state Main state.
[in] base64_authentification Authentification credentials encoded in base64.
Returns:
Possible error.
See also:
mp3splt_encode_in_base64
mp3splt_clear_proxy
mp3splt_use_proxy
char* mp3splt_encode_in_base64 ( splt_state state,
const char *  input,
int *  error 
)

Encode the input in base64.

Parameters:
[in] state Main state.
[in] input Input to be encoded in base64.
[in] error Possible error; can be NULL.
Returns:
The input encoded as base64.
See also:
mp3splt_use_base64_authentification
void mp3splt_clear_proxy ( splt_state state  ) 

Clears the proxy data from the state.

For security purposes, use this function as soon as the proxy is not needed any more.

Parameters:
[in] state Main state.
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.

Parameters:
[in] state Main state.
[in] searched_string Search string - might be artist or album.
[out] error Possible error; can be NULL.
[in] search_type Type of the search. Only SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI is supported for the moment.
[in] search_server You can use SPLT_FREEDB2_CGI_SITE as search server.
[in] port Port of the search_server. Can be SPLT_FREEDB_CDDB_CGI_PORT.
Returns:
The search results.
See also:
mp3splt_freedb_init_iterator
mp3splt_freedb_next
mp3splt_write_freedb_file_result
void mp3splt_freedb_init_iterator ( splt_freedb_results freedb_results  ) 

Initialisation of the iterator for use with mp3splt_freedb_next.

Parameters:
[in] freedb_results Freedb results returned with mp3splt_get_freedb_search.
See also:
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.

Parameters:
[in] freedb_results Freedb results to be processed.
Returns:
Next freedb result of freedb_results or NULL if none found or no result remains.
See also:
mp3splt_freedb_get_id
mp3splt_freedb_get_name
mp3splt_freedb_get_number_of_revisions
int mp3splt_freedb_get_id ( const splt_freedb_one_result result  ) 

Returns the ID of the result.

The ID is needed when using mp3splt_write_freedb_file_result.

const char* mp3splt_freedb_get_name ( const splt_freedb_one_result result  ) 

Returns the name of the result.

int mp3splt_freedb_get_number_of_revisions ( const splt_freedb_one_result result  ) 

Returns the number of revisions of the 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.

Parameters:
[in] state Main state.
[in] disc_id ID of the chosen disc provided by mp3splt_freedb_get_id.
[in] output_file Name of the output CDDB file that will be written.
[in] cddb_get_type Type of the download. Can be SPLT_FREEDB_GET_FILE_TYPE_CDDB or SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI.
[in] cddb_get_server Name of the server from the file is downloaded. Can be SPLT_FREEDB2_CGI_SITE (or freedb.org or freedb.org/~cddb/cddb.cgi).
[in] port Port of the cddb_get_server. Can be SPLT_FREEDB_CDDB_CGI_PORT (or 8880) for example.
Returns:
Possible error.
See also:
mp3splt_get_freedb_search