[Xfce4-commits] r27087 - in xfce4-mixer/trunk: . libxfce4mixer panel-plugin po xfce4-mixer

Jannis Pohlmann jannis at xfce.org
Thu Jun 19 17:08:24 CEST 2008


Author: jannis
Date: 2008-06-19 15:08:24 +0000 (Thu, 19 Jun 2008)
New Revision: 27087

Added:
   xfce4-mixer/trunk/libxfce4mixer/
   xfce4-mixer/trunk/libxfce4mixer/Makefile.am
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.c
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.h
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.c
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.h
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.c
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.h
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.c
   xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.h
   xfce4-mixer/trunk/panel-plugin/
   xfce4-mixer/trunk/panel-plugin/Makefile.am
   xfce4-mixer/trunk/panel-plugin/xfce-mixer-plugin.c
   xfce4-mixer/trunk/panel-plugin/xfce-volume-button.c
   xfce4-mixer/trunk/panel-plugin/xfce-volume-button.h
   xfce4-mixer/trunk/panel-plugin/xfce4-mixer-plugin.desktop.in.in
Removed:
   xfce4-mixer/trunk/po/xfce4-mixer.pot
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-card.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-card.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-preferences.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-preferences.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-stock.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-stock.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track-type.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track-type.h
Modified:
   xfce4-mixer/trunk/ChangeLog
   xfce4-mixer/trunk/INSTALL
   xfce4-mixer/trunk/Makefile.am
   xfce4-mixer/trunk/TODO
   xfce4-mixer/trunk/configure.in.in
   xfce4-mixer/trunk/xfce4-mixer/Makefile.am
   xfce4-mixer/trunk/xfce4-mixer/main.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-controls-dialog.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.h
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.c
   xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.h
Log:
	* Huge code reorganization: Split the mixer into three parts:
	  libxfce4mixer, xfce4-mixer and the panel plugin. libxfce4mixer
	  contains everything that's needed by both, the mixer and the
	  plugin.
	* panel-plugin/: This will become a minimalistic, keyboard and
	  scroll-wheel orientated plugin with no volume popup slider or
	  whatsoever. I'll have to add this later. Still missing: config
	  dialog and the connection to the soundcard.
	* xfce4-mixer/: I don't think I've changed anything in here, just
	  reorganized the code.


Modified: xfce4-mixer/trunk/ChangeLog
===================================================================
--- xfce4-mixer/trunk/ChangeLog	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/ChangeLog	2008-06-19 15:08:24 UTC (rev 27087)
@@ -1,3 +1,16 @@
+2008-06-19	Jannis Pohlmann <jannis at xfce.org>
+
+	* Huge code reorganization: Split the mixer into three parts: 
+	  libxfce4mixer, xfce4-mixer and the panel plugin. libxfce4mixer
+	  contains everything that's needed by both, the mixer and the 
+	  plugin.
+	* panel-plugin/: This will become a minimalistic, keyboard and 
+	  scroll-wheel orientated plugin with no volume popup slider or
+	  whatsoever. I'll have to add this later. Still missing: config
+	  dialog and the connection to the soundcard.
+	* xfce4-mixer/: I don't think I've changed anything in here, just
+	  reorganized the code.
+
 2008-01-14	Jannis Pohlmann <jannis at xfce.org>
 
 	* configure.in.in: Add support for version information, just like all

Modified: xfce4-mixer/trunk/INSTALL
===================================================================
--- xfce4-mixer/trunk/INSTALL	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/INSTALL	2008-06-19 15:08:24 UTC (rev 27087)
@@ -2,7 +2,7 @@
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+2006, 2007 Free Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -67,6 +67,9 @@
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
 Compilers and Options
 =====================
 

Modified: xfce4-mixer/trunk/Makefile.am
===================================================================
--- xfce4-mixer/trunk/Makefile.am	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/Makefile.am	2008-06-19 15:08:24 UTC (rev 27087)
@@ -7,6 +7,8 @@
 SUBDIRS =								\
 	icons								\
 	pixmaps								\
+	libxfce4mixer							\
+	panel-plugin							\
 	xfce4-mixer							\
 	po
 

Modified: xfce4-mixer/trunk/TODO
===================================================================
--- xfce4-mixer/trunk/TODO	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/TODO	2008-06-19 15:08:24 UTC (rev 27087)
@@ -5,7 +5,7 @@
 
 * Write panel plugin
 
-* Write MCS plugin (or go the xfconf way)
+* Implement Xfconf support
 
 * Allow changing controls from the console, probably via something like:
   --change-control=SOUNDCARD NAME:TRACK NAME:NEW VALUE

Modified: xfce4-mixer/trunk/configure.in.in
===================================================================
--- xfce4-mixer/trunk/configure.in.in	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/configure.in.in	2008-06-19 15:08:24 UTC (rev 27087)
@@ -78,6 +78,7 @@
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
+XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.4.0])
 
 dnl **************************************
 dnl *** Check for GstMixer bus support ***
@@ -158,6 +159,8 @@
 icons/48x48/Makefile
 icons/scalable/Makefile
 pixmaps/Makefile
+libxfce4mixer/Makefile
+panel-plugin/Makefile
 xfce4-mixer/Makefile
 po/Makefile.in
 ])

Added: xfce4-mixer/trunk/libxfce4mixer/Makefile.am
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/Makefile.am	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/Makefile.am	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,37 @@
+# $Id$ 
+#
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
+
+noinst_LTLIBRARIES = 							\
+	libxfce4mixer.la
+
+libxfce4mixer_la_SOURCES =						\
+	xfce-mixer-card.h						\
+	xfce-mixer-card.c						\
+	xfce-mixer-stock.h						\
+	xfce-mixer-stock.c						\
+	xfce-mixer-track-type.h						\
+	xfce-mixer-track-type.c						\
+	xfce-mixer-preferences.h					\
+	xfce-mixer-preferences.c
+
+libxfce4mixer_la_CFLAGS = 						\
+	-I$(top_srcdir)							\
+	-DG_LOG_DOMAIN=\"libxfce4mixer\"				\
+	$(PLATFORM_CFLAGS)						\
+	$(GLIB_CFLAGS)							\
+	$(GTK_FLAGS)							\
+	$(LIBXFCE4UTIL_CFLAGS)						\
+	$(LIBXFCEGUI4_CFLAGS)						\
+	$(GST_PLUGINS_BASE_CFLAGS)
+
+libxfce4mixer_la_LDFLAGS =						\
+	-no-undefined
+
+libxfce4mixer_la_LIBADD =						\
+	$(PLATFORM_LDFLAGS)
+	$(GLIB_LIBS)							\
+	$(GTK_FLAGS)							\
+	$(LIBXFCE4UTIL_LIBS)						\
+	$(LIBXFCEGUI4_LIBS)						\
+	$(GST_PLUGINS_BASE_LIBS)

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.c (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-card.c)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.c	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,353 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 card) 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
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+
+#include <gst/gst.h>
+#include <gst/interfaces/mixer.h>
+
+#include "xfce-mixer-card.h"
+#include "xfce-mixer-preferences.h"
+
+
+
+static void xfce_mixer_card_class_init (XfceMixerCardClass *klass);
+static void xfce_mixer_card_init       (XfceMixerCard      *card);
+static void xfce_mixer_card_finalize   (GObject            *object);
+
+
+
+struct _XfceMixerCardClass
+{
+  GObjectClass __parent__;
+};
+
+struct _XfceMixerCard
+{
+  GObject __parent__;
+
+  GstElement *element;
+
+#ifdef HAVE_GST_MIXER_NOTIFICATION
+  GstBus     *bus;
+#endif
+
+  gchar      *display_name;
+  gchar      *name;
+};
+
+
+
+static GObjectClass *xfce_mixer_card_parent_class = NULL;
+
+
+
+GType
+xfce_mixer_card_get_type (void)
+{
+  static GType type = G_TYPE_INVALID;
+
+  if (G_UNLIKELY (type == G_TYPE_INVALID))
+    {
+      static const GTypeInfo info = 
+        {
+          sizeof (XfceMixerCardClass),
+          NULL,
+          NULL,
+          (GClassInitFunc) xfce_mixer_card_class_init,
+          NULL,
+          NULL,
+          sizeof (XfceMixerCard),
+          0,
+          (GInstanceInitFunc) xfce_mixer_card_init,
+          NULL,
+        };
+
+      type = g_type_register_static (G_TYPE_OBJECT, "XfceMixerCard", &info, 0);
+    }
+  
+  return type;
+}
+
+
+
+static void
+xfce_mixer_card_class_init (XfceMixerCardClass *klass)
+{
+  GObjectClass *gobject_class;
+
+  /* Determine parent type class */
+  xfce_mixer_card_parent_class = g_type_class_peek_parent (klass);
+
+  gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->finalize = xfce_mixer_card_finalize;
+}
+
+
+
+static void
+xfce_mixer_card_init (XfceMixerCard *card)
+{
+  card->name = NULL;
+
+#ifdef HAVE_GST_MIXER_NOTIFICATION
+  card->bus = NULL;
+#endif
+}
+
+
+
+static void
+xfce_mixer_card_finalize (GObject *object)
+{
+  XfceMixerCard *card = XFCE_MIXER_CARD (object);
+
+  gst_element_set_state (card->element, GST_STATE_NULL);
+  gst_object_unref (card->element);
+
+#ifdef HAVE_GST_MIXER_NOTIFICATION
+  if (G_LIKELY (card->bus != NULL))
+    gst_object_unref (card->bus);
+#endif
+
+  g_free (card->display_name);
+  g_free (card->name);
+
+  (*G_OBJECT_CLASS (xfce_mixer_card_parent_class)->finalize) (object);
+}
+
+
+
+XfceMixerCard*
+xfce_mixer_card_new (GstElement *element)
+{
+  XfceMixerCard *card;
+
+  card = g_object_new (TYPE_XFCE_MIXER_CARD, NULL);
+  card->element = gst_object_ref (element);
+  card->display_name = g_strdup (g_object_get_data (G_OBJECT (card->element), "xfce-mixer-control-name"));
+
+  return card;
+}
+
+
+
+const gchar*
+xfce_mixer_card_get_display_name (XfceMixerCard *card)
+{
+  g_return_val_if_fail (IS_XFCE_MIXER_CARD (card), NULL);
+  return card->display_name;
+}
+
+
+
+const gchar*
+xfce_mixer_card_get_name (XfceMixerCard *card)
+{
+  gint   i;
+  gint   pos = 0;
+
+  g_return_val_if_fail (IS_XFCE_MIXER_CARD (card), NULL);
+
+  if (G_UNLIKELY (card->name == NULL))
+    {
+      card->name = g_new (gchar, strlen (card->display_name));
+
+      for (i = 0; card->display_name[i] != '\0'; ++i)
+        if (g_ascii_isalnum (card->display_name[i]))
+          card->name[pos++] = card->display_name[i];
+
+      card->name[pos] = '\0';
+    }
+
+  return card->name;
+}
+
+
+
+void
+xfce_mixer_card_set_ready (XfceMixerCard *card)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  gst_element_set_state (card->element, GST_STATE_READY);
+}
+
+
+
+GList*
+xfce_mixer_card_get_visible_controls (XfceMixerCard *card)
+{
+  XfceMixerPreferences *preferences;
+  GList                *list = NULL;
+
+  g_return_val_if_fail (IS_XFCE_MIXER_CARD (card), NULL);
+
+  preferences = xfce_mixer_preferences_get ();
+  list = xfce_mixer_preferences_get_visible_controls (preferences, xfce_mixer_card_get_name (card));
+  g_object_unref (G_OBJECT (preferences));
+
+  return list;
+}
+
+
+
+const GList*
+xfce_mixer_card_get_tracks (XfceMixerCard *card)
+{
+  g_return_val_if_fail (IS_XFCE_MIXER_CARD (card), NULL);
+  return gst_mixer_list_tracks (GST_MIXER (card->element));
+}
+
+
+
+void
+xfce_mixer_card_set_control_visible (XfceMixerCard *card,
+                                     const gchar   *control,
+                                     gboolean       visible)
+{
+  XfceMixerPreferences *preferences;
+
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  g_return_if_fail (control != NULL);
+
+  preferences = xfce_mixer_preferences_get ();
+  xfce_mixer_preferences_set_control_visible (preferences, xfce_mixer_card_get_name (card), control, visible);
+  g_object_unref (G_OBJECT (preferences));
+}
+
+
+
+void
+xfce_mixer_card_get_track_volume (XfceMixerCard *card,
+                                  GstMixerTrack *track,
+                                  gint          *volumes)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  g_return_if_fail (GST_IS_MIXER_TRACK (track));
+
+  gst_mixer_get_volume (GST_MIXER (card->element), track, volumes);
+}
+
+
+
+void
+xfce_mixer_card_set_track_volume (XfceMixerCard *card,
+                                  GstMixerTrack *track,
+                                  gint          *volumes)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  g_return_if_fail (GST_IS_MIXER_TRACK (track));
+
+  gst_mixer_set_volume (GST_MIXER (card->element), track, volumes);
+}
+
+
+
+void
+xfce_mixer_card_set_track_muted (XfceMixerCard *card,
+                                 GstMixerTrack *track,
+                                 gboolean       muted)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  g_return_if_fail (GST_IS_MIXER_TRACK (track));
+  
+  gst_mixer_set_mute (GST_MIXER (card->element), track, muted);
+}
+
+
+
+void
+xfce_mixer_card_set_track_record (XfceMixerCard *card,
+                                  GstMixerTrack *track,
+                                  gboolean       record)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  g_return_if_fail (GST_IS_MIXER_TRACK (track));
+  
+  gst_mixer_set_record (GST_MIXER (card->element), track, record);
+}
+
+
+
+const gchar*
+xfce_mixer_card_get_track_option (XfceMixerCard *card,
+                                  GstMixerTrack *track)
+{
+  g_return_val_if_fail (IS_XFCE_MIXER_CARD (card), NULL);
+  g_return_val_if_fail (GST_IS_MIXER_OPTIONS (track), NULL);
+
+  return gst_mixer_get_option (GST_MIXER (card->element), GST_MIXER_OPTIONS (track));
+}
+
+
+
+void
+xfce_mixer_card_set_track_option (XfceMixerCard *card,
+                                  GstMixerTrack *track,
+                                  gchar         *option)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+  g_return_if_fail (GST_IS_MIXER_OPTIONS (track));
+
+  gst_mixer_set_option (GST_MIXER (card->element), GST_MIXER_OPTIONS (track), option);
+}
+
+
+
+#ifdef HAVE_GST_MIXER_NOTIFICATION
+void
+xfce_mixer_card_connect (XfceMixerCard *card,
+                         GCallback      callback_func,
+                         gpointer       user_data)
+{
+  g_return_if_fail (IS_XFCE_MIXER_CARD (card));
+
+  if (G_UNLIKELY (card->bus == NULL))
+    {
+      card->bus = gst_bus_new ();
+      gst_bus_add_signal_watch (card->bus);
+      gst_element_set_bus (card->element, card->bus);
+    }
+
+  g_signal_connect (G_OBJECT (card->bus), "message::element", callback_func, user_data);
+}
+
+
+
+gboolean
+xfce_mixer_card_get_message_owner (XfceMixerCard *card,
+                                   GstMessage    *message)
+{
+  g_return_val_if_fail (IS_XFCE_MIXER_CARD (card), FALSE);
+  g_return_val_if_fail (GST_IS_MESSAGE (message), FALSE);
+
+  return GST_MESSAGE_SRC (message) == GST_OBJECT (card->element);
+}
+#endif

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.h (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-card.h)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.h	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-card.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,76 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 __XFCE_MIXER_CARD_H__
+#define __XFCE_MIXER_CARD_H__
+
+#include <gtk/gtk.h>
+#include <gst/interfaces/mixer.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _XfceMixerCardClass XfceMixerCardClass;
+typedef struct _XfceMixerCard      XfceMixerCard;
+
+#define TYPE_XFCE_MIXER_CARD            (xfce_mixer_card_get_type ())
+#define XFCE_MIXER_CARD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_XFCE_MIXER_CARD, XfceMixerCard))
+#define XFCE_MIXER_CARD_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_XFCE_MIXER_CARD, XfceMixerCardClass))
+#define IS_XFCE_MIXER_CARD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_XFCE_MIXER_CARD))
+#define IS_XFCE_MIXER_CARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_XFCE_MIXER_CARD))
+#define XFCE_MIXER_CARD_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_XFCE_MIXER_CARD, XfceMixerCardClass))
+
+GType          xfce_mixer_card_get_type             (void) G_GNUC_CONST;
+
+XfceMixerCard *xfce_mixer_card_new                  (GstElement    *element);
+const gchar   *xfce_mixer_card_get_display_name     (XfceMixerCard *card);
+const gchar   *xfce_mixer_card_get_name             (XfceMixerCard *card);
+void           xfce_mixer_card_set_ready            (XfceMixerCard *card);
+GList         *xfce_mixer_card_get_visible_controls (XfceMixerCard *card);
+const GList   *xfce_mixer_card_get_tracks           (XfceMixerCard *card);
+void           xfce_mixer_card_set_control_visible  (XfceMixerCard *card,
+                                                     const gchar   *control,
+                                                     gboolean       visible);
+void           xfce_mixer_card_get_track_volume     (XfceMixerCard *card,
+                                                     GstMixerTrack *track,
+                                                     gint          *volumes);
+void           xfce_mixer_card_set_track_muted      (XfceMixerCard *card,
+                                                     GstMixerTrack *track,
+                                                     gboolean       muted);
+void           xfce_mixer_card_set_track_record     (XfceMixerCard *card,
+                                                     GstMixerTrack *track,
+                                                     gboolean       record);
+const gchar   *xfce_mixer_card_get_track_option     (XfceMixerCard *card,
+                                                     GstMixerTrack *track);
+void           xfce_mixer_card_set_track_option     (XfceMixerCard *card,
+                                                     GstMixerTrack *track,
+                                                     gchar         *option);
+#ifdef HAVE_GST_MIXER_NOTIFICATION
+void           xfce_mixer_card_connect              (XfceMixerCard *card,
+                                                     GCallback      callback_func,
+                                                     gpointer       user_data);
+gboolean       xfce_mixer_card_get_message_owner    (XfceMixerCard *card,
+                                                     GstMessage    *message);
+#endif
+
+
+G_END_DECLS;
+
+#endif /* !__XFCE_MIXER_CARD_H__ */

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.c (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-preferences.c)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.c	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,422 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 preferences) 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 <glib-object.h>
+
+#include <libxfce4util/libxfce4util.h>
+
+#include "xfce-mixer-preferences.h"
+
+
+
+enum
+{
+  PROP_0,
+  PROP_LAST_WINDOW_WIDTH,
+  PROP_LAST_WINDOW_HEIGHT,
+  PROP_SOUND_CARD,
+  N_PROPERTIES,
+};
+
+
+
+static void   xfce_mixer_preferences_class_init        (XfceMixerPreferencesClass *klass);
+static void   xfce_mixer_preferences_init              (XfceMixerPreferences      *preferences);
+static void   xfce_mixer_preferences_finalize          (GObject                   *object);
+static void   xfce_mixer_preferences_get_property      (GObject                   *object,
+                                                        guint                      prop_id,
+                                                        GValue                    *value,
+                                                        GParamSpec                *pspec);
+static void   xfce_mixer_preferences_set_property      (GObject                   *object,
+                                                        guint                      prop_id,
+                                                        const GValue              *value,
+                                                        GParamSpec                *pspec);
+static void   xfce_mixer_preferences_load              (XfceMixerPreferences      *preferences);
+static gchar *xfce_mixer_preferences_get_mixer_rc_group (XfceMixerPreferences      *preferences,
+                                                        const gchar               *mixer);
+
+
+
+struct _XfceMixerPreferencesClass
+{
+  GObjectClass __parent__;
+};
+
+struct _XfceMixerPreferences
+{
+  GObject __parent__;
+
+  GValue  values[N_PROPERTIES];
+};
+
+
+
+static GObjectClass *xfce_mixer_preferences_parent_class = NULL;
+
+
+
+GType
+xfce_mixer_preferences_get_type (void)
+{
+  static GType type = G_TYPE_INVALID;
+
+  if (G_UNLIKELY (type == G_TYPE_INVALID))
+    {
+      static const GTypeInfo info = 
+        {
+          sizeof (XfceMixerPreferencesClass),
+          NULL,
+          NULL,
+          (GClassInitFunc) xfce_mixer_preferences_class_init,
+          NULL,
+          NULL,
+          sizeof (XfceMixerPreferences),
+          0,
+          (GInstanceInitFunc) xfce_mixer_preferences_init,
+          NULL,
+        };
+
+      type = g_type_register_static (G_TYPE_OBJECT, "XfceMixerPreferences", &info, 0);
+    }
+  
+  return type;
+}
+
+
+
+static void
+xfce_mixer_preferences_class_init (XfceMixerPreferencesClass *klass)
+{
+  GObjectClass *gobject_class;
+
+  /* Determine parent type class */
+  xfce_mixer_preferences_parent_class = g_type_class_peek_parent (klass);
+
+  gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->get_property = xfce_mixer_preferences_get_property;
+  gobject_class->set_property = xfce_mixer_preferences_set_property;
+  gobject_class->finalize = xfce_mixer_preferences_finalize;
+
+  g_object_class_install_property (gobject_class, 
+                                   PROP_LAST_WINDOW_WIDTH,
+                                   g_param_spec_int ("last-window-width",
+                                                     "last-window-width",
+                                                     "last-window-width",
+                                                     1, G_MAXINT, 600,
+                                                     G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_object_class_install_property (gobject_class, 
+                                   PROP_LAST_WINDOW_HEIGHT,
+                                   g_param_spec_int ("last-window-height",
+                                                     "last-window-height",
+                                                     "last-window-height",
+                                                     1, G_MAXINT, 400,
+                                                     G_PARAM_READABLE | G_PARAM_WRITABLE));
+
+  g_object_class_install_property (gobject_class, 
+                                   PROP_SOUND_CARD,
+                                   g_param_spec_string ("sound-card",
+                                                        "sound-card",
+                                                        "sound-card",
+                                                        NULL,
+                                                        G_PARAM_READABLE | G_PARAM_WRITABLE));
+}
+
+
+
+static void
+xfce_mixer_preferences_init (XfceMixerPreferences *preferences)
+{
+}
+
+
+
+static void
+xfce_mixer_preferences_finalize (GObject *object)
+{
+  XfceMixerPreferences *preferences = XFCE_MIXER_PREFERENCES (object);
+
+  (*G_OBJECT_CLASS (xfce_mixer_preferences_parent_class)->finalize) (object);
+}
+
+
+
+static void 
+xfce_mixer_preferences_get_property (GObject    *object,
+                                     guint       prop_id,
+                                     GValue     *value,
+                                     GParamSpec *pspec)
+{
+  XfceMixerPreferences *preferences = XFCE_MIXER_PREFERENCES (object);
+  GValue               *src;
+
+  src = preferences->values + prop_id;
+
+  if (G_LIKELY (G_IS_VALUE (src)))
+    g_value_copy (src, value);
+  else
+    g_param_value_set_default (pspec, value);
+}
+
+
+
+static void 
+xfce_mixer_preferences_set_property (GObject      *object,
+                                     guint         prop_id,
+                                     const GValue *value,
+                                     GParamSpec   *pspec)
+{
+  XfceMixerPreferences *preferences = XFCE_MIXER_PREFERENCES (object);
+  GValue               *dest;
+
+  dest = preferences->values + prop_id;
+
+  if (G_UNLIKELY (!G_IS_VALUE (dest)))
+    {
+      g_value_init (dest, pspec->value_type);
+      g_param_value_set_default (pspec, dest);
+    }
+
+  if (G_LIKELY (g_param_values_cmp (pspec, value, dest) != 0))
+    {
+      g_value_copy (value, dest);
+      xfce_mixer_preferences_store (preferences);
+    }
+}
+
+
+
+XfceMixerPreferences*
+xfce_mixer_preferences_get (void)
+{
+  static XfceMixerPreferences *preferences = NULL;
+
+  if (G_UNLIKELY (preferences == NULL))
+    {
+      preferences = g_object_new (TYPE_XFCE_MIXER_PREFERENCES, NULL);
+      g_object_add_weak_pointer (G_OBJECT (preferences), (gpointer) &preferences);
+      xfce_mixer_preferences_load (preferences);
+    }
+  else
+    g_object_ref (G_OBJECT (preferences));
+
+  return preferences;
+}
+
+
+
+static void 
+xfce_mixer_preferences_load (XfceMixerPreferences *preferences)
+{
+  const gchar *value;
+  GParamSpec **specs;
+  GParamSpec  *spec;
+  GValue       dest = { 0, };
+  GValue       src = { 0, };
+  XfceRc      *rc;
+  guint        nspecs;
+  guint        n;
+
+  rc = xfce_mixer_preferences_get_rc (preferences);
+
+  if (G_UNLIKELY (rc == NULL))
+    {
+      g_warning ("Failed to load the mixer preferences.");
+      return;
+    }
+
+  g_object_freeze_notify (G_OBJECT (preferences));
+
+  xfce_rc_set_group (rc, "Configuration");
+
+  specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (preferences), &nspecs);
+
+  for (n = 0; n < nspecs; ++n)
+    {
+      spec = specs[n];
+
+      value = xfce_rc_read_entry (rc, spec->name, NULL);
+
+      if (G_UNLIKELY (value == NULL))
+        continue;
+
+      g_value_init (&src, G_TYPE_STRING);
+      g_value_set_static_string (&src, value);
+
+      if (spec->value_type == G_TYPE_STRING)
+        g_object_set_property (G_OBJECT (preferences), spec->name, &src);
+      else if (g_value_type_transformable (G_TYPE_STRING, spec->value_type))
+        {
+          g_value_init (&dest, spec->value_type);
+          if (g_value_transform (&src, &dest))
+            g_object_set_property (G_OBJECT (preferences), spec->name, &dest);
+          g_value_unset (&dest);
+        }
+      else
+        g_warning ("Failed to load property \"%s\"", spec->name);
+
+      g_value_unset (&src);
+    }
+
+  xfce_rc_close (rc);
+
+  g_object_thaw_notify (G_OBJECT (preferences));
+}
+
+
+
+void 
+xfce_mixer_preferences_store (XfceMixerPreferences *preferences)
+{
+  const gchar *value;
+  GParamSpec **specs;
+  GParamSpec  *spec;
+  GValue       dest = { 0, };
+  GValue       src = { 0, };
+  XfceRc      *rc;
+  guint        nspecs;
+  guint        n;
+
+  rc = xfce_mixer_preferences_get_rc (preferences);
+
+  if (G_UNLIKELY (rc == NULL))
+    {
+      g_warning ("Failed to save the mixer preferences");
+      return;
+    }
+
+  xfce_rc_set_group (rc, "Configuration");
+
+  specs = g_object_class_list_properties (G_OBJECT_GET_CLASS (preferences), &nspecs);
+
+  for (n = 0; n < nspecs; ++n)
+    {
+      spec = specs[n];
+
+      g_value_init (&dest, G_TYPE_STRING);
+
+      if (spec->value_type == G_TYPE_STRING)
+        g_object_get_property (G_OBJECT (preferences), spec->name, &dest);
+      else
+        {
+          g_value_init (&src, spec->value_type);
+          g_object_get_property (G_OBJECT (preferences), spec->name, &src);
+          g_value_transform (&src, &dest);
+          g_value_unset (&src);
+        }
+
+      value = g_value_get_string (&dest);
+
+      if (G_LIKELY (value != NULL))
+        xfce_rc_write_entry (rc, spec->name, value);
+
+      g_value_unset (&dest);
+    }
+
+  xfce_rc_close (rc);
+}
+
+
+
+XfceRc*
+xfce_mixer_preferences_get_rc (XfceMixerPreferences *preferences)
+{
+  return xfce_rc_config_open (XFCE_RESOURCE_CONFIG, "xfce4/mixerrc", FALSE);
+}
+
+
+
+GList*
+xfce_mixer_preferences_get_visible_controls (XfceMixerPreferences *preferences,
+                                             const gchar          *mixer)
+{
+  XfceRc  *rc;
+  GList   *list = NULL;
+  gchar  **entries;
+  gchar   *group;
+  gint     i;
+
+  rc = xfce_mixer_preferences_get_rc (preferences);
+
+  if (G_UNLIKELY (rc == NULL))
+    return NULL;
+
+  group = xfce_mixer_preferences_get_mixer_rc_group (preferences, mixer);
+  xfce_rc_set_group (rc, group);
+  entries = xfce_rc_get_entries (rc, group);
+  g_free (group);
+
+  for (i = 0; entries != NULL && entries[i] != NULL; ++i)
+    {
+      if (xfce_rc_read_bool_entry (rc, entries[i], FALSE))
+        list = g_list_prepend (list, g_strdup (entries[i]));
+    }
+
+  g_strfreev (entries);
+
+  xfce_rc_close (rc);
+
+  return list;
+}
+
+
+
+static gchar*
+xfce_mixer_preferences_get_mixer_rc_group (XfceMixerPreferences *preferences,
+                                           const gchar          *mixer)
+{
+  return g_strdup_printf ("Card %s", mixer);
+}
+
+
+
+void
+xfce_mixer_preferences_set_control_visible (XfceMixerPreferences *preferences,
+                                            const gchar          *mixer,
+                                            const gchar          *control,
+                                            gboolean              visible)
+{
+  XfceRc *rc;
+  gchar  *group;
+
+  rc = xfce_mixer_preferences_get_rc (preferences);
+
+  if (G_UNLIKELY (rc == NULL))
+    {
+      g_warning ("Failed to save control visibility configuration");
+      return;
+    }
+
+  group = xfce_mixer_preferences_get_mixer_rc_group (preferences, mixer);
+  xfce_rc_set_group (rc, group);
+  g_free (group);
+
+  if (visible)
+    xfce_rc_write_bool_entry (rc, control, TRUE);
+  else
+    xfce_rc_delete_entry (rc, control, FALSE);
+
+  xfce_rc_close (rc);
+}

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.h (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-preferences.h)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.h	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-preferences.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,53 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 __XFCE_MIXER_PREFERENCES_H__
+#define __XFCE_MIXER_PREFERENCES_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _XfceMixerPreferencesClass XfceMixerPreferencesClass;
+typedef struct _XfceMixerPreferences      XfceMixerPreferences;
+
+#define TYPE_XFCE_MIXER_PREFERENCES            (xfce_mixer_preferences_get_type ())
+#define XFCE_MIXER_PREFERENCES(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_XFCE_MIXER_PREFERENCES, XfceMixerPreferences))
+#define XFCE_MIXER_PREFERENCES_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_XFCE_MIXER_PREFERENCES, XfceMixerPreferencesClass))
+#define IS_XFCE_MIXER_PREFERENCES(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_XFCE_MIXER_PREFERENCES))
+#define IS_XFCE_MIXER_PREFERENCES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_XFCE_MIXER_PREFERENCES))
+#define XFCE_MIXER_PREFERENCES_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_XFCE_MIXER_PREFERENCES, XfceMixerPreferencesClass))
+
+GType                 xfce_mixer_preferences_get_type             (void) G_GNUC_CONST;
+
+XfceMixerPreferences *xfce_mixer_preferences_get                  (void);
+void                  xfce_mixer_preferences_store                (XfceMixerPreferences *preferences);
+XfceRc               *xfce_mixer_preferences_get_rc               (XfceMixerPreferences *preferences);
+GList                *xfce_mixer_preferences_get_visible_controls (XfceMixerPreferences *preferences,
+                                                                   const gchar          *mixer);
+void                  xfce_mixer_preferences_set_control_visible  (XfceMixerPreferences *preferences,
+                                                                   const gchar          *mixer,
+                                                                   const gchar          *control,
+                                                                   gboolean              visible);
+
+G_END_DECLS;
+
+#endif /* !__XFCE_MIXER_PREFERENCES_H__ */

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.c (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-stock.c)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.c	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,81 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 <gtk/gtk.h>
+
+#include "xfce-mixer-stock.h"
+
+
+
+typedef struct
+{
+  const gchar *name;
+  const gchar *icon;
+} XfceMixerStockIcon;
+
+
+
+static const XfceMixerStockIcon xfce_mixer_stock_icons[] =
+{
+  { XFCE_MIXER_STOCK_RECORD,    "stock_xfce4-mixer-record",    },
+  { XFCE_MIXER_STOCK_NO_RECORD, "stock_xfce4-mixer-no-record", },
+  { XFCE_MIXER_STOCK_MUTED,     "stock_xfce4-mixer-muted",     },
+  { XFCE_MIXER_STOCK_NO_MUTED,  "stock_xfce4-mixer-no-muted",  },
+};
+
+
+
+void
+xfce_mixer_stock_init (void)
+{
+  GtkIconFactory *icon_factory;
+  GtkIconSource  *icon_source;
+  GtkIconSet     *icon_set;
+  guint           n;
+
+  /* Allocate a new icon factory for the mixer stock icons */
+  icon_factory = gtk_icon_factory_new ();
+
+  /* Allocate an icon source */
+  icon_source = gtk_icon_source_new ();
+
+  /* Register the stock icons */
+  for (n = 0; n < G_N_ELEMENTS (xfce_mixer_stock_icons); ++n)
+    {
+      /* Setup the icon set */
+      icon_set = gtk_icon_set_new ();
+      gtk_icon_source_set_icon_name (icon_source, xfce_mixer_stock_icons[n].icon);
+      gtk_icon_set_add_source (icon_set, icon_source);
+      gtk_icon_factory_add (icon_factory, xfce_mixer_stock_icons[n].name, icon_set);
+      gtk_icon_set_unref (icon_set);
+    }
+
+  /* Register our icon factory as default */
+  gtk_icon_factory_add_default (icon_factory);
+
+  /* Clean up */
+  g_object_unref (G_OBJECT (icon_factory));
+  gtk_icon_source_free (icon_source);
+}

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.h (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-stock.h)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.h	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-stock.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,36 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 __XFCE_MIXER_STOCK_H__
+#define __XFCE_MIXER_STOCK_H__
+
+G_BEGIN_DECLS;
+
+#define XFCE_MIXER_STOCK_RECORD    "xfce-mixer-record"
+#define XFCE_MIXER_STOCK_NO_RECORD "xfce-mixer-no-record"
+#define XFCE_MIXER_STOCK_MUTED     "xfce-mixer-muted"
+#define XFCE_MIXER_STOCK_NO_MUTED  "xfce-mixer-no-muted"
+
+void xfce_mixer_stock_init (void) G_GNUC_INTERNAL;
+
+G_END_DECLS;
+
+#endif /* !__XFCE_MIXER_STOCK_H__ */

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.c (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track-type.c)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.c	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,78 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 <glib.h>
+#include <glib-object.h>
+
+#include "xfce-mixer-track-type.h"
+
+
+
+GType
+xfce_mixer_track_type_get_type (void)
+{
+  static GType type = G_TYPE_INVALID;
+
+  if (G_UNLIKELY (type == G_TYPE_INVALID))
+    {
+      static const GEnumValue values[] = 
+        {
+          { XFCE_MIXER_TRACK_TYPE_PLAYBACK, "XFCE_MIXER_TRACK_TYPE_PLAYBACK", "playback" },
+          { XFCE_MIXER_TRACK_TYPE_CAPTURE, "XFCE_MIXER_TRACK_TYPE_CAPTURE", "capture" },
+          { XFCE_MIXER_TRACK_TYPE_SWITCH, "XFCE_MIXER_TRACK_TYPE_SWITCH", "switch" },
+          { XFCE_MIXER_TRACK_TYPE_OPTIONS, "XFCE_MIXER_TRACK_TYPE_OPTIONS", "options" },
+          { 0, NULL, NULL }
+        };
+
+      type = g_enum_register_static (g_intern_static_string ("XfceMixerTrackType"), values);
+    }
+
+  return type;
+}
+
+
+
+XfceMixerTrackType
+xfce_mixer_track_type_new (GstMixerTrack *track)
+{
+  XfceMixerTrackType type = XFCE_MIXER_TRACK_TYPE_CAPTURE;
+  
+  if (G_UNLIKELY (GST_IS_MIXER_OPTIONS (track)))
+    type = XFCE_MIXER_TRACK_TYPE_OPTIONS;
+  else
+    {
+      if (G_UNLIKELY (track->num_channels == 0))
+        type = XFCE_MIXER_TRACK_TYPE_SWITCH;
+      else
+        {
+          if (GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_INPUT))
+            type = XFCE_MIXER_TRACK_TYPE_CAPTURE;
+          else
+            type = XFCE_MIXER_TRACK_TYPE_PLAYBACK;
+        }
+    }
+
+  return type;
+}

Copied: xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.h (from rev 26985, xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track-type.h)
===================================================================
--- xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.h	                        (rev 0)
+++ xfce4-mixer/trunk/libxfce4mixer/xfce-mixer-track-type.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,46 @@
+/* $Id$ */
+/* vim:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ *
+ * 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 __XFCE_TRACK_TYPE_H__
+#define __XFCE_TRACK_TYPE_H__
+
+#include <glib-object.h>
+#include <gst/interfaces/mixer.h>
+
+G_BEGIN_DECLS;
+
+typedef enum
+{
+  XFCE_MIXER_TRACK_TYPE_PLAYBACK,
+  XFCE_MIXER_TRACK_TYPE_CAPTURE,
+  XFCE_MIXER_TRACK_TYPE_SWITCH,
+  XFCE_MIXER_TRACK_TYPE_OPTIONS
+} XfceMixerTrackType;
+
+#define TYPE_XFCE_MIXER_TRACK_TYPE  (xfce_mixer_track_type_get_type ())
+
+GType              xfce_mixer_track_type_get_type (void) G_GNUC_CONST G_GNUC_INTERNAL;
+
+XfceMixerTrackType xfce_mixer_track_type_new      (GstMixerTrack *track);
+
+G_END_DECLS;
+
+#endif /* !__XFCE_TRACK_TYPE_H__ */

Added: xfce4-mixer/trunk/panel-plugin/Makefile.am
===================================================================
--- xfce4-mixer/trunk/panel-plugin/Makefile.am	                        (rev 0)
+++ xfce4-mixer/trunk/panel-plugin/Makefile.am	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,66 @@
+# $Id$
+#
+# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
+
+plugindir = $(libexecdir)/xfce4/panel-plugins
+
+plugin_PROGRAMS =							\
+	xfce4-mixer-plugin
+
+xfce4_mixer_plugin_SOURCES =						\
+	xfce-volume-button.h						\
+	xfce-volume-button.c						\
+	xfce-mixer-plugin.c
+
+xfce4_mixer_plugin_CFLAGS =						\
+	-I$(top_builddir)						\
+	-I$(top_srcdir)							\
+	-DDATADIR=\"$(datadir)\"					\
+	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
+	-DG_LOG_DOMAIN=\"xfce4-mixer-plugin\"				\
+	$(PLATFORM_CFLAGS)						\
+	$(GLIB_CFLAGS)							\
+	$(GTK_CFLAGS)							\
+	$(LIBXFCE4UTIL_CFLAGS)						\
+	$(LIBXFCEGUI4_CFLAGS)						\
+	$(LIBXFCE4PANEL_CFLAGS)						\
+	$(GST_PLUGINS_BASE_CFLAGS)
+
+xfce4_mixer_plugin_DEPENDENCIES =					\
+	$(top_builddir)/libxfce4mixer/libxfce4mixer.la
+
+xfce4_mixer_plugin_LDFLAGS =						\
+	$(top_builddir)/libxfce4mixer/libxfce4mixer.la			\
+	$(PLATFORM_LDFLAGS)						\
+	$(GLIB_LIBS)							\
+	$(GTK_LIBS)							\
+	$(LIBXFCE4UTIL_LIBS)						\
+	$(LIBXFCEGUI4_LIBS)						\
+	$(LIBXFCE4PANEL_LIBS)						\
+	$(GST_PLUGINS_BASE_LIBS)					\
+	-lgstaudio-0.10							\
+	-lgstinterfaces-0.10
+
+desktopdir = 								\
+	$(datadir)/xfce4/panel-plugins
+
+desktop_in_in_files = 							\
+	xfce4-mixer-plugin.desktop.in.in
+
+desktop_in_files = 							\
+	$(desktop_in_in_files:.desktop.in.in=.desktop.in)
+
+%.desktop.in: %.desktop.in.in
+	sed -e "s,\@libexecdir\@,$(libexecdir),g" < $< > $@
+
+desktop_DATA = 								\
+	$(desktop_in_files:.desktop.in=.desktop)
+
+ at INTLTOOL_DESKTOP_RULE@
+
+EXTRA_DIST =								\
+	$(desktop_in_in_files)
+
+CLEANFILES =								\
+	$(desktop_in_files)						\
+	$(desktop_DATA)

