libdiscid 0.7.0
Loading...
Searching...
No Matches
discid.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------------
2
3 MusicBrainz -- The Internet music metadatabase
4
5 Copyright (C) 2013 Johannes Dewender
6 Copyright (C) 2006-2010 Lukas Lalinsky
7 Copyright (C) 2006 Matthias Friedrich
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, see
21 <https://www.gnu.org/licenses/>.
22
23--------------------------------------------------------------------------- */
24#ifndef MUSICBRAINZ_DISC_ID_H
25#define MUSICBRAINZ_DISC_ID_H
26
27#if (defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__))
28# ifdef libdiscid_EXPORTS
29# define LIBDISCID_API __declspec(dllexport)
30# else
31# define LIBDISCID_API __declspec(dllimport)
32# endif
33# define LIBDISCID_INTERNAL
34#elif (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__)
35# define LIBDISCID_API
36# define LIBDISCID_INTERNAL __attribute__((visibility("hidden")))
37#elif defined(__SUNPRO_C)
38# define LIBDISCID_API __global
39# define LIBDISCID_INTERNAL __hidden
40#else
41# define LIBDISCID_API
42# define LIBDISCID_INTERNAL
43#endif
44
45#if (defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__))
46#define LIBDISCID_DEPRECATED __declspec(deprecated)
47#elif (defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))) || defined(__clang__)
48#define LIBDISCID_DEPRECATED __attribute__((deprecated))
49#else
50#define LIBDISCID_DEPRECATED
51#endif
52
53#define DISCID_VERSION_MAJOR 0
54#define DISCID_VERSION_MINOR 7
55#define DISCID_VERSION_PATCH 0
56#define DISCID_VERSION_NUM 700
57
58#ifdef __cplusplus
59 extern "C" {
60#endif
61
123typedef void *DiscId;
124
125
135
136
143
144
166LIBDISCID_API int discid_read(DiscId *d, const char *device);
167
168
204LIBDISCID_API int discid_read_sparse(DiscId *d, const char *device,
205 unsigned int features);
206
207#define DISCID_HAVE_SPARSE_READ
208
240LIBDISCID_API int discid_put(DiscId *d, int first, int last, int *offsets);
241
242
253
254
264
265
275
296
310
326
340
341
349
350
358
359
367
368
380
381
393
405
419
420
453
454#define DISCID_FEATURE_STR_READ "read"
455#define DISCID_FEATURE_STR_MCN "mcn"
456#define DISCID_FEATURE_STR_ISRC "isrc"
457#define DISCID_FEATURE_LENGTH 32
469 char *features[DISCID_FEATURE_LENGTH]);
470
481
482
483#ifdef __cplusplus
484 }
485#endif
486
487#endif /* MUSICBRAINZ_DISC_ID_H */
488
#define DISCID_FEATURE_LENGTH
Definition discid.h:457
LIBDISCID_API char * discid_get_mcn(DiscId *d)
Return the Media Catalogue Number (MCN) for the disc.
LIBDISCID_API int discid_get_track_offset(DiscId *d, int track_num)
Return the sector offset of a track.
LIBDISCID_API int discid_get_last_track_num(DiscId *d)
Return the number of the last audio track on this disc.
LIBDISCID_API int discid_get_sectors(DiscId *d)
Return the length of the disc in sectors.
void * DiscId
A transparent handle for an Audio CD.
Definition discid.h:123
LIBDISCID_API int discid_put(DiscId *d, int first, int last, int *offsets)
Provides the TOC of a known CD.
LIBDISCID_API DiscId * discid_new()
Return a handle for a new DiscId object.
discid_feature
PLATFORM-DEPENDENT FEATURES.
Definition discid.h:437
@ DISCID_FEATURE_ISRC
Definition discid.h:440
@ DISCID_FEATURE_READ
Definition discid.h:438
@ DISCID_FEATURE_MCN
Definition discid.h:439
LIBDISCID_API char * discid_get_freedb_id(DiscId *d)
Return a FreeDB DiscID.
LIBDISCID_API char * discid_get_track_isrc(DiscId *d, int track_num)
Return the ISRC for a track.
#define LIBDISCID_API
Definition discid.h:41
LIBDISCID_API LIBDISCID_DEPRECATED char * discid_get_webservice_url(DiscId *d)
Return an URL for retrieving CD information from MusicBrainz' web service.
#define LIBDISCID_DEPRECATED
Definition discid.h:50
LIBDISCID_API int discid_has_feature(enum discid_feature feature)
Check if a certain feature is implemented on the current platform.
LIBDISCID_API char * discid_get_submission_url(DiscId *d)
Return an URL for submitting the DiscID to MusicBrainz.
LIBDISCID_API char * discid_get_version_string(void)
Return the full version string of this library, including the name.
LIBDISCID_API char * discid_get_default_device(void)
Return the name of the default disc drive for this machine.
LIBDISCID_API int discid_get_track_length(DiscId *d, int track_num)
Return the length of a track in sectors.
LIBDISCID_API char * discid_get_toc_string(DiscId *d)
Return a string representing CD Table Of Contents (TOC).
LIBDISCID_API int discid_read_sparse(DiscId *d, const char *device, unsigned int features)
Read the disc in the given CD-ROM/DVD-ROM drive extracting only the TOC and additionally specified fe...
LIBDISCID_API char * discid_get_id(DiscId *d)
Return a MusicBrainz DiscID.
LIBDISCID_API int discid_read(DiscId *d, const char *device)
Read all supported features of the disc in the given CD-ROM/DVD-ROM drive.
LIBDISCID_API void discid_get_feature_list(char *features[DISCID_FEATURE_LENGTH])
Return a list of features supported by the current platform.
LIBDISCID_API char * discid_get_error_msg(DiscId *d)
Return a human-readable error message.
LIBDISCID_API int discid_get_first_track_num(DiscId *d)
Return the number of the first track on this disc.
LIBDISCID_API void discid_free(DiscId *d)
Release the memory allocated for the DiscId object.