Index: plugins/gstreamer0.10/gstroar.c
===================================================================
--- plugins/gstreamer0.10/gstroar.c	(revision 1600)
+++ plugins/gstreamer0.10/gstroar.c	(revision 2073)
@@ -26,4 +26,5 @@
 #endif
 #include "roarsink.h"
+#include "roarmixer.h"
 
 //#include "gst/gst-i18n-plugin.h"
@@ -33,4 +34,6 @@
 {
   if (!gst_roarsink_factory_init (plugin))
+    return FALSE;
+  if (!gst_roarmixer_factory_init (plugin))
     return FALSE;
 
Index: plugins/gstreamer0.10/roarmixer.c
===================================================================
--- plugins/gstreamer0.10/roarmixer.c	(revision 2072)
+++ plugins/gstreamer0.10/roarmixer.c	(revision 2073)
@@ -27,4 +27,129 @@
 #include "roarmixer.h"
 
+GST_DEBUG_CATEGORY_EXTERN (roar_debug);
+#define GST_CAT_DEFAULT roar_debug
+
+enum
+{
+  PROP_DEVICE_NAME = 1
+};
+
+
+static const GstElementDetails gst_roar_mixer_element_details =
+GST_ELEMENT_DETAILS ("RoarAudio Mixer",
+    "Generic/Audio",
+    "Control sound input and output levels with RoarAudio",
+    "Philipp 'ph3-der-loewe' Schafft <lion@lion.leolix.org>");
+
+GST_BOILERPLATE_WITH_INTERFACE (GstRoarMixerElement, gst_roar_mixer_element,
+    GstElement, GST_TYPE_ELEMENT, GstMixer, GST_TYPE_MIXER,
+    gst_roar_mixer_element);
+
+GST_IMPLEMENT_ROAR_MIXER_METHODS (GstRoarMixerElement, gst_roar_mixer_element);
+
+static GstStateChangeReturn gst_roar_mixer_element_change_state (GstElement *
+    element, GstStateChange transition);
+
+static void gst_roar_mixer_element_get_property (GObject * object,
+    guint prop_id, GValue * value, GParamSpec * pspec);
+
+static void
+gst_roar_mixer_element_base_init (gpointer klass)
+{
+  gst_element_class_set_details (GST_ELEMENT_CLASS (klass),
+      &gst_roar_mixer_element_details);
+}
+
+static void
+gst_roar_mixer_element_class_init (GstRoarMixerElementClass * klass)
+{
+  GstElementClass *element_class;
+  GObjectClass *gobject_class;
+
+  element_class = (GstElementClass *) klass;
+  gobject_class = (GObjectClass *) klass;
+
+  gobject_class->get_property = gst_roar_mixer_element_get_property;
+
+  g_object_class_install_property (gobject_class, PROP_DEVICE_NAME,
+      g_param_spec_string ("device-name", "Device name",
+          "Human-readable name of the sound device", "", G_PARAM_READABLE));
+
+  element_class->change_state =
+      GST_DEBUG_FUNCPTR (gst_roar_mixer_element_change_state);
+}
+
+static void
+gst_roar_mixer_element_init (GstRoarMixerElement * this,
+    GstRoarMixerElementClass * g_class)
+{
+  this->mixer = NULL;
+}
+
+static void
+gst_roar_mixer_element_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec)
+{
+  GstRoarMixerElement *this = GST_ROAR_MIXER_ELEMENT (object);
+
+  switch (prop_id) {
+    case PROP_DEVICE_NAME:
+      if (this->mixer) {
+        g_value_set_string (value, this->mixer->cardname);
+      } else {
+        g_value_set_string (value, NULL);
+      }
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static GstStateChangeReturn
+gst_roar_mixer_element_change_state (GstElement * element,
+    GstStateChange transition)
+{
+  GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
+  GstRoarMixerElement *this = GST_ROAR_MIXER_ELEMENT (element);
+
+  switch (transition) {
+    case GST_STATE_CHANGE_NULL_TO_READY:
+      if (!this->mixer) {
+        this->mixer = gst_roarmixer_new ("/dev/mixer", GST_ROAR_MIXER_ALL);
+      }
+      break;
+      break;
+    default:
+      break;
+  }
+
+  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+  if (ret == GST_STATE_CHANGE_FAILURE)
+    return ret;
+
+  switch (transition) {
+    case GST_STATE_CHANGE_READY_TO_NULL:
+      if (this->mixer) {
+        gst_roarmixer_free (this->mixer);
+        this->mixer = NULL;
+      }
+      break;
+    default:
+      break;
+  }
+
+  return ret;
+}
+
+
+gboolean gst_roarmixer_factory_init (GstPlugin * plugin) {
+  if (!gst_element_register(plugin, "roarmixer", GST_RANK_MARGINAL,
+                            GST_TYPE_ROARMIXER))
+    return FALSE;
+
+  return TRUE;
+}
+
 GstRoarMixer*    gst_roarmixer_new                (const gchar *device,
                                                  GstRoarMixerDirection dir) {
Index: plugins/gstreamer0.10/roarmixer.h
===================================================================
--- plugins/gstreamer0.10/roarmixer.h	(revision 2072)
+++ plugins/gstreamer0.10/roarmixer.h	(revision 2073)
@@ -39,4 +39,28 @@
 G_BEGIN_DECLS
 
+#define GST_ROAR_MIXER_ELEMENT(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ROAR_MIXER_ELEMENT,GstRoarMixerElement))
+#define GST_ROAR_MIXER_ELEMENT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ROAR_MIXER_ELEMENT,GstRoarMixerElementClass))
+#define GST_IS_ROAR_MIXER_ELEMENT(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ROAR_MIXER_ELEMENT))
+#define GST_IS_ROAR_MIXER_ELEMENT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ROAR_MIXER_ELEMENT))
+#define GST_TYPE_ROAR_MIXER_ELEMENT              (gst_roar_mixer_element_get_type())
+
+
+typedef struct _GstRoarMixerElement GstRoarMixerElement;
+typedef struct _GstRoarMixerElementClass GstRoarMixerElementClass;
+typedef struct _GstRoarMixer GstRoarMixer;
+
+struct _GstRoarMixerElement {
+  GstElement            parent;
+
+  GstRoarMixer           *mixer;
+};
+
+struct _GstRoarMixerElementClass {
+  GstElementClass       parent;
+};
+
+
+GType           gst_roar_mixer_element_get_type          (void);
+
 typedef enum {
   GST_ROAR_MIXER_CAPTURE = 1<<0,
@@ -45,7 +69,9 @@
 } GstRoarMixerDirection;
 
-typedef struct _GstRoarMixer GstRoarMixer;
 
 #define GST_ROAR_MIXER(obj)              ((GstRoarMixer*)(obj))
+
+#define GST_TYPE_ROARMIXER \
+  (gst_roarmixer_get_type())
 
 struct _GstRoarMixer {
@@ -74,4 +100,6 @@
 } GstRoarMixerTrackClass;
 
+GType gst_roarmixer_get_type(void);
+gboolean gst_roarmixer_factory_init (GstPlugin *plugin);
 
 GstRoarMixer*    gst_roarmixer_new                (const gchar *device,
@@ -93,4 +121,86 @@
                                                  gboolean mute);
 
+#define GST_IMPLEMENT_ROAR_MIXER_METHODS(Type, interface_as_function)            \
+static gboolean                                                                 \
+interface_as_function ## _supported (Type *this, GType iface_type)              \
+{                                                                               \
+  g_assert (iface_type == GST_TYPE_MIXER);                                      \
+                                                                                \
+  return (this->mixer != NULL);                                                 \
+}                                                                               \
+                                                                                \
+static const GList*                                                             \
+interface_as_function ## _list_tracks (GstMixer * mixer)                        \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_val_if_fail (this != NULL, NULL);                                    \
+  g_return_val_if_fail (this->mixer != NULL, NULL);                             \
+                                                                                \
+  return gst_roarmixer_list_tracks (this->mixer);                                \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _set_volume (GstMixer * mixer, GstMixerTrack * track,  \
+    gint * volumes)                                                             \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_roarmixer_set_volume (this->mixer, track, volumes);                        \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _get_volume (GstMixer * mixer, GstMixerTrack * track,  \
+    gint * volumes)                                                             \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_roarmixer_get_volume (this->mixer, track, volumes);                        \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _set_record (GstMixer * mixer, GstMixerTrack * track,  \
+    gboolean record)                                                            \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_roarmixer_set_record (this->mixer, track, record);                         \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _set_mute (GstMixer * mixer, GstMixerTrack * track,    \
+    gboolean mute)                                                              \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_roarmixer_set_mute (this->mixer, track, mute);                             \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _interface_init (GstMixerClass * klass)                \
+{                                                                               \
+  GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE;                                  \
+                                                                                \
+  /* set up the interface hooks */                                              \
+  klass->list_tracks = interface_as_function ## _list_tracks;                   \
+  klass->set_volume = interface_as_function ## _set_volume;                     \
+  klass->get_volume = interface_as_function ## _get_volume;                     \
+  klass->set_mute = interface_as_function ## _set_mute;                         \
+  klass->set_record = interface_as_function ## _set_record;                     \
+}
+
+
 G_END_DECLS
 
