Commit 601e9610 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Add missing functions to VorbisComment class.

Patch from Bastiaan Timmer <basjetimmer@yahoo.com> sent to the
<flac-dev@xiph.org> mailing list.
parent 5289b309
......@@ -675,6 +675,9 @@ namespace FLAC {
//! 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_resize_comments()
bool resize_comments(unsigned new_num_comments);
//! See FLAC__metadata_object_vorbiscomment_set_comment()
bool set_comment(unsigned index, const Entry &entry);
......@@ -684,8 +687,20 @@ namespace FLAC {
//! See FLAC__metadata_object_vorbiscomment_append_comment()
bool append_comment(const Entry &entry);
//! See FLAC__metadata_object_vorbiscomment_replace_comment()
bool replace_comment(const Entry &entry, bool all);
//! See FLAC__metadata_object_vorbiscomment_delete_comment()
bool delete_comment(unsigned index);
//! See FLAC__metadata_object_vorbiscomment_find_entry_from()
int find_entry_from(unsigned offset, const char *field_name);
//! See FLAC__metadata_object_vorbiscomment_remove_entry_matching()
int remove_entry_matching(const char *field_name);
//! See FLAC__metadata_object_vorbiscomment_remove_entries_matching()
int remove_entries_matching(const char *field_name);
};
/** CUESHEET metadata block.
......
......@@ -849,6 +849,12 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_vorbiscomment_set_vendor_string(object_, vendor_string, /*copy=*/true);
}
bool VorbisComment::resize_comments(unsigned new_num_comments)
{
FLAC__ASSERT(is_valid());
return (bool)::FLAC__metadata_object_vorbiscomment_resize_comments(object_, new_num_comments);
}
bool VorbisComment::set_comment(unsigned index, const VorbisComment::Entry &entry)
{
FLAC__ASSERT(is_valid());
......@@ -869,6 +875,12 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_vorbiscomment_append_comment(object_, entry.get_entry(), /*copy=*/true);
}
bool VorbisComment::replace_comment(const VorbisComment::Entry &entry, bool all)
{
FLAC__ASSERT(is_valid());
return (bool)::FLAC__metadata_object_vorbiscomment_replace_comment(object_, entry.get_entry(), all, /*copy=*/true);
}
bool VorbisComment::delete_comment(unsigned index)
{
FLAC__ASSERT(is_valid());
......@@ -876,6 +888,24 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_vorbiscomment_delete_comment(object_, index);
}
int VorbisComment::find_entry_from(unsigned offset, const char *field_name)
{
FLAC__ASSERT(is_valid());
return ::FLAC__metadata_object_vorbiscomment_find_entry_from(object_, offset, field_name);
}
int VorbisComment::remove_entry_matching(const char *field_name)
{
FLAC__ASSERT(is_valid());
return ::FLAC__metadata_object_vorbiscomment_remove_entry_matching(object_, field_name);
}
int VorbisComment::remove_entries_matching(const char *field_name)
{
FLAC__ASSERT(is_valid());
return ::FLAC__metadata_object_vorbiscomment_remove_entries_matching(object_, field_name);
}
//
// CueSheet::Track
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment