summaryrefslogtreecommitdiff
path: root/backends/alsa/alsa-switch.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-11-08 22:18:34 +0100
committerMichal Ratajsky <[email protected]>2014-11-08 22:18:34 +0100
commit068d95e1c28b0e20e692c5ecb24f044542e82ae9 (patch)
tree5be0c066ba9d6ce605c4b82e8e0ae2ec8c00bb9c /backends/alsa/alsa-switch.c
parente72c6f834323e65a41f2ab50047d6fd98f1e09db (diff)
downloadlibmatemixer-068d95e1c28b0e20e692c5ecb24f044542e82ae9.tar.bz2
libmatemixer-068d95e1c28b0e20e692c5ecb24f044542e82ae9.tar.xz
alsa: Use MateMixerStreamSwitch
Also introduce alsa-types.h and move instance typedefs there to fix cross referencing introduced by this change
Diffstat (limited to 'backends/alsa/alsa-switch.c')
-rw-r--r--backends/alsa/alsa-switch.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/backends/alsa/alsa-switch.c b/backends/alsa/alsa-switch.c
index 6a0f1f4..b080188 100644
--- a/backends/alsa/alsa-switch.c
+++ b/backends/alsa/alsa-switch.c
@@ -23,6 +23,7 @@
#include <libmatemixer/matemixer-private.h>
#include "alsa-element.h"
+#include "alsa-stream.h"
#include "alsa-switch.h"
#include "alsa-switch-option.h"
@@ -40,7 +41,7 @@ static void alsa_switch_init (AlsaSwitch *swtch);
static void alsa_switch_dispose (GObject *object);
G_DEFINE_TYPE_WITH_CODE (AlsaSwitch, alsa_switch,
- MATE_MIXER_TYPE_SWITCH,
+ MATE_MIXER_TYPE_STREAM_SWITCH,
G_IMPLEMENT_INTERFACE (ALSA_TYPE_ELEMENT,
alsa_element_interface_init))
@@ -102,17 +103,24 @@ alsa_switch_init (AlsaSwitch *swtch)
}
AlsaSwitch *
-alsa_switch_new (const gchar *name,
+alsa_switch_new (AlsaStream *stream,
+ const gchar *name,
const gchar *label,
MateMixerSwitchRole role,
GList *options)
{
AlsaSwitch *swtch;
+ g_return_val_if_fail (ALSA_IS_STREAM (stream), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (label != NULL, NULL);
+ g_return_val_if_fail (options != NULL, NULL);
+
swtch = g_object_new (ALSA_TYPE_SWITCH,
"name", name,
"label", label,
"role", role,
+ "stream", stream,
NULL);
/* Takes ownership of options */