Import splitpoints
Using libmp3splt
Collaboration diagram for Import splitpoints:

## Macros

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

## Typedefs

typedef struct _splt_freedb_one_result | splt_freedb_one_result
typedef struct _splt_freedb_results | splt_freedb_results

## Enumerations

enum | splt_import_type { CUE_IMPORT, CDDB_IMPORT, AUDACITY_LABELS_IMPORT }

## Functions

void | mp3splt_clear_proxy (splt_state *state)
char * | mp3splt_encode_in_base64 (splt_state *state, const char *input, int *error)
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)
void | mp3splt_freedb_init_iterator (splt_freedb_results *freedb_results)
const splt_freedb_one_result * | mp3splt_freedb_next (splt_freedb_results *freedb_results)
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)
splt_code | mp3splt_import (splt_state *state, splt_import_type type, const char *file)
splt_code | mp3splt_use_base64_authentification (splt_state *state, const char *base64_authentification)
splt_code | mp3splt_use_proxy (splt_state *state, const char *proxy_address, int proxy_port)
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)

## Detailed Description

## Macro Definition Documentation

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

URL of tracktype.org when using SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI and SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI types.

See Also
  mp3splt_get_freedb_search
  mp3splt_write_freedb_file_result

Definition at line 1771 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 1762 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 1754 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 1747 of file mp3splt.h.

#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 1740 of file mp3splt.h.

## Typedef Documentation

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 1790 of file mp3splt.h.

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 1781 of file mp3splt.h.

## Enumeration Type Documentation

enum splt_import_type

Type of the import.

See Also
  mp3splt_import

Definition at line 1717 of file mp3splt.h.

## Function Documentation

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.

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

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`.

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

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

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_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

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_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