Added: xfce4-mixer/trunk/panel-plugin/xfce-mixer-plugin.c
===================================================================
--- xfce4-mixer/trunk/panel-plugin/xfce-mixer-plugin.c	                        (rev 0)
+++ xfce4-mixer/trunk/panel-plugin/xfce-mixer-plugin.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,156 @@
+/* $Id$ */
+/* vim:set et ai sw=2 sts=2: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>
+ * 
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4panel/xfce-panel-plugin.h>
+
+#include "xfce-volume-button.h"
+
+
+
+typedef struct _XfceMixerPlugin XfceMixerPlugin;
+
+
+
+/* Plugin structure */
+struct _XfceMixerPlugin
+{
+  XfcePanelPlugin *plugin;
+
+  GtkWidget       *hvbox;
+  GtkWidget       *button;
+};
+
+
+
+/* Function prototypes */
+static void             xfce_mixer_plugin_construct      (XfcePanelPlugin  *plugin);
+static XfceMixerPlugin *xfce_mixer_plugin_new            (XfcePanelPlugin  *plugin);
+static void             xfce_mixer_plugin_free           (XfcePanelPlugin  *plugin,
+                                                          XfceMixerPlugin  *mixer_plugin);
+static gboolean         xfce_mixer_plugin_size_changed   (XfcePanelPlugin  *plugin,
+                                                          gint              size,
+                                                          XfceMixerPlugin  *mixer_plugin);
+static void             xfce_mixer_plugin_volume_changed (XfceVolumeButton *button,
+                                                          gdouble           volume,
+                                                          XfceMixerPlugin  *mixer_plugin);
+
+
+
+/* Register the plugin */
+XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (xfce_mixer_plugin_construct);
+
+
+
+static XfceMixerPlugin*
+xfce_mixer_plugin_new (XfcePanelPlugin *plugin)
+{
+  XfceMixerPlugin *mixer_plugin;
+  GtkWidget       *button;
+
+  /* Allocate memory for the plugin structure */
+  mixer_plugin = panel_slice_new0 (XfceMixerPlugin);
+
+  /* Store pointer to the panel plugin */
+  mixer_plugin->plugin = plugin;
+
+  mixer_plugin->hvbox = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
+  gtk_container_add (GTK_CONTAINER (plugin), mixer_plugin->hvbox);
+  gtk_widget_show (mixer_plugin->hvbox);
+
+  mixer_plugin->button = xfce_volume_button_new ();
+  g_signal_connect (G_OBJECT (mixer_plugin->button), "volume-changed", G_CALLBACK (xfce_mixer_plugin_volume_changed), mixer_plugin);
+  gtk_container_add (GTK_CONTAINER (mixer_plugin->hvbox), mixer_plugin->button);
+  gtk_widget_show (mixer_plugin->button);
+
+  /* Connect to plugin signals */
+  g_signal_connect (G_OBJECT (plugin), "free-data", G_CALLBACK (xfce_mixer_plugin_free), mixer_plugin);
+  g_signal_connect (G_OBJECT (plugin), "size-changed", G_CALLBACK (xfce_mixer_plugin_size_changed), mixer_plugin);
+//  g_signal_connect (G_OBJECT (plugin), "configure", G_CALLBACK (xfce_mixer_plugin_configure), mixer_plugin);
+
+  return mixer_plugin;
+}
+
+
+
+static void
+xfce_mixer_plugin_free (XfcePanelPlugin *plugin,
+                        XfceMixerPlugin *mixer_plugin)
+{
+  panel_slice_free (XfceMixerPlugin, mixer_plugin);
+}
+
+
+
+static void
+xfce_mixer_plugin_construct (XfcePanelPlugin *plugin)
+{
+  XfceMixerPlugin *mixer_plugin;
+
+  /* Set up translation domain */
+  xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+
+  /* Create the plugin */
+  mixer_plugin = xfce_mixer_plugin_new (plugin);
+}
+
+
+
+static gboolean
+xfce_mixer_plugin_size_changed (XfcePanelPlugin *plugin,
+                                gint             size,
+                                XfceMixerPlugin *mixer_plugin)
+{
+  GtkOrientation orientation;
+
+  g_return_val_if_fail (plugin != NULL, FALSE);
+  g_return_val_if_fail (mixer_plugin != NULL, FALSE);
+
+  /* Determine the icon size for the volume button */
+  size -= 4 * MAX (mixer_plugin->button->style->xthickness, mixer_plugin->button->style->ythickness);
+
+  /* Update the volume button icon size */
+  xfce_volume_button_set_icon_size (XFCE_VOLUME_BUTTON (mixer_plugin->button), size);
+
+  /* Get the orientation of the panel */
+  orientation = xfce_panel_plugin_get_orientation (plugin);
+
+  /* TODO: Handle it */
+
+  return TRUE;
+}
+
+
+
+static void
+xfce_mixer_plugin_volume_changed (XfceVolumeButton *button,
+                                  gdouble           volume,
+                                  XfceMixerPlugin  *mixer_plugin)
+{
+  g_message ("volume changed to %f", volume);
+}

