1 /*-*- Mode: C; c-basic-offset: 2 -*-*/
4 * GStreamer pulseaudio plugin
6 * Copyright (c) 2004-2008 Lennart Poettering
8 * gst-pulse is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as
10 * published by the Free Software Foundation; either version 2.1 of the
11 * License, or (at your option) any later version.
13 * gst-pulse is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with gst-pulse; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
24 #ifndef __GST_PULSEPROBE_H__
25 #define __GST_PULSEPROBE_H__
31 #include <gst/interfaces/propertyprobe.h>
32 #include <pulse/pulseaudio.h>
33 #include <pulse/thread-mainloop.h>
35 typedef struct _GstPulseProbe GstPulseProbe;
43 gboolean devices_valid:1;
45 gboolean operation_success:1;
47 gboolean enumerate_sinks:1;
48 gboolean enumerate_sources:1;
50 pa_threaded_mainloop *mainloop;
57 GstPulseProbe *gst_pulseprobe_new (GObject *object, GObjectClass * klass,
58 guint prop_id, const gchar * server, gboolean sinks, gboolean sources);
59 void gst_pulseprobe_free (GstPulseProbe * probe);
61 const GList *gst_pulseprobe_get_properties (GstPulseProbe * probe);
63 gboolean gst_pulseprobe_needs_probe (GstPulseProbe * probe, guint prop_id,
64 const GParamSpec * pspec);
65 void gst_pulseprobe_probe_property (GstPulseProbe * probe, guint prop_id,
66 const GParamSpec * pspec);
67 GValueArray *gst_pulseprobe_get_values (GstPulseProbe * probe, guint prop_id,
68 const GParamSpec * pspec);
70 void gst_pulseprobe_set_server (GstPulseProbe * c, const gchar * server);
72 #define GST_IMPLEMENT_PULSEPROBE_METHODS(Type, interface_as_function) \
74 interface_as_function ## _get_properties(GstPropertyProbe * probe) \
76 Type *this = (Type*) probe; \
78 g_return_val_if_fail(this != NULL, NULL); \
79 g_return_val_if_fail(this->probe != NULL, NULL); \
81 return gst_pulseprobe_get_properties(this->probe); \
84 interface_as_function ## _needs_probe(GstPropertyProbe *probe, guint prop_id, \
85 const GParamSpec *pspec) \
87 Type *this = (Type*) probe; \
89 g_return_val_if_fail(this != NULL, FALSE); \
90 g_return_val_if_fail(this->probe != NULL, FALSE); \
92 return gst_pulseprobe_needs_probe(this->probe, prop_id, pspec); \
95 interface_as_function ## _probe_property(GstPropertyProbe *probe, \
96 guint prop_id, const GParamSpec *pspec) \
98 Type *this = (Type*) probe; \
100 g_return_if_fail(this != NULL); \
101 g_return_if_fail(this->probe != NULL); \
103 gst_pulseprobe_probe_property(this->probe, prop_id, pspec); \
105 static GValueArray* \
106 interface_as_function ## _get_values(GstPropertyProbe *probe, guint prop_id, \
107 const GParamSpec *pspec) \
109 Type *this = (Type*) probe; \
111 g_return_val_if_fail(this != NULL, NULL); \
112 g_return_val_if_fail(this->probe != NULL, NULL); \
114 return gst_pulseprobe_get_values(this->probe, prop_id, pspec); \
117 interface_as_function ## _property_probe_interface_init(GstPropertyProbeInterface *iface)\
119 iface->get_properties = interface_as_function ## _get_properties; \
120 iface->needs_probe = interface_as_function ## _needs_probe; \
121 iface->probe_property = interface_as_function ## _probe_property; \
122 iface->get_values = interface_as_function ## _get_values; \