Chris@1: Chris@1:
Chris@1:00001 /* libFLAC - Free Lossless Audio Codec library Chris@1: 00002 * Copyright (C) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson Chris@1: 00003 * Chris@1: 00004 * Redistribution and use in source and binary forms, with or without Chris@1: 00005 * modification, are permitted provided that the following conditions Chris@1: 00006 * are met: Chris@1: 00007 * Chris@1: 00008 * - Redistributions of source code must retain the above copyright Chris@1: 00009 * notice, this list of conditions and the following disclaimer. Chris@1: 00010 * Chris@1: 00011 * - Redistributions in binary form must reproduce the above copyright Chris@1: 00012 * notice, this list of conditions and the following disclaimer in the Chris@1: 00013 * documentation and/or other materials provided with the distribution. Chris@1: 00014 * Chris@1: 00015 * - Neither the name of the Xiph.org Foundation nor the names of its Chris@1: 00016 * contributors may be used to endorse or promote products derived from Chris@1: 00017 * this software without specific prior written permission. Chris@1: 00018 * Chris@1: 00019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS Chris@1: 00020 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT Chris@1: 00021 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR Chris@1: 00022 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR Chris@1: 00023 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, Chris@1: 00024 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, Chris@1: 00025 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR Chris@1: 00026 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF Chris@1: 00027 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING Chris@1: 00028 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS Chris@1: 00029 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Chris@1: 00030 */ Chris@1: 00031 Chris@1: 00032 #ifndef FLAC__FORMAT_H Chris@1: 00033 #define FLAC__FORMAT_H Chris@1: 00034 Chris@1: 00035 #include "export.h" Chris@1: 00036 #include "ordinals.h" Chris@1: 00037 Chris@1: 00038 #ifdef __cplusplus Chris@1: 00039 extern "C" { Chris@1: 00040 #endif Chris@1: 00041 Chris@1: 00086 /* Chris@1: 00087 Most of the values described in this file are defined by the FLAC Chris@1: 00088 format specification. There is nothing to tune here. Chris@1: 00089 */ Chris@1: 00090 Chris@1: 00092 #define FLAC__MAX_METADATA_TYPE_CODE (126u) Chris@1: 00093 Chris@1: 00095 #define FLAC__MIN_BLOCK_SIZE (16u) Chris@1: 00096 Chris@1: 00098 #define FLAC__MAX_BLOCK_SIZE (65535u) Chris@1: 00099 Chris@1: 00102 #define FLAC__SUBSET_MAX_BLOCK_SIZE_48000HZ (4608u) Chris@1: 00103 Chris@1: 00105 #define FLAC__MAX_CHANNELS (8u) Chris@1: 00106 Chris@1: 00108 #define FLAC__MIN_BITS_PER_SAMPLE (4u) Chris@1: 00109 Chris@1: 00111 #define FLAC__MAX_BITS_PER_SAMPLE (32u) Chris@1: 00112 Chris@1: 00121 #define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u) Chris@1: 00122 Chris@1: 00127 #define FLAC__MAX_SAMPLE_RATE (655350u) Chris@1: 00128 Chris@1: 00130 #define FLAC__MAX_LPC_ORDER (32u) Chris@1: 00131 Chris@1: 00134 #define FLAC__SUBSET_MAX_LPC_ORDER_48000HZ (12u) Chris@1: 00135 Chris@1: 00139 #define FLAC__MIN_QLP_COEFF_PRECISION (5u) Chris@1: 00140 Chris@1: 00144 #define FLAC__MAX_QLP_COEFF_PRECISION (15u) Chris@1: 00145 Chris@1: 00147 #define FLAC__MAX_FIXED_ORDER (4u) Chris@1: 00148 Chris@1: 00150 #define FLAC__MAX_RICE_PARTITION_ORDER (15u) Chris@1: 00151 Chris@1: 00153 #define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u) Chris@1: 00154 Chris@1: 00161 extern FLAC_API const char *FLAC__VERSION_STRING; Chris@1: 00162 Chris@1: 00167 extern FLAC_API const char *FLAC__VENDOR_STRING; Chris@1: 00168 Chris@1: 00170 extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */ Chris@1: 00171 Chris@1: 00175 extern FLAC_API const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */ Chris@1: 00176 Chris@1: 00178 extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */ Chris@1: 00179 Chris@1: 00181 #define FLAC__STREAM_SYNC_LENGTH (4u) Chris@1: 00182 Chris@1: 00183 Chris@1: 00184 /***************************************************************************** Chris@1: 00185 * Chris@1: 00186 * Subframe structures Chris@1: 00187 * Chris@1: 00188 *****************************************************************************/ Chris@1: 00189 Chris@1: 00190 /*****************************************************************************/ Chris@1: 00191 Chris@1: 00193 typedef enum { Chris@1: 00194 FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0, Chris@1: 00198 FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2 = 1 Chris@1: 00201 } FLAC__EntropyCodingMethodType; Chris@1: 00202 Chris@1: 00208 extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[]; Chris@1: 00209 Chris@1: 00210 Chris@1: 00213 typedef struct { Chris@1: 00214 Chris@1: 00215 unsigned *parameters; Chris@1: 00218 unsigned *raw_bits; Chris@1: 00223 unsigned capacity_by_order; Chris@1: 00228 } FLAC__EntropyCodingMethod_PartitionedRiceContents; Chris@1: 00229 Chris@1: 00232 typedef struct { Chris@1: 00233 Chris@1: 00234 unsigned order; Chris@1: 00237 const FLAC__EntropyCodingMethod_PartitionedRiceContents *contents; Chris@1: 00240 } FLAC__EntropyCodingMethod_PartitionedRice; Chris@1: 00241 Chris@1: 00242 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; Chris@1: 00243 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; Chris@1: 00244 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN; Chris@1: 00245 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; Chris@1: 00247 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER; Chris@1: 00249 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER; Chris@1: 00254 typedef struct { Chris@1: 00255 FLAC__EntropyCodingMethodType type; Chris@1: 00256 union { Chris@1: 00257 FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice; Chris@1: 00258 } data; Chris@1: 00259 } FLAC__EntropyCodingMethod; Chris@1: 00260 Chris@1: 00261 extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; Chris@1: 00263 /*****************************************************************************/ Chris@1: 00264 Chris@1: 00266 typedef enum { Chris@1: 00267 FLAC__SUBFRAME_TYPE_CONSTANT = 0, Chris@1: 00268 FLAC__SUBFRAME_TYPE_VERBATIM = 1, Chris@1: 00269 FLAC__SUBFRAME_TYPE_FIXED = 2, Chris@1: 00270 FLAC__SUBFRAME_TYPE_LPC = 3 Chris@1: 00271 } FLAC__SubframeType; Chris@1: 00272 Chris@1: 00278 extern FLAC_API const char * const FLAC__SubframeTypeString[]; Chris@1: 00279 Chris@1: 00280 Chris@1: 00283 typedef struct { Chris@1: 00284 FLAC__int32 value; Chris@1: 00285 } FLAC__Subframe_Constant; Chris@1: 00286 Chris@1: 00287 Chris@1: 00290 typedef struct { Chris@1: 00291 const FLAC__int32 *data; Chris@1: 00292 } FLAC__Subframe_Verbatim; Chris@1: 00293 Chris@1: 00294 Chris@1: 00297 typedef struct { Chris@1: 00298 FLAC__EntropyCodingMethod entropy_coding_method; Chris@1: 00301 unsigned order; Chris@1: 00304 FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER]; Chris@1: 00307 const FLAC__int32 *residual; Chris@1: 00309 } FLAC__Subframe_Fixed; Chris@1: 00310 Chris@1: 00311 Chris@1: 00314 typedef struct { Chris@1: 00315 FLAC__EntropyCodingMethod entropy_coding_method; Chris@1: 00318 unsigned order; Chris@1: 00321 unsigned qlp_coeff_precision; Chris@1: 00324 int quantization_level; Chris@1: 00327 FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER]; Chris@1: 00330 FLAC__int32 warmup[FLAC__MAX_LPC_ORDER]; Chris@1: 00333 const FLAC__int32 *residual; Chris@1: 00335 } FLAC__Subframe_LPC; Chris@1: 00336 Chris@1: 00337 extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; Chris@1: 00338 extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; Chris@1: 00343 typedef struct { Chris@1: 00344 FLAC__SubframeType type; Chris@1: 00345 union { Chris@1: 00346 FLAC__Subframe_Constant constant; Chris@1: 00347 FLAC__Subframe_Fixed fixed; Chris@1: 00348 FLAC__Subframe_LPC lpc; Chris@1: 00349 FLAC__Subframe_Verbatim verbatim; Chris@1: 00350 } data; Chris@1: 00351 unsigned wasted_bits; Chris@1: 00352 } FLAC__Subframe; Chris@1: 00353 Chris@1: 00361 extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; Chris@1: 00362 extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; Chris@1: 00363 extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; Chris@1: 00365 extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; Chris@1: 00366 extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; Chris@1: 00367 extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; Chris@1: 00368 extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; Chris@1: 00370 /*****************************************************************************/ Chris@1: 00371 Chris@1: 00372 Chris@1: 00373 /***************************************************************************** Chris@1: 00374 * Chris@1: 00375 * Frame structures Chris@1: 00376 * Chris@1: 00377 *****************************************************************************/ Chris@1: 00378 Chris@1: 00380 typedef enum { Chris@1: 00381 FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, Chris@1: 00382 FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, Chris@1: 00383 FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, Chris@1: 00384 FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 Chris@1: 00385 } FLAC__ChannelAssignment; Chris@1: 00386 Chris@1: 00392 extern FLAC_API const char * const FLAC__ChannelAssignmentString[]; Chris@1: 00393 Chris@1: 00395 typedef enum { Chris@1: 00396 FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER, Chris@1: 00397 FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER Chris@1: 00398 } FLAC__FrameNumberType; Chris@1: 00399 Chris@1: 00405 extern FLAC_API const char * const FLAC__FrameNumberTypeString[]; Chris@1: 00406 Chris@1: 00407 Chris@1: 00410 typedef struct { Chris@1: 00411 unsigned blocksize; Chris@1: 00414 unsigned sample_rate; Chris@1: 00417 unsigned channels; Chris@1: 00420 FLAC__ChannelAssignment channel_assignment; Chris@1: 00423 unsigned bits_per_sample; Chris@1: 00426 FLAC__FrameNumberType number_type; Chris@1: 00431 union { Chris@1: 00432 FLAC__uint32 frame_number; Chris@1: 00433 FLAC__uint64 sample_number; Chris@1: 00434 } number; Chris@1: 00438 FLAC__uint8 crc; Chris@1: 00443 } FLAC__FrameHeader; Chris@1: 00444 Chris@1: 00445 extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; Chris@1: 00446 extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; Chris@1: 00447 extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; Chris@1: 00448 extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN; Chris@1: 00449 extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; Chris@1: 00450 extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; Chris@1: 00451 extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; Chris@1: 00452 extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; Chris@1: 00453 extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; Chris@1: 00454 extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; Chris@1: 00459 typedef struct { Chris@1: 00460 FLAC__uint16 crc; Chris@1: 00465 } FLAC__FrameFooter; Chris@1: 00466 Chris@1: 00467 extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; Chris@1: 00472 typedef struct { Chris@1: 00473 FLAC__FrameHeader header; Chris@1: 00474 FLAC__Subframe subframes[FLAC__MAX_CHANNELS]; Chris@1: 00475 FLAC__FrameFooter footer; Chris@1: 00476 } FLAC__Frame; Chris@1: 00477 Chris@1: 00478 /*****************************************************************************/ Chris@1: 00479 Chris@1: 00480 Chris@1: 00481 /***************************************************************************** Chris@1: 00482 * Chris@1: 00483 * Meta-data structures Chris@1: 00484 * Chris@1: 00485 *****************************************************************************/ Chris@1: 00486 Chris@1: 00488 typedef enum { Chris@1: 00489 Chris@1: 00490 FLAC__METADATA_TYPE_STREAMINFO = 0, Chris@1: 00493 FLAC__METADATA_TYPE_PADDING = 1, Chris@1: 00496 FLAC__METADATA_TYPE_APPLICATION = 2, Chris@1: 00499 FLAC__METADATA_TYPE_SEEKTABLE = 3, Chris@1: 00502 FLAC__METADATA_TYPE_VORBIS_COMMENT = 4, Chris@1: 00505 FLAC__METADATA_TYPE_CUESHEET = 5, Chris@1: 00508 FLAC__METADATA_TYPE_PICTURE = 6, Chris@1: 00511 FLAC__METADATA_TYPE_UNDEFINED = 7 Chris@1: 00514 } FLAC__MetadataType; Chris@1: 00515 Chris@1: 00521 extern FLAC_API const char * const FLAC__MetadataTypeString[]; Chris@1: 00522 Chris@1: 00523 Chris@1: 00526 typedef struct { Chris@1: 00527 unsigned min_blocksize, max_blocksize; Chris@1: 00528 unsigned min_framesize, max_framesize; Chris@1: 00529 unsigned sample_rate; Chris@1: 00530 unsigned channels; Chris@1: 00531 unsigned bits_per_sample; Chris@1: 00532 FLAC__uint64 total_samples; Chris@1: 00533 FLAC__byte md5sum[16]; Chris@1: 00534 } FLAC__StreamMetadata_StreamInfo; Chris@1: 00535 Chris@1: 00536 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; Chris@1: 00537 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; Chris@1: 00538 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; Chris@1: 00539 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; Chris@1: 00540 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; Chris@1: 00541 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; Chris@1: 00542 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; Chris@1: 00543 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; Chris@1: 00544 extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; Chris@1: 00547 #define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u) Chris@1: 00548 Chris@1: 00551 typedef struct { Chris@1: 00552 int dummy; Chris@1: 00557 } FLAC__StreamMetadata_Padding; Chris@1: 00558 Chris@1: 00559 Chris@1: 00562 typedef struct { Chris@1: 00563 FLAC__byte id[4]; Chris@1: 00564 FLAC__byte *data; Chris@1: 00565 } FLAC__StreamMetadata_Application; Chris@1: 00566 Chris@1: 00567 extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; Chris@1: 00571 typedef struct { Chris@1: 00572 FLAC__uint64 sample_number; Chris@1: 00575 FLAC__uint64 stream_offset; Chris@1: 00579 unsigned frame_samples; Chris@1: 00581 } FLAC__StreamMetadata_SeekPoint; Chris@1: 00582 Chris@1: 00583 extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; Chris@1: 00584 extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; Chris@1: 00585 extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; Chris@1: 00588 #define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u) Chris@1: 00589 Chris@1: 00594 extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER; Chris@1: 00595 Chris@1: 00596 Chris@1: 00609 typedef struct { Chris@1: 00610 unsigned num_points; Chris@1: 00611 FLAC__StreamMetadata_SeekPoint *points; Chris@1: 00612 } FLAC__StreamMetadata_SeekTable; Chris@1: 00613 Chris@1: 00614 Chris@1: 00621 typedef struct { Chris@1: 00622 FLAC__uint32 length; Chris@1: 00623 FLAC__byte *entry; Chris@1: 00624 } FLAC__StreamMetadata_VorbisComment_Entry; Chris@1: 00625 Chris@1: 00626 extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; Chris@1: 00631 typedef struct { Chris@1: 00632 FLAC__StreamMetadata_VorbisComment_Entry vendor_string; Chris@1: 00633 FLAC__uint32 num_comments; Chris@1: 00634 FLAC__StreamMetadata_VorbisComment_Entry *comments; Chris@1: 00635 } FLAC__StreamMetadata_VorbisComment; Chris@1: 00636 Chris@1: 00637 extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; Chris@1: 00644 typedef struct { Chris@1: 00645 FLAC__uint64 offset; Chris@1: 00650 FLAC__byte number; Chris@1: 00652 } FLAC__StreamMetadata_CueSheet_Index; Chris@1: 00653 Chris@1: 00654 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN; Chris@1: 00655 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN; Chris@1: 00656 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN; Chris@1: 00663 typedef struct { Chris@1: 00664 FLAC__uint64 offset; Chris@1: 00667 FLAC__byte number; Chris@1: 00670 char isrc[13]; Chris@1: 00673 unsigned type:1; Chris@1: 00676 unsigned pre_emphasis:1; Chris@1: 00679 FLAC__byte num_indices; Chris@1: 00682 FLAC__StreamMetadata_CueSheet_Index *indices; Chris@1: 00685 } FLAC__StreamMetadata_CueSheet_Track; Chris@1: 00686 Chris@1: 00687 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN; Chris@1: 00688 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN; Chris@1: 00689 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN; Chris@1: 00690 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN; Chris@1: 00691 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN; Chris@1: 00692 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN; Chris@1: 00693 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN; Chris@1: 00700 typedef struct { Chris@1: 00701 char media_catalog_number[129]; Chris@1: 00707 FLAC__uint64 lead_in; Chris@1: 00710 FLAC__bool is_cd; Chris@1: 00713 unsigned num_tracks; Chris@1: 00716 FLAC__StreamMetadata_CueSheet_Track *tracks; Chris@1: 00719 } FLAC__StreamMetadata_CueSheet; Chris@1: 00720 Chris@1: 00721 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN; Chris@1: 00722 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN; Chris@1: 00723 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN; Chris@1: 00724 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN; Chris@1: 00725 extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN; Chris@1: 00729 typedef enum { Chris@1: 00730 FLAC__STREAM_METADATA_PICTURE_TYPE_OTHER = 0, Chris@1: 00731 FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON_STANDARD = 1, Chris@1: 00732 FLAC__STREAM_METADATA_PICTURE_TYPE_FILE_ICON = 2, Chris@1: 00733 FLAC__STREAM_METADATA_PICTURE_TYPE_FRONT_COVER = 3, Chris@1: 00734 FLAC__STREAM_METADATA_PICTURE_TYPE_BACK_COVER = 4, Chris@1: 00735 FLAC__STREAM_METADATA_PICTURE_TYPE_LEAFLET_PAGE = 5, Chris@1: 00736 FLAC__STREAM_METADATA_PICTURE_TYPE_MEDIA = 6, Chris@1: 00737 FLAC__STREAM_METADATA_PICTURE_TYPE_LEAD_ARTIST = 7, Chris@1: 00738 FLAC__STREAM_METADATA_PICTURE_TYPE_ARTIST = 8, Chris@1: 00739 FLAC__STREAM_METADATA_PICTURE_TYPE_CONDUCTOR = 9, Chris@1: 00740 FLAC__STREAM_METADATA_PICTURE_TYPE_BAND = 10, Chris@1: 00741 FLAC__STREAM_METADATA_PICTURE_TYPE_COMPOSER = 11, Chris@1: 00742 FLAC__STREAM_METADATA_PICTURE_TYPE_LYRICIST = 12, Chris@1: 00743 FLAC__STREAM_METADATA_PICTURE_TYPE_RECORDING_LOCATION = 13, Chris@1: 00744 FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_RECORDING = 14, Chris@1: 00745 FLAC__STREAM_METADATA_PICTURE_TYPE_DURING_PERFORMANCE = 15, Chris@1: 00746 FLAC__STREAM_METADATA_PICTURE_TYPE_VIDEO_SCREEN_CAPTURE = 16, Chris@1: 00747 FLAC__STREAM_METADATA_PICTURE_TYPE_FISH = 17, Chris@1: 00748 FLAC__STREAM_METADATA_PICTURE_TYPE_ILLUSTRATION = 18, Chris@1: 00749 FLAC__STREAM_METADATA_PICTURE_TYPE_BAND_LOGOTYPE = 19, Chris@1: 00750 FLAC__STREAM_METADATA_PICTURE_TYPE_PUBLISHER_LOGOTYPE = 20, Chris@1: 00751 FLAC__STREAM_METADATA_PICTURE_TYPE_UNDEFINED Chris@1: 00752 } FLAC__StreamMetadata_Picture_Type; Chris@1: 00753 Chris@1: 00760 extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[]; Chris@1: 00761 Chris@1: 00766 typedef struct { Chris@1: 00767 FLAC__StreamMetadata_Picture_Type type; Chris@1: 00770 char *mime_type; Chris@1: 00781 FLAC__byte *description; Chris@1: 00788 FLAC__uint32 width; Chris@1: 00791 FLAC__uint32 height; Chris@1: 00794 FLAC__uint32 depth; Chris@1: 00797 FLAC__uint32 colors; Chris@1: 00802 FLAC__uint32 data_length; Chris@1: 00805 FLAC__byte *data; Chris@1: 00808 } FLAC__StreamMetadata_Picture; Chris@1: 00809 Chris@1: 00810 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_TYPE_LEN; Chris@1: 00811 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN; Chris@1: 00812 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN; Chris@1: 00813 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN; Chris@1: 00814 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN; Chris@1: 00815 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN; Chris@1: 00816 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_COLORS_LEN; Chris@1: 00817 extern FLAC_API const unsigned FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN; Chris@1: 00824 typedef struct { Chris@1: 00825 FLAC__byte *data; Chris@1: 00826 } FLAC__StreamMetadata_Unknown; Chris@1: 00827 Chris@1: 00828 Chris@1: 00831 typedef struct { Chris@1: 00832 FLAC__MetadataType type; Chris@1: 00837 FLAC__bool is_last; Chris@1: 00840 unsigned length; Chris@1: 00843 union { Chris@1: 00844 FLAC__StreamMetadata_StreamInfo stream_info; Chris@1: 00845 FLAC__StreamMetadata_Padding padding; Chris@1: 00846 FLAC__StreamMetadata_Application application; Chris@1: 00847 FLAC__StreamMetadata_SeekTable seek_table; Chris@1: 00848 FLAC__StreamMetadata_VorbisComment vorbis_comment; Chris@1: 00849 FLAC__StreamMetadata_CueSheet cue_sheet; Chris@1: 00850 FLAC__StreamMetadata_Picture picture; Chris@1: 00851 FLAC__StreamMetadata_Unknown unknown; Chris@1: 00852 } data; Chris@1: 00855 } FLAC__StreamMetadata; Chris@1: 00856 Chris@1: 00857 extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; Chris@1: 00858 extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN; Chris@1: 00859 extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; Chris@1: 00862 #define FLAC__STREAM_METADATA_HEADER_LENGTH (4u) Chris@1: 00863 Chris@1: 00864 /*****************************************************************************/ Chris@1: 00865 Chris@1: 00866 Chris@1: 00867 /***************************************************************************** Chris@1: 00868 * Chris@1: 00869 * Utility functions Chris@1: 00870 * Chris@1: 00871 *****************************************************************************/ Chris@1: 00872 Chris@1: 00880 FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate); Chris@1: 00881 Chris@1: 00891 FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(unsigned sample_rate); Chris@1: 00892 Chris@1: 00905 FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name); Chris@1: 00906 Chris@1: 00921 FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, unsigned length); Chris@1: 00922 Chris@1: 00938 FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, unsigned length); Chris@1: 00939 Chris@1: 00950 FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table); Chris@1: 00951 Chris@1: 00964 FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table); Chris@1: 00965 Chris@1: 00984 FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation); Chris@1: 00985 Chris@1: 01002 FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation); Chris@1: 01003 Chris@1: 01004 /* \} */ Chris@1: 01005 Chris@1: 01006 #ifdef __cplusplus Chris@1: 01007 } Chris@1: 01008 #endif Chris@1: 01009 Chris@1: 01010 #endif Chris@1: