--- mixer/applet.h	2006-01-14 17:15:10.000000000 -0600
+++ mixer/applet.h	2006-01-14 15:48:36.000000000 -0600
@@ -31,7 +31,11 @@
 #include <gconf/gconf-client.h>
 #include <panel-applet-gconf.h>
 #include <gst/gst.h>
+#ifdef HAVE_GST10
+#include <gst/interfaces/mixer.h>
+#else
 #include <gst/mixer/mixer.h>
+#endif
 
 #include "dock.h"
 
--- mixer/applet.c	2006-01-14 17:07:59.000000000 -0600
+++ mixer/applet.c	2006-01-14 15:47:38.000000000 -0600
@@ -260,7 +260,12 @@
   active_track_name_list = NULL;
 
   if (reset_state) {
-    if (gst_element_set_state (element, GST_STATE_READY) != GST_STATE_SUCCESS)
+    if (gst_element_set_state (element, GST_STATE_READY) !=
+#ifdef HAVE_GST10
+          GST_STATE_CHANGE_SUCCESS)
+#else
+          GST_STATE_SUCCESS)
+#endif
       return NULL;
   }
 
@@ -1159,7 +1164,12 @@
           if (new_element != old_element) {
             /* change element */
             if (gst_element_set_state (item->data,
-				       GST_STATE_READY) != GST_STATE_SUCCESS)
+				       GST_STATE_READY) !=
+#ifdef HAVE_GST10
+               GST_STATE_CHANGE_SUCCESS)
+#else
+               GST_STATE_SUCCESS)
+#endif
               continue;
 	    
             /* save */
--- mixer/dock.h	2006-01-14 15:48:48.000000000 -0600
+++ mixer/dock.h	2006-01-14 15:49:46.000000000 -0600
@@ -28,7 +28,11 @@
 #include <gtk/gtkrange.h>
 #include <gtk/gtkwindow.h>
 #include <gst/gst.h>
+#ifdef HAVE_GST10
+#include <gst/interfaces/mixer.h>
+#else
 #include <gst/mixer/mixer.h>
+#endif
 
 G_BEGIN_DECLS
 
--- mixer/Makefile.am	2006-01-14 15:51:49.000000000 -0600
+++ mixer/Makefile.am	2006-01-14 15:53:36.000000000 -0600
@@ -27,6 +27,11 @@
 	$(GNOME_APPLETS_LIBS)				\
 	$(GNOMEDESKTOP_LIBS)
 
+if HAVE_GST10
+INCLUDES += -DHAVE_GST10
+mixer_applet2_LDADD += -lgstinterfaces-0.10
+endif
+
 serverdir       = $(libdir)/bonobo/servers
 server_in_files = GNOME_MixerApplet.server.in
 server_DATA     = $(server_in_files:.server.in=.server)
--- configure.in	2006-01-14 15:54:26.000000000 -0600
+++ configure.in	2006-01-14 16:27:05.000000000 -0600
@@ -319,24 +319,44 @@
 MIXER_CFLAGS=
 MIXER_LIBS=
 
-GST_MAJORMINOR=0.8
-GST_REQ=0.8.2
-PKG_CHECK_MODULES(MIXER, gstreamer-interfaces-$GST_MAJORMINOR >= $GST_REQ \
-			 gstreamer-$GST_MAJORMINOR >= $GST_REQ,
-		  HAVE_GST="yes", HAVE_GST="no")
+GST_MAJORMINOR=auto
+AC_ARG_WITH(gstreamer,
+            AC_HELP_STRING([--with-gstreamer],[use gstreamer version for mixer if available]),
+            [case "${enableval}" in
+               0.8) GST_MAJORMINOR=0.8 ;;
+               0.10) GST_MAJORMINOR=0.10 ;;
+               *) AC_MSG_ERROR([
+                                *** Bad value ${enableval} for --enable-gstreamer
+                                *** Please use one of the following:
+                                ***    --enable-gstreamer=0.8
+                                ***    --enable-gstreamer=0.10
+                              ]);;
+             esac])
+
+if test x$GST_MAJORMINOR = xauto ; then
+   PKG_CHECK_MODULES(GST, gstreamer-0.8, GST_MAJORMINOR=0.8, GST_MAJORMINOR=0.10)
+   AC_MSG_RESULT([using $GST_MAJORMINOR backend])
+fi
+
+if test x$GST_MAJORMINOR = x0.8 ; then
+   GST_REQS=0.8.0
+   PKGS="gstreamer-0.8 >= $GST_REQS gstreamer-interfaces-0.8 >= $GST_REQS"
+else
+   GST_REQS=0.10.1
+   PKGS="gstreamer-0.10 >= $GST_REQS gstreamer-plugins-base-0.10 >= $GST_REQS"
+fi
+
+PKG_CHECK_MODULES(MIXER, $PKGS, [HAVE_GST="yes"], [HAVE_GST="no"])
+
 if test "x$HAVE_GST" = "xyes"; then
