diff options
Diffstat (limited to 'src/lib/util/flac.h')
-rw-r--r-- | src/lib/util/flac.h | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/lib/util/flac.h b/src/lib/util/flac.h index 2bb41964a43..f5951945b07 100644 --- a/src/lib/util/flac.h +++ b/src/lib/util/flac.h @@ -30,14 +30,14 @@ class flac_encoder public: // construction/destruction flac_encoder(); - flac_encoder(void *buffer, UINT32 buflength); + flac_encoder(void *buffer, uint32_t buflength); flac_encoder(util::core_file &file); ~flac_encoder(); // configuration - void set_sample_rate(UINT32 sample_rate) { m_sample_rate = sample_rate; } - void set_num_channels(UINT8 num_channels) { m_channels = num_channels; } - void set_block_size(UINT32 block_size) { m_block_size = block_size; } + void set_sample_rate(uint32_t sample_rate) { m_sample_rate = sample_rate; } + void set_num_channels(uint8_t num_channels) { m_channels = num_channels; } + void set_block_size(uint32_t block_size) { m_block_size = block_size; } void set_strip_metadata(bool strip) { m_strip_metadata = strip; } // getters (valid after reset) @@ -46,15 +46,15 @@ public: // reset bool reset(); - bool reset(void *buffer, UINT32 buflength); + bool reset(void *buffer, uint32_t buflength); bool reset(util::core_file &file); // encode a buffer - bool encode_interleaved(const INT16 *samples, UINT32 samples_per_channel, bool swap_endian = false); - bool encode(INT16 *const *samples, UINT32 samples_per_channel, bool swap_endian = false); + bool encode_interleaved(const int16_t *samples, uint32_t samples_per_channel, bool swap_endian = false); + bool encode(int16_t *const *samples, uint32_t samples_per_channel, bool swap_endian = false); // finish up - UINT32 finish(); + uint32_t finish(); private: // internal helpers @@ -65,18 +65,18 @@ private: // internal state FLAC__StreamEncoder * m_encoder; // actual encoder util::core_file * m_file; // output file - UINT32 m_compressed_offset; // current offset with the compressed stream + uint32_t m_compressed_offset; // current offset with the compressed stream FLAC__byte * m_compressed_start; // start of compressed data - UINT32 m_compressed_length; // length of the compressed stream + uint32_t m_compressed_length; // length of the compressed stream // parameters - UINT32 m_sample_rate; // sample rate - UINT8 m_channels; // number of channels - UINT32 m_block_size; // block size + uint32_t m_sample_rate; // sample rate + uint8_t m_channels; // number of channels + uint32_t m_block_size; // block size // header stripping bool m_strip_metadata; // strip the metadata? - UINT32 m_ignore_bytes; // how many bytes to ignore when writing + uint32_t m_ignore_bytes; // how many bytes to ignore when writing bool m_found_audio; // have we hit the audio yet? }; @@ -88,30 +88,30 @@ class flac_decoder public: // construction/destruction flac_decoder(); - flac_decoder(const void *buffer, UINT32 length, const void *buffer2 = nullptr, UINT32 length2 = 0); + flac_decoder(const void *buffer, uint32_t length, const void *buffer2 = nullptr, uint32_t length2 = 0); flac_decoder(util::core_file &file); ~flac_decoder(); // getters (valid after reset) - UINT32 sample_rate() const { return m_sample_rate; } - UINT8 channels() const { return m_channels; } - UINT8 bits_per_sample() const { return m_bits_per_sample; } - UINT32 total_samples() const { return FLAC__stream_decoder_get_total_samples(m_decoder); } + uint32_t sample_rate() const { return m_sample_rate; } + uint8_t channels() const { return m_channels; } + uint8_t bits_per_sample() const { return m_bits_per_sample; } + uint32_t total_samples() const { return FLAC__stream_decoder_get_total_samples(m_decoder); } FLAC__StreamDecoderState state() const { return FLAC__stream_decoder_get_state(m_decoder); } const char *state_string() const { return FLAC__stream_decoder_get_resolved_state_string(m_decoder); } // reset bool reset(); - bool reset(const void *buffer, UINT32 length, const void *buffer2 = nullptr, UINT32 length2 = 0); - bool reset(UINT32 sample_rate, UINT8 num_channels, UINT32 block_size, const void *buffer, UINT32 length); + bool reset(const void *buffer, uint32_t length, const void *buffer2 = nullptr, uint32_t length2 = 0); + bool reset(uint32_t sample_rate, uint8_t num_channels, uint32_t block_size, const void *buffer, uint32_t length); bool reset(util::core_file &file); // decode to a buffer; num_samples must be a multiple of the block size - bool decode_interleaved(INT16 *samples, UINT32 num_samples, bool swap_endian = false); - bool decode(INT16 **samples, UINT32 num_samples, bool swap_endian = false); + bool decode_interleaved(int16_t *samples, uint32_t num_samples, bool swap_endian = false); + bool decode(int16_t **samples, uint32_t num_samples, bool swap_endian = false); // finish up - UINT32 finish(); + uint32_t finish(); private: // internal helpers @@ -126,19 +126,19 @@ private: // output state FLAC__StreamDecoder * m_decoder; // actual encoder util::core_file * m_file; // output file - UINT32 m_sample_rate; // decoded sample rate - UINT8 m_channels; // decoded number of channels - UINT8 m_bits_per_sample; // decoded bits per sample - UINT32 m_compressed_offset; // current offset in compressed data + uint32_t m_sample_rate; // decoded sample rate + uint8_t m_channels; // decoded number of channels + uint8_t m_bits_per_sample; // decoded bits per sample + uint32_t m_compressed_offset; // current offset in compressed data const FLAC__byte * m_compressed_start; // start of compressed data - UINT32 m_compressed_length; // length of compressed data + uint32_t m_compressed_length; // length of compressed data const FLAC__byte * m_compressed2_start; // start of compressed data - UINT32 m_compressed2_length; // length of compressed data - INT16 * m_uncompressed_start[8];// pointer to start of uncompressed data (up to 8 streams) - UINT32 m_uncompressed_offset; // current position in uncompressed data - UINT32 m_uncompressed_length; // length of uncompressed data + uint32_t m_compressed2_length; // length of compressed data + int16_t * m_uncompressed_start[8];// pointer to start of uncompressed data (up to 8 streams) + uint32_t m_uncompressed_offset; // current position in uncompressed data + uint32_t m_uncompressed_length; // length of uncompressed data bool m_uncompressed_swap; // swap uncompressed sample data - UINT8 m_custom_header[0x2a]; // custom header + uint8_t m_custom_header[0x2a]; // custom header }; |