[gnome-media] Don't depend on Pulseaudio in "public" headers
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-media] Don't depend on Pulseaudio in "public" headers
- Date: Tue, 19 Oct 2010 14:58:02 +0000 (UTC)
commit 8ad93e59c9a7737c85b4368b71daff3cad9565bd
Author: Bastien Nocera <hadess hadess net>
Date: Mon Sep 27 15:34:17 2010 +0100
Don't depend on Pulseaudio in "public" headers
This makes it possible to copy portions of the gnome-volume-control
sources code and introspect it without requiring an introspected
PulseAudio dependency.
https://bugzilla.gnome.org/show_bug.cgi?id=630736
gnome-volume-control/src/Makefile.am | 5 +
gnome-volume-control/src/cc-sound-panel.c | 1 +
gnome-volume-control/src/gvc-applet.c | 1 +
gnome-volume-control/src/gvc-balance-bar.c | 2 +
gnome-volume-control/src/gvc-channel-map-private.h | 39 +++++++++
gnome-volume-control/src/gvc-channel-map.c | 9 ++
gnome-volume-control/src/gvc-channel-map.h | 12 +---
gnome-volume-control/src/gvc-combo-box.c | 1 +
gnome-volume-control/src/gvc-mixer-card-private.h | 35 ++++++++
gnome-volume-control/src/gvc-mixer-card.c | 8 ++
gnome-volume-control/src/gvc-mixer-card.h | 4 -
.../src/gvc-mixer-control-private.h | 35 ++++++++
gnome-volume-control/src/gvc-mixer-control.c | 82 ++++++++++++++++++++
gnome-volume-control/src/gvc-mixer-control.h | 2 -
gnome-volume-control/src/gvc-mixer-dialog.c | 2 +
gnome-volume-control/src/gvc-mixer-event-role.c | 11 +++
gnome-volume-control/src/gvc-mixer-sink-input.c | 11 +++
gnome-volume-control/src/gvc-mixer-sink.c | 11 +++
gnome-volume-control/src/gvc-mixer-source-output.c | 9 ++
gnome-volume-control/src/gvc-mixer-source.c | 11 +++
.../src/gvc-mixer-stream-private.h | 34 ++++++++
gnome-volume-control/src/gvc-mixer-stream.c | 32 ++++++++
gnome-volume-control/src/gvc-mixer-stream.h | 4 +-
gnome-volume-control/src/gvc-pulseaudio-fake.h | 34 ++++++++
gnome-volume-control/src/gvc-speaker-test.c | 1 +
gnome-volume-control/src/gvc-stream-status-icon.c | 1 +
26 files changed, 378 insertions(+), 19 deletions(-)
---
diff --git a/gnome-volume-control/src/Makefile.am b/gnome-volume-control/src/Makefile.am
index 3ea3475..8e32ba0 100644
--- a/gnome-volume-control/src/Makefile.am
+++ b/gnome-volume-control/src/Makefile.am
@@ -24,10 +24,13 @@ noinst_LTLIBRARIES = libgnomevolumecontrol.la
libgnomevolumecontrol_la_SOURCES = \
gvc-mixer-card.h \
gvc-mixer-card.c \
+ gvc-mixer-card-private.h \
gvc-mixer-stream.h \
gvc-mixer-stream.c \
+ gvc-mixer-stream-private.h \
gvc-channel-map.h \
gvc-channel-map.c \
+ gvc-channel-map-private.h \
gvc-mixer-sink.h \
gvc-mixer-sink.c \
gvc-mixer-source.h \
@@ -40,10 +43,12 @@ libgnomevolumecontrol_la_SOURCES = \
gvc-mixer-event-role.c \
gvc-mixer-control.h \
gvc-mixer-control.c \
+ gvc-mixer-control-private.h \
gvc-channel-bar.h \
gvc-channel-bar.c \
gvc-log.h \
gvc-log.c \
+ gvc-pulseaudio-fake.h \
$(NULL)
gnome_volume_control_applet_LDADD = \
diff --git a/gnome-volume-control/src/cc-sound-panel.c b/gnome-volume-control/src/cc-sound-panel.c
index 9b25b41..1ec93c8 100644
--- a/gnome-volume-control/src/cc-sound-panel.c
+++ b/gnome-volume-control/src/cc-sound-panel.c
@@ -29,6 +29,7 @@
#include <glib/gi18n-lib.h>
#include <glib.h>
#include <gtk/gtk.h>
+#include <pulse/pulseaudio.h>
#include "cc-sound-panel.h"
#include "gvc-mixer-dialog.h"
diff --git a/gnome-volume-control/src/gvc-applet.c b/gnome-volume-control/src/gvc-applet.c
index 629a77c..ef94ac5 100644
--- a/gnome-volume-control/src/gvc-applet.c
+++ b/gnome-volume-control/src/gvc-applet.c
@@ -30,6 +30,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <pulse/pulseaudio.h>
#include "gvc-applet.h"
#include "gvc-mixer-control.h"
diff --git a/gnome-volume-control/src/gvc-balance-bar.c b/gnome-volume-control/src/gvc-balance-bar.c
index 239779c..78594bf 100644
--- a/gnome-volume-control/src/gvc-balance-bar.c
+++ b/gnome-volume-control/src/gvc-balance-bar.c
@@ -28,8 +28,10 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <canberra-gtk.h>
+#include <pulse/pulseaudio.h>
#include "gvc-balance-bar.h"
+#include "gvc-channel-map-private.h"
#define SCALE_SIZE 128
#define ADJUSTMENT_MAX_NORMAL 65536.0 /* PA_VOLUME_NORM */
diff --git a/gnome-volume-control/src/gvc-channel-map-private.h b/gnome-volume-control/src/gvc-channel-map-private.h
new file mode 100644
index 0000000..3949de3
--- /dev/null
+++ b/gnome-volume-control/src/gvc-channel-map-private.h
@@ -0,0 +1,39 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GVC_CHANNEL_MAP_PRIVATE_H
+#define __GVC_CHANNEL_MAP_PRIVATE_H
+
+#include <glib-object.h>
+#include <pulse/pulseaudio.h>
+
+G_BEGIN_DECLS
+
+GvcChannelMap * gvc_channel_map_new_from_pa_channel_map (const pa_channel_map *map);
+const pa_channel_map * gvc_channel_map_get_pa_channel_map (const GvcChannelMap *map);
+
+void gvc_channel_map_volume_changed (GvcChannelMap *map,
+ const pa_cvolume *cv,
+ gboolean set);
+const pa_cvolume * gvc_channel_map_get_cvolume (const GvcChannelMap *map);
+
+G_END_DECLS
+
+#endif /* __GVC_CHANNEL_MAP_PRIVATE_H */
diff --git a/gnome-volume-control/src/gvc-channel-map.c b/gnome-volume-control/src/gvc-channel-map.c
index 644774a..a2073fd 100644
--- a/gnome-volume-control/src/gvc-channel-map.c
+++ b/gnome-volume-control/src/gvc-channel-map.c
@@ -30,6 +30,7 @@
#include <pulse/pulseaudio.h>
#include "gvc-channel-map.h"
+#include "gvc-channel-map-private.h"
#define GVC_CHANNEL_MAP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_CHANNEL_MAP, GvcChannelMapPrivate))
@@ -119,6 +120,14 @@ gvc_channel_map_get_mapping (const GvcChannelMap *map)
return pa_channel_map_to_pretty_name (&map->priv->pa_map);
}
+/**
+ * gvc_channel_map_has_position: (skip)
+ *
+ * @map:
+ * @position:
+ *
+ * Returns:
+ */
gboolean
gvc_channel_map_has_position (const GvcChannelMap *map,
pa_channel_position_t position)
diff --git a/gnome-volume-control/src/gvc-channel-map.h b/gnome-volume-control/src/gvc-channel-map.h
index a149ee3..85c5772 100644
--- a/gnome-volume-control/src/gvc-channel-map.h
+++ b/gnome-volume-control/src/gvc-channel-map.h
@@ -22,7 +22,7 @@
#define __GVC_CHANNEL_MAP_H
#include <glib-object.h>
-#include <pulse/pulseaudio.h>
+#include <gvc-pulseaudio-fake.h>
G_BEGIN_DECLS
@@ -52,14 +52,12 @@ enum {
BALANCE,
FADE,
LFE,
+ NUM_TYPES
};
-#define NUM_TYPES LFE + 1
-
GType gvc_channel_map_get_type (void);
GvcChannelMap * gvc_channel_map_new (void);
-GvcChannelMap * gvc_channel_map_new_from_pa_channel_map (const pa_channel_map *map);
guint gvc_channel_map_get_num_channels (const GvcChannelMap *map);
const gdouble * gvc_channel_map_get_volume (GvcChannelMap *map);
gboolean gvc_channel_map_can_balance (const GvcChannelMap *map);
@@ -68,14 +66,8 @@ gboolean gvc_channel_map_has_position (const GvcChanne
pa_channel_position_t position);
#define gvc_channel_map_has_lfe(x) gvc_channel_map_has_position (x, PA_CHANNEL_POSITION_LFE)
-void gvc_channel_map_volume_changed (GvcChannelMap *map,
- const pa_cvolume *cv,
- gboolean set);
const char * gvc_channel_map_get_mapping (const GvcChannelMap *map);
-/* private */
-const pa_cvolume * gvc_channel_map_get_cvolume (const GvcChannelMap *map);
-const pa_channel_map * gvc_channel_map_get_pa_channel_map (const GvcChannelMap *map);
G_END_DECLS
#endif /* __GVC_CHANNEL_MAP_H */
diff --git a/gnome-volume-control/src/gvc-combo-box.c b/gnome-volume-control/src/gvc-combo-box.c
index 67a5960..7e14fb2 100644
--- a/gnome-volume-control/src/gvc-combo-box.c
+++ b/gnome-volume-control/src/gvc-combo-box.c
@@ -28,6 +28,7 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
#include <canberra-gtk.h>
+#include <pulse/pulseaudio.h>
#include "gvc-combo-box.h"
#include "gvc-mixer-stream.h"
diff --git a/gnome-volume-control/src/gvc-mixer-card-private.h b/gnome-volume-control/src/gvc-mixer-card-private.h
new file mode 100644
index 0000000..e190f7f
--- /dev/null
+++ b/gnome-volume-control/src/gvc-mixer-card-private.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008-2009 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GVC_MIXER_CARD_PRIVATE_H
+#define __GVC_MIXER_CARD_PRIVATE_H
+
+#include <pulse/pulseaudio.h>
+#include "gvc-mixer-card.h"
+
+G_BEGIN_DECLS
+
+GvcMixerCard * gvc_mixer_card_new (pa_context *context,
+ guint index);
+pa_context * gvc_mixer_card_get_pa_context (GvcMixerCard *card);
+
+G_END_DECLS
+
+#endif /* __GVC_MIXER_CARD_PRIVATE_H */
diff --git a/gnome-volume-control/src/gvc-mixer-card.c b/gnome-volume-control/src/gvc-mixer-card.c
index 047b8b8..f198f1b 100644
--- a/gnome-volume-control/src/gvc-mixer-card.c
+++ b/gnome-volume-control/src/gvc-mixer-card.c
@@ -31,6 +31,7 @@
#include <pulse/pulseaudio.h>
#include "gvc-mixer-card.h"
+#include "gvc-mixer-card-private.h"
#define GVC_MIXER_CARD_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_CARD, GvcMixerCardPrivate))
@@ -143,6 +144,13 @@ gvc_mixer_card_set_icon_name (GvcMixerCard *card,
return TRUE;
}
+/**
+ * gvc_mixer_card_get_profile: (skip)
+ *
+ * @card:
+ *
+ * Returns:
+ */
GvcMixerCardProfile *
gvc_mixer_card_get_profile (GvcMixerCard *card)
{
diff --git a/gnome-volume-control/src/gvc-mixer-card.h b/gnome-volume-control/src/gvc-mixer-card.h
index ad24cd6..5a3a7bc 100644
--- a/gnome-volume-control/src/gvc-mixer-card.h
+++ b/gnome-volume-control/src/gvc-mixer-card.h
@@ -22,7 +22,6 @@
#define __GVC_MIXER_CARD_H
#include <glib-object.h>
-#include <pulse/pulseaudio.h>
G_BEGIN_DECLS
@@ -58,8 +57,6 @@ typedef struct
} GvcMixerCardProfile;
GType gvc_mixer_card_get_type (void);
-GvcMixerCard * gvc_mixer_card_new (pa_context *context,
- guint index);
guint gvc_mixer_card_get_id (GvcMixerCard *card);
guint gvc_mixer_card_get_index (GvcMixerCard *card);
@@ -68,7 +65,6 @@ const char * gvc_mixer_card_get_icon_name (GvcMixerCard *card);
GvcMixerCardProfile * gvc_mixer_card_get_profile (GvcMixerCard *card);
const GList * gvc_mixer_card_get_profiles (GvcMixerCard *card);
-pa_context * gvc_mixer_card_get_pa_context (GvcMixerCard *card);
gboolean gvc_mixer_card_change_profile (GvcMixerCard *card,
const char *profile);
diff --git a/gnome-volume-control/src/gvc-mixer-control-private.h b/gnome-volume-control/src/gvc-mixer-control-private.h
new file mode 100644
index 0000000..ac79975
--- /dev/null
+++ b/gnome-volume-control/src/gvc-mixer-control-private.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GVC_MIXER_CONTROL_PRIVATE_H
+#define __GVC_MIXER_CONTROL_PRIVATE_H
+
+#include <glib-object.h>
+#include <pulse/pulseaudio.h>
+#include "gvc-mixer-stream.h"
+#include "gvc-mixer-card.h"
+
+G_BEGIN_DECLS
+
+pa_context * gvc_mixer_control_get_pa_context (GvcMixerControl *control);
+
+G_END_DECLS
+
+#endif /* __GVC_MIXER_CONTROL_PRIVATE_H */
diff --git a/gnome-volume-control/src/gvc-mixer-control.c b/gnome-volume-control/src/gvc-mixer-control.c
index 60ee9c2..d8d80f6 100644
--- a/gnome-volume-control/src/gvc-mixer-control.c
+++ b/gnome-volume-control/src/gvc-mixer-control.c
@@ -40,6 +40,9 @@
#include "gvc-mixer-source-output.h"
#include "gvc-mixer-event-role.h"
#include "gvc-mixer-card.h"
+#include "gvc-mixer-card-private.h"
+#include "gvc-channel-map-private.h"
+#include "gvc-mixer-control-private.h"
#define GVC_MIXER_CONTROL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_CONTROL, GvcMixerControlPrivate))
@@ -107,6 +110,13 @@ gvc_mixer_control_get_pa_context (GvcMixerControl *control)
return control->priv->pa_context;
}
+/**
+ * gvc_mixer_control_get_event_sink_input:
+ *
+ * @control:
+ *
+ * Returns: (transfer none):
+ */
GvcMixerStream *
gvc_mixer_control_get_event_sink_input (GvcMixerControl *control)
{
@@ -218,6 +228,13 @@ gvc_mixer_control_set_default_source (GvcMixerControl *control,
return TRUE;
}
+/**
+ * gvc_mixer_control_get_default_sink:
+ *
+ * @control:
+ *
+ * Returns: (transfer none):
+ */
GvcMixerStream *
gvc_mixer_control_get_default_sink (GvcMixerControl *control)
{
@@ -235,6 +252,13 @@ gvc_mixer_control_get_default_sink (GvcMixerControl *control)
return stream;
}
+/**
+ * gvc_mixer_control_get_default_source:
+ *
+ * @control:
+ *
+ * Returns: (transfer none):
+ */
GvcMixerStream *
gvc_mixer_control_get_default_source (GvcMixerControl *control)
{
@@ -260,6 +284,14 @@ gvc_mixer_control_lookup_id (GHashTable *hash_table,
GUINT_TO_POINTER (id));
}
+/**
+ * gvc_mixer_control_lookup_stream_id:
+ *
+ * @control:
+ * @id:
+ *
+ * Returns: (transfer none):
+ */
GvcMixerStream *
gvc_mixer_control_lookup_stream_id (GvcMixerControl *control,
guint id)
@@ -269,6 +301,14 @@ gvc_mixer_control_lookup_stream_id (GvcMixerControl *control,
return gvc_mixer_control_lookup_id (control->priv->all_streams, id);
}
+/**
+ * gvc_mixer_control_lookup_card_id:
+ *
+ * @control:
+ * @id:
+ *
+ * Returns: (transfer none):
+ */
GvcMixerCard *
gvc_mixer_control_lookup_card_id (GvcMixerControl *control,
guint id)
@@ -318,6 +358,13 @@ gvc_card_collate (GvcMixerCard *a,
return gvc_name_collate (namea, nameb);
}
+/**
+ * gvc_mixer_control_get_cards:
+ *
+ * @control:
+ *
+ * Returns: (transfer container) (element-type Gvc.MixerCard):
+ */
GSList *
gvc_mixer_control_get_cards (GvcMixerControl *control)
{
@@ -348,6 +395,13 @@ gvc_stream_collate (GvcMixerStream *a,
return gvc_name_collate (namea, nameb);
}
+/**
+ * gvc_mixer_control_get_streams:
+ *
+ * @control:
+ *
+ * Returns: (transfer container) (element-type Gvc.MixerStream):
+ */
GSList *
gvc_mixer_control_get_streams (GvcMixerControl *control)
{
@@ -362,6 +416,13 @@ gvc_mixer_control_get_streams (GvcMixerControl *control)
return g_slist_sort (retval, (GCompareFunc) gvc_stream_collate);
}
+/**
+ * gvc_mixer_control_get_sinks:
+ *
+ * @control:
+ *
+ * Returns: (transfer container) (element-type Gvc.MixerSink):
+ */
GSList *
gvc_mixer_control_get_sinks (GvcMixerControl *control)
{
@@ -376,6 +437,13 @@ gvc_mixer_control_get_sinks (GvcMixerControl *control)
return g_slist_sort (retval, (GCompareFunc) gvc_stream_collate);
}
+/**
+ * gvc_mixer_control_get_sources:
+ *
+ * @control:
+ *
+ * Returns: (transfer container) (element-type Gvc.MixerSource):
+ */
GSList *
gvc_mixer_control_get_sources (GvcMixerControl *control)
{
@@ -390,6 +458,13 @@ gvc_mixer_control_get_sources (GvcMixerControl *control)
return g_slist_sort (retval, (GCompareFunc) gvc_stream_collate);
}
+/**
+ * gvc_mixer_control_get_sink_inputs:
+ *
+ * @control:
+ *
+ * Returns: (transfer container) (element-type Gvc.MixerSinkInput):
+ */
GSList *
gvc_mixer_control_get_sink_inputs (GvcMixerControl *control)
{
@@ -404,6 +479,13 @@ gvc_mixer_control_get_sink_inputs (GvcMixerControl *control)
return g_slist_sort (retval, (GCompareFunc) gvc_stream_collate);
}
+/**
+ * gvc_mixer_control_get_source_outputs:
+ *
+ * @control:
+ *
+ * Returns: (transfer container) (element-type Gvc.MixerSourceOutput):
+ */
GSList *
gvc_mixer_control_get_source_outputs (GvcMixerControl *control)
{
diff --git a/gnome-volume-control/src/gvc-mixer-control.h b/gnome-volume-control/src/gvc-mixer-control.h
index d49e5a3..d32b204 100644
--- a/gnome-volume-control/src/gvc-mixer-control.h
+++ b/gnome-volume-control/src/gvc-mixer-control.h
@@ -22,7 +22,6 @@
#define __GVC_MIXER_CONTROL_H
#include <glib-object.h>
-#include <pulse/pulseaudio.h>
#include "gvc-mixer-stream.h"
#include "gvc-mixer-card.h"
@@ -71,7 +70,6 @@ gboolean gvc_mixer_control_open (GvcMixerControl *cont
gboolean gvc_mixer_control_close (GvcMixerControl *control);
gboolean gvc_mixer_control_is_ready (GvcMixerControl *control);
-pa_context * gvc_mixer_control_get_pa_context (GvcMixerControl *control);
GSList * gvc_mixer_control_get_cards (GvcMixerControl *control);
GSList * gvc_mixer_control_get_streams (GvcMixerControl *control);
GSList * gvc_mixer_control_get_sinks (GvcMixerControl *control);
diff --git a/gnome-volume-control/src/gvc-mixer-dialog.c b/gnome-volume-control/src/gvc-mixer-dialog.c
index 6f0c8b7..fa4ca3b 100644
--- a/gnome-volume-control/src/gvc-mixer-dialog.c
+++ b/gnome-volume-control/src/gvc-mixer-dialog.c
@@ -28,6 +28,7 @@
#include <glib/gi18n-lib.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include <pulse/pulseaudio.h>
#include "gvc-channel-bar.h"
#include "gvc-balance-bar.h"
@@ -41,6 +42,7 @@
#include "gvc-sound-theme-chooser.h"
#include "gvc-level-bar.h"
#include "gvc-speaker-test.h"
+#include "gvc-mixer-control-private.h"
#define SCALE_SIZE 128
diff --git a/gnome-volume-control/src/gvc-mixer-event-role.c b/gnome-volume-control/src/gvc-mixer-event-role.c
index fb5831f..7eb3d00 100644
--- a/gnome-volume-control/src/gvc-mixer-event-role.c
+++ b/gnome-volume-control/src/gvc-mixer-event-role.c
@@ -31,6 +31,8 @@
#include <pulse/ext-stream-restore.h>
#include "gvc-mixer-event-role.h"
+#include "gvc-mixer-stream-private.h"
+#include "gvc-channel-map-private.h"
#define GVC_MIXER_EVENT_ROLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_EVENT_ROLE, GvcMixerEventRolePrivate))
@@ -221,6 +223,15 @@ gvc_mixer_event_role_finalize (GObject *object)
G_OBJECT_CLASS (gvc_mixer_event_role_parent_class)->finalize (object);
}
+/**
+ * gvc_mixer_event_role_new: (skip)
+ *
+ * @context:
+ * @index:
+ * @channel_map:
+ *
+ * Returns:
+ */
GvcMixerStream *
gvc_mixer_event_role_new (pa_context *context,
const char *device,
diff --git a/gnome-volume-control/src/gvc-mixer-sink-input.c b/gnome-volume-control/src/gvc-mixer-sink-input.c
index cc4b507..9429eca 100644
--- a/gnome-volume-control/src/gvc-mixer-sink-input.c
+++ b/gnome-volume-control/src/gvc-mixer-sink-input.c
@@ -30,6 +30,8 @@
#include <pulse/pulseaudio.h>
#include "gvc-mixer-sink-input.h"
+#include "gvc-mixer-stream-private.h"
+#include "gvc-channel-map-private.h"
#define GVC_MIXER_SINK_INPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_SINK_INPUT, GvcMixerSinkInputPrivate))
@@ -171,6 +173,15 @@ gvc_mixer_sink_input_finalize (GObject *object)
G_OBJECT_CLASS (gvc_mixer_sink_input_parent_class)->finalize (object);
}
+/**
+ * gvc_mixer_sink_input_new: (skip)
+ *
+ * @context:
+ * @index:
+ * @channel_map:
+ *
+ * Returns:
+ */
GvcMixerStream *
gvc_mixer_sink_input_new (pa_context *context,
guint index,
diff --git a/gnome-volume-control/src/gvc-mixer-sink.c b/gnome-volume-control/src/gvc-mixer-sink.c
index 1a14440..30fceac 100644
--- a/gnome-volume-control/src/gvc-mixer-sink.c
+++ b/gnome-volume-control/src/gvc-mixer-sink.c
@@ -30,6 +30,8 @@
#include <pulse/pulseaudio.h>
#include "gvc-mixer-sink.h"
+#include "gvc-mixer-stream-private.h"
+#include "gvc-channel-map-private.h"
#define GVC_MIXER_SINK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_SINK, GvcMixerSinkPrivate))
@@ -202,6 +204,15 @@ gvc_mixer_sink_finalize (GObject *object)
G_OBJECT_CLASS (gvc_mixer_sink_parent_class)->finalize (object);
}
+/**
+ * gvc_mixer_sink_new: (skip)
+ *
+ * @context:
+ * @index:
+ * @channel_map:
+ *
+ * Returns:
+ */
GvcMixerStream *
gvc_mixer_sink_new (pa_context *context,
guint index,
diff --git a/gnome-volume-control/src/gvc-mixer-source-output.c b/gnome-volume-control/src/gvc-mixer-source-output.c
index 034b21c..636fc2e 100644
--- a/gnome-volume-control/src/gvc-mixer-source-output.c
+++ b/gnome-volume-control/src/gvc-mixer-source-output.c
@@ -111,6 +111,15 @@ gvc_mixer_source_output_finalize (GObject *object)
G_OBJECT_CLASS (gvc_mixer_source_output_parent_class)->finalize (object);
}
+/**
+ * gvc_mixer_source_output_new: (skip)
+ *
+ * @context:
+ * @index:
+ * @channel_map:
+ *
+ * Returns:
+ */
GvcMixerStream *
gvc_mixer_source_output_new (pa_context *context,
guint index,
diff --git a/gnome-volume-control/src/gvc-mixer-source.c b/gnome-volume-control/src/gvc-mixer-source.c
index 8900481..46d6403 100644
--- a/gnome-volume-control/src/gvc-mixer-source.c
+++ b/gnome-volume-control/src/gvc-mixer-source.c
@@ -30,6 +30,8 @@
#include <pulse/pulseaudio.h>
#include "gvc-mixer-source.h"
+#include "gvc-mixer-stream-private.h"
+#include "gvc-channel-map-private.h"
#define GVC_MIXER_SOURCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_SOURCE, GvcMixerSourcePrivate))
@@ -202,6 +204,15 @@ gvc_mixer_source_finalize (GObject *object)
G_OBJECT_CLASS (gvc_mixer_source_parent_class)->finalize (object);
}
+/**
+ * gvc_mixer_source_new: (skip)
+ *
+ * @context:
+ * @index:
+ * @channel_map:
+ *
+ * Returns:
+ */
GvcMixerStream *
gvc_mixer_source_new (pa_context *context,
guint index,
diff --git a/gnome-volume-control/src/gvc-mixer-stream-private.h b/gnome-volume-control/src/gvc-mixer-stream-private.h
new file mode 100644
index 0000000..b97ecf5
--- /dev/null
+++ b/gnome-volume-control/src/gvc-mixer-stream-private.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GVC_MIXER_STREAM_PRIVATE_H
+#define __GVC_MIXER_STREAM_PRIVATE_H
+
+#include <glib-object.h>
+
+#include "gvc-channel-map.h"
+
+G_BEGIN_DECLS
+
+pa_context * gvc_mixer_stream_get_pa_context (GvcMixerStream *stream);
+
+G_END_DECLS
+
+#endif /* __GVC_MIXER_STREAM_PRIVATE_H */
diff --git a/gnome-volume-control/src/gvc-mixer-stream.c b/gnome-volume-control/src/gvc-mixer-stream.c
index cdb71e8..3b4953a 100644
--- a/gnome-volume-control/src/gvc-mixer-stream.c
+++ b/gnome-volume-control/src/gvc-mixer-stream.c
@@ -30,6 +30,8 @@
#include <pulse/pulseaudio.h>
#include "gvc-mixer-stream.h"
+#include "gvc-mixer-stream-private.h"
+#include "gvc-channel-map-private.h"
#define GVC_MIXER_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_MIXER_STREAM, GvcMixerStreamPrivate))
@@ -126,6 +128,13 @@ gvc_mixer_stream_get_channel_map (GvcMixerStream *stream)
return stream->priv->channel_map;
}
+/**
+ * gvc_mixer_stream_get_volume:
+ *
+ * @stream:
+ *
+ * Returns: (type guint32) (transfer none):
+ */
pa_volume_t
gvc_mixer_stream_get_volume (GvcMixerStream *stream)
{
@@ -143,6 +152,14 @@ gvc_mixer_stream_get_decibel (GvcMixerStream *stream)
(pa_volume_t) gvc_channel_map_get_volume(stream->priv->channel_map)[VOLUME]);
}
+/**
+ * gvc_mixer_stream_set_volume:
+ *
+ * @stream:
+ * @volume: (type guint32):
+ *
+ * Returns:
+ */
gboolean
gvc_mixer_stream_set_volume (GvcMixerStream *stream,
pa_volume_t volume)
@@ -386,6 +403,13 @@ gvc_mixer_stream_set_icon_name (GvcMixerStream *stream,
return TRUE;
}
+/**
+ * gvc_mixer_stream_get_base_volume:
+ *
+ * @stream:
+ *
+ * Returns: (type guint32) (transfer none):
+ */
pa_volume_t
gvc_mixer_stream_get_base_volume (GvcMixerStream *stream)
{
@@ -394,6 +418,14 @@ gvc_mixer_stream_get_base_volume (GvcMixerStream *stream)
return stream->priv->base_volume;
}
+/**
+ * gvc_mixer_stream_set_base_volume:
+ *
+ * @stream:
+ * @base_volume: (type guint32):
+ *
+ * Returns:
+ */
gboolean
gvc_mixer_stream_set_base_volume (GvcMixerStream *stream,
pa_volume_t base_volume)
diff --git a/gnome-volume-control/src/gvc-mixer-stream.h b/gnome-volume-control/src/gvc-mixer-stream.h
index bbeb8a3..53b7eb6 100644
--- a/gnome-volume-control/src/gvc-mixer-stream.h
+++ b/gnome-volume-control/src/gvc-mixer-stream.h
@@ -22,8 +22,7 @@
#define __GVC_MIXER_STREAM_H
#include <glib-object.h>
-#include <pulse/pulseaudio.h>
-
+#include "gvc-pulseaudio-fake.h"
#include "gvc-channel-map.h"
G_BEGIN_DECLS
@@ -65,7 +64,6 @@ typedef struct
GType gvc_mixer_stream_get_type (void);
-pa_context * gvc_mixer_stream_get_pa_context (GvcMixerStream *stream);
guint gvc_mixer_stream_get_index (GvcMixerStream *stream);
guint gvc_mixer_stream_get_id (GvcMixerStream *stream);
const GvcChannelMap *gvc_mixer_stream_get_channel_map(GvcMixerStream *stream);
diff --git a/gnome-volume-control/src/gvc-pulseaudio-fake.h b/gnome-volume-control/src/gvc-pulseaudio-fake.h
new file mode 100644
index 0000000..65293cd
--- /dev/null
+++ b/gnome-volume-control/src/gvc-pulseaudio-fake.h
@@ -0,0 +1,34 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GVC_PULSEAUDIO_FAKE_H
+#define __GVC_PULSEAUDIO_FAKE_H
+
+#ifdef WITH_INTROSPECTION
+
+#ifndef PA_API_VERSION
+typedef int pa_channel_position_t;
+typedef guint32 pa_volume_t;
+typedef gpointer pa_context;
+#endif /* PA_API_VERSION */
+
+#endif /* WITH_INTROSPECTION */
+
+#endif /* __GVC_PULSEAUDIO_FAKE_H */
diff --git a/gnome-volume-control/src/gvc-speaker-test.c b/gnome-volume-control/src/gvc-speaker-test.c
index 7d7714a..8b56c48 100644
--- a/gnome-volume-control/src/gvc-speaker-test.c
+++ b/gnome-volume-control/src/gvc-speaker-test.c
@@ -29,6 +29,7 @@
#include <gtk/gtk.h>
#include <canberra.h>
#include <canberra-gtk.h>
+#include <pulse/pulseaudio.h>
#include "gvc-speaker-test.h"
#include "gvc-mixer-stream.h"
diff --git a/gnome-volume-control/src/gvc-stream-status-icon.c b/gnome-volume-control/src/gvc-stream-status-icon.c
index 742e5cf..02c095f 100644
--- a/gnome-volume-control/src/gvc-stream-status-icon.c
+++ b/gnome-volume-control/src/gvc-stream-status-icon.c
@@ -28,6 +28,7 @@
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
+#include <pulse/pulseaudio.h>
#include "gvc-mixer-stream.h"
#include "gvc-channel-bar.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]