778
790
//! See FLAC__metadata_object_cuesheet_is_legal()
779
791
bool is_legal(bool check_cd_da_subset = false, const char **violation = 0) const;
793
//! See FLAC__metadata_object_cuesheet_calculate_cddb_id()
794
FLAC__uint32 calculate_cddb_id() const;
797
/** PICTURE metadata block.
798
* See the \link flacpp_metadata_object overview \endlink for more,
799
* and the <A HREF="../format.html#metadata_block_picture">format specification</A>.
801
class FLACPP_API Picture : public Prototype {
806
/** Constructs a copy of the given object. This form
807
* always performs a deep copy.
809
inline Picture(const Picture &object): Prototype(object) { }
810
inline Picture(const ::FLAC__StreamMetadata &object): Prototype(object) { }
811
inline Picture(const ::FLAC__StreamMetadata *object): Prototype(object) { }
814
/** Constructs an object with copy control. See
815
* Prototype(::FLAC__StreamMetadata *object, bool copy).
817
inline Picture(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
822
/** Assign from another object. Always performs a deep copy. */
823
inline Picture &operator=(const Picture &object) { Prototype::operator=(object); return *this; }
824
inline Picture &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; }
825
inline Picture &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; }
828
/** Assigns an object with copy control. See
829
* Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy).
831
inline Picture &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; }
834
/** Check for equality, performing a deep compare by following pointers. */
835
inline bool operator==(const Picture &object) const { return Prototype::operator==(object); }
836
inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); }
837
inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); }
841
/** Check for inequality, performing a deep compare by following pointers. */
842
inline bool operator!=(const Picture &object) const { return Prototype::operator!=(object); }
843
inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); }
844
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
847
::FLAC__StreamMetadata_Picture_Type get_type() const;
848
const char *get_mime_type() const; // NUL-terminated printable ASCII string
849
const FLAC__byte *get_description() const; // NUL-terminated UTF-8 string
850
FLAC__uint32 get_width() const;
851
FLAC__uint32 get_height() const;
852
FLAC__uint32 get_depth() const;
853
FLAC__uint32 get_colors() const; ///< a return value of \c 0 means true-color, i.e. 2^depth colors
854
FLAC__uint32 get_data_length() const;
855
const FLAC__byte *get_data() const;
857
void set_type(::FLAC__StreamMetadata_Picture_Type type);
859
//! See FLAC__metadata_object_picture_set_mime_type()
860
bool set_mime_type(const char *string); // NUL-terminated printable ASCII string
862
//! See FLAC__metadata_object_picture_set_description()
863
bool set_description(const FLAC__byte *string); // NUL-terminated UTF-8 string
865
void set_width(FLAC__uint32 value) const;
866
void set_height(FLAC__uint32 value) const;
867
void set_depth(FLAC__uint32 value) const;
868
void set_colors(FLAC__uint32 value) const; ///< a value of \c 0 means true-color, i.e. 2^depth colors
870
//! See FLAC__metadata_object_picture_set_data()
871
bool set_data(const FLAC__byte *data, FLAC__uint32 data_length);
782
874
/** Opaque metadata block for storing unknown types.
783
875
* This should not be used unless you know what you are doing;
784
876
* it is currently used only internally to support forward
785
877
* compatibility of metadata blocks.
878
* See the \link flacpp_metadata_object overview \endlink for more,
787
880
class FLACPP_API Unknown : public Prototype {
855
//! See FLAC__metadata_get_streaminfo().
856
FLACPP_API bool get_streaminfo(const char *filename, StreamInfo &streaminfo);
858
//! See FLAC__metadata_get_tags().
859
FLACPP_API bool get_tags(const char *filename, VorbisComment *&tags);
860
FLACPP_API bool get_tags(const char *filename, VorbisComment &tags);
948
FLACPP_API bool get_streaminfo(const char *filename, StreamInfo &streaminfo); ///< See FLAC__metadata_get_streaminfo().
950
FLACPP_API bool get_tags(const char *filename, VorbisComment *&tags); ///< See FLAC__metadata_get_tags().
951
FLACPP_API bool get_tags(const char *filename, VorbisComment &tags); ///< See FLAC__metadata_get_tags().
953
FLACPP_API bool get_cuesheet(const char *filename, CueSheet *&cuesheet); ///< See FLAC__metadata_get_cuesheet().
954
FLACPP_API bool get_cuesheet(const char *filename, CueSheet &cuesheet); ///< See FLAC__metadata_get_cuesheet().
956
FLACPP_API bool get_picture(const char *filename, Picture *&picture, ::FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); ///< See FLAC__metadata_get_picture().
957
FLACPP_API bool get_picture(const char *filename, Picture &picture, ::FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); ///< See FLAC__metadata_get_picture().
908
1009
SimpleIterator();
909
1010
virtual ~SimpleIterator();
911
bool init(const char *filename, bool read_only, bool preserve_file_stats);
913
bool is_valid() const;
915
bool is_writable() const;
920
::FLAC__MetadataType get_block_type() const;
921
Prototype *get_block();
922
bool set_block(Prototype *block, bool use_padding = true);
923
bool insert_block_after(Prototype *block, bool use_padding = true);
924
bool delete_block(bool use_padding = true);
1012
bool is_valid() const; ///< Returns \c true iff object was properly constructed.
1014
bool init(const char *filename, bool read_only, bool preserve_file_stats); ///< See FLAC__metadata_simple_iterator_init().
1016
Status status(); ///< See FLAC__metadata_simple_iterator_status().
1017
bool is_writable() const; ///< See FLAC__metadata_simple_iterator_is_writable().
1019
bool next(); ///< See FLAC__metadata_simple_iterator_next().
1020
bool prev(); ///< See FLAC__metadata_simple_iterator_prev().
1021
bool is_last() const; ///< See FLAC__metadata_simple_iterator_is_last().
1023
off_t get_block_offset() const; ///< See FLAC__metadata_simple_iterator_get_block_offset().
1024
::FLAC__MetadataType get_block_type() const; ///< See FLAC__metadata_simple_iterator_get_block_type().
1025
unsigned get_block_length() const; ///< See FLAC__metadata_simple_iterator_get_block_length().
1026
bool get_application_id(FLAC__byte *id); ///< See FLAC__metadata_simple_iterator_get_application_id().
1027
Prototype *get_block(); ///< See FLAC__metadata_simple_iterator_get_block().
1028
bool set_block(Prototype *block, bool use_padding = true); ///< See FLAC__metadata_simple_iterator_set_block().
1029
bool insert_block_after(Prototype *block, bool use_padding = true); ///< See FLAC__metadata_simple_iterator_insert_block_after().
1030
bool delete_block(bool use_padding = true); ///< See FLAC__metadata_simple_iterator_delete_block().
927
1033
::FLAC__Metadata_SimpleIterator *iterator_;
988
1098
friend class Iterator;
990
bool is_valid() const;
993
bool read(const char *filename);
994
bool read(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks);
996
bool check_if_tempfile_needed(bool use_padding);
998
bool write(bool use_padding = true, bool preserve_file_stats = false);
999
bool write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks);
1000
bool write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks, ::FLAC__IOHandle temp_handle, ::FLAC__IOCallbacks temp_callbacks);
1002
void merge_padding();
1003
void sort_padding();
1100
bool is_valid() const; ///< Returns \c true iff object was properly constructed.
1102
Status status(); ///< See FLAC__metadata_chain_status().
1104
bool read(const char *filename, bool is_ogg = false); ///< See FLAC__metadata_chain_read(), FLAC__metadata_chain_read_ogg().
1105
bool read(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, bool is_ogg = false); ///< See FLAC__metadata_chain_read_with_callbacks(), FLAC__metadata_chain_read_ogg_with_callbacks().
1107
bool check_if_tempfile_needed(bool use_padding); ///< See FLAC__metadata_chain_check_if_tempfile_needed().
1109
bool write(bool use_padding = true, bool preserve_file_stats = false); ///< See FLAC__metadata_chain_write().
1110
bool write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks); ///< See FLAC__metadata_chain_write_with_callbacks().
1111
bool write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks, ::FLAC__IOHandle temp_handle, ::FLAC__IOCallbacks temp_callbacks); ///< See FLAC__metadata_chain_write_with_callbacks_and_tempfile().
1113
void merge_padding(); ///< See FLAC__metadata_chain_merge_padding().
1114
void sort_padding(); ///< See FLAC__metadata_chain_sort_padding().
1006
1117
::FLAC__Metadata_Chain *chain_;
1010
1121
/** This class is a wrapper around the FLAC__metadata_iterator
1011
* structures and methods; see ::FLAC__Metadata_Iterator.
1122
* structures and methods; see the
1123
* \link flacpp_metadata_level2 usage guide \endlink and
1124
* ::FLAC__Metadata_Iterator.
1013
1126
class FLACPP_API Iterator {
1016
1129
virtual ~Iterator();
1018
bool is_valid() const;
1020
void init(Chain &chain);
1025
::FLAC__MetadataType get_block_type() const;
1026
Prototype *get_block();
1027
bool set_block(Prototype *block);
1028
bool delete_block(bool replace_with_padding);
1029
bool insert_block_before(Prototype *block);
1030
bool insert_block_after(Prototype *block);
1131
bool is_valid() const; ///< Returns \c true iff object was properly constructed.
1134
void init(Chain &chain); ///< See FLAC__metadata_iterator_init().
1136
bool next(); ///< See FLAC__metadata_iterator_next().
1137
bool prev(); ///< See FLAC__metadata_iterator_prev().
1139
::FLAC__MetadataType get_block_type() const; ///< See FLAC__metadata_iterator_get_block_type().
1140
Prototype *get_block(); ///< See FLAC__metadata_iterator_get_block().
1141
bool set_block(Prototype *block); ///< See FLAC__metadata_iterator_set_block().
1142
bool delete_block(bool replace_with_padding); ///< See FLAC__metadata_iterator_delete_block().
1143
bool insert_block_before(Prototype *block); ///< See FLAC__metadata_iterator_insert_block_before().
1144
bool insert_block_after(Prototype *block); ///< See FLAC__metadata_iterator_insert_block_after().
1033
1147
::FLAC__Metadata_Iterator *iterator_;