add FLAC::Encoder::*::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks)

This commit is contained in:
Josh Coalson 2004-07-22 01:04:22 +00:00
parent d113ca3d2f
commit 091d84f25c
4 changed files with 38 additions and 0 deletions

View File

@ -38,6 +38,7 @@
#include "FLAC/seekable_stream_encoder.h"
#include "FLAC/stream_encoder.h"
#include "decoder.h"
#include "metadata.h"
/** \file include/FLAC++/encoder.h
@ -125,6 +126,7 @@ namespace FLAC {
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::Metadata::Prototype **metadata, unsigned num_blocks);
State get_state() const;
Decoder::Stream::State get_verify_decoder_state() const;
@ -222,6 +224,7 @@ namespace FLAC {
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::Metadata::Prototype **metadata, unsigned num_blocks);
State get_state() const;
Stream::State get_stream_encoder_state() const;
@ -322,6 +325,7 @@ namespace FLAC {
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::Metadata::Prototype **metadata, unsigned num_blocks);
bool set_filename(const char *value);
State get_state() const;

View File

@ -165,6 +165,17 @@ namespace FLAC {
return (bool)::FLAC__file_encoder_set_metadata(encoder_, metadata, num_blocks);
}
bool File::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks)
{
FLAC__ASSERT(is_valid());
::FLAC__StreamMetadata *m[num_blocks];
for(unsigned i = 0; i < num_blocks; i++) {
// we can get away with this since we know the encoder will only correct the is_last flags
m[i] = const_cast< ::FLAC__StreamMetadata*>((::FLAC__StreamMetadata*)metadata[i]);
}
return (bool)::FLAC__file_encoder_set_metadata(encoder_, m, num_blocks);
}
bool File::set_filename(const char *value)
{
FLAC__ASSERT(is_valid());

View File

@ -165,6 +165,17 @@ namespace FLAC {
return (bool)::FLAC__seekable_stream_encoder_set_metadata(encoder_, metadata, num_blocks);
}
bool SeekableStream::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks)
{
FLAC__ASSERT(is_valid());
::FLAC__StreamMetadata *m[num_blocks];
for(unsigned i = 0; i < num_blocks; i++) {
// we can get away with this since we know the encoder will only correct the is_last flags
m[i] = const_cast< ::FLAC__StreamMetadata*>((::FLAC__StreamMetadata*)metadata[i]);
}
return (bool)::FLAC__seekable_stream_encoder_set_metadata(encoder_, m, num_blocks);
}
SeekableStream::State SeekableStream::get_state() const
{
FLAC__ASSERT(is_valid());

View File

@ -30,6 +30,7 @@
*/
#include "FLAC++/encoder.h"
#include "FLAC++/metadata.h"
#include "FLAC/assert.h"
#ifdef _MSC_VER
@ -165,6 +166,17 @@ namespace FLAC {
return (bool)::FLAC__stream_encoder_set_metadata(encoder_, metadata, num_blocks);
}
bool Stream::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks)
{
FLAC__ASSERT(is_valid());
::FLAC__StreamMetadata *m[num_blocks];
for(unsigned i = 0; i < num_blocks; i++) {
// we can get away with this since we know the encoder will only correct the is_last flags
m[i] = const_cast< ::FLAC__StreamMetadata*>((::FLAC__StreamMetadata*)metadata[i]);
}
return (bool)::FLAC__stream_encoder_set_metadata(encoder_, m, num_blocks);
}
Stream::State Stream::get_state() const
{
FLAC__ASSERT(is_valid());