aboutsummaryrefslogtreecommitdiffstats
path: root/src/mixer/AlsaMixerPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-09 22:25:24 +0100
committerMax Kellermann <max@duempel.org>2013-01-09 22:25:24 +0100
commitd3e1b72d381dc7dd01926188b6d62729788b76b9 (patch)
treeebea31783d45b5f5a8e8e99d3e50c315af3b9e8f /src/mixer/AlsaMixerPlugin.cxx
parentb5e1bd5705842fe73bbb12e5ff771e42e10cb004 (diff)
downloadmpd-d3e1b72d381dc7dd01926188b6d62729788b76b9.tar.gz
mpd-d3e1b72d381dc7dd01926188b6d62729788b76b9.tar.xz
mpd-d3e1b72d381dc7dd01926188b6d62729788b76b9.zip
mixer/{alsa,pulse}: convert to C++
Diffstat (limited to '')
-rw-r--r--src/mixer/AlsaMixerPlugin.cxx (renamed from src/mixer/alsa_mixer_plugin.c)34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/mixer/alsa_mixer_plugin.c b/src/mixer/AlsaMixerPlugin.cxx
index 22e4e22bd..6623d12ec 100644
--- a/src/mixer/alsa_mixer_plugin.c
+++ b/src/mixer/AlsaMixerPlugin.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
@@ -77,7 +77,7 @@ find_fd(GSList **list_r, int fd)
if (list == NULL)
return NULL;
- GPollFD *p = list->data;
+ GPollFD *p = (GPollFD *)list->data;
if (p->fd == fd)
return list_r;
@@ -103,7 +103,7 @@ alsa_mixer_update_fd(struct alsa_mixer_source *source, const struct pollfd *p,
GSList *found = *found_r;
*found_r = found->next;
- GPollFD *q = found->data;
+ GPollFD *q = (GPollFD *)found->data;
if (q->events != p->events) {
/* refresh events */
g_source_remove_poll(&source->source, q);
@@ -135,7 +135,7 @@ alsa_mixer_update_fds(struct alsa_mixer_source *source)
g_free(pfds);
for (; old != NULL; old = old->next) {
- GPollFD *q = old->data;
+ GPollFD *q = (GPollFD *)old->data;
g_source_remove_poll(&source->source, q);
g_free(q);
}
@@ -163,7 +163,7 @@ alsa_mixer_source_check(GSource *_source)
struct alsa_mixer_source *source = (struct alsa_mixer_source *)_source;
for (const GSList *i = source->fds; i != NULL; i = i->next) {
- const GPollFD *poll_fd = i->data;
+ const GPollFD *poll_fd = (GPollFD *)i->data;
if (poll_fd->revents != 0)
return true;
}
@@ -194,10 +194,12 @@ alsa_mixer_source_finalize(GSource *_source)
}
static GSourceFuncs alsa_mixer_source_funcs = {
- .prepare = alsa_mixer_source_prepare,
- .check = alsa_mixer_source_check,
- .dispatch = alsa_mixer_source_dispatch,
- .finalize = alsa_mixer_source_finalize,
+ alsa_mixer_source_prepare,
+ alsa_mixer_source_check,
+ alsa_mixer_source_dispatch,
+ alsa_mixer_source_finalize,
+ nullptr,
+ nullptr,
};
/*
@@ -421,11 +423,11 @@ alsa_mixer_set_volume(struct mixer *mixer, unsigned volume, GError **error_r)
}
const struct mixer_plugin alsa_mixer_plugin = {
- .init = alsa_mixer_init,
- .finish = alsa_mixer_finish,
- .open = alsa_mixer_open,
- .close = alsa_mixer_close,
- .get_volume = alsa_mixer_get_volume,
- .set_volume = alsa_mixer_set_volume,
- .global = true,
+ alsa_mixer_init,
+ alsa_mixer_finish,
+ alsa_mixer_open,
+ alsa_mixer_close,
+ alsa_mixer_get_volume,
+ alsa_mixer_set_volume,
+ true,
};