From 29030b54c98b0aee65fbc10ebf7ba36bed98c02c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Aug 2013 18:02:44 +0200 Subject: util/Error: new error passing library Replaces GLib's GError. --- src/mixer/SoftwareMixerPlugin.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/mixer/SoftwareMixerPlugin.cxx') 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 #include +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 ¶m, - 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; -- cgit v1.2.3