Added: xfce4-mixer/trunk/panel-plugin/xfce-volume-button.c
===================================================================
--- xfce4-mixer/trunk/panel-plugin/xfce-volume-button.c	                        (rev 0)
+++ xfce4-mixer/trunk/panel-plugin/xfce-volume-button.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,362 @@
+/* vi:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>.
+ *
+ * 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
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+
+#include <gdk/gdkkeysyms.h>
+
+#include "xfce-volume-button.h"
+
+
+
+/* Signal identifiers */
+enum
+{
+  VOLUME_CHANGED,
+  LAST_SIGNAL,
+};
+
+
+
+static guint button_signals[LAST_SIGNAL];
+
+static const char *icons[] = {
+  "audio-volume-muted",
+  "audio-volume-low",
+  "audio-volume-medium",
+  "audio-volume-high",
+  NULL
+};
+
+
+
+static void xfce_volume_button_class_init     (XfceVolumeButtonClass *klass);
+static void xfce_volume_button_init           (XfceVolumeButton      *button);
+static void xfce_volume_button_dispose        (GObject               *object);
+static void xfce_volume_button_finalize       (GObject               *object);
+static void xfce_volume_button_key_pressed    (GtkWidget             *widget,
+                                               GdkEventKey           *event,
+                                               XfceVolumeButton      *button);
+static void xfce_volume_button_enter          (GtkWidget             *widget,
+                                               GdkEventCrossing      *event);
+static void xfce_volume_button_leave          (GtkWidget             *widget,
+                                               GdkEventCrossing      *event);
+static void xfce_volume_button_update         (XfceVolumeButton      *button);
+static void xfce_volume_button_scrolled       (GtkWidget             *widget,
+                                               GdkEventScroll        *event,
+                                               XfceVolumeButton      *button);
+static void xfce_volume_button_volume_changed (XfceVolumeButton      *button,
+                                               gdouble                volume);
+
+
+
+struct _XfceVolumeButtonClass
+{
+  GtkButtonClass __parent__;
+
+  /* Signals */
+  void (*volume_changed) (XfceVolumeButton *button,
+                          gdouble           volume);
+};
+
+struct _XfceVolumeButton
+{
+  GtkButton __parent__;
+
+  gint       icon_size;
+
+  GtkWidget *image;
+
+  GtkObject *adjustment;
+};
+
+
+
+static GObjectClass *xfce_volume_button_parent_class = NULL;
+
+
+
+GType
+xfce_volume_button_get_type (void)
+{
+  static GType type = G_TYPE_INVALID;
+
+  if (G_UNLIKELY (type == G_TYPE_INVALID))
+    {
+      static const GTypeInfo info = 
+        {
+          sizeof (XfceVolumeButtonClass),
+          NULL,
+          NULL,
+          (GClassInitFunc) xfce_volume_button_class_init,
+          NULL,
+          NULL,
+          sizeof (XfceVolumeButton),
+          0,
+          (GInstanceInitFunc) xfce_volume_button_init,
+          NULL,
+        };
+
+      type = g_type_register_static (GTK_TYPE_BUTTON, "XfceVolumeButton", &info, 0);
+    }
+  
+  return type;
+}
+
+
+
+static void
+xfce_volume_button_class_init (XfceVolumeButtonClass *klass)
+{
+  GObjectClass *gobject_class;
+
+  /* Determine parent type class */
+  xfce_volume_button_parent_class = g_type_class_peek_parent (klass);
+
+  gobject_class = G_OBJECT_CLASS (klass);
+  gobject_class->dispose = xfce_volume_button_dispose;
+  gobject_class->finalize = xfce_volume_button_finalize;
+
+  klass->volume_changed = xfce_volume_button_volume_changed;
+
+  button_signals[VOLUME_CHANGED] = g_signal_new ("volume-changed",
+                                                 G_TYPE_FROM_CLASS (klass),
+                                                 G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                                                 G_STRUCT_OFFSET (XfceVolumeButtonClass, volume_changed),
+                                                 NULL, 
+                                                 NULL,
+                                                 g_cclosure_marshal_VOID__DOUBLE,
+                                                 G_TYPE_NONE, 
+                                                 1, 
+                                                 G_TYPE_DOUBLE);
+}
+
+
+
+static void
+xfce_volume_button_init (XfceVolumeButton *button)
+{
+  button->adjustment = gtk_adjustment_new (0.0, 0.0, 1.0, 0.1, 0.1, 0.2);
+  button->image = gtk_image_new ();
+
+  button->icon_size = GTK_ICON_SIZE_SMALL_TOOLBAR;
+
+  gtk_container_add (GTK_CONTAINER (button), button->image);
+  gtk_widget_show (button->image);
+
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+
+  g_signal_connect (G_OBJECT (button), "key-press-event", G_CALLBACK (xfce_volume_button_key_pressed), button);
+  g_signal_connect (G_OBJECT (button), "enter-notify-event", G_CALLBACK (xfce_volume_button_enter), NULL);
+  g_signal_connect (G_OBJECT (button), "leave-notify-event", G_CALLBACK (xfce_volume_button_leave), NULL);
+  g_signal_connect (G_OBJECT (button), "scroll-event", G_CALLBACK (xfce_volume_button_scrolled), button);
+
+  xfce_volume_button_update (button);
+}
+
+
+
+static void
+xfce_volume_button_dispose (GObject *object)
+{
+  (*G_OBJECT_CLASS (xfce_volume_button_parent_class)->dispose) (object);
+}
+
+
+
+static void
+xfce_volume_button_finalize (GObject *object)
+{
+  XfceVolumeButton *button = XFCE_VOLUME_BUTTON (object);
+
+  (*G_OBJECT_CLASS (xfce_volume_button_parent_class)->finalize) (object);
+}
+
+
+
+GtkWidget*
+xfce_volume_button_new (void)
+{
+  return g_object_new (TYPE_XFCE_VOLUME_BUTTON, NULL);
+}
+
+
+
+static void 
+xfce_volume_button_key_pressed (GtkWidget        *widget,
+                                GdkEventKey      *event,
+                                XfceVolumeButton *button)
+{
+  gdouble value;
+  gdouble step_increment;
+  gdouble page_size;
+
+  g_return_if_fail (IS_XFCE_VOLUME_BUTTON (button));
+
+  g_object_get (G_OBJECT (button->adjustment), "value", &value, "step-increment", &step_increment, "page-size", &page_size, NULL);
+
+  switch (event->keyval)
+    {
+      case GDK_plus:
+        gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), value + step_increment);
+        break;
+      case GDK_minus:
+        gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), value - step_increment);
+        break;
+      case GDK_Page_Up:
+        gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), value + page_size);
+        break;
+      case GDK_Page_Down:
+        gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), value - page_size);
+        break;
+    }
+
+  xfce_volume_button_update (button);
+
+  g_signal_emit_by_name (button, "volume-changed", gtk_adjustment_get_value (GTK_ADJUSTMENT (button->adjustment)));
+}
+
+
+
+static void 
+xfce_volume_button_enter (GtkWidget        *widget,
+                          GdkEventCrossing *event)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  if (!GTK_WIDGET_HAS_FOCUS (widget))
+    {
+      gtk_widget_grab_focus (widget);
+      gtk_grab_add (widget);
+      gdk_pointer_grab (widget->window, TRUE, GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK|GDK_POINTER_MOTION_MASK|GDK_SCROLL_MASK, NULL, NULL, GDK_CURRENT_TIME);
+      gdk_keyboard_grab (widget->window, TRUE, GDK_CURRENT_TIME);
+      gtk_widget_set_state (widget, GTK_STATE_SELECTED);
+    }
+}
+
+
+
+static void 
+xfce_volume_button_leave (GtkWidget        *widget,
+                          GdkEventCrossing *event)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+
+  if (GTK_WIDGET_HAS_FOCUS (widget))
+    {
+      gdk_keyboard_ungrab (GDK_CURRENT_TIME);
+      gdk_pointer_ungrab (GDK_CURRENT_TIME);
+      gtk_grab_remove (widget);
+    }
+}
+
+
+
+static void 
+xfce_volume_button_scrolled (GtkWidget        *widget,
+                             GdkEventScroll   *event,
+                             XfceVolumeButton *button)
+{
+  gdouble value;
+  gdouble step_increment;
+
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (IS_XFCE_VOLUME_BUTTON (button));
+
+  g_object_get (G_OBJECT (button->adjustment), "value", &value, "step-increment", &step_increment, NULL);
+
+  switch (event->direction)
+    {
+      case GDK_SCROLL_UP:
+      case GDK_SCROLL_RIGHT:
+        gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), value + step_increment);
+        break;
+      case GDK_SCROLL_DOWN:
+      case GDK_SCROLL_LEFT:
+        gtk_adjustment_set_value (GTK_ADJUSTMENT (button->adjustment), value - step_increment);
+        break;
+    }
+
+  xfce_volume_button_update (button);
+
+  g_signal_emit_by_name (button, "volume-changed", gtk_adjustment_get_value (GTK_ADJUSTMENT (button->adjustment)));
+}
+
+
+
+static void 
+xfce_volume_button_update (XfceVolumeButton *button)
+{
+  GdkPixbuf *pixbuf = NULL;
+  gdouble    upper;
+  gdouble    lower;
+  gdouble    value;
+  gdouble    range;
+  gint       i;
+
+  g_return_if_fail (IS_XFCE_VOLUME_BUTTON (button));
+
+  g_object_get (G_OBJECT (button->adjustment), "upper", &upper, "lower", &lower, "value", &value, NULL);
+
+  range = (upper - lower) / (G_N_ELEMENTS (icons) - 2);
+
+  if (value == 0)
+    pixbuf = xfce_themed_icon_load (icons[0], button->icon_size);
+  else
+    {
+      for (i = 1; i < G_N_ELEMENTS (icons) - 1; ++i)
+        if (value <= range * i)
+          {
+            pixbuf = xfce_themed_icon_load (icons[i], button->icon_size);
+            break;
+          }
+    }
+
+  if (G_LIKELY (pixbuf != NULL))
+    {
+      gtk_image_set_from_pixbuf (GTK_IMAGE (button->image), pixbuf);
+      g_object_unref (G_OBJECT (pixbuf));
+    }
+}
+
+
+
+void
+xfce_volume_button_set_icon_size (XfceVolumeButton *button,
+                                  gint              size)
+{
+  g_return_if_fail (IS_XFCE_VOLUME_BUTTON (button));
+
+  button->icon_size = size;
+
+  xfce_volume_button_update (button);
+}
+
+
+
+static void
+xfce_volume_button_volume_changed (XfceVolumeButton *button,
+                                   gdouble           volume)
+{
+}