-  P_MIXER=mixer
+   P_MIXER=mixer
 fi
 
 AC_SUBST(MIXER_CFLAGS)
 AC_SUBST(MIXER_LIBS)
 
 AM_CONDITIONAL(APPLET_MIXER, test "$P_MIXER" = "mixer")
-if test x"$P_MIXER" == x"mixer"; then
-	AC_MSG_RESULT(yes)
-else
-	AC_MSG_RESULT(no)
-fi
+AM_CONDITIONAL(HAVE_GST10, test x"$GST_MAJORMINOR" = "x0.10")
 
 dnl ***************************************
 dnl ** Check for libnotify               **
--- mixer/preferences.h	2006-01-14 16:29:21.000000000 -0600
+++ mixer/preferences.h	2006-01-14 16:29:42.000000000 -0600
@@ -26,7 +26,11 @@
 #include <gtk/gtkdialog.h>
 #include <panel-applet.h>
 #include <panel-applet-gconf.h>
+#ifdef HAVE_GST10
+#include <gst/interfaces/mixer.h>
+#else
 #include <gst/mixer/mixer.h>
+#endif
 
 G_BEGIN_DECLS
 
--- mixer/load.c	2006-01-14 15:49:59.000000000 -0600
+++ mixer/load.c	2006-01-14 16:32:34.000000000 -0600
@@ -26,7 +26,13 @@
 #include <string.h>
 
 #include <glib/glist.h>
+#ifdef HAVE_GST10
+#include <gst/gst.h>
+#include <gst/interfaces/mixer.h>
+#include <gst/interfaces/propertyprobe.h>
+#else
 #include <gst/propertyprobe/propertyprobe.h>
+#endif
 
 #include "applet.h"
 
@@ -58,7 +64,12 @@
 
   /* go through all elements of a certain class and check whether
    * they implement a mixer. If so, add it to the list. */
+#ifdef HAVE_GST10
+  GstRegistry* default_registry = gst_registry_get_default();
+  elements = gst_registry_get_feature_list (default_registry, GST_TYPE_ELEMENT_FACTORY);
+#else
   elements = gst_registry_pool_feature_list (GST_TYPE_ELEMENT_FACTORY);
+#endif
   for ( ; elements != NULL; elements = elements->next) {
     GstElementFactory *factory = GST_ELEMENT_FACTORY (elements->data);
     gchar *title = NULL, *name;
@@ -101,8 +112,12 @@
 
       /* set this device */
       g_object_set_property (G_OBJECT (element), "device", device);
-      if (gst_element_set_state (element,
-				 GST_STATE_READY) == GST_STATE_FAILURE)
+      if (gst_element_set_state (element,GST_STATE_READY) ==
+#ifdef HAVE_GST10
+            GST_STATE_CHANGE_FAILURE)
+#else
+            GST_STATE_FAILURE)
+#endif
         continue;
 
       /* is this device a mixer? */
--- mixer/preferences.c	2006-01-14 17:21:41.000000000 -0600
+++ mixer/preferences.c	2006-01-14 16:33:09.000000000 -0600
@@ -41,7 +41,11 @@
 #include <gtk/gtktreeselection.h>
 #include <gtk/gtkvbox.h>
 
+#ifdef HAVE_GST10
+#include <gst/interfaces/mixer.h>
+#else
 #include <gst/mixer/mixer.h>
+#endif
 
 #include "applet.h"
 #include "preferences.h"
