Mercurial > audlegacy-plugins
changeset 1968:10705f679abe
Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author | Calin Crisan ccrisan@gmail.com |
---|---|
date | Wed, 03 Oct 2007 02:53:44 +0300 |
parents | 600972dea2ac (current diff) f85a079573c3 (diff) |
children | 7ada85b64e90 |
files | |
diffstat | 21 files changed, 67 insertions(+), 97 deletions(-) [+] |
line wrap: on
line diff
--- a/src/OSS/configure.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/OSS/configure.c Wed Oct 03 02:53:44 2007 +0300 @@ -27,7 +27,6 @@ #include <string.h> #include <audacious/configdb.h> -#include <audacious/vfs.h> #include <audacious/i18n.h>
--- a/src/cue/cuesheet.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/cue/cuesheet.c Wed Oct 03 02:53:44 2007 +0300 @@ -26,7 +26,6 @@ #include <audacious/plugin.h> #include <audacious/output.h> #include <audacious/playlist.h> -#include <audacious/vfs.h> #include <audacious/util.h> #include <audacious/strings.h> #include <audacious/main.h>
--- a/src/daap/daap.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/daap/daap.c Wed Oct 03 02:53:44 2007 +0300 @@ -20,7 +20,6 @@ #include <glib.h> -#include <audacious/vfs.h> #include <audacious/plugin.h> #include <audacious/discovery.h>
--- a/src/dockalbumart/dockalbumart.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/dockalbumart/dockalbumart.c Wed Oct 03 02:53:44 2007 +0300 @@ -30,7 +30,6 @@ #include <audacious/plugin.h> #include <audacious/util.h> #include <audacious/playlist.h> -#include <audacious/tuple.h> #include "audacious_player.xpm"
--- a/src/flacng/flacng.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/flacng/flacng.h Wed Oct 03 02:53:44 2007 +0300 @@ -19,12 +19,11 @@ #ifndef FLACNG_H #define FLACNG_H +#include "config.h" #include <glib.h> #include <audacious/plugin.h> #include <audacious/main.h> -#include <audacious/vfs.h> #include <audacious/i18n.h> -# include "config.h" #define OUTPUT_BLOCK_SIZE (8192u) #define MAX_SUPPORTED_CHANNELS (2u)
--- a/src/flacng/plugin.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/flacng/plugin.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "flacng.h" #include <audacious/util.h> #include <audacious/output.h> #include <glib/gi18n.h> -#include "flacng.h" #include "tools.h" #include "plugin.h" #include "seekable_stream_callbacks.h"
--- a/src/ladspa/ladspa.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/ladspa/ladspa.c Wed Oct 03 02:53:44 2007 +0300 @@ -18,6 +18,8 @@ /* BMP-ladspa port by Giacomo Lozito <city_hunter@users.sf.net> */ +#include "config.h" + #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -31,7 +33,6 @@ #include <audacious/configdb.h> #include <audacious/i18n.h> -#include "../../config.h" #include "ladspa.h" #ifndef PATH_MAX
--- a/src/madplug/plugin.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/madplug/plugin.h Wed Oct 03 02:53:44 2007 +0300 @@ -40,7 +40,6 @@ #include <audacious/main.h> #include <audacious/util.h> #include <audacious/strings.h> -#include <audacious/vfs.h> #include <audacious/i18n.h> #include <audacious/id3tag.h> #include <mad.h>
--- a/src/metronom/metronom.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/metronom/metronom.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,10 +17,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" #include <audacious/plugin.h> #include <audacious/util.h> #include <audacious/i18n.h> -#include "../../config.h" #include <glib.h> #include <string.h>
--- a/src/mms/mms.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/mms/mms.c Wed Oct 03 02:53:44 2007 +0300 @@ -18,7 +18,6 @@ #include <glib.h> -#include <audacious/vfs.h> #include <audacious/plugin.h> #include <stdio.h>
--- a/src/modplug/sndmix.cxx Wed Oct 03 02:47:26 2007 +0300 +++ b/src/modplug/sndmix.cxx Wed Oct 03 02:53:44 2007 +0300 @@ -307,7 +307,6 @@ } else { m_nMixStat += CreateStereoMix(lCount); - if (nMaxPlugins) ProcessPlugins(lCount); ProcessStereoDSP(lCount); X86_MonoFromStereo(MixSoundBuffer, lCount); }
--- a/src/modplug/stdafx.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/modplug/stdafx.h Wed Oct 03 02:53:44 2007 +0300 @@ -19,8 +19,6 @@ #include <mmsystem.h> #include <stdio.h> -inline void ProcessPlugins(int n) {} - #elif defined(__x86_64__) || defined(__powerpc64__) #include <stdlib.h> @@ -74,8 +72,6 @@ return p; } -inline void ProcessPlugins(int n) {} - #define GlobalFreePtr(p) free((void *)(p)) #define strnicmp(a,b,c) strncasecmp(a,b,c) @@ -152,8 +148,6 @@ return p; } -inline void ProcessPlugins(int n) {} - #define GlobalFreePtr(p) free((void *)(p)) #define strnicmp(a,b,c) strncasecmp(a,b,c)
--- a/src/neon/neon.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/neon/neon.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,7 +17,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <audacious/vfs.h> +#include "neon.h" + #include <audacious/plugin.h> #include <audacious/configdb.h> @@ -28,7 +29,6 @@ #include <ne_auth.h> #include "debug.h" -#include "neon.h" #include "rb.h" #define NBUFSIZ (128u*1024u)
--- a/src/neon/neon.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/neon/neon.h Wed Oct 03 02:53:44 2007 +0300 @@ -20,6 +20,8 @@ #ifndef _NEON_PLUGIN_H #define _NEON_PLUGIN_H +#include "config.h" + #include <glib.h> #include <audacious/vfs.h> #include <ne_session.h>
--- a/src/pls/pls.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/pls/pls.c Wed Oct 03 02:53:44 2007 +0300 @@ -36,7 +36,6 @@ #include <audacious/playlist.h> #include <audacious/playlist_container.h> #include <audacious/plugin.h> -#include <audacious/vfs.h> #include <audacious/strings.h> static void
--- a/src/shnplug/id3v2.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/shnplug/id3v2.c Wed Oct 03 02:53:44 2007 +0300 @@ -20,13 +20,10 @@ * $Id: id3v2.c,v 1.6 2007/03/23 05:49:48 jason Exp $ */ +#include "config.h" #include <stdio.h> #include "shorten.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #define ID3V2_MAGIC "ID3" typedef struct {
--- a/src/shnplug/shorten.h Wed Oct 03 02:47:26 2007 +0300 +++ b/src/shnplug/shorten.h Wed Oct 03 02:53:44 2007 +0300 @@ -13,9 +13,7 @@ #ifndef _SHORTEN_H #define _SHORTEN_H -#ifdef HAVE_CONFIG_H #include "config.h" -#endif #include <stdlib.h> #include <pthread.h>
--- a/src/smb/smb.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/smb/smb.c Wed Oct 03 02:53:44 2007 +0300 @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "config.h" #include <audacious/plugin.h> #include <stdio.h>
--- a/src/tonegen/tonegen.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/tonegen/tonegen.c Wed Oct 03 02:53:44 2007 +0300 @@ -17,11 +17,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "config.h" #include <audacious/plugin.h> #include <audacious/output.h> #include <audacious/util.h> #include <audacious/i18n.h> -#include "config.h" #include <glib.h> #include <stdlib.h> #include <string.h>
--- a/src/tta/libtta.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/tta/libtta.c Wed Oct 03 02:53:44 2007 +0300 @@ -45,7 +45,6 @@ #include <audacious/output.h> #include <audacious/strings.h> #include <audacious/i18n.h> - #include <audacious/id3tag.h> #define PLUGIN_VERSION "1.4"
--- a/src/xspf/xspf.c Wed Oct 03 02:47:26 2007 +0300 +++ b/src/xspf/xspf.c Wed Oct 03 02:53:44 2007 +0300 @@ -30,11 +30,11 @@ #include <sys/stat.h> #include <sys/errno.h> +#include <audacious/plugin.h> #include <audacious/main.h> #include <audacious/util.h> #include <audacious/playlist.h> #include <audacious/playlist_container.h> -#include <audacious/plugin.h> #include <libxml/tree.h> #include <libxml/parser.h> @@ -78,14 +78,22 @@ static const gint xspf_nentries = (sizeof(xspf_entries) / sizeof(xspf_entry_t)); +#ifdef DEBUG +# define XSDEBUG(...) { fprintf(stderr, "xspf[%s:%d]: ", __FUNCTION__, (int) __LINE__); fprintf(stderr, __VA_ARGS__); } +#else +# define XSDEBUG(...) /* stub */ +#endif + + static gboolean is_uri(gchar *uri) { - if(strstr(uri, "://")) + if (strstr(uri, "://")) return TRUE; else return FALSE; } + /* This function is taken from libxml2-2.6.27. */ static xmlChar *xspf_path_to_uri(const xmlChar *path) @@ -115,7 +123,8 @@ } -static void xspf_add_file(xmlNode *track, const gchar *filename, gint pos, const gchar *base) +static void xspf_add_file(xmlNode *track, const gchar *filename, + gint pos, const gchar *base) { xmlNode *nptr; Tuple *tuple; @@ -196,10 +205,9 @@ tuple_associate_string(tuple, FIELD_FILE_EXT, NULL, strrchr(location, '.')); -#ifdef DEBUG - printf("xspf: tuple->file_name = %s\n", tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); - printf("xspf: tuple->file_path = %s\n", tuple_get_string(tuple, FIELD_FILE_PATH, NULL)); -#endif + XSDEBUG("tuple->file_name = %s\n", tuple_get_string(tuple, FIELD_FILE_NAME, NULL)); + XSDEBUG("tuple->file_path = %s\n", tuple_get_string(tuple, FIELD_FILE_PATH, NULL)); + // add file to playlist uri = g_filename_to_uri(location, NULL, NULL); // uri would be NULL if location is already uri. --yaz @@ -212,7 +220,8 @@ } -static void xspf_find_track(xmlNode *tracklist, const gchar *filename, gint pos, const gchar *base) +static void xspf_find_track(xmlNode *tracklist, const gchar *filename, + gint pos, const gchar *base) { xmlNode *nptr; @@ -242,7 +251,6 @@ playlist->attribute ^= PLAYLIST_STATIC; xmlFree(opt); - opt = NULL; } } } @@ -252,39 +260,37 @@ { xmlDocPtr doc; xmlNode *nptr, *nptr2; - gchar *tmp = NULL, *base = NULL; g_return_if_fail(filename != NULL); -#ifdef DEBUG - printf("playlist_load_xspf: filename = %s\n", filename); -#endif + XSDEBUG("filename='%s', pos=%d\n", filename, pos); doc = xmlRecoverFile(filename); - if(doc == NULL) + if (doc == NULL) return; // find trackList for (nptr = doc->children; nptr != NULL; nptr = nptr->next) { if (nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"playlist")) { + gchar *tmp, *base; + base = (gchar *)xmlNodeGetBase(doc, nptr); -#ifdef DEBUG - printf("playlist_load_xspf: base @1 = %s\n", base); -#endif + + XSDEBUG("base @1 = %s\n", base); + // if filename is specified as a base, ignore it. tmp = xmlURIUnescapeString(base, -1, NULL); - if(tmp) { - if(!strcmp(tmp, filename)) { + if (tmp) { + if (!strcmp(tmp, filename)) { xmlFree(base); base = NULL; } g_free(tmp); - tmp = NULL; } -#ifdef DEBUG - printf("playlist_load_xspf: base @2 = %s\n", base); -#endif + + XSDEBUG("base @2 = %s\n", base); + for (nptr2 = nptr->children; nptr2 != NULL; nptr2 = nptr2->next) { if (nptr2->type == XML_ELEMENT_NODE && @@ -306,7 +312,7 @@ } xmlFree(title); } else - if(nptr2->type == XML_ELEMENT_NODE && + if (nptr2->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr2->name, (xmlChar *)"trackList")) { xspf_find_track(nptr2, filename, pos, base); } @@ -317,9 +323,9 @@ } -static void xspf_add_node( - xmlNodePtr node, TupleValueType type, gboolean isMeta, - const gchar *xspfName, const gchar *strVal, const gint intVal) +static void xspf_add_node(xmlNodePtr node, TupleValueType type, + gboolean isMeta, const gchar *xspfName, const gchar *strVal, + const gint intVal) { gchar tmps[64]; xmlNodePtr tmp; @@ -357,9 +363,7 @@ gchar *base = NULL; Playlist *playlist = playlist_get_active(); -#ifdef DEBUG - printf("playlist_save_xspf: filename = %s\n", filename); -#endif + XSDEBUG("filename='%s', pos=%d\n", filename, pos); doc = xmlNewDoc((xmlChar *)"1.0"); doc->charset = XML_CHAR_ENCODING_UTF8; @@ -381,15 +385,13 @@ gint tmplen = 0; if (!is_uri(entry->filename)) { //obsolete - gchar *tmp2; - tmp2 = g_path_get_dirname(entry->filename); + gchar *tmp2 = g_path_get_dirname(entry->filename); tmp = g_strdup_printf("%s/", tmp2); g_free(tmp2); - } else { + } else tmp = g_strdup(entry->filename); - } - if(!base) { + if (!base) { base = strdup(tmp); baselen = strlen(base); } @@ -409,43 +411,34 @@ g_free(base); base = tmp; baselen = tmplen; -#ifdef DEBUG - printf("base = \"%s\" baselen = %d\n", base, baselen); -#endif - } - else { + XSDEBUG("base='%s', baselen=%d\n", base, baselen); + } else g_free(tmp); - tmp = NULL; - } } /* set base URI */ if (base) { gchar *tmp; - if(!is_uri(base)) { + if (!is_uri(base)) { tmp = (gchar *) xspf_path_to_uri((xmlChar *)base); - if(tmp) { + if (tmp) { g_free(base); base = tmp; } } - if(!is_uri(base)) { -#ifdef DEBUG - printf("base is not uri. something is wrong.\n"); -#endif + if (!is_uri(base)) { + XSDEBUG("base is not uri. something is wrong.\n"); tmp = g_strdup_printf("file://%s", base); xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)tmp); g_free(tmp); - } - else + } else xmlSetProp(rootnode, (xmlChar *)"xml:base", (xmlChar *)base); } } /* USE_RELATIVE */ /* common */ xmlDocSetRootElement(doc, rootnode); - xspf_add_node(rootnode, TUPLE_STRING, FALSE, "creator", PACKAGE "-" VERSION, 0); /* add staticlist marker */ @@ -471,7 +464,7 @@ tracklist = xmlNewNode(NULL, (xmlChar *)"trackList"); xmlAddChild(rootnode, tracklist); - for(node = playlist->entries; node != NULL; node = g_list_next(node)) { + for (node = playlist->entries; node != NULL; node = g_list_next(node)) { PlaylistEntry *entry = PLAYLIST_ENTRY(node->data); xmlNodePtr track, location; gchar *filename = NULL; @@ -481,26 +474,21 @@ track = xmlNewNode(NULL, (xmlChar *)"track"); location = xmlNewNode(NULL, (xmlChar *)"location"); - if(is_uri(entry->filename)) { /* uri */ -#ifdef DEBUG - printf("filename is uri\n"); -#endif + if (is_uri(entry->filename)) { /* uri */ + XSDEBUG("filename is uri\n"); filename = g_strdup(entry->filename + baselen); // entry->filename is always uri now. - } - else { /* local file (obsolete) */ + } else { /* local file (obsolete) */ gchar *tmp = (gchar *) xspf_path_to_uri((const xmlChar *)entry->filename + baselen); - if(base) { /* relative */ + if (base) { /* relative */ filename = g_strdup_printf("%s", tmp); } else { -#ifdef DEBUG - printf("absolute and local (obsolete)\n"); -#endif + XSDEBUG("absolute and local (obsolete)\n"); filename = g_filename_to_uri(tmp, NULL, NULL); } - g_free(tmp); tmp = NULL; + g_free(tmp); } /* obsolete */ - if(!g_utf8_validate(filename, -1, NULL)) + if (!g_utf8_validate(filename, -1, NULL)) continue; xmlAddChild(location, xmlNewText((xmlChar *)filename)); @@ -557,17 +545,13 @@ } g_free(filename); - filename = NULL; } PLAYLIST_UNLOCK(playlist); xmlSaveFormatFile(filename, doc, 1); xmlFreeDoc(doc); - doc = NULL; - xmlFree(base); - base = NULL; } @@ -578,14 +562,17 @@ .plc_write = xspf_playlist_save, }; + static void xspf_init(void) { playlist_container_register(&plc_xspf); } + static void xspf_cleanup(void) { playlist_container_unregister(&plc_xspf); } + DECLARE_PLUGIN(xspf, xspf_init, xspf_cleanup, NULL, NULL, NULL, NULL, NULL, NULL);