#include "errors.h"#include "queries.h"Go to the source code of this file.
Defines | |
| #define | MB_CDINDEX_ID_LEN 28 |
| #define | MB_ID_LEN 36 |
Typedefs | |
| typedef void * | musicbrainz_t |
| typedef void * | trm_t |
Functions | |
| musicbrainz_t | mb_New (void) |
| void | mb_Delete (musicbrainz_t o) |
| void | mb_GetVersion (musicbrainz_t o, int *major, int *minor, int *rev) |
| int | mb_SetServer (musicbrainz_t o, char *serverAddr, short serverPort) |
| void | mb_SetDebug (musicbrainz_t o, int debug) |
| int | mb_SetProxy (musicbrainz_t o, char *serverAddr, short serverPort) |
| int | mb_Authenticate (musicbrainz_t o, char *userName, char *password) |
| int | mb_SetDevice (musicbrainz_t o, char *device) |
| void | mb_UseUTF8 (musicbrainz_t o, int useUTF8) |
| void | mb_SetDepth (musicbrainz_t o, int depth) |
| void | mb_SetMaxItems (musicbrainz_t o, int maxItems) |
| int | mb_Query (musicbrainz_t o, char *rdfObject) |
| int | mb_QueryWithArgs (musicbrainz_t o, char *rdfObject, char **args) |
| int | mb_GetWebSubmitURL (musicbrainz_t o, char *url, int urlLen) |
| void | mb_GetQueryError (musicbrainz_t o, char *error, int errorLen) |
| int | mb_Select (musicbrainz_t o, char *selectQuery) |
| int | mb_Select1 (musicbrainz_t o, char *selectQuery, int ord) |
| int | mb_SelectWithArgs (musicbrainz_t o, char *selectQuery, int *ordinals) |
| int | mb_GetResultData (musicbrainz_t o, char *resultName, char *data, int dataLen) |
| int | mb_GetResultData1 (musicbrainz_t o, char *resultName, char *data, int maxDataLen, int ordinal) |
| int | mb_DoesResultExist (musicbrainz_t o, char *resultName) |
| int | mb_DoesResultExist1 (musicbrainz_t o, char *resultName, int ordinal) |
| int | mb_GetResultInt (musicbrainz_t o, char *resultName) |
| int | mb_GetResultInt1 (musicbrainz_t o, char *resultName, int ordinal) |
| int | mb_GetResultRDF (musicbrainz_t o, char *RDF, int RDFLen) |
| int | mb_GetResultRDFLen (musicbrainz_t o) |
| int | mb_SetResultRDF (musicbrainz_t o, char *RDF) |
| void | mb_GetIDFromURL (musicbrainz_t o, char *url, char *id, int idLen) |
| void | mb_GetFragmentFromURL (musicbrainz_t o, char *url, char *fragment, int fragmentLen) |
| int | mb_GetOrdinalFromList (musicbrainz_t o, char *listType, char *URI) |
| int | mb_GetMP3Info (musicbrainz_t o, char *fileName, int *duration, int *bitrate, int *stereo, int *samplerate) |
| trm_t | trm_New (void) |
| void | trm_Delete (trm_t o) |
| int | trm_SetProxy (trm_t o, char *proxyAddr, short proxyPort) |
| int | trm_SetPCMDataInfo (trm_t o, int samplesPerSecond, int numChannels, int bitsPerSample) |
| void | trm_SetSongLength (trm_t o, long int seconds) |
| int | trm_GenerateSignature (trm_t o, char *data, int size) |
| int | trm_FinalizeSignature (trm_t o, char signature[17], char *collectionID) |
| void | trm_ConvertSigToASCII (trm_t o, char sig[17], char ascii_sig[37]) |
|
|
The length of a CD Index id in characters |
|
|
The length of a Artist/Album/Track id in characters |
|
|
Basic C abstraction for the MusicBrainz Object |
|
|
Basic C abstraction for the TRM Object |
|
||||||||||||||||
|
This function must be called if you want to submit data to the server and give the user credit for the submission. If you're looking up data from the server, you do not need to call mb_Authenticate. If you are submitting data to the MB server and you want your submissions be submitted anonymously, then do not call this function.
|
|
|
The destructor for the MusicBrainz class.
|
|
||||||||||||
|
Check to see if a piece of information exists in data returned by a successful query. This function takes the same resultName argument as mb_GetResultData()
|
|
||||||||||||||||
|
Check to see if a piece of information exists in data returned by a successful query. This function takes the same resultName and ordinal arguments as mb_GetResultData1()
|
|
||||||||||||||||||||
|
Extract the identifier fragment from a URI. Given a URI this function will return the string that follows the # seperator. (e.g. when passed 'http://musicbrainz.org/mm/mq-1.1#ArtistResult', this function will return 'ArtistResult'
|
|
||||||||||||||||||||
|
Extract the actual artist/album/track ID from a MBE_GETxxxxxId query. The MBE_GETxxxxxId functions return a URL to where the more RDF metadata for the given ID can be retrieved. Callers may wish to extract only the ID of an artist/album/track for reference in elsewhere.
|
|
||||||||||||||||||||||||||||
|
This helper function calculates the crucial pieces of information for an MP3 files. This function returns the duration of the MP3 in milliseconds, which is handy for passing the length of the track to the TRM generation routines. Beware: The TRM routines are expecting the duratin in SECONDS, so you will need to divide the duration returned by this function by 1000 before you pass it to the TRM routines.
|
|
||||||||||||||||
|
Get the ordinal (list position) of an item in a list. This function is normally used to retrieve the track number out of a list of tracks in an album using a list query (usually MBE_AlbumGetTrackList)
|
|
||||||||||||||||
|
Retrieve the error message that was generated during the last call to mb_Query() or mb_QueryWithArgs().
|
|
||||||||||||||||||||
|
Extract a piece of information from the data returned by a successful query. This function takes a resultName (usually named starting with MBE_), as defined in the MusicBrainz HOWTO.
|
|
||||||||||||||||||||||||
|
Extract a piece of information from the data returned by a successful query. This function takes a resultName (usually named starting with MBE_), as defined in the MusicBrainz HOWTO, and on ordinal argument.
|
|
||||||||||||
|
Return the integer value of a result from the data returned by a successful Query. This function takes the same resultName argument as mb_GetResultData()
|
|
||||||||||||||||
|
Return the integer value of a result from the data returned by a successful query. This function takes the same resultName and ordinal arguments as mb_GetResultData1()
|
|
||||||||||||||||
|
Retrieve the RDF that was returned by the server. Most users will not want to use this function!
|
|
|
Returns the length (in bytes) of the current RDF result. Advanced users only!
|
|
||||||||||||||||||||
|
Get the version number of this library
|
|
||||||||||||||||
|
Use this function to query the current CD-ROM and to calculate the web submit URL that can be opened in a browser in order to start the web based CD-ROM Submission to MusicBrainz. The CD-ROM in the CD-ROM drive set by mb_SetDevice() will be queried.
|
|
|
Create a new handle (a C abstraction) to the MusicBrainz object. Call mb_Delete() when done with the handle.
|
|
||||||||||||
|
Query the MusicBrainz server. Use this function if your query requires no arguments other than the query itself. Please refer to the HOWTO for the documentation on the available queries.
|
|
||||||||||||||||
|
Query the MusicBrainz server. Use this function if your query requires one or more arguments. The arguments are specified via a pointer to an array of char *. To pass two arguments to the mb_QueryWithArgs() call, do this
char *args[3];
args[0] = "Portishead";
args[1] = "Dummy";
args[3] = NULL;
mb_QueryWithArgs(MBQ_AlbumFindAlbum, args);
Note that the last element in the args array must point to NULL, to prevent the client library from crashing should an incorrect number of arguments be specified for the given query. Please refer to the HOWTO for the documentation on the available queries and the number of required arguments
|
|
||||||||||||
|
Select a context in the result query. Use this function if your Select requires no ordinal arguments. Pass this function a select query (starts with MBS_) Please refer to the MusicBrainz HOWTO for more details on why you need to do a Select and what types of Selects are available.
|
|
||||||||||||||||
|
Select a context in the result query. Use this function if your Select requires one ordinal argument. Pass this function a selectQuery (usually start with MBS_) as defined in the MusicBrainz HOWTO. See the HOWTO for more details on why you need to do a Select and what types of Selects are available.
|
|
||||||||||||||||
|
Select a context in the result query. Use this function if your Select requires more than one ordinal argument. Pass this function a selectQuery (usually start with MBS_) as defined in the MusicBrainz HOWTO. The ordinal arguments are passed in an array of ints, with the last int being a zero:
int ordinals[3];
ordinals[0] = 2;
ordinals[1] = 3;
ordinals[3] = 0;
mb_QueryWithArgs(MBQ_AlbumFindAlbum, ordinals);
Note that the last element in the ordinals array must be 0. be specified for the given query. Please refer to the HOWTO for the Please refer to the MusicBrainz HOWTO for more details on why you need to do a Select and what types of Selects are available.
|
|
||||||||||||
|
Enable debug out to stdout by sending a non-zero value to this function.
|
|
||||||||||||
|
Set the search depth of the query. Please refer to the MusicBrainz HOWTO for an explanation of this value. Defaults to 2.
|
|
||||||||||||
|
Call this function to set the CD-ROM drive device if you plan to use the client library to identify and look up CD-ROMs using MusicBrainz. Unix: specify a device such as /dev/cdrom. Defaults to /dev/cdrom Windows: specify a drive letter of a CD-ROM drive. e.g. E:
|
|
||||||||||||
|
Set the maximum number of items to return to the client. If a search query yields more items than this max number, the server will omit the excess items and not return them to the client. This value defaults to 25.
|
|
||||||||||||||||
|
Set the name of the HTTP Proxy to use. This function must be called anytime the client library must communicate via a proxy firewall.
|
|
||||||||||||
|
Set an RDF object for so that the Get functions can be used to extract data from the RDF. Advanced users only!
|
|
||||||||||||||||
|
Set the name and the port of the MusicBrainz server to use. If this function is not called, the default www.musicbrainz.org server on port 80 will be used.
|
|
||||||||||||
|
Use this function to set the output returned by the Get function. The Get functions can return data in ISO-8859-1 encoding or in UTF-8. Defaults to ISO-8859-1.
|
|
||||||||||||||||
|
This translates the 16 character raw signature into a 36 character human-readable string containing only letters and numbers. Used after trm_GenerateSignature() or trm_GenerateSignatureNow() has generated a signature.
|
|
|
The destructor for the TRM class.
|
|
||||||||||||||||
|
Used when there is no more audio data available or trm_GenerateSignature() has returned a '1'. This function finishes the generation of a signature from the data already sent via trm_GenerateSignature(). This function will access the Relatable signature server to generate the signature itself. Windows only: You will need to call mb_WSAInit before you can use this function. If your program already uses sockets, you will not need to call WSAInit and WSAStop.
|
|
||||||||||||||||
|
The main functionality of the TRM class. Audio is passed to this function and stored for analysis. trm_SetPCMDataInfo() needs to be called before calling this function. trm_FinalizeSignature() needs to be called after this function has returned a '1' or there is no more audio data to be passed in.
|
|
|
The contructor for the TRM class. Call trm_Delete() when done with the object.
|
|
||||||||||||||||||||
|
Called to set the type of audio being sent to be signatured. This MUST be called before attempting to generate a signature.
|
|
||||||||||||||||
|
Called to set a proxy server to use for Internet access.
|
|
||||||||||||
|
Called to set the total length of the song in seconds. Optional, but if this function is not used, trm_GenerateSignature() will calculate the length of the audio instead. Must be called after trm_SetPCMDataInfo() but before any calls to trm_GenerateSignature().
|
1.4.2