From 6d156916d8455cb8edef0e90020026d395dd82a0 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Sat, 8 Nov 2014 20:31:26 +0100 Subject: oss: Use MateMixerStreamSwitch --- backends/oss/oss-stream.c | 3 ++- backends/oss/oss-switch.c | 16 ++++++++++------ backends/oss/oss-switch.h | 7 ++++--- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/backends/oss/oss-stream.c b/backends/oss/oss-stream.c index 8755b13..0e7a0c0 100644 --- a/backends/oss/oss-stream.c +++ b/backends/oss/oss-stream.c @@ -203,7 +203,8 @@ oss_stream_set_switch_data (OssStream *stream, gint fd, GList *options) } /* Takes ownership of options */ - stream->priv->swtch = oss_switch_new (OSS_STREAM_SWITCH_NAME, + stream->priv->swtch = oss_switch_new (stream, + OSS_STREAM_SWITCH_NAME, _("Connector"), fd, options); diff --git a/backends/oss/oss-switch.c b/backends/oss/oss-switch.c index 682814b..40527b9 100644 --- a/backends/oss/oss-switch.c +++ b/backends/oss/oss-switch.c @@ -22,6 +22,7 @@ #include #include "oss-common.h" +#include "oss-stream.h" #include "oss-switch.h" #include "oss-switch-option.h" @@ -31,12 +32,12 @@ struct _OssSwitchPrivate GList *options; }; -static void oss_switch_class_init (OssSwitchClass *klass); -static void oss_switch_init (OssSwitch *swtch); -static void oss_switch_dispose (GObject *object); -static void oss_switch_finalize (GObject *object); +static void oss_switch_class_init (OssSwitchClass *klass); +static void oss_switch_init (OssSwitch *swtch); +static void oss_switch_dispose (GObject *object); +static void oss_switch_finalize (GObject *object); -G_DEFINE_TYPE (OssSwitch, oss_switch, MATE_MIXER_TYPE_SWITCH) +G_DEFINE_TYPE (OssSwitch, oss_switch, MATE_MIXER_TYPE_STREAM_SWITCH) static gboolean oss_switch_set_active_option (MateMixerSwitch *mms, MateMixerSwitchOption *mmso); @@ -99,13 +100,15 @@ oss_switch_finalize (GObject *object) } OssSwitch * -oss_switch_new (const gchar *name, +oss_switch_new (OssStream *stream, + const gchar *name, const gchar *label, gint fd, GList *options) { OssSwitch *swtch; + g_return_val_if_fail (OSS_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 (fd != -1, NULL); @@ -115,6 +118,7 @@ oss_switch_new (const gchar *name, "name", name, "label", label, "role", MATE_MIXER_SWITCH_ROLE_PORT, + "stream", stream, NULL); /* Takes ownership of options */ diff --git a/backends/oss/oss-switch.h b/backends/oss/oss-switch.h index dc91758..520d0c9 100644 --- a/backends/oss/oss-switch.h +++ b/backends/oss/oss-switch.h @@ -44,7 +44,7 @@ typedef struct _OssSwitchPrivate OssSwitchPrivate; struct _OssSwitch { - MateMixerSwitch parent; + MateMixerStreamSwitch parent; /*< private >*/ OssSwitchPrivate *priv; @@ -52,12 +52,13 @@ struct _OssSwitch struct _OssSwitchClass { - MateMixerSwitchClass parent_class; + MateMixerStreamSwitchClass parent_class; }; GType oss_switch_get_type (void) G_GNUC_CONST; -OssSwitch *oss_switch_new (const gchar *name, +OssSwitch *oss_switch_new (OssStream *stream, + const gchar *name, const gchar *label, gint fd, GList *options); -- cgit v1.2.1