changeset 3012:d891850c4042 trunk

branch merge
author Tomasz Mon <desowin@gmail.com>
date Mon, 09 Jul 2007 12:08:39 +0200
parents 99865f696f13 (current diff) 2897d744d87a (diff)
children 034d16dfdd44 e84073b61ba5
files src/audacious/widgets/number.c src/audacious/widgets/number.h
diffstat 7 files changed, 81 insertions(+), 126 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Mon Jul 09 12:07:13 2007 +0200
+++ b/configure.ac	Mon Jul 09 12:08:39 2007 +0200
@@ -101,9 +101,9 @@
 
 dnl Check for libmowgli.
 
-PKG_CHECK_MODULES(MOWGLI, [libmowgli >= 0.1],
-    [ADD_PC_REQUIRES([libmowgli >= 0.1])],
-    [AC_MSG_ERROR([Cannot find libmowgli: try http://sacredspiral.co.uk/~nenolod/mowgli])]
+PKG_CHECK_MODULES(MOWGLI, [libmowgli >= 0.3],
+    [ADD_PC_REQUIRES([libmowgli >= 0.3])],
+    [AC_MSG_ERROR([Cannot find libmowgli: try http://www.atheme-project.org/projects/mowgli.shtml])]
 )
 
 dnl Check for libglade
--- a/src/audacious/Makefile	Mon Jul 09 12:07:13 2007 +0200
+++ b/src/audacious/Makefile	Mon Jul 09 12:08:39 2007 +0200
@@ -44,6 +44,7 @@
 	input.h \
 	hook.h \
 	main.h \
+	mime.h \
 	output.h \
 	playlist.h \
 	playlist_container.h \
@@ -79,6 +80,7 @@
 	logger.c \
 	main.c \
 	memorypool.c \
+	mime.c \
 	output.c \
 	pixbuf_effects.c \
 	playback.c \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audacious/mime.c	Mon Jul 09 12:08:39 2007 +0200
@@ -0,0 +1,40 @@
+/*
+ * Audacious
+ * Copyright (c) 2007 William Pitcock
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "mime.h"
+
+mowgli_dictionary_t *mime_type_dict = NULL;
+
+void mime_set_plugin(const gchar *mimetype, InputPlugin *ip)
+{
+	g_return_if_fail(mimetype != NULL);
+	g_return_if_fail(ip != NULL);
+
+	if (mime_type_dict == NULL)
+		mime_type_dict = mowgli_dictionary_create(strcasecmp);
+
+	mowgli_dictionary_add(mime_type_dict, mimetype, ip);
+}
+
+InputPlugin *mime_get_plugin(const gchar *mimetype)
+{
+	if (mime_type_dict == NULL)
+		return NULL;
+
+	return mowgli_dictionary_retrieve(mime_type_dict, mimetype);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/audacious/mime.h	Mon Jul 09 12:08:39 2007 +0200
@@ -0,0 +1,34 @@
+/*
+ * Audacious
+ * Copyright (c) 2007 William Pitcock
+ *
+ * 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; under version 2 of the License.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include <glib.h>
+#include <mowgli.h>
+
+#include <audacious/plugin.h>
+
+#ifndef __AUDACIOUS_MIME_H__
+#define __AUDACIOUS_MIME_H__
+
+G_BEGIN_DECLS
+
+InputPlugin *mime_get_plugin(const gchar *mimetype);
+void mime_set_plugin(const gchar *mimetype, InputPlugin *ip);
+
+G_END_DECLS
+
+#endif
--- a/src/audacious/plugin.h	Mon Jul 09 12:07:13 2007 +0200
+++ b/src/audacious/plugin.h	Mon Jul 09 12:08:39 2007 +0200
@@ -287,4 +287,6 @@
 
 G_END_DECLS
 
+#include "audacious/mime.h"
+
 #endif
--- a/src/audacious/widgets/number.c	Mon Jul 09 12:07:13 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*  BMP - Cross-platform multimedia player
- *  Copyright (C) 2003-2004  BMP development team.
- *
- *  Based on XMMS:
- *  Copyright (C) 1998-2003  XMMS development team.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "widgetcore.h"
-
-#include <glib.h>
-#include <gdk/gdk.h>
-
-#include "skin.h"
-
-void
-number_set_number(Number * nu,
-                  gint number)
-{
-    if (number == nu->nu_number)
-        return;
-
-    nu->nu_number = number;
-    widget_draw(WIDGET(nu));
-}
-
-void
-number_draw(Widget * w)
-{
-    Number *nu = NUMBER(w);
-    GdkPixmap *obj;
-
-    obj = nu->nu_widget.parent;
-
-    if (nu->nu_number <= 11)
-        skin_draw_pixmap(bmp_active_skin, obj, nu->nu_widget.gc,
-                         nu->nu_skin_index, nu->nu_number * 9, 0,
-                         nu->nu_widget.x, nu->nu_widget.y, 9, 13);
-    else
-        skin_draw_pixmap(bmp_active_skin, obj, nu->nu_widget.gc,
-                         nu->nu_skin_index, 90, 0, nu->nu_widget.x,
-                         nu->nu_widget.y, 9, 13);
-}
-
-Number *
-create_number(GList ** wlist,
-              GdkPixmap * parent,
-              GdkGC * gc,
-              gint x, gint y,
-              SkinPixmapId si)
-{
-    Number *nu;
-
-    nu = g_new0(Number, 1);
-    widget_init(&nu->nu_widget, parent, gc, x, y, 9, 13, 1);
-    nu->nu_widget.draw = number_draw;
-    nu->nu_number = 10;
-    nu->nu_skin_index = si;
-
-    widget_list_add(wlist, WIDGET(nu));
-    return nu;
-}
--- a/src/audacious/widgets/number.h	Mon Jul 09 12:07:13 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*  BMP - Cross-platform multimedia player
- *  Copyright (C) 2003-2004  BMP development team.
- *
- *  Based on XMMS:
- *  Copyright (C) 1998-2003  XMMS development team.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#ifndef _WIDGETCORE_H_
-#error Please do not include me directly! Use widgetcore.h instead!
-#endif
-
-#ifndef NUMBER_H
-#define NUMBER_H
-
-#include <glib.h>
-#include <gdk/gdk.h>
-
-#include "widget.h"
-#include "skin.h"
-
-#define NUMBER(x) ((Number *)(x))
-struct _Number {
-    Widget nu_widget;
-    gint nu_number;
-    SkinPixmapId nu_skin_index;
-};
-
-typedef struct _Number Number;
-
-void number_set_number(Number * nu, gint number);
-Number *create_number(GList ** wlist, GdkPixmap * parent, GdkGC * gc,
-                      gint x, gint y, SkinPixmapId si);
-
-#endif