summaryrefslogtreecommitdiff
path: root/gvc-mixer-stream.c
diff options
context:
space:
mode:
authorGiovanni Campagna <gcampagna@src.gnome.org>2012-10-18 19:45:56 +0200
committerGiovanni Campagna <gcampagna@src.gnome.org>2012-12-08 15:45:28 +0100
commit740bab171443cda76d27ca77ac31717475ad51dd (patch)
tree91a2fbe9b71d6939b04149d963cbaae38eab6ef6 /gvc-mixer-stream.c
parenteab2bf3eeabc5445c7c2168dadb732c4b7a45deb (diff)
downloadlibgnome-volume-control-740bab171443cda76d27ca77ac31717475ad51dd.tar.gz
Gvc: make GvcMixerStreamPort a boxed type
It's a prerequisite for accessing it from JS https://bugzilla.gnome.org/show_bug.cgi?id=675902
Diffstat (limited to 'gvc-mixer-stream.c')
-rw-r--r--gvc-mixer-stream.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/gvc-mixer-stream.c b/gvc-mixer-stream.c
index 5a5c8e6..d3e01b6 100644
--- a/gvc-mixer-stream.c
+++ b/gvc-mixer-stream.c
@@ -88,6 +88,30 @@ static void gvc_mixer_stream_finalize (GObject *object);
G_DEFINE_ABSTRACT_TYPE (GvcMixerStream, gvc_mixer_stream, G_TYPE_OBJECT)
+static void
+free_port (GvcMixerStreamPort *p)
+{
+ g_free (p->port);
+ g_free (p->human_port);
+ g_slice_free (GvcMixerStreamPort, p);
+}
+
+static GvcMixerStreamPort *
+dup_port (GvcMixerStreamPort *p)
+{
+ GvcMixerStreamPort *m;
+
+ m = g_slice_new (GvcMixerStreamPort);
+
+ *m = *p;
+ m->port = g_strdup (p->port);
+ m->human_port = g_strdup (p->human_port);
+
+ return m;
+}
+
+G_DEFINE_BOXED_TYPE (GvcMixerStreamPort, gvc_mixer_stream_port, dup_port, free_port)
+
static guint32
get_next_stream_serial (void)
{
@@ -946,14 +970,6 @@ gvc_mixer_stream_init (GvcMixerStream *stream)
}
static void
-free_port (GvcMixerStreamPort *p)
-{
- g_free (p->port);
- g_free (p->human_port);
- g_free (p);
-}
-
-static void
gvc_mixer_stream_finalize (GObject *object)
{
GvcMixerStream *mixer_stream;