Main Page Modules Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# include/FLAC/metadata.h

Go to the documentation of this file.

    00001 /* libFLAC - Free Lossless Audio Codec library
    00002  * Copyright (C) 2001,2002,2003  Josh Coalson
    00003  *
    00004  * This library is free software; you can redistribute it and/or
    00005  * modify it under the terms of the GNU Library General Public
    00006  * License as published by the Free Software Foundation; either
    00007  * version 2 of the License, or (at your option) any later version.
    00008  *
    00009  * This library is distributed in the hope that it will be useful,
    00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012  * Library General Public License for more details.
    00013  *
    00014  * You should have received a copy of the GNU Library General Public
    00015  * License along with this library; if not, write to the
    00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00017  * Boston, MA  02111-1307, USA.
    00018  */
    00019
    00020 #ifndef FLAC__METADATA_H
    00021 #define FLAC__METADATA_H
    00022
    00023 #include "export.h"
    00024 #include "format.h"
    00025
    00026 /******************************************************************************
    00027     (For an example of how all these routines are used, see the source
    00028     code for the unit tests in src/test_libFLAC/metadata_*.c, or metaflac
    00029     in src/metaflac/)
    00030 ******************************************************************************/
    00031
    00099 #ifdef __cplusplus
    00100 extern "C" {
    00101 #endif
    00102
    00103
    00129 FLAC_API FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo);
    00130
    00131 /* \} */
    00132
    00133
    00189 struct FLAC__Metadata_SimpleIterator;
    00195 typedef struct FLAC__Metadata_SimpleIterator FLAC__Metadata_SimpleIterator;
    00196
    00201 typedef enum {
    00202
    00203     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0,
    00206     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT,
    00209     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE,
    00212     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE,
    00215     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE,
    00218     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA,
    00221     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR,
    00224     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR,
    00227     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR,
    00230     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR,
    00233     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR,
    00236     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR,
    00239     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR
    00242 } FLAC__Metadata_SimpleIteratorStatus;
    00243
    00249 extern FLAC_API const char * const FLAC__Metadata_SimpleIteratorStatusString[];
    00250
    00251
    00257 FLAC_API FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new();
    00258
    00265 FLAC_API void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator);
    00266
    00277 FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator);
    00278
    00298 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats);
    00299
    00310 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator);
    00311
    00324 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator);
    00325
    00338 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator);
    00339
    00353 FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator);
    00354
    00370 FLAC_API FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator);
    00371
    00426 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding);
    00427
    00451 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding);
    00452
    00470 FLAC_API FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding);
    00471
    00472 /* \} */
    00473
    00474
    00527 struct FLAC__Metadata_Chain;
    00530 typedef struct FLAC__Metadata_Chain FLAC__Metadata_Chain;
    00531
    00532 struct FLAC__Metadata_Iterator;
    00535 typedef struct FLAC__Metadata_Iterator FLAC__Metadata_Iterator;
    00536
    00537 typedef enum {
    00538     FLAC__METADATA_CHAIN_STATUS_OK = 0,
    00541     FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT,
    00544     FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE,
    00547     FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE,
    00550     FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE,
    00553     FLAC__METADATA_CHAIN_STATUS_BAD_METADATA,
    00556     FLAC__METADATA_CHAIN_STATUS_READ_ERROR,
    00559     FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR,
    00562     FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR,
    00565     FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR,
    00568     FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR,
    00571     FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR,
    00574     FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR
    00577 } FLAC__Metadata_ChainStatus;
    00578
    00584 extern FLAC_API const char * const FLAC__Metadata_ChainStatusString[];
    00585
    00586 /*********** FLAC__Metadata_Chain ***********/
    00587
    00593 FLAC_API FLAC__Metadata_Chain *FLAC__metadata_chain_new();
    00594
    00601 FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain);
    00602
    00613 FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain);
    00614
    00627 FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename);
    00628
    00669 FLAC_API FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats);
    00670
    00683 FLAC_API void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain);
    00684
    00698 FLAC_API void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain);
    00699
    00700
    00701 /*********** FLAC__Metadata_Iterator ***********/
    00702
    00708 FLAC_API FLAC__Metadata_Iterator *FLAC__metadata_iterator_new();
    00709
    00716 FLAC_API void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator);
    00717
    00727 FLAC_API void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain);
    00728
    00741 FLAC_API FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator);
    00742
    00755 FLAC_API FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator);
    00756
    00767 FLAC_API FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator);
    00768
    00788 FLAC_API FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator);
    00789
    00805 FLAC_API FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block);
    00806
    00823 FLAC_API FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding);
    00824
    00842 FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block);
    00843
    00860 FLAC_API FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block);
    00861
    00862 /* \} */
    00863
    00864
    00918 FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type);
    00919
    00932 FLAC_API FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object);
    00933
    00943 FLAC_API void FLAC__metadata_object_delete(FLAC__StreamMetadata *object);
    00944
    00958 FLAC_API FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2);
    00959
    00978 FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy);
    00979
    00995 FLAC_API FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points);
    00996
    01007 FLAC_API void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point);
    01008
    01021 FLAC_API FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point);
    01022
    01034 FLAC_API FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num);
    01035
    01047 FLAC_API FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object);
    01048
    01064 FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num);
    01065
    01081 FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number);
    01082
    01099 FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num);
    01100
    01120 FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples);
    01121
    01137 FLAC_API FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact);
    01138
    01156 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy);
    01157
    01173 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments);
    01174
    01194 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy);
    01195
    01218 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy);
    01219
    01233 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num);
    01234
    01235 /*@@@@ add to unit tests */
    01249 FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_entry_matches(const FLAC__StreamMetadata_VorbisComment_Entry *entry, const char *field_name, unsigned field_name_length);
    01250
    01251 /*@@@@ add to unit tests */
    01268 FLAC_API int FLAC__metadata_object_vorbiscomment_find_entry_from(const FLAC__StreamMetadata *object, unsigned offset, const char *field_name);
    01269
    01270 /*@@@@ add to unit tests */
    01282 FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entry_matching(FLAC__StreamMetadata *object, const char *field_name);
    01283
    01284 /*@@@@ add to unit tests */
    01296 FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name);
    01297
    01305 FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new();
    01306
    01320 FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object);
    01321
    01328 FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object);
    01329
    01348 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices);
    01349
    01371 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index);
    01372
    01395 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num);
    01396
    01414 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num);
    01415
    01431 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_resize_tracks(FLAC__StreamMetadata *object, unsigned new_num_tracks);
    01432
    01454 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_set_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy);
    01455
    01478 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_track(FLAC__StreamMetadata *object, unsigned track_num, FLAC__StreamMetadata_CueSheet_Track *track, FLAC__bool copy);
    01479
    01497 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_insert_blank_track(FLAC__StreamMetadata *object, unsigned track_num);
    01498
    01512 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_delete_track(FLAC__StreamMetadata *object, unsigned track_num);
    01513
    01533 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_is_legal(const FLAC__StreamMetadata *object, FLAC__bool check_cd_da_subset, const char **violation);
    01534
    01535 /* \} */
    01536
    01537 #ifdef __cplusplus
    01538 }
    01539 #endif
    01540
    01541 #endif