Commit 71b909b7 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Yet more purging of `unsigned` type

parent 588689b1
...@@ -36,9 +36,9 @@ ...@@ -36,9 +36,9 @@
#include "share/compat.h" #include "share/compat.h"
static FLAC__uint64 total_samples = 0; static FLAC__uint64 total_samples = 0;
static unsigned sample_rate = 0; static uint32_t sample_rate = 0;
static unsigned channels = 0; static uint32_t channels = 0;
static unsigned bps = 0; static uint32_t bps = 0;
static bool write_little_endian_uint16(FILE *f, FLAC__uint16 x) static bool write_little_endian_uint16(FILE *f, FLAC__uint16 x)
{ {
......
...@@ -43,12 +43,12 @@ class OurEncoder: public FLAC::Encoder::File { ...@@ -43,12 +43,12 @@ class OurEncoder: public FLAC::Encoder::File {
public: public:
OurEncoder(): FLAC::Encoder::File() { } OurEncoder(): FLAC::Encoder::File() { }
protected: protected:
virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate); virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate);
}; };
#define READSIZE 1024 #define READSIZE 1024
static unsigned total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */ static uint32_t total_samples = 0; /* can use a 32-bit number due to WAVE size limitations */
static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into here */ static FLAC__byte buffer[READSIZE/*samples*/ * 2/*bytes_per_sample*/ * 2/*channels*/]; /* we read the WAVE data into here */
static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/]; static FLAC__int32 pcm[READSIZE/*samples*/ * 2/*channels*/];
...@@ -60,9 +60,9 @@ int main(int argc, char *argv[]) ...@@ -60,9 +60,9 @@ int main(int argc, char *argv[])
FLAC__StreamMetadata *metadata[2]; FLAC__StreamMetadata *metadata[2];
FLAC__StreamMetadata_VorbisComment_Entry entry; FLAC__StreamMetadata_VorbisComment_Entry entry;
FILE *fin; FILE *fin;
unsigned sample_rate = 0; uint32_t sample_rate = 0;
unsigned channels = 0; uint32_t channels = 0;
unsigned bps = 0; uint32_t bps = 0;
if(argc != 3) { if(argc != 3) {
fprintf(stderr, "usage: %s infile.wav outfile.flac\n", argv[0]); fprintf(stderr, "usage: %s infile.wav outfile.flac\n", argv[0]);
...@@ -85,10 +85,10 @@ int main(int argc, char *argv[]) ...@@ -85,10 +85,10 @@ int main(int argc, char *argv[])
fclose(fin); fclose(fin);
return 1; return 1;
} }
sample_rate = ((((((unsigned)buffer[27] << 8) | buffer[26]) << 8) | buffer[25]) << 8) | buffer[24]; sample_rate = ((((((uint32_t)buffer[27] << 8) | buffer[26]) << 8) | buffer[25]) << 8) | buffer[24];
channels = 2; channels = 2;
bps = 16; bps = 16;
total_samples = (((((((unsigned)buffer[43] << 8) | buffer[42]) << 8) | buffer[41]) << 8) | buffer[40]) / 4; total_samples = (((((((uint32_t)buffer[43] << 8) | buffer[42]) << 8) | buffer[41]) << 8) | buffer[40]) / 4;
/* check the encoder */ /* check the encoder */
if(!encoder) { if(!encoder) {
...@@ -170,7 +170,7 @@ int main(int argc, char *argv[]) ...@@ -170,7 +170,7 @@ int main(int argc, char *argv[])
return 0; return 0;
} }
void OurEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate) void OurEncoder::progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate)
{ {
fprintf(stderr, "wrote %" PRIu64 " bytes, %" PRIu64 "/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate); fprintf(stderr, "wrote %" PRIu64 " bytes, %" PRIu64 "/%u samples, %u/%u frames\n", bytes_written, samples_written, total_samples, frames_written, total_frames_estimate);
} }
...@@ -135,11 +135,11 @@ namespace FLAC { ...@@ -135,11 +135,11 @@ namespace FLAC {
State get_state() const; ///< See FLAC__stream_decoder_get_state() State get_state() const; ///< See FLAC__stream_decoder_get_state()
virtual bool get_md5_checking() const; ///< See FLAC__stream_decoder_get_md5_checking() virtual bool get_md5_checking() const; ///< See FLAC__stream_decoder_get_md5_checking()
virtual FLAC__uint64 get_total_samples() const; ///< See FLAC__stream_decoder_get_total_samples() virtual FLAC__uint64 get_total_samples() const; ///< See FLAC__stream_decoder_get_total_samples()
virtual unsigned get_channels() const; ///< See FLAC__stream_decoder_get_channels() virtual uint32_t get_channels() const; ///< See FLAC__stream_decoder_get_channels()
virtual ::FLAC__ChannelAssignment get_channel_assignment() const; ///< See FLAC__stream_decoder_get_channel_assignment() virtual ::FLAC__ChannelAssignment get_channel_assignment() const; ///< See FLAC__stream_decoder_get_channel_assignment()
virtual unsigned get_bits_per_sample() const; ///< See FLAC__stream_decoder_get_bits_per_sample() virtual uint32_t get_bits_per_sample() const; ///< See FLAC__stream_decoder_get_bits_per_sample()
virtual unsigned get_sample_rate() const; ///< See FLAC__stream_decoder_get_sample_rate() virtual uint32_t get_sample_rate() const; ///< See FLAC__stream_decoder_get_sample_rate()
virtual unsigned get_blocksize() const; ///< See FLAC__stream_decoder_get_blocksize() virtual uint32_t get_blocksize() const; ///< See FLAC__stream_decoder_get_blocksize()
virtual bool get_decode_position(FLAC__uint64 *position) const; ///< See FLAC__stream_decoder_get_decode_position() virtual bool get_decode_position(FLAC__uint64 *position) const; ///< See FLAC__stream_decoder_get_decode_position()
virtual ::FLAC__StreamDecoderInitStatus init(); ///< Seek FLAC__stream_decoder_init_stream() virtual ::FLAC__StreamDecoderInitStatus init(); ///< Seek FLAC__stream_decoder_init_stream()
......
...@@ -128,46 +128,46 @@ namespace FLAC { ...@@ -128,46 +128,46 @@ namespace FLAC {
virtual bool set_ogg_serial_number(long value); ///< See FLAC__stream_encoder_set_ogg_serial_number() virtual bool set_ogg_serial_number(long value); ///< See FLAC__stream_encoder_set_ogg_serial_number()
virtual bool set_verify(bool value); ///< See FLAC__stream_encoder_set_verify() virtual bool set_verify(bool value); ///< See FLAC__stream_encoder_set_verify()
virtual bool set_streamable_subset(bool value); ///< See FLAC__stream_encoder_set_streamable_subset() virtual bool set_streamable_subset(bool value); ///< See FLAC__stream_encoder_set_streamable_subset()
virtual bool set_channels(unsigned value); ///< See FLAC__stream_encoder_set_channels() virtual bool set_channels(uint32_t value); ///< See FLAC__stream_encoder_set_channels()
virtual bool set_bits_per_sample(unsigned value); ///< See FLAC__stream_encoder_set_bits_per_sample() virtual bool set_bits_per_sample(uint32_t value); ///< See FLAC__stream_encoder_set_bits_per_sample()
virtual bool set_sample_rate(unsigned value); ///< See FLAC__stream_encoder_set_sample_rate() virtual bool set_sample_rate(uint32_t value); ///< See FLAC__stream_encoder_set_sample_rate()
virtual bool set_compression_level(unsigned value); ///< See FLAC__stream_encoder_set_compression_level() virtual bool set_compression_level(uint32_t value); ///< See FLAC__stream_encoder_set_compression_level()
virtual bool set_blocksize(unsigned value); ///< See FLAC__stream_encoder_set_blocksize() virtual bool set_blocksize(uint32_t value); ///< See FLAC__stream_encoder_set_blocksize()
virtual bool set_do_mid_side_stereo(bool value); ///< See FLAC__stream_encoder_set_do_mid_side_stereo() virtual bool set_do_mid_side_stereo(bool value); ///< See FLAC__stream_encoder_set_do_mid_side_stereo()
virtual bool set_loose_mid_side_stereo(bool value); ///< See FLAC__stream_encoder_set_loose_mid_side_stereo() virtual bool set_loose_mid_side_stereo(bool value); ///< See FLAC__stream_encoder_set_loose_mid_side_stereo()
virtual bool set_apodization(const char *specification); ///< See FLAC__stream_encoder_set_apodization() virtual bool set_apodization(const char *specification); ///< See FLAC__stream_encoder_set_apodization()
virtual bool set_max_lpc_order(unsigned value); ///< See FLAC__stream_encoder_set_max_lpc_order() virtual bool set_max_lpc_order(uint32_t value); ///< See FLAC__stream_encoder_set_max_lpc_order()
virtual bool set_qlp_coeff_precision(unsigned value); ///< See FLAC__stream_encoder_set_qlp_coeff_precision() virtual bool set_qlp_coeff_precision(uint32_t value); ///< See FLAC__stream_encoder_set_qlp_coeff_precision()
virtual bool set_do_qlp_coeff_prec_search(bool value); ///< See FLAC__stream_encoder_set_do_qlp_coeff_prec_search() virtual bool set_do_qlp_coeff_prec_search(bool value); ///< See FLAC__stream_encoder_set_do_qlp_coeff_prec_search()
virtual bool set_do_escape_coding(bool value); ///< See FLAC__stream_encoder_set_do_escape_coding() virtual bool set_do_escape_coding(bool value); ///< See FLAC__stream_encoder_set_do_escape_coding()
virtual bool set_do_exhaustive_model_search(bool value); ///< See FLAC__stream_encoder_set_do_exhaustive_model_search() virtual bool set_do_exhaustive_model_search(bool value); ///< See FLAC__stream_encoder_set_do_exhaustive_model_search()
virtual bool set_min_residual_partition_order(unsigned value); ///< See FLAC__stream_encoder_set_min_residual_partition_order() virtual bool set_min_residual_partition_order(uint32_t value); ///< See FLAC__stream_encoder_set_min_residual_partition_order()
virtual bool set_max_residual_partition_order(unsigned value); ///< See FLAC__stream_encoder_set_max_residual_partition_order() virtual bool set_max_residual_partition_order(uint32_t value); ///< See FLAC__stream_encoder_set_max_residual_partition_order()
virtual bool set_rice_parameter_search_dist(unsigned value); ///< See FLAC__stream_encoder_set_rice_parameter_search_dist() virtual bool set_rice_parameter_search_dist(uint32_t value); ///< See FLAC__stream_encoder_set_rice_parameter_search_dist()
virtual bool set_total_samples_estimate(FLAC__uint64 value); ///< See FLAC__stream_encoder_set_total_samples_estimate() virtual bool set_total_samples_estimate(FLAC__uint64 value); ///< See FLAC__stream_encoder_set_total_samples_estimate()
virtual bool set_metadata(::FLAC__StreamMetadata **metadata, unsigned num_blocks); ///< See FLAC__stream_encoder_set_metadata() virtual bool set_metadata(::FLAC__StreamMetadata **metadata, uint32_t num_blocks); ///< See FLAC__stream_encoder_set_metadata()
virtual bool set_metadata(FLAC::Metadata::Prototype **metadata, unsigned num_blocks); ///< See FLAC__stream_encoder_set_metadata() virtual bool set_metadata(FLAC::Metadata::Prototype **metadata, uint32_t num_blocks); ///< See FLAC__stream_encoder_set_metadata()
/* get_state() is not virtual since we want subclasses to be able to return their own state */ /* get_state() is not virtual since we want subclasses to be able to return their own state */
State get_state() const; ///< See FLAC__stream_encoder_get_state() State get_state() const; ///< See FLAC__stream_encoder_get_state()
virtual Decoder::Stream::State get_verify_decoder_state() const; ///< See FLAC__stream_encoder_get_verify_decoder_state() virtual Decoder::Stream::State get_verify_decoder_state() const; ///< See FLAC__stream_encoder_get_verify_decoder_state()
virtual void get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got); ///< See FLAC__stream_encoder_get_verify_decoder_error_stats() virtual void get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, uint32_t *frame_number, uint32_t *channel, uint32_t *sample, FLAC__int32 *expected, FLAC__int32 *got); ///< See FLAC__stream_encoder_get_verify_decoder_error_stats()
virtual bool get_verify() const; ///< See FLAC__stream_encoder_get_verify() virtual bool get_verify() const; ///< See FLAC__stream_encoder_get_verify()
virtual bool get_streamable_subset() const; ///< See FLAC__stream_encoder_get_streamable_subset() virtual bool get_streamable_subset() const; ///< See FLAC__stream_encoder_get_streamable_subset()
virtual bool get_do_mid_side_stereo() const; ///< See FLAC__stream_encoder_get_do_mid_side_stereo() virtual bool get_do_mid_side_stereo() const; ///< See FLAC__stream_encoder_get_do_mid_side_stereo()
virtual bool get_loose_mid_side_stereo() const; ///< See FLAC__stream_encoder_get_loose_mid_side_stereo() virtual bool get_loose_mid_side_stereo() const; ///< See FLAC__stream_encoder_get_loose_mid_side_stereo()
virtual unsigned get_channels() const; ///< See FLAC__stream_encoder_get_channels() virtual uint32_t get_channels() const; ///< See FLAC__stream_encoder_get_channels()
virtual unsigned get_bits_per_sample() const; ///< See FLAC__stream_encoder_get_bits_per_sample() virtual uint32_t get_bits_per_sample() const; ///< See FLAC__stream_encoder_get_bits_per_sample()
virtual unsigned get_sample_rate() const; ///< See FLAC__stream_encoder_get_sample_rate() virtual uint32_t get_sample_rate() const; ///< See FLAC__stream_encoder_get_sample_rate()
virtual unsigned get_blocksize() const; ///< See FLAC__stream_encoder_get_blocksize() virtual uint32_t get_blocksize() const; ///< See FLAC__stream_encoder_get_blocksize()
virtual unsigned get_max_lpc_order() const; ///< See FLAC__stream_encoder_get_max_lpc_order() virtual uint32_t get_max_lpc_order() const; ///< See FLAC__stream_encoder_get_max_lpc_order()
virtual unsigned get_qlp_coeff_precision() const; ///< See FLAC__stream_encoder_get_qlp_coeff_precision() virtual uint32_t get_qlp_coeff_precision() const; ///< See FLAC__stream_encoder_get_qlp_coeff_precision()
virtual bool get_do_qlp_coeff_prec_search() const; ///< See FLAC__stream_encoder_get_do_qlp_coeff_prec_search() virtual bool get_do_qlp_coeff_prec_search() const; ///< See FLAC__stream_encoder_get_do_qlp_coeff_prec_search()
virtual bool get_do_escape_coding() const; ///< See FLAC__stream_encoder_get_do_escape_coding() virtual bool get_do_escape_coding() const; ///< See FLAC__stream_encoder_get_do_escape_coding()
virtual bool get_do_exhaustive_model_search() const; ///< See FLAC__stream_encoder_get_do_exhaustive_model_search() virtual bool get_do_exhaustive_model_search() const; ///< See FLAC__stream_encoder_get_do_exhaustive_model_search()
virtual unsigned get_min_residual_partition_order() const; ///< See FLAC__stream_encoder_get_min_residual_partition_order() virtual uint32_t get_min_residual_partition_order() const; ///< See FLAC__stream_encoder_get_min_residual_partition_order()
virtual unsigned get_max_residual_partition_order() const; ///< See FLAC__stream_encoder_get_max_residual_partition_order() virtual uint32_t get_max_residual_partition_order() const; ///< See FLAC__stream_encoder_get_max_residual_partition_order()
virtual unsigned get_rice_parameter_search_dist() const; ///< See FLAC__stream_encoder_get_rice_parameter_search_dist() virtual uint32_t get_rice_parameter_search_dist() const; ///< See FLAC__stream_encoder_get_rice_parameter_search_dist()
virtual FLAC__uint64 get_total_samples_estimate() const; ///< See FLAC__stream_encoder_get_total_samples_estimate() virtual FLAC__uint64 get_total_samples_estimate() const; ///< See FLAC__stream_encoder_get_total_samples_estimate()
virtual ::FLAC__StreamEncoderInitStatus init(); ///< See FLAC__stream_encoder_init_stream() virtual ::FLAC__StreamEncoderInitStatus init(); ///< See FLAC__stream_encoder_init_stream()
...@@ -175,14 +175,14 @@ namespace FLAC { ...@@ -175,14 +175,14 @@ namespace FLAC {
virtual bool finish(); ///< See FLAC__stream_encoder_finish() virtual bool finish(); ///< See FLAC__stream_encoder_finish()
virtual bool process(const FLAC__int32 * const buffer[], unsigned samples); ///< See FLAC__stream_encoder_process() virtual bool process(const FLAC__int32 * const buffer[], uint32_t samples); ///< See FLAC__stream_encoder_process()
virtual bool process_interleaved(const FLAC__int32 buffer[], unsigned samples); ///< See FLAC__stream_encoder_process_interleaved() virtual bool process_interleaved(const FLAC__int32 buffer[], uint32_t samples); ///< See FLAC__stream_encoder_process_interleaved()
protected: protected:
/// See FLAC__StreamEncoderReadCallback /// See FLAC__StreamEncoderReadCallback
virtual ::FLAC__StreamEncoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes); virtual ::FLAC__StreamEncoderReadStatus read_callback(FLAC__byte buffer[], size_t *bytes);
/// See FLAC__StreamEncoderWriteCallback /// See FLAC__StreamEncoderWriteCallback
virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame) = 0; virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame) = 0;
/// See FLAC__StreamEncoderSeekCallback /// See FLAC__StreamEncoderSeekCallback
virtual ::FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset); virtual ::FLAC__StreamEncoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset);
...@@ -200,7 +200,7 @@ namespace FLAC { ...@@ -200,7 +200,7 @@ namespace FLAC {
::FLAC__StreamEncoder *encoder_; ::FLAC__StreamEncoder *encoder_;
static ::FLAC__StreamEncoderReadStatus read_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data); static ::FLAC__StreamEncoderReadStatus read_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data);
static ::FLAC__StreamEncoderWriteStatus write_callback_(const ::FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data); static ::FLAC__StreamEncoderWriteStatus write_callback_(const ::FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame, void *client_data);
static ::FLAC__StreamEncoderSeekStatus seek_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data); static ::FLAC__StreamEncoderSeekStatus seek_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data);
static ::FLAC__StreamEncoderTellStatus tell_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data); static ::FLAC__StreamEncoderTellStatus tell_callback_(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
static void metadata_callback_(const ::FLAC__StreamEncoder *encoder, const ::FLAC__StreamMetadata *metadata, void *client_data); static void metadata_callback_(const ::FLAC__StreamEncoder *encoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
...@@ -245,12 +245,12 @@ namespace FLAC { ...@@ -245,12 +245,12 @@ namespace FLAC {
virtual ::FLAC__StreamEncoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_encoder_init_ogg_file() virtual ::FLAC__StreamEncoderInitStatus init_ogg(const std::string &filename); ///< See FLAC__stream_encoder_init_ogg_file()
protected: protected:
/// See FLAC__StreamEncoderProgressCallback /// See FLAC__StreamEncoderProgressCallback
virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate); virtual void progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate);
/// This is a dummy implementation to satisfy the pure virtual in Stream that is actually supplied internally by the C layer /// This is a dummy implementation to satisfy the pure virtual in Stream that is actually supplied internally by the C layer
virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame); virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], size_t bytes, uint32_t samples, uint32_t current_frame);
private: private:
static void progress_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data); static void progress_callback_(const ::FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, uint32_t frames_written, uint32_t total_frames_estimate, void *client_data);
// Private and undefined so you can't use them: // Private and undefined so you can't use them:
File(const Stream &); File(const Stream &);
......
...@@ -199,7 +199,7 @@ namespace FLAC { ...@@ -199,7 +199,7 @@ namespace FLAC {
* \assert * \assert
* \code is_valid() \endcode * \code is_valid() \endcode
*/ */
unsigned get_length() const; uint32_t get_length() const;
/** Sets the "is_last" flag for the block. When using the iterators /** Sets the "is_last" flag for the block. When using the iterators
* it is not necessary to set this flag; they will do it for you. * it is not necessary to set this flag; they will do it for you.
...@@ -315,23 +315,23 @@ namespace FLAC { ...@@ -315,23 +315,23 @@ namespace FLAC {
//@{ //@{
/** See <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. */ /** See <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. */
unsigned get_min_blocksize() const; uint32_t get_min_blocksize() const;
unsigned get_max_blocksize() const; uint32_t get_max_blocksize() const;
unsigned get_min_framesize() const; uint32_t get_min_framesize() const;
unsigned get_max_framesize() const; uint32_t get_max_framesize() const;
unsigned get_sample_rate() const; uint32_t get_sample_rate() const;
unsigned get_channels() const; uint32_t get_channels() const;
unsigned get_bits_per_sample() const; uint32_t get_bits_per_sample() const;
FLAC__uint64 get_total_samples() const; FLAC__uint64 get_total_samples() const;
const FLAC__byte *get_md5sum() const; const FLAC__byte *get_md5sum() const;
void set_min_blocksize(unsigned value); void set_min_blocksize(uint32_t value);
void set_max_blocksize(unsigned value); void set_max_blocksize(uint32_t value);
void set_min_framesize(unsigned value); void set_min_framesize(uint32_t value);
void set_max_framesize(unsigned value); void set_max_framesize(uint32_t value);
void set_sample_rate(unsigned value); void set_sample_rate(uint32_t value);
void set_channels(unsigned value); void set_channels(uint32_t value);
void set_bits_per_sample(unsigned value); void set_bits_per_sample(uint32_t value);
void set_total_samples(FLAC__uint64 value); void set_total_samples(FLAC__uint64 value);
void set_md5sum(const FLAC__byte value[16]); void set_md5sum(const FLAC__byte value[16]);
//@} //@}
...@@ -361,7 +361,7 @@ namespace FLAC { ...@@ -361,7 +361,7 @@ namespace FLAC {
/** Constructs an object with the given length. /** Constructs an object with the given length.
*/ */
Padding(unsigned length); Padding(uint32_t length);
~Padding(); ~Padding();
...@@ -393,7 +393,7 @@ namespace FLAC { ...@@ -393,7 +393,7 @@ namespace FLAC {
/** Sets the length in bytes of the padding block. /** Sets the length in bytes of the padding block.
*/ */
void set_length(unsigned length); void set_length(uint32_t length);
}; };
/** APPLICATION metadata block. /** APPLICATION metadata block.
...@@ -451,8 +451,8 @@ namespace FLAC { ...@@ -451,8 +451,8 @@ namespace FLAC {
void set_id(const FLAC__byte value[4]); void set_id(const FLAC__byte value[4]);
//! This form always copies \a data //! This form always copies \a data
bool set_data(const FLAC__byte *data, unsigned length); bool set_data(const FLAC__byte *data, uint32_t length);
bool set_data(FLAC__byte *data, unsigned length, bool copy); bool set_data(FLAC__byte *data, uint32_t length, bool copy);
}; };
/** SEEKTABLE metadata block. /** SEEKTABLE metadata block.
...@@ -505,38 +505,38 @@ namespace FLAC { ...@@ -505,38 +505,38 @@ namespace FLAC {
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; uint32_t get_num_points() const;
::FLAC__StreamMetadata_SeekPoint get_point(unsigned index) const; ::FLAC__StreamMetadata_SeekPoint get_point(uint32_t index) const;
//! See FLAC__metadata_object_seektable_resize_points() //! See FLAC__metadata_object_seektable_resize_points()
bool resize_points(unsigned new_num_points); bool resize_points(uint32_t new_num_points);
//! See FLAC__metadata_object_seektable_set_point() //! See FLAC__metadata_object_seektable_set_point()
void set_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point); void set_point(uint32_t index, const ::FLAC__StreamMetadata_SeekPoint &point);
//! See FLAC__metadata_object_seektable_insert_point() //! See FLAC__metadata_object_seektable_insert_point()
bool insert_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point); bool insert_point(uint32_t index, const ::FLAC__StreamMetadata_SeekPoint &point);
//! See FLAC__metadata_object_seektable_delete_point() //! See FLAC__metadata_object_seektable_delete_point()
bool delete_point(unsigned index); bool delete_point(uint32_t index);
//! See FLAC__metadata_object_seektable_is_legal() //! See FLAC__metadata_object_seektable_is_legal()
bool is_legal() const; bool is_legal() const;
//! See FLAC__metadata_object_seektable_template_append_placeholders() //! See FLAC__metadata_object_seektable_template_append_placeholders()
bool template_append_placeholders(unsigned num); bool template_append_placeholders(uint32_t num);
//! See FLAC__metadata_object_seektable_template_append_point() //! See FLAC__metadata_object_seektable_template_append_point()
bool template_append_point(FLAC__uint64 sample_number); bool template_append_point(FLAC__uint64 sample_number);
//! See FLAC__metadata_object_seektable_template_append_points() //! See FLAC__metadata_object_seektable_template_append_points()
bool template_append_points(FLAC__uint64 sample_numbers[], unsigned num); bool template_append_points(FLAC__uint64 sample_numbers[], uint32_t num);
//! See FLAC__metadata_object_seektable_template_append_spaced_points() //! See FLAC__metadata_object_seektable_template_append_spaced_points()
bool template_append_spaced_points(unsigned num, FLAC__uint64 total_samples); bool template_append_spaced_points(uint32_t num, FLAC__uint64 total_samples);
//! See FLAC__metadata_object_seektable_template_append_spaced_points_by_samples() //! See FLAC__metadata_object_seektable_template_append_spaced_points_by_samples()
bool template_append_spaced_points_by_samples(unsigned samples, FLAC__uint64 total_samples); bool template_append_spaced_points_by_samples(uint32_t samples, FLAC__uint64 total_samples);
//! See FLAC__metadata_object_seektable_template_sort() //! See FLAC__metadata_object_seektable_template_sort()
bool template_sort(bool compact); bool template_sort(bool compact);
...@@ -581,10 +581,10 @@ namespace FLAC { ...@@ -581,10 +581,10 @@ namespace FLAC {
public: public:
Entry(); Entry();
Entry(const char *field, unsigned field_length); Entry(const char *field, uint32_t field_length);
Entry(const char *field); // assumes \a field is NUL-terminated 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, uint32_t field_value_length);
Entry(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated Entry(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated
Entry(const Entry &entry); Entry(const Entry &entry);
...@@ -595,36 +595,36 @@ namespace FLAC { ...@@ -595,36 +595,36 @@ namespace FLAC {
virtual bool is_valid() const; ///< Returns \c true iff object was properly constructed. virtual bool is_valid() const; ///< Returns \c true iff object was properly constructed.
unsigned get_field_length() const; uint32_t get_field_length() const;
unsigned get_field_name_length() const; uint32_t get_field_name_length() const;
unsigned get_field_value_length() const; uint32_t get_field_value_length() const;
::FLAC__StreamMetadata_VorbisComment_Entry get_entry() const; ::FLAC__StreamMetadata_VorbisComment_Entry get_entry() const;
const char *get_field() const; const char *get_field() const;
const char *get_field_name() const; const char *get_field_name() const;
const char *get_field_value() const; const char *get_field_value() const;
bool set_field(const char *field, unsigned field_length); bool set_field(const char *field, uint32_t field_length);
bool set_field(const char *field); // assumes \a field is NUL-terminated bool set_field(const char *field); // assumes \a field is NUL-terminated
bool set_field_name(const char *field_name); 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, uint32_t field_value_length);
bool set_field_value(const char *field_value); // assumes \a field_value is NUL-terminated bool set_field_value(const char *field_value); // assumes \a field_value is NUL-terminated
protected: protected:
bool is_valid_; bool is_valid_;
::FLAC__StreamMetadata_VorbisComment_Entry entry_; ::FLAC__StreamMetadata_VorbisComment_Entry entry_;
char *field_name_; char *field_name_;
unsigned field_name_length_; uint32_t field_name_length_;
char *field_value_; char *field_value_;
unsigned field_value_length_; uint32_t field_value_length_;
private: private:
void zero(); void zero();
void clear(); void clear();
void clear_entry(); void clear_entry();
void clear_field_name(); void clear_field_name();
void clear_field_value(); void clear_field_value();
void construct(const char *field, unsigned field_length); void construct(const char *field, uint32_t field_length);
void construct(const char *field); // assumes \a field is NUL-terminated 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, uint32_t field_value_length);
void construct(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated void construct(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated
void compose_field(); void compose_field();
void parse_field(); void parse_field();
...@@ -674,21 +674,21 @@ namespace FLAC { ...@@ -674,21 +674,21 @@ namespace FLAC {
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; uint32_t get_num_comments() const;
const FLAC__byte *get_vendor_string() const; // NUL-terminated UTF-8 string const FLAC__byte *get_vendor_string() const; // NUL-terminated UTF-8 string
Entry get_comment(unsigned index) const; Entry get_comment(uint32_t index) const;
//! See FLAC__metadata_object_vorbiscomment_set_vendor_string() //! See FLAC__metadata_object_vorbiscomment_set_vendor_string()
bool set_vendor_string(const FLAC__byte *string); // NUL-terminated UTF-8 string bool set_vendor_string(const FLAC__byte *string); // NUL-terminated UTF-8 string
//! See FLAC__metadata_object_vorbiscomment_resize_comments() //! See FLAC__metadata_object_vorbiscomment_resize_comments()
bool resize_comments(unsigned new_num_comments); bool resize_comments(uint32_t new_num_comments);
//! See FLAC__metadata_object_vorbiscomment_set_comment() //! See FLAC__metadata_object_vorbiscomment_set_comment()
bool set_comment(unsigned index, const Entry &entry); bool set_comment(uint32_t index, const Entry &entry);
//! See FLAC__metadata_object_vorbiscomment_insert_comment() //! See FLAC__metadata_object_vorbiscomment_insert_comment()
bool insert_comment(unsigned index, const Entry &entry); bool insert_comment(uint32_t index, const Entry &entry);
//! See FLAC__metadata_object_vorbiscomment_append_comment() //! See FLAC__metadata_object_vorbiscomment_append_comment()
bool append_comment(const Entry &entry); bool append_comment(const Entry &entry);
...@@ -697,10 +697,10 @@ namespace FLAC { ...@@ -697,10 +697,10 @@ namespace FLAC {
bool replace_comment(const Entry &entry, bool all); bool replace_comment(const Entry &entry, bool all);
//! See FLAC__metadata_object_vorbiscomment_delete_comment() //! See FLAC__metadata_object_vorbiscomment_delete_comment()
bool delete_comment(unsigned index); bool delete_comment(uint32_t index);
//! See FLAC__metadata_object_vorbiscomment_find_entry_from() //! See FLAC__metadata_object_vorbiscomment_find_entry_from()
int find_entry_from(unsigned offset, const char *field_name); int find_entry_from(uint32_t offset, const char *field_name);
//! See FLAC__metadata_object_vorbiscomment_remove_entry_matching() //! See FLAC__metadata_object_vorbiscomment_remove_entry_matching()
int remove_entry_matching(const char *field_name); int remove_entry_matching(const char *field_name);
...@@ -738,21 +738,21 @@ namespace FLAC { ...@@ -738,21 +738,21 @@ namespace FLAC {
inline FLAC__uint64 get_offset() const { return object_->offset; } inline FLAC__uint64 get_offset() const { return object_->offset; }
inline FLAC__byte get_number() const { return object_->number; } inline FLAC__byte get_number() const { return object_->number; }
inline const char *get_isrc() const { return object_->isrc; } inline const char *get_isrc() const { return object_->isrc; }
inline unsigned get_type() const { return object_->type; } inline uint32_t get_type() const { return object_->type; }
inline bool get_pre_emphasis() const { return object_->pre_emphasis; } inline bool get_pre_emphasis() const { return object_->pre_emphasis; }
inline FLAC__byte get_num_indices() const { return object_->num_indices; } inline FLAC__byte get_num_indices() const { return object_->num_indices; }
::FLAC__StreamMetadata_CueSheet_Index get_index(unsigned i) const; ::FLAC__StreamMetadata_CueSheet_Index get_index(uint32_t i) const;