aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-07 10:12:51 +0100
committerMax Kellermann <max@duempel.org>2013-01-07 10:17:16 +0100
commit989c9a7317354a538aef7c3ed35cf995a9afc6e1 (patch)
tree257b031657e777cb4638f80ac854d2dba8f1f2d1 /src
parent975370c084c8d679ff2cc2fcee48326b1dbcbf2e (diff)
downloadmpd-989c9a7317354a538aef7c3ed35cf995a9afc6e1.tar.gz
mpd-989c9a7317354a538aef7c3ed35cf995a9afc6e1.tar.xz
mpd-989c9a7317354a538aef7c3ed35cf995a9afc6e1.zip
filter/replay_gain: convert to C++
Diffstat (limited to '')
-rw-r--r--src/OutputControl.cxx2
-rw-r--r--src/OutputInit.cxx3
-rw-r--r--src/OutputThread.cxx2
-rw-r--r--src/filter/ReplayGainFilterPlugin.cxx (renamed from src/filter/replay_gain_filter_plugin.c)26
-rw-r--r--src/filter/ReplayGainFilterPlugin.hxx (renamed from src/filter/replay_gain_filter_plugin.h)6
5 files changed, 22 insertions, 17 deletions
diff --git a/src/OutputControl.cxx b/src/OutputControl.cxx
index 7cc2814de..005003d2d 100644
--- a/src/OutputControl.cxx
+++ b/src/OutputControl.cxx
@@ -27,9 +27,9 @@ extern "C" {
#include "mixer_control.h"
#include "mixer_plugin.h"
#include "notify.h"
-#include "filter/replay_gain_filter_plugin.h"
}
+#include "filter/ReplayGainFilterPlugin.hxx"
#include "filter_plugin.h"
#include <assert.h>
diff --git a/src/OutputInit.cxx b/src/OutputInit.cxx
index 5fc800d19..3c394ba44 100644
--- a/src/OutputInit.cxx
+++ b/src/OutputInit.cxx
@@ -34,9 +34,10 @@ extern "C" {
#include "filter_config.h"
#include "filter/chain_filter_plugin.h"
#include "filter/autoconvert_filter_plugin.h"
-#include "filter/replay_gain_filter_plugin.h"
}
+#include "filter/ReplayGainFilterPlugin.hxx"
+
#include <glib.h>
#include <assert.h>
diff --git a/src/OutputThread.cxx b/src/OutputThread.cxx
index 3d0d96f7a..6fe833330 100644
--- a/src/OutputThread.cxx
+++ b/src/OutputThread.cxx
@@ -26,10 +26,10 @@ extern "C" {
#include "pcm_mix.h"
#include "filter_plugin.h"
#include "filter/convert_filter_plugin.h"
-#include "filter/replay_gain_filter_plugin.h"
#include "notify.h"
}
+#include "filter/ReplayGainFilterPlugin.hxx"
#include "PlayerControl.hxx"
#include "MusicPipe.hxx"
#include "MusicChunk.hxx"
diff --git a/src/filter/replay_gain_filter_plugin.c b/src/filter/ReplayGainFilterPlugin.cxx
index 9fd3cbc07..1c2f40260 100644
--- a/src/filter/replay_gain_filter_plugin.c
+++ b/src/filter/ReplayGainFilterPlugin.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,16 +18,19 @@
*/
#include "config.h"
-#include "filter/replay_gain_filter_plugin.h"
+#include "ReplayGainFilterPlugin.hxx"
#include "filter_plugin.h"
#include "filter_internal.h"
#include "filter_registry.h"
#include "audio_format.h"
-#include "pcm_buffer.h"
-#include "pcm_volume.h"
#include "replay_gain_info.h"
#include "replay_gain_config.h"
+
+extern "C" {
+#include "pcm_buffer.h"
+#include "pcm_volume.h"
#include "mixer_control.h"
+}
#include <assert.h>
#include <string.h>
@@ -183,7 +186,8 @@ replay_gain_filter_filter(struct filter *_filter,
memcpy(dest, src, src_size);
- success = pcm_volume(dest, src_size, filter->audio_format.format,
+ success = pcm_volume(dest, src_size,
+ sample_format(filter->audio_format.format),
filter->volume);
if (!success) {
g_set_error(error_r, replay_gain_quark(), 0,
@@ -195,12 +199,12 @@ replay_gain_filter_filter(struct filter *_filter,
}
const struct filter_plugin replay_gain_filter_plugin = {
- .name = "replay_gain",
- .init = replay_gain_filter_init,
- .finish = replay_gain_filter_finish,
- .open = replay_gain_filter_open,
- .close = replay_gain_filter_close,
- .filter = replay_gain_filter_filter,
+ "replay_gain",
+ replay_gain_filter_init,
+ replay_gain_filter_finish,
+ replay_gain_filter_open,
+ replay_gain_filter_close,
+ replay_gain_filter_filter,
};
void
diff --git a/src/filter/replay_gain_filter_plugin.h b/src/filter/ReplayGainFilterPlugin.hxx
index da2df9d6a..9b4ffc522 100644
--- a/src/filter/replay_gain_filter_plugin.h
+++ b/src/filter/ReplayGainFilterPlugin.hxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef REPLAY_GAIN_FILTER_PLUGIN_H
-#define REPLAY_GAIN_FILTER_PLUGIN_H
+#ifndef MPD_REPLAY_GAIN_FILTER_PLUGIN_HXX
+#define MPD_REPLAY_GAIN_FILTER_PLUGIN_HXX
#include "replay_gain_info.h"