Added: xfce4-mixer/trunk/panel-plugin/xfce-volume-button.h
===================================================================
--- xfce4-mixer/trunk/panel-plugin/xfce-volume-button.h	                        (rev 0)
+++ xfce4-mixer/trunk/panel-plugin/xfce-volume-button.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,47 @@
+/* vi:set sw=2 sts=2 ts=2 et ai: */
+/*-
+ * Copyright (c) 2008 Jannis Pohlmann <jannis at xfce.org>.
+ *
+ * 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 __XFCE_VOLUME_BUTTON_H__
+#define __XFCE_VOLUME_BUTTON_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS;
+
+typedef struct _XfceVolumeButtonClass XfceVolumeButtonClass;
+typedef struct _XfceVolumeButton      XfceVolumeButton;
+
+#define TYPE_XFCE_VOLUME_BUTTON            (xfce_volume_button_get_type ())
+#define XFCE_VOLUME_BUTTON(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_XFCE_VOLUME_BUTTON, XfceVolumeButton))
+#define XFCE_VOLUME_BUTTON_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_XFCE_VOLUME_BUTTON, XfceVolumeButtonClass))
+#define IS_XFCE_VOLUME_BUTTON(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_XFCE_VOLUME_BUTTON))
+#define IS_XFCE_VOLUME_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_XFCE_VOLUME_BUTTON))
+#define XFCE_VOLUME_BUTTON_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_XFCE_VOLUME_BUTTON, XfceVolumeButtonClass))
+
+GType     xfce_volume_button_get_type       (void) G_GNUC_CONST;
+
+GtkWidget *xfce_volume_button_new           (void);
+
+void       xfce_volume_button_set_icon_size (XfceVolumeButton *button,
+                                             gint              size);
+
+G_END_DECLS;
+
+#endif /* !__XFCE_VOLUME_BUTTON_H__ */

