aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer/SoftwareMixerPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /src/mixer/SoftwareMixerPlugin.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to '')
-rw-r--r--src/mixer/SoftwareMixerPlugin.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mixer/SoftwareMixerPlugin.cxx b/src/mixer/SoftwareMixerPlugin.cxx
index 8a268aaf1..b7eb8ff0f 100644
--- a/src/mixer/SoftwareMixerPlugin.cxx
+++ b/src/mixer/SoftwareMixerPlugin.cxx
@@ -26,10 +26,18 @@
#include "filter/VolumeFilterPlugin.hxx"
#include "pcm/PcmVolume.hxx"
#include "ConfigData.hxx"
+#include "util/Error.hxx"
#include <assert.h>
#include <math.h>
+static Filter *
+CreateVolumeFilter()
+{
+ Error error;
+ return filter_new(&volume_filter_plugin, config_param(), error);
+}
+
struct SoftwareMixer final : public Mixer {
Filter *filter;
@@ -37,8 +45,7 @@ struct SoftwareMixer final : public Mixer {
SoftwareMixer()
:Mixer(software_mixer_plugin),
- filter(filter_new(&volume_filter_plugin, config_param(),
- nullptr)),
+ filter(CreateVolumeFilter()),
volume(100)
{
assert(filter != nullptr);
@@ -52,7 +59,7 @@ struct SoftwareMixer final : public Mixer {
static Mixer *
software_mixer_init(gcc_unused void *ao,
gcc_unused const config_param &param,
- gcc_unused GError **error_r)
+ gcc_unused Error &error)
{
return new SoftwareMixer();
}
@@ -66,7 +73,7 @@ software_mixer_finish(Mixer *data)
}
static int
-software_mixer_get_volume(Mixer *mixer, gcc_unused GError **error_r)
+software_mixer_get_volume(Mixer *mixer, gcc_unused Error &error)
{
SoftwareMixer *sm = (SoftwareMixer *)mixer;
@@ -75,7 +82,7 @@ software_mixer_get_volume(Mixer *mixer, gcc_unused GError **error_r)
static bool
software_mixer_set_volume(Mixer *mixer, unsigned volume,
- gcc_unused GError **error_r)
+ gcc_unused Error &error)
{
SoftwareMixer *sm = (SoftwareMixer *)mixer;