aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-17 19:33:51 +0200
committerMax Kellermann <max@duempel.org>2011-09-17 19:33:51 +0200
commit947848ebf6eb4706e8b3a88e7506e893b01f9a07 (patch)
tree354d2f860d9aa6d3a9046b170520b78bb9b20c4b /src/mixer
parent5e22fe488ed7209c6e470e542826da4674e93338 (diff)
downloadmpd-947848ebf6eb4706e8b3a88e7506e893b01f9a07.tar.gz
mpd-947848ebf6eb4706e8b3a88e7506e893b01f9a07.tar.xz
mpd-947848ebf6eb4706e8b3a88e7506e893b01f9a07.zip
output/roar: export volume methods
Use these instead of exposing the internal roar_t struct.
Diffstat (limited to 'src/mixer')
-rw-r--r--src/mixer/roar_mixer_plugin.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/mixer/roar_mixer_plugin.c b/src/mixer/roar_mixer_plugin.c
index 636a9c00e..47d3c17f9 100644
--- a/src/mixer/roar_mixer_plugin.c
+++ b/src/mixer/roar_mixer_plugin.c
@@ -34,7 +34,7 @@ typedef struct roar_mpd_mixer
{
/** the base mixer class */
struct mixer base;
- roar_t *self;
+ struct roar *self;
} roar_mixer_t;
/**
@@ -82,20 +82,7 @@ static int
roar_mixer_get_volume(struct mixer *mixer, G_GNUC_UNUSED GError **error_r)
{
roar_mixer_t *self = (roar_mixer_t *)mixer;
- g_mutex_lock(self->self->lock);
- if (self->self->vss && self->self->alive)
- {
- float l, r;
- int error;
- roar_vs_volume_get(self->self->vss, &l, &r, &error);
- g_mutex_unlock(self->self->lock);
- return (l + r) * 50;
- }
- else
- {
- g_mutex_unlock(self->self->lock);
- return 0;
- }
+ return roar_output_get_volume(self->self);
}
static bool
@@ -103,23 +90,7 @@ roar_mixer_set_volume(struct mixer *mixer, unsigned volume,
G_GNUC_UNUSED GError **error_r)
{
roar_mixer_t *self = (roar_mixer_t *)mixer;
- g_mutex_lock(self->self->lock);
- if (self->self->vss && self->self->alive)
- {
- assert(volume <= 100);
-
- int error;
- float level = volume / 100.0;
-
- roar_vs_volume_mono(self->self->vss, level, &error);
- g_mutex_unlock(self->self->lock);
- return true;
- }
- else
- {
- g_mutex_unlock(self->self->lock);
- return false;
- }
+ return roar_output_set_volume(self->self, volume);
}
const struct mixer_plugin roar_mixer_plugin = {