diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-11 20:56:14 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-11 21:48:43 +0100 |
commit | c5a2cadccc1df3355cda986b30b99923afed3dfb (patch) | |
tree | efbd5239e4c4b8a71d69095325ff5033988aa92f /src/pcm | |
parent | 9aa43416b6d451af33cbf5cbbe796fc404010f2f (diff) |
pcm/Export: convert to class, make members private
Diffstat (limited to 'src/pcm')
-rw-r--r-- | src/pcm/PcmExport.hxx | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/pcm/PcmExport.hxx b/src/pcm/PcmExport.hxx index e7cbf9f08..eb010bf0e 100644 --- a/src/pcm/PcmExport.hxx +++ b/src/pcm/PcmExport.hxx @@ -31,33 +31,7 @@ template<typename T> struct ConstBuffer; * outside of MPD. It has a few more options to tweak the binary * representation which are not supported by the pcm_convert library. */ -struct PcmExport { - struct Params { - bool alsa_channel_order = false; -#ifdef ENABLE_DSD - bool dsd_u32 = false; - bool dop = false; -#endif - bool shift8 = false; - bool pack24 = false; - bool reverse_endian = false; - - /** - * Calculate the output sample rate, given a specific input - * sample rate. Usually, both are the same; however, with - * DSD_U32, four input bytes (= 4 * 8 bits) are combined to - * one output word (32 bits), dividing the sample rate by 4. - */ - gcc_pure - unsigned CalcOutputSampleRate(unsigned input_sample_rate) const; - - /** - * The inverse of CalcOutputSampleRate(). - */ - gcc_pure - unsigned CalcInputSampleRate(unsigned output_sample_rate) const; - }; - +class PcmExport { /** * This buffer is used to reorder channels. * @@ -136,6 +110,33 @@ struct PcmExport { */ uint8_t reverse_endian; +public: + struct Params { + bool alsa_channel_order = false; +#ifdef ENABLE_DSD + bool dsd_u32 = false; + bool dop = false; +#endif + bool shift8 = false; + bool pack24 = false; + bool reverse_endian = false; + + /** + * Calculate the output sample rate, given a specific input + * sample rate. Usually, both are the same; however, with + * DSD_U32, four input bytes (= 4 * 8 bits) are combined to + * one output word (32 bits), dividing the sample rate by 4. + */ + gcc_pure + unsigned CalcOutputSampleRate(unsigned input_sample_rate) const; + + /** + * The inverse of CalcOutputSampleRate(). + */ + gcc_pure + unsigned CalcInputSampleRate(unsigned output_sample_rate) const; + }; + /** * Open the object. * |