diff options
author | Max Kellermann <max@duempel.org> | 2013-08-03 21:00:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-03 21:37:56 +0200 |
commit | d1e7b4e38136f9342aad76c685a13adf0e69f869 (patch) | |
tree | 49643b937ddfe735511b566a71398da5a945d7aa /src/filter/VolumeFilterPlugin.cxx | |
parent | 67f591a9ce60651da41afc499bd9a22e25314e35 (diff) | |
download | mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip |
audio_format: convert to C++
Diffstat (limited to 'src/filter/VolumeFilterPlugin.cxx')
-rw-r--r-- | src/filter/VolumeFilterPlugin.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/filter/VolumeFilterPlugin.cxx b/src/filter/VolumeFilterPlugin.cxx index 824ad0ab4..3888cefe4 100644 --- a/src/filter/VolumeFilterPlugin.cxx +++ b/src/filter/VolumeFilterPlugin.cxx @@ -25,7 +25,7 @@ #include "conf.h" #include "pcm/PcmVolume.hxx" #include "pcm/PcmBuffer.hxx" -#include "audio_format.h" +#include "AudioFormat.hxx" #include <assert.h> #include <string.h> @@ -36,7 +36,7 @@ class VolumeFilter final : public Filter { */ unsigned volume; - struct audio_format format; + AudioFormat format; PcmBuffer buffer; @@ -56,7 +56,7 @@ public: volume = _volume; } - virtual const audio_format *Open(audio_format &af, GError **error_r); + virtual AudioFormat Open(AudioFormat &af, GError **error_r) override; virtual void Close(); virtual const void *FilterPCM(const void *src, size_t src_size, size_t *dest_size_r, GError **error_r); @@ -75,12 +75,12 @@ volume_filter_init(gcc_unused const struct config_param *param, return new VolumeFilter(); } -const struct audio_format * -VolumeFilter::Open(audio_format &audio_format, gcc_unused GError **error_r) +AudioFormat +VolumeFilter::Open(AudioFormat &audio_format, gcc_unused GError **error_r) { format = audio_format; - return &format; + return format; } void @@ -112,7 +112,7 @@ VolumeFilter::FilterPCM(const void *src, size_t src_size, memcpy(dest, src, src_size); bool success = pcm_volume(dest, src_size, - sample_format(format.format), + format.format, volume); if (!success) { g_set_error(error_r, volume_quark(), 0, |