📄 metadata.h
字号:
/** Constructs an object with copy control. See
* Prototype(::FLAC__StreamMetadata *object, bool copy).
*/
inline Padding(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~Padding();
//@{
/** Assign from another object. Always performs a deep copy. */
inline Padding &operator=(const Padding &object) { Prototype::operator=(object); return *this; }
inline Padding &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; }
inline Padding &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; }
//@}
/** Assigns an object with copy control. See
* Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy).
*/
inline Padding &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; }
//@{
/** Check for equality, performing a deep compare by following pointers. */
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); }
//@}
//@{
/** Check for inequality, performing a deep compare by following pointers. */
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); }
//@}
void set_length(unsigned length);
};
/** APPLICATION metadata block.
* See <A HREF="../format.html#metadata_block_application">format specification</A>.
*/
class FLACPP_API Application : public Prototype {
public:
Application();
//
//@{
/** Constructs a copy of the given object. This form
* always performs a deep copy.
*/
inline Application(const Application &object): Prototype(object) { }
inline Application(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline Application(const ::FLAC__StreamMetadata *object): Prototype(object) { }
//@}
/** Constructs an object with copy control. See
* Prototype(::FLAC__StreamMetadata *object, bool copy).
*/
inline Application(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~Application();
//@{
/** Assign from another object. Always performs a deep copy. */
inline Application &operator=(const Application &object) { Prototype::operator=(object); return *this; }
inline Application &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; }
inline Application &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; }
//@}
/** Assigns an object with copy control. See
* Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy).
*/
inline Application &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; }
//@{
/** Check for equality, performing a deep compare by following pointers. */
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); }
//@}
//@{
/** Check for inequality, performing a deep compare by following pointers. */
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); }
//@}
const FLAC__byte *get_id() const;
const FLAC__byte *get_data() const;
void set_id(const FLAC__byte value[4]);
//! This form always copies \a data
bool set_data(const FLAC__byte *data, unsigned length);
bool set_data(FLAC__byte *data, unsigned length, bool copy);
};
/** SEEKTABLE metadata block.
* See <A HREF="../format.html#metadata_block_seektable">format specification</A>.
*/
class FLACPP_API SeekTable : public Prototype {
public:
SeekTable();
//@{
/** Constructs a copy of the given object. This form
* always performs a deep copy.
*/
inline SeekTable(const SeekTable &object): Prototype(object) { }
inline SeekTable(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline SeekTable(const ::FLAC__StreamMetadata *object): Prototype(object) { }
//@}
/** Constructs an object with copy control. See
* Prototype(::FLAC__StreamMetadata *object, bool copy).
*/
inline SeekTable(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~SeekTable();
//@{
/** Assign from another object. Always performs a deep copy. */
inline SeekTable &operator=(const SeekTable &object) { Prototype::operator=(object); return *this; }
inline SeekTable &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; }
inline SeekTable &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; }
//@}
/** Assigns an object with copy control. See
* Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy).
*/
inline SeekTable &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; }
//@{
/** Check for equality, performing a deep compare by following pointers. */
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); }
//@}
//@{
/** Check for inequality, performing a deep compare by following pointers. */
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); }
//@}
unsigned get_num_points() const;
::FLAC__StreamMetadata_SeekPoint get_point(unsigned index) const;
//! See FLAC__metadata_object_seektable_set_point()
void set_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point);
//! See FLAC__metadata_object_seektable_insert_point()
bool insert_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point);
//! See FLAC__metadata_object_seektable_delete_point()
bool delete_point(unsigned index);
//! See FLAC__metadata_object_seektable_is_legal()
bool is_legal() const;
};
/** VORBIS_COMMENT metadata block.
* See <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>.
*/
class FLACPP_API VorbisComment : public Prototype {
public:
/** Convenience class for encapsulating Vorbis comment
* entries. An entry is a vendor string or a comment
* field. In the case of a vendor string, the field
* name is undefined; only the field value is relevant.
*
* A \a field as used in the methods refers to an
* entire 'NAME=VALUE' string; for convenience the
* string is NUL-terminated. A length field is
* required in the unlikely event that the value
* contains contain embedded NULs.
*
* A \a field_name is what is on the left side of the
* first '=' in the \a field. By definition it is ASCII
* and so is NUL-terminated and does not require a
* length to describe it. \a field_name is undefined
* for a vendor string entry.
*
* A \a field_value is what is on the right side of the
* first '=' in the \a field. By definition, this may
* contain embedded NULs and so a \a field_value_length
* is required to describe it. However in practice,
* embedded NULs are not known to be used, so it is
* generally safe to treat field values as NUL-
* terminated UTF-8 strings.
*
* Always check is_valid() after the constructor or operator=
* to make sure memory was properly allocated and that the
* Entry conforms to the Vorbis comment specification.
*/
class FLACPP_API Entry {
public:
Entry();
Entry(const char *field, unsigned field_length);
Entry(const char *field); // assumes \a field is NUL-terminated
Entry(const char *field_name, const char *field_value, unsigned field_value_length);
Entry(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated
Entry(const Entry &entry);
Entry &operator=(const Entry &entry);
virtual ~Entry();
virtual bool is_valid() const;
unsigned get_field_length() const;
unsigned get_field_name_length() const;
unsigned get_field_value_length() 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;
bool set_field(const char *field, unsigned field_length);
bool set_field(const char *field); // assumes \a field is NUL-terminated
bool set_field_name(const char *field_name);
bool set_field_value(const char *field_value, unsigned field_value_length);
bool set_field_value(const char *field_value); // assumes \a field_value is NUL-terminated
protected:
bool is_valid_;
::FLAC__StreamMetadata_VorbisComment_Entry entry_;
char *field_name_;
unsigned field_name_length_;
char *field_value_;
unsigned field_value_length_;
private:
void zero();
void clear();
void clear_entry();
void clear_field_name();
void clear_field_value();
void construct(const char *field, unsigned field_length);
void construct(const char *field); // assumes \a field is NUL-terminated
void construct(const char *field_name, const char *field_value, unsigned field_value_length);
void construct(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated
void compose_field();
void parse_field();
};
VorbisComment();
//@{
/** Constructs a copy of the given object. This form
* always performs a deep copy.
*/
inline VorbisComment(const VorbisComment &object): Prototype(object) { }
inline VorbisComment(const ::FLAC__StreamMetadata &object): Prototype(object) { }
inline VorbisComment(const ::FLAC__StreamMetadata *object): Prototype(object) { }
//@}
/** Constructs an object with copy control. See
* Prototype(::FLAC__StreamMetadata *object, bool copy).
*/
inline VorbisComment(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { }
~VorbisComment();
//@{
/** Assign from another object. Always performs a deep copy. */
inline VorbisComment &operator=(const VorbisComment &object) { Prototype::operator=(object); return *this; }
inline VorbisComment &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; }
inline VorbisComment &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; }
//@}
/** Assigns an object with copy control. See
* Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy).
*/
inline VorbisComment &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; }
//@{
/** Check for equality, performing a deep compare by following pointers. */
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); }
//@}
//@{
/** Check for inequality, performing a deep compare by following pointers. */
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); }
//@}
unsigned get_num_comments() const;
const FLAC__byte *get_vendor_string() const; // NUL-terminated UTF-8 string
Entry get_comment(unsigned index) const;
//! See FLAC__metadata_object_vorbiscomment_set_vendor_string()
bool set_vendor_string(const FLAC__byte *string); // NUL-terminated UTF-8 string
//! See FLAC__metadata_object_vorbiscomment_set_comment()
bool set_comment(unsigned index, const Entry &entry);
//! See FLAC__metadata_object_vorbiscomment_insert_comment()
bool insert_comment(unsigned index, const Entry &entry);
//! See FLAC__metadata_object_vorbiscomment_append_comment()
bool append_comment(const Entry &entry);
//! See FLAC__metadata_object_vorbiscomment_delete_comment()
bool delete_comment(unsigned index);
};
/** CUESHEET metadata block.
* See <A HREF="../format.html#metadata_block_cuesheet">format specification</A>.
*/
class FLACPP_API CueSheet : public Prototype {
public:
/** Convenience class for encapsulating a cue sheet
* track.
*
* Always check is_valid() after the constructor or operator=
* to make sure memory was properly allocated.
*/
class FLACPP_API Track {
protected:
::FLAC__StreamMetadata_CueSheet_Track *object_;
public:
Track();
Track(const ::FLAC__StreamMetadata_CueSheet_Track *track);
Track(const Track &track);
Track &operator=(const Track &track);
virtual ~Track();
virtual bool is_valid() const;
inline FLAC__uint64 get_offset() const { return object_->offset; }
inline FLAC__byte get_number() const { return object_->number; }
inline const char *get_isrc() const { return object_->isrc; }
inline unsigned get_type() const { return object_->type; }
inline bool get_pre_emphasis() const { return object_->pre_emphasis; }
inline FLAC__byte get_num_indices() const { return object_->num_indices; }
::FLAC__StreamMetadata_CueSheet_Index get_index(unsigned i) const;
inline const ::FLAC__StreamMetadata_CueSheet_Track *get_track() const { return object_; }
inline void set_offset(FLAC__uint64 value) { object_->offset = value; }
inline void set_number(FLAC__byte value) { object_->number = value; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -