aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx8
-rw-r--r--src/mixer/OssMixerPlugin.cxx4
-rw-r--r--src/mixer/PulseMixerPlugin.cxx2
-rw-r--r--src/mixer/PulseMixerPlugin.hxx7
-rw-r--r--src/mixer/RoarMixerPlugin.cxx2
-rw-r--r--src/mixer/SoftwareMixerPlugin.cxx2
6 files changed, 9 insertions, 16 deletions
diff --git a/src/mixer/AlsaMixerPlugin.cxx b/src/mixer/AlsaMixerPlugin.cxx
index 4a4ca433c..75ba8825c 100644
--- a/src/mixer/AlsaMixerPlugin.cxx
+++ b/src/mixer/AlsaMixerPlugin.cxx
@@ -27,6 +27,7 @@
#include "event/Call.hxx"
#include "util/ASCII.hxx"
#include "util/ReusableArray.hxx"
+#include "util/Clamp.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
@@ -47,7 +48,7 @@ class AlsaMixerMonitor final : private MultiSocketMonitor {
public:
AlsaMixerMonitor(EventLoop &_loop, snd_mixer_t *_mixer)
:MultiSocketMonitor(_loop), mixer(_mixer) {
-#ifdef USE_EPOLL
+#ifdef USE_INTERNAL_EVENTLOOP
_loop.AddCall([this](){ InvalidateSockets(); });
#else
_loop.AddIdle(InitAlsaMixerMonitor, this);
@@ -55,7 +56,7 @@ public:
}
private:
-#ifndef USE_EPOLL
+#ifndef USE_INTERNAL_EVENTLOOP
static gboolean InitAlsaMixerMonitor(gpointer data) {
AlsaMixerMonitor &amm = *(AlsaMixerMonitor *)data;
amm.InvalidateSockets();
@@ -372,8 +373,7 @@ AlsaMixer::SetVolume(unsigned volume, Error &error)
level = (long)(((vol / 100.0) * (volume_max - volume_min) +
volume_min) + 0.5);
- level = level > volume_max ? volume_max : level;
- level = level < volume_min ? volume_min : level;
+ level = Clamp(level, volume_min, volume_max);
err = snd_mixer_selem_set_playback_volume_all(elem, level);
if (err < 0) {
diff --git a/src/mixer/OssMixerPlugin.cxx b/src/mixer/OssMixerPlugin.cxx
index 0a459bc97..7a91cfcb1 100644
--- a/src/mixer/OssMixerPlugin.cxx
+++ b/src/mixer/OssMixerPlugin.cxx
@@ -19,7 +19,7 @@
#include "config.h"
#include "MixerInternal.hxx"
-#include "OutputAPI.hxx"
+#include "ConfigData.hxx"
#include "system/fd_util.h"
#include "util/ASCII.hxx"
#include "util/Error.hxx"
@@ -28,10 +28,8 @@
#include <assert.h>
#include <string.h>
-#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
-#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/src/mixer/PulseMixerPlugin.cxx b/src/mixer/PulseMixerPlugin.cxx
index ff10256cb..84d42c392 100644
--- a/src/mixer/PulseMixerPlugin.cxx
+++ b/src/mixer/PulseMixerPlugin.cxx
@@ -26,7 +26,6 @@
#include "util/Domain.hxx"
#include "Log.hxx"
-#include <pulse/thread-mainloop.h>
#include <pulse/context.h>
#include <pulse/introspect.h>
#include <pulse/stream.h>
@@ -34,7 +33,6 @@
#include <pulse/error.h>
#include <assert.h>
-#include <string.h>
struct PulseMixer final : public Mixer {
PulseOutput *output;
diff --git a/src/mixer/PulseMixerPlugin.hxx b/src/mixer/PulseMixerPlugin.hxx
index fa73e0f5e..46bd06a01 100644
--- a/src/mixer/PulseMixerPlugin.hxx
+++ b/src/mixer/PulseMixerPlugin.hxx
@@ -20,20 +20,17 @@
#ifndef MPD_PULSE_MIXER_PLUGIN_HXX
#define MPD_PULSE_MIXER_PLUGIN_HXX
-#include <pulse/def.h>
-
struct PulseMixer;
struct pa_context;
struct pa_stream;
void
-pulse_mixer_on_connect(PulseMixer *pm, struct pa_context *context);
+pulse_mixer_on_connect(PulseMixer *pm, pa_context *context);
void
pulse_mixer_on_disconnect(PulseMixer *pm);
void
-pulse_mixer_on_change(PulseMixer *pm,
- struct pa_context *context, struct pa_stream *stream);
+pulse_mixer_on_change(PulseMixer *pm, pa_context *context, pa_stream *stream);
#endif
diff --git a/src/mixer/RoarMixerPlugin.cxx b/src/mixer/RoarMixerPlugin.cxx
index 6bd700551..75147329e 100644
--- a/src/mixer/RoarMixerPlugin.cxx
+++ b/src/mixer/RoarMixerPlugin.cxx
@@ -21,8 +21,8 @@
#include "config.h"
#include "MixerInternal.hxx"
-#include "OutputAPI.hxx"
#include "output/RoarOutputPlugin.hxx"
+#include "Compiler.h"
struct RoarMixer final : public Mixer {
/** the base mixer class */
diff --git a/src/mixer/SoftwareMixerPlugin.cxx b/src/mixer/SoftwareMixerPlugin.cxx
index 193e68f23..e5f4b1659 100644
--- a/src/mixer/SoftwareMixerPlugin.cxx
+++ b/src/mixer/SoftwareMixerPlugin.cxx
@@ -24,7 +24,7 @@
#include "FilterRegistry.hxx"
#include "FilterInternal.hxx"
#include "filter/VolumeFilterPlugin.hxx"
-#include "pcm/PcmVolume.hxx"
+#include "pcm/Volume.hxx"
#include "ConfigData.hxx"
#include "util/Error.hxx"