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  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 "format.h"
00024 
00025 /******************************************************************************
00026     (For an example of how all these routines are used, see the source
00027     code for the unit tests in src/test_libFLAC/metadata_*.c, or metaflac
00028     in src/metaflac/)
00029 ******************************************************************************/
00030 
00098 #ifdef __cplusplus
00099 extern "C" {
00100 #endif
00101 
00102 
00128 FLAC__bool FLAC__metadata_get_streaminfo(const char *filename, FLAC__StreamMetadata *streaminfo);
00129 
00130 /* \} */
00131 
00132 
00188 struct FLAC__Metadata_SimpleIterator;
00194 typedef struct FLAC__Metadata_SimpleIterator FLAC__Metadata_SimpleIterator;
00195 
00200 typedef enum {
00201 
00202     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_OK = 0,
00205     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ILLEGAL_INPUT,
00208     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_ERROR_OPENING_FILE,
00211     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_A_FLAC_FILE,
00214     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_NOT_WRITABLE,
00217     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_BAD_METADATA,
00220     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_READ_ERROR,
00223     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_SEEK_ERROR,
00226     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_WRITE_ERROR,
00229     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_RENAME_ERROR,
00232     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_UNLINK_ERROR,
00235     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_MEMORY_ALLOCATION_ERROR,
00238     FLAC__METADATA_SIMPLE_ITERATOR_STATUS_INTERNAL_ERROR
00241 } FLAC__Metadata_SimpleIteratorStatus;
00242 
00248 extern const char * const FLAC__Metadata_SimpleIteratorStatusString[];
00249 
00250 
00256 FLAC__Metadata_SimpleIterator *FLAC__metadata_simple_iterator_new();
00257 
00264 void FLAC__metadata_simple_iterator_delete(FLAC__Metadata_SimpleIterator *iterator);
00265 
00276 FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_status(FLAC__Metadata_SimpleIterator *iterator);
00277 
00297 FLAC__bool FLAC__metadata_simple_iterator_init(FLAC__Metadata_SimpleIterator *iterator, const char *filename, FLAC__bool read_only, FLAC__bool preserve_file_stats);
00298 
00309 FLAC__bool FLAC__metadata_simple_iterator_is_writable(const FLAC__Metadata_SimpleIterator *iterator);
00310 
00323 FLAC__bool FLAC__metadata_simple_iterator_next(FLAC__Metadata_SimpleIterator *iterator);
00324 
00337 FLAC__bool FLAC__metadata_simple_iterator_prev(FLAC__Metadata_SimpleIterator *iterator);
00338 
00352 FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const FLAC__Metadata_SimpleIterator *iterator);
00353 
00369 FLAC__StreamMetadata *FLAC__metadata_simple_iterator_get_block(FLAC__Metadata_SimpleIterator *iterator);
00370 
00425 FLAC__bool FLAC__metadata_simple_iterator_set_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding);
00426 
00450 FLAC__bool FLAC__metadata_simple_iterator_insert_block_after(FLAC__Metadata_SimpleIterator *iterator, FLAC__StreamMetadata *block, FLAC__bool use_padding);
00451 
00469 FLAC__bool FLAC__metadata_simple_iterator_delete_block(FLAC__Metadata_SimpleIterator *iterator, FLAC__bool use_padding);
00470 
00471 /* \} */
00472 
00473 
00526 struct FLAC__Metadata_Chain;
00529 typedef struct FLAC__Metadata_Chain FLAC__Metadata_Chain;
00530 
00531 struct FLAC__Metadata_Iterator;
00534 typedef struct FLAC__Metadata_Iterator FLAC__Metadata_Iterator;
00535 
00536 typedef enum {
00537     FLAC__METADATA_CHAIN_STATUS_OK = 0,
00540     FLAC__METADATA_CHAIN_STATUS_ILLEGAL_INPUT,
00543     FLAC__METADATA_CHAIN_STATUS_ERROR_OPENING_FILE,
00546     FLAC__METADATA_CHAIN_STATUS_NOT_A_FLAC_FILE,
00549     FLAC__METADATA_CHAIN_STATUS_NOT_WRITABLE,
00552     FLAC__METADATA_CHAIN_STATUS_BAD_METADATA,
00555     FLAC__METADATA_CHAIN_STATUS_READ_ERROR,
00558     FLAC__METADATA_CHAIN_STATUS_SEEK_ERROR,
00561     FLAC__METADATA_CHAIN_STATUS_WRITE_ERROR,
00564     FLAC__METADATA_CHAIN_STATUS_RENAME_ERROR,
00567     FLAC__METADATA_CHAIN_STATUS_UNLINK_ERROR,
00570     FLAC__METADATA_CHAIN_STATUS_MEMORY_ALLOCATION_ERROR,
00573     FLAC__METADATA_CHAIN_STATUS_INTERNAL_ERROR
00576 } FLAC__Metadata_ChainStatus;
00577 
00583 extern const char * const FLAC__Metadata_ChainStatusString[];
00584 
00585 /*********** FLAC__Metadata_Chain ***********/
00586 
00592 FLAC__Metadata_Chain *FLAC__metadata_chain_new();
00593 
00600 void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain);
00601 
00612 FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain);
00613 
00626 FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename);
00627 
00668 FLAC__bool FLAC__metadata_chain_write(FLAC__Metadata_Chain *chain, FLAC__bool use_padding, FLAC__bool preserve_file_stats);
00669 
00682 void FLAC__metadata_chain_merge_padding(FLAC__Metadata_Chain *chain);
00683 
00697 void FLAC__metadata_chain_sort_padding(FLAC__Metadata_Chain *chain);
00698 
00699 
00700 /*********** FLAC__Metadata_Iterator ***********/
00701 
00707 FLAC__Metadata_Iterator *FLAC__metadata_iterator_new();
00708 
00715 void FLAC__metadata_iterator_delete(FLAC__Metadata_Iterator *iterator);
00716 
00726 void FLAC__metadata_iterator_init(FLAC__Metadata_Iterator *iterator, FLAC__Metadata_Chain *chain);
00727 
00740 FLAC__bool FLAC__metadata_iterator_next(FLAC__Metadata_Iterator *iterator);
00741 
00754 FLAC__bool FLAC__metadata_iterator_prev(FLAC__Metadata_Iterator *iterator);
00755 
00766 FLAC__MetadataType FLAC__metadata_iterator_get_block_type(const FLAC__Metadata_Iterator *iterator);
00767 
00787 FLAC__StreamMetadata *FLAC__metadata_iterator_get_block(FLAC__Metadata_Iterator *iterator);
00788 
00804 FLAC__bool FLAC__metadata_iterator_set_block(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block);
00805 
00822 FLAC__bool FLAC__metadata_iterator_delete_block(FLAC__Metadata_Iterator *iterator, FLAC__bool replace_with_padding);
00823 
00841 FLAC__bool FLAC__metadata_iterator_insert_block_before(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block);
00842 
00859 FLAC__bool FLAC__metadata_iterator_insert_block_after(FLAC__Metadata_Iterator *iterator, FLAC__StreamMetadata *block);
00860 
00861 /* \} */
00862 
00863 
00911 FLAC__StreamMetadata *FLAC__metadata_object_new(FLAC__MetadataType type);
00912 
00925 FLAC__StreamMetadata *FLAC__metadata_object_clone(const FLAC__StreamMetadata *object);
00926 
00936 void FLAC__metadata_object_delete(FLAC__StreamMetadata *object);
00937 
00951 FLAC__bool FLAC__metadata_object_is_equal(const FLAC__StreamMetadata *block1, const FLAC__StreamMetadata *block2);
00952 
00971 FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetadata *object, FLAC__byte *data, unsigned length, FLAC__bool copy);
00972 
00988 FLAC__bool FLAC__metadata_object_seektable_resize_points(FLAC__StreamMetadata *object, unsigned new_num_points);
00989 
01000 void FLAC__metadata_object_seektable_set_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point);
01001 
01014 FLAC__bool FLAC__metadata_object_seektable_insert_point(FLAC__StreamMetadata *object, unsigned point_num, FLAC__StreamMetadata_SeekPoint point);
01015 
01027 FLAC__bool FLAC__metadata_object_seektable_delete_point(FLAC__StreamMetadata *object, unsigned point_num);
01028 
01040 FLAC__bool FLAC__metadata_object_seektable_is_legal(const FLAC__StreamMetadata *object);
01041 
01057 FLAC__bool FLAC__metadata_object_seektable_template_append_placeholders(FLAC__StreamMetadata *object, unsigned num);
01058 
01074 FLAC__bool FLAC__metadata_object_seektable_template_append_point(FLAC__StreamMetadata *object, FLAC__uint64 sample_number);
01075 
01092 FLAC__bool FLAC__metadata_object_seektable_template_append_points(FLAC__StreamMetadata *object, FLAC__uint64 sample_numbers[], unsigned num);
01093 
01113 FLAC__bool FLAC__metadata_object_seektable_template_append_spaced_points(FLAC__StreamMetadata *object, unsigned num, FLAC__uint64 total_samples);
01114 
01130 FLAC__bool FLAC__metadata_object_seektable_template_sort(FLAC__StreamMetadata *object, FLAC__bool compact);
01131 
01149 FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__StreamMetadata *object, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy);
01150 
01166 FLAC__bool FLAC__metadata_object_vorbiscomment_resize_comments(FLAC__StreamMetadata *object, unsigned new_num_comments);
01167 
01186 FLAC__bool FLAC__metadata_object_vorbiscomment_set_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy);
01187 
01210 FLAC__bool FLAC__metadata_object_vorbiscomment_insert_comment(FLAC__StreamMetadata *object, unsigned comment_num, FLAC__StreamMetadata_VorbisComment_Entry entry, FLAC__bool copy);
01211 
01229 FLAC__bool FLAC__metadata_object_vorbiscomment_delete_comment(FLAC__StreamMetadata *object, unsigned comment_num);
01230 
01231 /* \} */
01232 
01233 #ifdef __cplusplus
01234 }
01235 #endif
01236 
01237 #endif

Generated on Tue Sep 24 21:17:41 2002 for FLAC by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002