mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
add FLAC::Encoder::*::set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks)
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
#include "FLAC/seekable_stream_encoder.h"
|
#include "FLAC/seekable_stream_encoder.h"
|
||||||
#include "FLAC/stream_encoder.h"
|
#include "FLAC/stream_encoder.h"
|
||||||
#include "decoder.h"
|
#include "decoder.h"
|
||||||
|
#include "metadata.h"
|
||||||
|
|
||||||
|
|
||||||
/** \file include/FLAC++/encoder.h
|
/** \file include/FLAC++/encoder.h
|
||||||
@@ -125,6 +126,7 @@ namespace FLAC {
|
|||||||
bool set_rice_parameter_search_dist(unsigned value);
|
bool set_rice_parameter_search_dist(unsigned value);
|
||||||
bool set_total_samples_estimate(FLAC__uint64 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);
|
||||||
|
bool set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks);
|
||||||
|
|
||||||
State get_state() const;
|
State get_state() const;
|
||||||
Decoder::Stream::State get_verify_decoder_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_rice_parameter_search_dist(unsigned value);
|
||||||
bool set_total_samples_estimate(FLAC__uint64 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);
|
||||||
|
bool set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks);
|
||||||
|
|
||||||
State get_state() const;
|
State get_state() const;
|
||||||
Stream::State get_stream_encoder_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_rice_parameter_search_dist(unsigned value);
|
||||||
bool set_total_samples_estimate(FLAC__uint64 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);
|
||||||
|
bool set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks);
|
||||||
bool set_filename(const char *value);
|
bool set_filename(const char *value);
|
||||||
|
|
||||||
State get_state() const;
|
State get_state() const;
|
||||||
|
|||||||
@@ -165,6 +165,17 @@ namespace FLAC {
|
|||||||
return (bool)::FLAC__file_encoder_set_metadata(encoder_, metadata, num_blocks);
|
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)
|
bool File::set_filename(const char *value)
|
||||||
{
|
{
|
||||||
FLAC__ASSERT(is_valid());
|
FLAC__ASSERT(is_valid());
|
||||||
|
|||||||
@@ -165,6 +165,17 @@ namespace FLAC {
|
|||||||
return (bool)::FLAC__seekable_stream_encoder_set_metadata(encoder_, metadata, num_blocks);
|
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
|
SeekableStream::State SeekableStream::get_state() const
|
||||||
{
|
{
|
||||||
FLAC__ASSERT(is_valid());
|
FLAC__ASSERT(is_valid());
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FLAC++/encoder.h"
|
#include "FLAC++/encoder.h"
|
||||||
|
#include "FLAC++/metadata.h"
|
||||||
#include "FLAC/assert.h"
|
#include "FLAC/assert.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
@@ -165,6 +166,17 @@ namespace FLAC {
|
|||||||
return (bool)::FLAC__stream_encoder_set_metadata(encoder_, metadata, num_blocks);
|
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
|
Stream::State Stream::get_state() const
|
||||||
{
|
{
|
||||||
FLAC__ASSERT(is_valid());
|
FLAC__ASSERT(is_valid());
|
||||||
|
|||||||
Reference in New Issue
Block a user