Commit 1294b649 authored by Bastiaan Timmer's avatar Bastiaan Timmer Committed by Erik de Castro Lopo
Browse files

Adds last functions from C metadata api to C++ metadata api


Signed-off-by: Erik de Castro Lopo's avatarErik de Castro Lopo <erikd@mega-nerd.com>
parent 8749dc27
......@@ -808,18 +808,30 @@ namespace FLAC {
void set_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index);
//! See FLAC__metadata_object_cuesheet_track_resize_indices()
bool resize_indices(unsigned track_num, unsigned new_num_indices);
//! See FLAC__metadata_object_cuesheet_track_insert_index()
bool insert_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index);
//! See FLAC__metadata_object_cuesheet_track_insert_blank_index()
bool insert_blank_index(unsigned track_num, unsigned index_num);
//! See FLAC__metadata_object_cuesheet_track_delete_index()
bool delete_index(unsigned track_num, unsigned index_num);
//! See FLAC__metadata_object_cuesheet_resize_tracks()
bool resize_tracks(unsigned new_num_tracks);
//! See FLAC__metadata_object_cuesheet_set_track()
bool set_track(unsigned i, const Track &track);
//! See FLAC__metadata_object_cuesheet_insert_track()
bool insert_track(unsigned i, const Track &track);
//! See FLAC__metadata_object_cuesheet_insert_blank_track()
bool insert_blank_track(unsigned i);
//! See FLAC__metadata_object_cuesheet_delete_track()
bool delete_track(unsigned i);
......@@ -905,6 +917,9 @@ namespace FLAC {
//! See FLAC__metadata_object_picture_set_data()
bool set_data(const FLAC__byte *data, FLAC__uint32 data_length);
//! See FLAC__metadata_object_picture_is_legal()
bool is_legal(const char **violation);
};
/** Opaque metadata block for storing unknown types.
......
......@@ -1042,6 +1042,13 @@ namespace FLAC {
object_->data.cue_sheet.tracks[track_num].indices[index_num] = index;
}
bool CueSheet::resize_indices(unsigned track_num, unsigned new_num_indices)
{
FLAC__ASSERT(is_valid());
FLAC__ASSERT(track_num < object_->data.cue_sheet.num_tracks);
return (bool)::FLAC__metadata_object_cuesheet_track_resize_indices(object_, track_num, new_num_indices);
}
bool CueSheet::insert_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index)
{
FLAC__ASSERT(is_valid());
......@@ -1050,6 +1057,14 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_cuesheet_track_insert_index(object_, track_num, index_num, index);
}
bool CueSheet::insert_blank_index(unsigned track_num, unsigned index_num)
{
FLAC__ASSERT(is_valid());
FLAC__ASSERT(track_num < object_->data.cue_sheet.num_tracks);
FLAC__ASSERT(index_num <= object_->data.cue_sheet.tracks[track_num].num_indices);
return (bool)::FLAC__metadata_object_cuesheet_track_insert_blank_index(object_, track_num, index_num);
}
bool CueSheet::delete_index(unsigned track_num, unsigned index_num)
{
FLAC__ASSERT(is_valid());
......@@ -1058,6 +1073,12 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_cuesheet_track_delete_index(object_, track_num, index_num);
}
bool CueSheet::resize_tracks(unsigned new_num_tracks)
{
FLAC__ASSERT(is_valid());
return (bool)::FLAC__metadata_object_cuesheet_resize_tracks(object_, new_num_tracks);
}
bool CueSheet::set_track(unsigned i, const CueSheet::Track &track)
{
FLAC__ASSERT(is_valid());
......@@ -1074,6 +1095,13 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_cuesheet_insert_track(object_, i, const_cast< ::FLAC__StreamMetadata_CueSheet_Track*>(track.get_track()), /*copy=*/true);
}
bool CueSheet::insert_blank_track(unsigned i)
{
FLAC__ASSERT(is_valid());
FLAC__ASSERT(i <= object_->data.cue_sheet.num_tracks);
return (bool)::FLAC__metadata_object_cuesheet_insert_blank_track(object_, i);
}
bool CueSheet::delete_track(unsigned i)
{
FLAC__ASSERT(is_valid());
......@@ -1210,6 +1238,12 @@ namespace FLAC {
return (bool)::FLAC__metadata_object_picture_set_data(object_, const_cast<FLAC__byte*>(data), data_length, /*copy=*/true);
}
bool Picture::is_legal(const char **violation)
{
FLAC__ASSERT(is_valid());
return (bool)::FLAC__metadata_object_picture_is_legal(object_, violation);
}
//
// Unknown
......
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