Added: xfce4-mixer/trunk/panel-plugin/xfce4-mixer-plugin.desktop.in.in
===================================================================
--- xfce4-mixer/trunk/panel-plugin/xfce4-mixer-plugin.desktop.in.in	                        (rev 0)
+++ xfce4-mixer/trunk/panel-plugin/xfce4-mixer-plugin.desktop.in.in	2008-06-19 15:08:24 UTC (rev 27087)
@@ -0,0 +1,8 @@
+[Xfce Panel]
+Type=X-XFCE-PanelPlugin
+Encoding=UTF-8
+_Name=Mixer
+_Comment=Volume control for your sound card
+Icon=xfce4-mixer-plugin
+X-XFCE-Exec=@libexecdir@/xfce4/panel-plugins/xfce4-mixer-plugin
+X-XFCE-Unique=false

Deleted: xfce4-mixer/trunk/po/xfce4-mixer.pot

Modified: xfce4-mixer/trunk/xfce4-mixer/Makefile.am
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/Makefile.am	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/Makefile.am	2008-06-19 15:08:24 UTC (rev 27087)
@@ -6,12 +6,6 @@
 
 xfce4_mixer_SOURCES =							\
 	main.c								\
-	xfce-mixer-card.c						\
-	xfce-mixer-card.h						\
-	xfce-mixer-stock.c						\
-	xfce-mixer-stock.h						\
-	xfce-mixer-track-type.c						\
-	xfce-mixer-track-type.h						\
 	xfce-mixer-track.c						\
 	xfce-mixer-track.h						\
 	xfce-mixer-switch.c						\
@@ -20,8 +14,6 @@
 	xfce-mixer-option.h						\
 	xfce-mixer.c							\
 	xfce-mixer.h							\
-	xfce-mixer-preferences.c					\
-	xfce-mixer-preferences.h					\
 	xfce-mixer-controls-dialog.c					\
 	xfce-mixer-controls-dialog.h					\
 	xfce-mixer-window.h						\
@@ -32,20 +24,23 @@
 	-I$(top_srcdir)							\
 	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
 	-DDATADIR=\"$(datadir)\"					\
-	@GLIB_CFLAGS@							\
-	@GTHREAD_CFLAGS@						\
-	@GST_PLUGINS_BASE_CFLAGS@					\
-	@GTK_CFLAGS@							\
-	@LIBXFCE4UTIL_CFLAGS@						\
-	@LIBXFCEGUI4_CFLAGS@						
+	$(GLIB_CFLAGS)							\
+	$(GTK_CFLAGS)							\
+	$(LIBXFCE4UTIL_CFLAGS)						\
+	$(LIBXFCEGUI4_CFLAGS)						\				
+	$(GST_PLUGINS_BASE_CFLAGS)
 
+xfce4_mixer_DEPENDENCIES = 						\
+	$(top_builddir)/libxfce4mixer/libxfce4mixer.la
+	
 xfce4_mixer_LDFLAGS = 							\
-	@GLIB_LIBS@							\
-	@GTHREAD_LIBS@							\
-	@GST_PLUGINS_BASE_LIBS@						\
-	@GTK_LIBS@							\
-	@LIBXFCE4UTIL_LIBS@						\
-	@LIBXFCEGUI4_LIBS@						\
+	$(top_builddir)/libxfce4mixer/libxfce4mixer.la			\
+	$(GLIB_LIBS)							\
+	$(GTHREAD_LIBS)							\
+	$(GST_PLUGINS_BASE_LIBS)					\
+	$(GTK_LIBS)							\
+	$(LIBXFCE4UTIL_LIBS)						\
+	$(LIBXFCEGUI4_LIBS)						\
 	-lgstaudio-0.10							\
 	-lgstinterfaces-0.10
 

Modified: xfce4-mixer/trunk/xfce4-mixer/main.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/main.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/main.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -32,7 +32,7 @@
 
 #include <gst/gst.h>
 
-#include "xfce-mixer-stock.h"
+#include "libxfce4mixer/xfce-mixer-stock.h"
 #include "xfce-mixer-window.h"
 
 

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-card.c

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-card.h

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-controls-dialog.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-controls-dialog.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-controls-dialog.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -30,8 +30,8 @@
 #include <gst/interfaces/mixer.h>
 
 #include "xfce-mixer-window.h"
-#include "xfce-mixer-preferences.h"
 #include "xfce-mixer-controls-dialog.h"
+#include "libxfce4mixer/xfce-mixer-preferences.h"
 
 
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -30,7 +30,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include "xfce-mixer-option.h"
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.h
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.h	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-option.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -25,7 +25,7 @@
 #include <gtk/gtk.h>
 #include <gst/interfaces/mixer.h>
 
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 G_BEGIN_DECLS;
 

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-preferences.c

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-preferences.h

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-stock.c

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-stock.h

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -30,7 +30,7 @@
 #include <gst/interfaces/mixer.h>
 
 #include "xfce-mixer-switch.h"
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.h
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.h	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-switch.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -25,7 +25,7 @@
 #include <gtk/gtk.h>
 #include <gst/interfaces/mixer.h>
 
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 G_BEGIN_DECLS;
 

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track-type.c

Deleted: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track-type.h

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -29,10 +29,10 @@
 #include <gst/gst.h>
 #include <gst/interfaces/mixer.h>
 
-#include "xfce-mixer-stock.h"
+#include "libxfce4mixer/xfce-mixer-stock.h"
 #include "xfce-mixer-track.h"
-#include "xfce-mixer-track-type.h"
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-track-type.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.h
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.h	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-track.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -25,7 +25,7 @@
 #include <gtk/gtk.h>
 #include <gst/interfaces/mixer.h>
 
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 G_BEGIN_DECLS;
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -32,9 +32,9 @@
 
 #include "xfce-mixer-window.h"
 #include "xfce-mixer.h"
-#include "xfce-mixer-preferences.h"
 #include "xfce-mixer-controls-dialog.h"
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-preferences.h"
 
 
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.h
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.h	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer-window.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -25,7 +25,7 @@
 #include <gtk/gtk.h>
 #include <gst/interfaces/mixer.h>
 
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 G_BEGIN_DECLS;
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.c
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.c	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.c	2008-06-19 15:08:24 UTC (rev 27087)
@@ -30,11 +30,11 @@
 #include <gst/interfaces/mixer.h>
 
 #include "xfce-mixer.h"
-#include "xfce-mixer-track-type.h"
+#include "libxfce4mixer/xfce-mixer-track-type.h"
 #include "xfce-mixer-track.h"
 #include "xfce-mixer-switch.h"
 #include "xfce-mixer-option.h"
-#include "xfce-mixer-preferences.h"
+#include "libxfce4mixer/xfce-mixer-preferences.h"
 
 
 

Modified: xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.h
===================================================================
--- xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.h	2008-06-19 08:18:09 UTC (rev 27086)
+++ xfce4-mixer/trunk/xfce4-mixer/xfce-mixer.h	2008-06-19 15:08:24 UTC (rev 27087)
@@ -25,7 +25,7 @@
 #include <gtk/gtk.h>
 #include <gst/interfaces/mixer.h>
 
-#include "xfce-mixer-card.h"
+#include "libxfce4mixer/xfce-mixer-card.h"
 
 G_BEGIN_DECLS;
 



More information about the Xfce4-commits mailing list