Commit cc68251f authored by Josh Coalson's avatar Josh Coalson
Browse files

another big glob of changes/fixes

parent eaf1f555
......@@ -30,7 +30,7 @@ and Winamp, licensed under the GPL; and 5) documentation, licensed
under the GNU Free Documentation License.
============
FLAC - 1.0.3
FLAC - 1.0.3_beta
============
This is the source release for the FLAC project. See
......
......@@ -19,7 +19,7 @@
# GNU makefile fragment for emulating stuff normally done by configure
#
VERSION=\"1.0.3\"
VERSION=\"1.0.3_beta\"
ORDINALS_H = ../../include/FLAC/ordinals.h
......
......@@ -19,7 +19,7 @@
# instead of FLAC__ since autoconf triggers off 'AC_' in strings
AC_INIT(src/flac/main.c)
AM_INIT_AUTOMAKE(flac, 1.0.3)
AM_INIT_AUTOMAKE(flac, 1.0.3_beta)
# We need two libtools, one that builds both shared and static, and
# one that builds only static. This is because the resulting libtool
......
......@@ -875,7 +875,7 @@
<UL>
<LI>Read callback - This function will be called when the decoder needs more input data. The address of the buffer to be filled is supplied, along with the number of bytes the buffer can hold. The callback may choose to supply less data and modify the byte count but must be careful not to overflow the buffer. The callback then returns a status code chosen from FLAC__StreamDecoderReadStatus.</LI>
<LI>Write callback - This function will be called when the decoder has decoded a single frame of data. The decoder will pass the frame metadata as well as an array of pointers (one for each channel) pointing to the decoded audio.</LI>
<LI>Metadata callback - This function will be called when the decoder has decoded a metadata block. There will always be one STREAMINFO block per stream, followed by zero or more other metadata blocks. These will be supplied by the decoder in the same order as they appear in the stream and always before the first audio frame. The metadata block that is passed in must not be modified, and it doesn't live beyond the callback, so you should make a copy of it with <TT>FLAC__metadata_object_copy()</TT> if you will need it elsewhere.</LI>
<LI>Metadata callback - This function will be called when the decoder has decoded a metadata block. There will always be one STREAMINFO block per stream, followed by zero or more other metadata blocks. These will be supplied by the decoder in the same order as they appear in the stream and always before the first audio frame. The metadata block that is passed in must not be modified, and it doesn't live beyond the callback, so you should make a copy of it with <TT>FLAC__metadata_object_clone()</TT> if you will need it elsewhere.</LI>
<LI>Error callback - This function will be called whenever an error occurs during decoding.</LI>
</UL>
</P>
......
......@@ -865,7 +865,7 @@
buildSettings = {
HEADER_SEARCH_PATHS = include;
OPTIMIZATION_CFLAGS = "-O3";
OTHER_CFLAGS = "-DFLAC__VERSION_STRING=\\\\\\\"1.0.3\\\\\\\"";
OTHER_CFLAGS = "-DFLAC__VERSION_STRING=\\\\\\\"1.0.3_beta\\\\\\\"";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = flac;
......@@ -995,7 +995,7 @@
buildSettings = {
HEADER_SEARCH_PATHS = include;
OPTIMIZATION_CFLAGS = "-O3";
OTHER_CFLAGS = "-DFLAC__VERSION_STRING=\\\\\\\"1.0.3\\\\\\\"";
OTHER_CFLAGS = "-DFLAC__VERSION_STRING=\\\\\\\"1.0.3_beta\\\\\\\"";
OTHER_LDFLAGS = "";
OTHER_REZFLAGS = "";
PRODUCT_NAME = metaflac;
......
......@@ -68,10 +68,10 @@ namespace FLAC {
bool is_valid() const;
inline operator bool() const { return is_valid(); }
bool set_metadata_respond(::FLAC__MetaDataType type);
bool set_metadata_respond(::FLAC__MetadataType type);
bool set_metadata_respond_application(const FLAC__byte id[4]);
bool set_metadata_respond_all();
bool set_metadata_ignore(::FLAC__MetaDataType type);
bool set_metadata_ignore(::FLAC__MetadataType type);
bool set_metadata_ignore_application(const FLAC__byte id[4]);
bool set_metadata_ignore_all();
......@@ -99,14 +99,14 @@ namespace FLAC {
protected:
virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], unsigned *bytes) = 0;
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetaData *metadata) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
::FLAC__StreamDecoder *decoder_;
private:
static ::FLAC__StreamDecoderReadStatus read_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
static ::FLAC__StreamDecoderWriteStatus write_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
static void metadata_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetaData *metadata, void *client_data);
static void metadata_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
static void error_callback_(const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data);
// Private and undefined so you can't use them:
......@@ -138,10 +138,10 @@ namespace FLAC {
inline operator bool() const { return is_valid(); }
bool set_md5_checking(bool value);
bool set_metadata_respond(::FLAC__MetaDataType type);
bool set_metadata_respond(::FLAC__MetadataType type);
bool set_metadata_respond_application(const FLAC__byte id[4]);
bool set_metadata_respond_all();
bool set_metadata_ignore(::FLAC__MetaDataType type);
bool set_metadata_ignore(::FLAC__MetadataType type);
bool set_metadata_ignore_application(const FLAC__byte id[4]);
bool set_metadata_ignore_all();
......@@ -173,7 +173,7 @@ namespace FLAC {
virtual ::FLAC__SeekableStreamDecoderLengthStatus length_callback(FLAC__uint64 *stream_length) = 0;
virtual bool eof_callback() = 0;
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetaData *metadata) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
::FLAC__SeekableStreamDecoder *decoder_;
......@@ -184,7 +184,7 @@ namespace FLAC {
static FLAC__SeekableStreamDecoderLengthStatus length_callback_(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
static FLAC__bool eof_callback_(const ::FLAC__SeekableStreamDecoder *decoder, void *client_data);
static FLAC__StreamDecoderWriteStatus write_callback_(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
static void metadata_callback_(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetaData *metadata, void *client_data);
static void metadata_callback_(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
static void error_callback_(const ::FLAC__SeekableStreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data);
// Private and undefined so you can't use them:
......@@ -217,10 +217,10 @@ namespace FLAC {
bool set_md5_checking(bool value);
bool set_filename(const char *value); // 'value' may not be 0; use "-" for stdin
bool set_metadata_respond(::FLAC__MetaDataType type);
bool set_metadata_respond(::FLAC__MetadataType type);
bool set_metadata_respond_application(const FLAC__byte id[4]);
bool set_metadata_respond_all();
bool set_metadata_ignore(::FLAC__MetaDataType type);
bool set_metadata_ignore(::FLAC__MetadataType type);
bool set_metadata_ignore_application(const FLAC__byte id[4]);
bool set_metadata_ignore_all();
......@@ -244,13 +244,13 @@ namespace FLAC {
bool seek_absolute(FLAC__uint64 sample);
protected:
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetaData *metadata) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
::FLAC__FileDecoder *decoder_;
private:
static ::FLAC__StreamDecoderWriteStatus write_callback_(const ::FLAC__FileDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
static void metadata_callback_(const ::FLAC__FileDecoder *decoder, const ::FLAC__StreamMetaData *metadata, void *client_data);
static void metadata_callback_(const ::FLAC__FileDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
static void error_callback_(const ::FLAC__FileDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data);
// Private and undefined so you can't use them:
......
......@@ -80,7 +80,7 @@ namespace FLAC {
bool set_max_residual_partition_order(unsigned value);
bool set_rice_parameter_search_dist(unsigned value);
bool set_total_samples_estimate(FLAC__uint64 value);
bool set_metadata(::FLAC__StreamMetaData **metadata, unsigned num_blocks);
bool set_metadata(::FLAC__StreamMetadata **metadata, unsigned num_blocks);
State get_state() const;
bool get_streamable_subset() const;
......@@ -110,12 +110,12 @@ namespace FLAC {
bool process_interleaved(const FLAC__int32 buffer[], unsigned samples);
protected:
virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetaData *metadata) = 0;
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
::FLAC__StreamEncoder *encoder_;
private:
static ::FLAC__StreamEncoderWriteStatus write_callback_(const ::FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data);
static void metadata_callback_(const ::FLAC__StreamEncoder *encoder, const ::FLAC__StreamMetaData *metadata, void *client_data);
static void metadata_callback_(const ::FLAC__StreamEncoder *encoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
// Private and undefined so you can't use them:
Stream(const Stream &);
......
......@@ -39,6 +39,10 @@ namespace FLAC {
//
// ============================================================
class Prototype;
Prototype *clone(const Prototype *);
// NOTE: When the get_*() methods return you a const pointer,
// DO NOT disobey and write into it. Always use the set_*()
// methods.
......@@ -46,33 +50,38 @@ namespace FLAC {
// base class for all metadata blocks
class Prototype {
protected:
Prototype(::FLAC__StreamMetaData *object, bool copy);
Prototype(const Prototype &object); // this form always copies object.object_
Prototype(const ::FLAC__StreamMetadata &object); // this form always copies
Prototype(const ::FLAC__StreamMetadata *object); // this form always copies
Prototype(::FLAC__StreamMetadata *object, bool copy); // this form allows you to pass ownership to the Prototype using copy=false
void operator=(const Prototype &);
void operator=(const ::FLAC__StreamMetaData &);
void operator=(const ::FLAC__StreamMetaData *);
inline bool operator==(const Prototype &) const;
inline bool operator==(const ::FLAC__StreamMetaData &) const;
inline bool operator==(const ::FLAC__StreamMetaData *) const;
inline bool operator!=(const Prototype &) const;
inline bool operator!=(const ::FLAC__StreamMetaData &) const;
inline bool operator!=(const ::FLAC__StreamMetaData *) const;
void operator=(const ::FLAC__StreamMetadata &); // this form always copies
void operator=(const ::FLAC__StreamMetadata *); // this form always copies
virtual void clear();
::FLAC__StreamMetaData *object_;
::FLAC__StreamMetadata *object_;
public:
virtual ~Prototype();
inline bool operator==(const Prototype &) const;
inline bool operator==(const ::FLAC__StreamMetadata &) const;
inline bool operator==(const ::FLAC__StreamMetadata *) const;
inline bool operator!=(const Prototype &) const;
inline bool operator!=(const ::FLAC__StreamMetadata &) const;
inline bool operator!=(const ::FLAC__StreamMetadata *) const;
friend class SimpleIterator;
friend class Iterator;
inline bool is_valid() const;
bool get_is_last() const;
FLAC__MetaDataType get_type() const;
FLAC__MetadataType get_type() const;
unsigned get_length() const; // NOTE: does not include the header, per spec
void set_is_last(bool);
private:
Prototype(); // Private and undefined so you can't use it
......@@ -84,19 +93,19 @@ namespace FLAC {
inline bool Prototype::operator==(const Prototype &object) const
{ return ::FLAC__metadata_object_is_equal(object_, object.object_); }
inline bool Prototype::operator==(const ::FLAC__StreamMetaData &object) const
inline bool Prototype::operator==(const ::FLAC__StreamMetadata &object) const
{ return ::FLAC__metadata_object_is_equal(object_, &object); }
inline bool Prototype::operator==(const ::FLAC__StreamMetaData *object) const
inline bool Prototype::operator==(const ::FLAC__StreamMetadata *object) const
{ return ::FLAC__metadata_object_is_equal(object_, object); }
inline bool Prototype::operator!=(const Prototype &object) const
{ return !operator==(object); }
inline bool Prototype::operator!=(const ::FLAC__StreamMetaData &object) const
inline bool Prototype::operator!=(const ::FLAC__StreamMetadata &object) const
{ return !operator==(object); }
inline bool Prototype::operator!=(const ::FLAC__StreamMetaData *object) const
inline bool Prototype::operator!=(const ::FLAC__StreamMetadata *object) const
{ return !operator==(object); }
inline bool Prototype::is_valid() const
......@@ -106,19 +115,22 @@ namespace FLAC {
class StreamInfo : public Prototype {
public:
StreamInfo();
StreamInfo(::FLAC__StreamMetaData *object, bool copy = false);
inline StreamInfo(const StreamInfo &object): Prototype(object) { }
inline StreamInfo(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline StreamInfo(const ::FLAC__StreamMetadata *object): Prototype(object) { }
inline StreamInfo(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~StreamInfo();
inline void operator=(const StreamInfo &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData *object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); }
inline bool operator==(const StreamInfo &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); }
inline bool operator!=(const StreamInfo &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
unsigned get_min_blocksize() const;
unsigned get_max_blocksize() const;
......@@ -144,19 +156,22 @@ namespace FLAC {
class Padding : public Prototype {
public:
Padding();
Padding(::FLAC__StreamMetaData *object, bool copy = false);
inline Padding(const Padding &object): Prototype(object) { }
inline Padding(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline Padding(const ::FLAC__StreamMetadata *object): Prototype(object) { }
inline Padding(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~Padding();
inline void operator=(const Padding &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData *object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); }
inline bool operator==(const Padding &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); }
inline bool operator!=(const Padding &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
void set_length(unsigned length);
};
......@@ -164,49 +179,56 @@ namespace FLAC {
class Application : public Prototype {
public:
Application();
Application(::FLAC__StreamMetaData *object, bool copy = false);
inline Application(const Application &object): Prototype(object) { }
inline Application(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline Application(const ::FLAC__StreamMetadata *object): Prototype(object) { }
inline Application(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~Application();
inline void operator=(const Application &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData *object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); }
inline bool operator==(const Application &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); }
inline bool operator!=(const Application &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
const FLAC__byte *get_id() const;
const FLAC__byte *get_data() const;
void set_id(FLAC__byte value[4]);
bool set_data(FLAC__byte *data, unsigned length, bool copy = false);
void set_id(const FLAC__byte value[4]);
bool set_data(const FLAC__byte *data, unsigned length); // this form always copies
bool set_data(FLAC__byte *data, unsigned length, bool copy);
};
class SeekTable : public Prototype {
public:
SeekTable();
SeekTable(::FLAC__StreamMetaData *object, bool copy = false);
inline SeekTable(const SeekTable &object): Prototype(object) { }
inline SeekTable(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline SeekTable(const ::FLAC__StreamMetadata *object): Prototype(object) { }
inline SeekTable(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~SeekTable();
inline void operator=(const SeekTable &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData *object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); }
inline bool operator==(const SeekTable &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); }
inline bool operator!=(const SeekTable &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
unsigned get_num_points() const;
::FLAC__StreamMetaData_SeekPoint get_point(unsigned index) const;
::FLAC__StreamMetadata_SeekPoint get_point(unsigned index) const;
void set_point(unsigned index, const ::FLAC__StreamMetaData_SeekPoint &point);
bool insert_point(unsigned index, const ::FLAC__StreamMetaData_SeekPoint &point);
void set_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point);
bool insert_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point);
bool delete_point(unsigned index);
bool is_legal() const;
......@@ -230,7 +252,7 @@ namespace FLAC {
unsigned get_field_name_length() const;
unsigned get_field_value_length() const;
::FLAC__StreamMetaData_VorbisComment_Entry get_entry() const;
::FLAC__StreamMetadata_VorbisComment_Entry get_entry() const;
const char *get_field() const;
const char *get_field_name() const;
const char *get_field_value() const;
......@@ -240,7 +262,7 @@ namespace FLAC {
bool set_field_value(const char *field_value, unsigned field_value_length);
protected:
bool is_valid_;
::FLAC__StreamMetaData_VorbisComment_Entry entry_;
::FLAC__StreamMetadata_VorbisComment_Entry entry_;
char *field_name_;
unsigned field_name_length_;
char *field_value_;
......@@ -258,25 +280,28 @@ namespace FLAC {
};
VorbisComment();
VorbisComment(::FLAC__StreamMetaData *object, bool copy = false);
inline VorbisComment(const VorbisComment &object): Prototype(object) { }
inline VorbisComment(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline VorbisComment(const ::FLAC__StreamMetadata *object): Prototype(object) { }
inline VorbisComment(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~VorbisComment();
inline void operator=(const VorbisComment &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetaData *object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); }
inline void operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); }
inline bool operator==(const VorbisComment &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); }
inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); }
inline bool operator!=(const VorbisComment &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetaData &object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetaData *object) const { return Prototype::operator==(object); }
inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); }
inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); }
unsigned get_num_comments() const;
Entry get_vendor_string() const;
Entry get_vendor_string() const; // only the Entry's field name should be used
Entry get_comment(unsigned index) const;
bool set_vendor_string(const Entry &entry);
bool set_vendor_string(const Entry &entry); // only the Entry's field name will be used
bool set_comment(unsigned index, const Entry &entry);
bool insert_comment(unsigned index, const Entry &entry);
bool delete_comment(unsigned index);
......@@ -324,11 +349,11 @@ namespace FLAC {
public:
class Status {
public:
inline Status(::FLAC__MetaData_SimpleIteratorStatus status): status_(status) { }
inline operator ::FLAC__MetaData_SimpleIteratorStatus() const { return status_; }
inline const char *as_cstring() const { return ::FLAC__MetaData_SimpleIteratorStatusString[status_]; }
inline Status(::FLAC__Metadata_SimpleIteratorStatus status): status_(status) { }
inline operator ::FLAC__Metadata_SimpleIteratorStatus() const { return status_; }
inline const char *as_cstring() const { return ::FLAC__Metadata_SimpleIteratorStatusString[status_]; }
protected:
::FLAC__MetaData_SimpleIteratorStatus status_;
::FLAC__Metadata_SimpleIteratorStatus status_;
};
SimpleIterator();
......@@ -343,14 +368,14 @@ namespace FLAC {
bool next();
bool prev();
::FLAC__MetaDataType get_block_type() const;
::FLAC__MetadataType get_block_type() const;
Prototype *get_block();
bool set_block(Prototype *block, bool use_padding = true);
bool insert_block_after(Prototype *block, bool use_padding = true);
bool delete_block(bool use_padding = true);
protected:
::FLAC__MetaData_SimpleIterator *iterator_;
::FLAC__Metadata_SimpleIterator *iterator_;
void clear();
};
......@@ -396,11 +421,11 @@ namespace FLAC {
public:
class Status {
public:
inline Status(::FLAC__MetaData_ChainStatus status): status_(status) { }
inline operator ::FLAC__MetaData_ChainStatus() const { return status_; }
inline const char *as_cstring() const { return ::FLAC__MetaData_ChainStatusString[status_]; }
inline Status(::FLAC__Metadata_ChainStatus status): status_(status) { }
inline operator ::FLAC__Metadata_ChainStatus() const { return status_; }
inline const char *as_cstring() const { return ::FLAC__Metadata_ChainStatusString[status_]; }
protected:
::FLAC__MetaData_ChainStatus status_;
::FLAC__Metadata_ChainStatus status_;
};
Chain();
......@@ -418,7 +443,7 @@ namespace FLAC {
void sort_padding();
protected:
::FLAC__MetaData_Chain *chain_;
::FLAC__Metadata_Chain *chain_;
virtual void clear();
};
......@@ -434,7 +459,7 @@ namespace FLAC {
bool next();
bool prev();
::FLAC__MetaDataType get_block_type() const;
::FLAC__MetadataType get_block_type() const;
Prototype *get_block();
bool set_block(Prototype *block);
bool delete_block(bool replace_with_padding);
......@@ -442,7 +467,7 @@ namespace FLAC {
bool insert_block_after(Prototype *block);
protected:
::FLAC__MetaData_Iterator *iterator_;
::FLAC__Metadata_Iterator *iterator_;
virtual void clear();
};
......
......@@ -100,16 +100,16 @@ void FLAC__file_decoder_delete(FLAC__FileDecoder *);
FLAC__bool FLAC__file_decoder_set_md5_checking(FLAC__FileDecoder *decoder, FLAC__bool value);
FLAC__bool FLAC__file_decoder_set_filename(FLAC__FileDecoder *decoder, const char *value); /* 'value' may not be 0; use "-" for stdin */
FLAC__bool FLAC__file_decoder_set_write_callback(FLAC__FileDecoder *decoder, FLAC__StreamDecoderWriteStatus (*value)(const FLAC__FileDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data));
FLAC__bool FLAC__file_decoder_set_metadata_callback(FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetaData *metadata, void *client_data));
FLAC__bool FLAC__file_decoder_set_metadata_callback(FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data));
FLAC__bool FLAC__file_decoder_set_error_callback(FLAC__FileDecoder *decoder, void (*value)(const FLAC__FileDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data));
FLAC__bool FLAC__file_decoder_set_client_data(FLAC__FileDecoder *decoder, void *value);
/*
* See the comments for the equivalent functions in stream_decoder.h
*/
FLAC__bool FLAC__file_decoder_set_metadata_respond(FLAC__FileDecoder *decoder, FLAC__MetaDataType type);
FLAC__bool FLAC__file_decoder_set_metadata_respond(FLAC__FileDecoder *decoder, FLAC__MetadataType type);
FLAC__bool FLAC__file_decoder_set_metadata_respond_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4]);
FLAC__bool FLAC__file_decoder_set_metadata_respond_all(FLAC__FileDecoder *decoder);
FLAC__bool FLAC__file_decoder_set_metadata_ignore(FLAC__FileDecoder *decoder, FLAC__MetaDataType type);
FLAC__bool FLAC__file_decoder_set_metadata_ignore(FLAC__FileDecoder *decoder, FLAC__MetadataType type);
FLAC__bool FLAC__file_decoder_set_metadata_ignore_application(FLAC__FileDecoder *decoder, const FLAC__byte id[4]);
FLAC__bool FLAC__file_decoder_set_metadata_ignore_all(FLAC__FileDecoder *decoder);
......
......@@ -350,8 +350,8 @@ typedef enum {
FLAC__METADATA_TYPE_APPLICATION = 2,
FLAC__METADATA_TYPE_SEEKTABLE = 3,
FLAC__METADATA_TYPE_VORBIS_COMMENT = 4
} FLAC__MetaDataType;
extern const char * const FLAC__MetaDataTypeString[];
} FLAC__MetadataType;
extern const char * const FLAC__MetadataTypeString[];
/*****************************************************************************
*
......@@ -375,7 +375,7 @@ typedef struct {
unsigned bits_per_sample;
FLAC__uint64 total_samples;
FLAC__byte md5sum[16];
} FLAC__StreamMetaData_StreamInfo;
} FLAC__StreamMetadata_StreamInfo;
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /* = 16 bits */
extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /* = 16 bits */
......@@ -398,7 +398,7 @@ extern const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /* = 128 bits
typedef struct {
int dummy; /* conceptually this is an empty struct since we don't store the padding bytes */
/* empty structs are allowed by C++ but not C, hence the 'dummy' */
} FLAC__StreamMetaData_Padding;
} FLAC__StreamMetadata_Padding;
/*****************************************************************************
*
......@@ -410,7 +410,7 @@ typedef struct {
typedef struct {
FLAC__byte id[4];
FLAC__byte *data;
} FLAC__StreamMetaData_Application;
} FLAC__StreamMetadata_Application;
extern const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /* = 32 bits */
......@@ -426,7 +426,7 @@ typedef struct {
FLAC__uint64 sample_number;
FLAC__uint64 stream_offset;
unsigned frame_samples;