--- /dev/null	2006-05-31 02:15:07.000000000 +0100
+++ gst-libs/gst/interfaces/soundserver.h	2006-07-05 13:19:58.000000000 +0100
@@ -0,0 +1,67 @@
+/* GStreamer sound server control/query interface
+ * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GST_SOUND_SERVER_H__
+#define __GST_SOUND_SERVER_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_SOUND_SERVER \
+  (gst_sound_server_get_type ())
+#define GST_SOUND_SERVER(obj) \
+  (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SOUND_SERVER, \
+                                                 GstSoundServer))
+#define GST_SOUND_SERVER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SOUND_SERVER, \
+                            GstSoundServerClass))
+#define GST_IS_SOUND_SERVER(obj) \
+  (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SOUND_SERVER))
+#define GST_IS_SOUND_SERVER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SOUND_SERVER))
+#define GST_SOUND_SERVER_GET_CLASS(inst) \
+  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_SOUND_SERVER, GstSoundServerClass))
+  
+
+typedef struct _GstSoundServer GstSoundServer;
+typedef struct _GstSoundServerClass GstSoundServerClass;
+  
+struct _GstSoundServerClass {
+  GTypeInterface klass;
+
+  /* virtual functions */
+  gboolean      (* is_running)    (GstSoundServer * soundserver);
+  gboolean      (* is_requested)  (GstSoundServer * soundserver);
+
+  /*< private >*/
+  gpointer     _gst_reserved[GST_PADDING_LARGE];
+};
+
+GType   gst_sound_server_get_type      (void);
+
+/* virtual class function wrappers */
+gboolean  gst_sound_server_is_running   (GstSoundServer * soundserver);
+
+gboolean  gst_sound_server_is_requested (GstSoundServer * soundserver);
+
+G_END_DECLS
+
+#endif /* __GST_SOUND_SERVER_H__ */
+
--- /dev/null	2006-05-31 02:15:07.000000000 +0100
+++ gst-libs/gst/interfaces/soundserver.c	2006-07-05 16:15:22.000000000 +0100
@@ -0,0 +1,115 @@
+/* GStreamer sound server control/query interface
+ * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "soundserver.h"
+
+/**
+ * SECTION:soundserver
+ * @short_description: Interface for elements interoperating with sound servers
+ *
+ * Since: 0.10.9
+ */
+
+static void gst_sound_server_class_init (GstSoundServerClass * klass);
+
+GType
+gst_sound_server_get_type (void)
+{
+  static GType gst_sound_server_type; /* 0 */
+
+  if (!gst_sound_server_type) {
+    static const GTypeInfo gst_sound_server_info = {
+      sizeof (GstSoundServerClass),
+      (GBaseInitFunc) gst_sound_server_class_init,
+      NULL,
+      NULL,
+      NULL,
+      NULL,
+      0,
+      0,
+      NULL,
+    };
+
+    gst_sound_server_type = g_type_register_static (G_TYPE_INTERFACE,
+        "GstSoundServer", &gst_sound_server_info, 0);
+  }
+
+  return gst_sound_server_type;
+}
+
+static void
+gst_sound_server_class_init (GstSoundServerClass * klass)
+{
+  klass->is_running = NULL;
+  klass->is_requested = NULL;
+}
+
+/**
+ * gst_sound_server_is_running:
+ * @soundserver: sound server
+ *
+ * Returns #TRUE if a sound server daemon is running currently, otherwise
+ * #FALSE.
+ *
+ * One of the purposes of this function is to avoid auto-spawning of server
+ * daemons when trying to see if an element communicating with a sound
+ * server is usable (for which usually a connection to the server needs to
+ * be established, which will often trigger auto-spawning of a server).
+ *
+ * Since: 0.10.9
+ */
+gboolean
+gst_sound_server_is_running (GstSoundServer * soundserver)
+{
+  GstSoundServerClass *klass = GST_SOUND_SERVER_GET_CLASS (soundserver);
+  gboolean res = FALSE;
+
+  if (klass->is_running) {
+    res = klass->is_running (soundserver);
+  }
+
+  return res;
+}
+
+/**
+ * gst_sound_server_is_requested:
+ * @soundserver: sound server
+ *
+ * Returns #TRUE if the user seems to explicitly request output to this
+ * sound server (e.g. by having a certain environment variable set),
+ * otherwise #FALSE.
+ *
+ * Since: 0.10.9
+ */
+gboolean
+gst_sound_server_is_requested (GstSoundServer * soundserver)
+{
+  GstSoundServerClass *klass = GST_SOUND_SERVER_GET_CLASS (soundserver);
+  gboolean res = FALSE;
+
+  if (klass->is_requested) {
+    res = klass->is_requested (soundserver);
+  }
+
+  return res;
+}
Index: gst-libs/gst/interfaces/interfaces.h
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/interfaces/interfaces.h,v
retrieving revision 1.1
diff -u -p -r1.1 interfaces.h
--- gst-libs/gst/interfaces/interfaces.h	30 Jun 2005 12:09:26 -0000	1.1
+++ gst-libs/gst/interfaces/interfaces.h	5 Jul 2006 15:49:30 -0000
@@ -26,6 +26,7 @@
 #include "mixer.h"
 #include "navigation.h"
 #include "propertyprobe.h"
+#include "soundserver.h"
 #include "tuner.h"
 #include "xoverlay.h"
 
Index: gst-libs/gst/interfaces/Makefile.am
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst-libs/gst/interfaces/Makefile.am,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile.am
--- gst-libs/gst/interfaces/Makefile.am	27 Nov 2005 16:18:49 -0000	1.4
+++ gst-libs/gst/interfaces/Makefile.am	5 Jul 2006 15:49:30 -0000
@@ -10,6 +10,7 @@ headers_interfaces = 		\
 	mixertrack.h		\
 	navigation.h		\
 	propertyprobe.h		\
+	soundserver.h		\
 	tuner.h			\
 	tunernorm.h		\
 	tunerchannel.h		\
@@ -44,6 +45,7 @@ libgstinterfaces_@GST_MAJORMINOR@_la_SOU
 	mixertrack.c		\
 	navigation.c		\
 	propertyprobe.c		\
+	soundserver.c		\
 	tuner.c			\
 	tunernorm.c		\
 	tunerchannel.c		\
