annotate src/xspf/xspf.c @ 884:4fd90f2d1832 trunk

[svn] improve support for static playlist: - make use of Playlist.attribute. - now xspf plugin is capable of embedding static playlist marker. user can specify at "Save Playlist" dialog. - all meaningful mtime value will be preserved even if a playlist file is handled as static playlist.
author yaz
date Wed, 21 Mar 2007 02:32:49 -0700
parents f46c9abe09d4
children 502222ed5dd4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 /*
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 * Audacious: A cross-platform multimedia player
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 * Copyright (c) 2006 William Pitcock, Tony Vroon, George Averill,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * Giacomo Lozito, Derek Pomery and Yoshiki Yazawa.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 * (at your option) any later version.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
10 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 * GNU General Public License for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 #include <config.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23 #include <glib.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
24 #include <string.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
25 #include <stdlib.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26 #include <time.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
27
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 #include <unistd.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29 #include <sys/types.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30 #include <sys/stat.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 #include <sys/errno.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
32
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
33 #include "audacious/main.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
34 #include "audacious/util.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
35 #include "audacious/playlist.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36 #include "audacious/playlist_container.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
37 #include "audacious/plugin.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
38
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
39 #include <libxml/tree.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
40 #include <libxml/parser.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
41 #include <libxml/xmlreader.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
42 #include <libxml/xpath.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 #include <libxml/xpathInternals.h>
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
44 #include <libxml/uri.h>
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
45
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
46 #define XSPF_ROOT_NODE_NAME "playlist"
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
47 #define XSPF_XMLNS "http://xspf.org/ns/0/"
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
48
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
49 #define TMP_BUF_LEN 128
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
50
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
51 gchar *base = NULL;
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
52
652
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
53 // this function is taken from libxml2-2.6.27.
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
54 static xmlChar *
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
55 audPathToURI(const xmlChar *path)
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
56 {
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
57 xmlURIPtr uri;
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
58 xmlURI temp;
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
59 xmlChar *ret, *cal;
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
60
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
61 if (path == NULL)
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
62 return(NULL);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
63
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
64 if ((uri = xmlParseURI((const char *) path)) != NULL) {
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
65 xmlFreeURI(uri);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
66 return xmlStrdup(path);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
67 }
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
68 cal = xmlCanonicPath(path);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
69 if (cal == NULL)
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
70 return(NULL);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
71 memset(&temp, 0, sizeof(temp));
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
72 temp.path = (char *) cal;
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
73 ret = xmlSaveUri(&temp);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
74 xmlFree(cal);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
75 return(ret);
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
76 }
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
77
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
78 static void
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
79 add_file(xmlNode *track, const gchar *filename, gint pos)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
80 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
81 xmlNode *nptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
82 TitleInput *tuple;
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
83 gchar *location = NULL;
361
f201074bf69a [svn] - update playlist code. M3U was simple and did not require anything special.
nenolod
parents: 95
diff changeset
84 Playlist *playlist = playlist_get_active();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
85
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
86 tuple = bmp_title_input_new();
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
87
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
88 tuple->length = -1;
657
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
89 tuple->mtime = -1; // mark as uninitialized.
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
90
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
91 // creator, album, title, duration, trackNum, annotation, image,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
92 for(nptr = track->children; nptr != NULL; nptr = nptr->next){
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
93 if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"location")){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
94 gchar *str = (gchar *)xmlNodeGetContent(nptr);
657
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
95 gchar *tmp;
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
96
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
97 if( strncmp(str, "http://", 7) && strncmp(str, "https://", 8) &&
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
98 strncmp(str, "mms://", 6) ) { /* not a streaming */
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
99 tmp = (gchar *)xmlURIUnescapeString(str, -1, NULL);
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
100 }
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
101 else { /* streaming */
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
102 tmp = g_strdup(str);
f46c9abe09d4 [svn] - do not unescape streaming uri.
yaz
parents: 652
diff changeset
103 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
104
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
105 if(strstr(tmp, "file://")){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
106 location = g_strdup_printf("%s%s", base ? base : "", tmp+7);
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
107 }
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
108 else {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
109 location = g_strdup_printf("%s%s", base ? base : "", tmp);
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
110 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
111 xmlFree(str); g_free(tmp);
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
112 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
113 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"title")){
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
114 tuple->track_name = (gchar *)xmlNodeGetContent(nptr);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
115 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
116 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"creator")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
117 tuple->performer = (gchar *)xmlNodeGetContent(nptr);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
118 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
119 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"annotation")){
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
120 tuple->comment = (gchar *)xmlNodeGetContent(nptr);
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
121 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
122 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"album")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
123 tuple->album_name = (gchar *)xmlNodeGetContent(nptr);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
124 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
125 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"trackNum")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
126 xmlChar *str = xmlNodeGetContent(nptr);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
127 tuple->track_number = atol((char *)str);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
128 xmlFree(str);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
129 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
130 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"duration")){
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
131 xmlChar *str = xmlNodeGetContent(nptr);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
132 tuple->length = atol((char *)str);
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
133 xmlFree(str);
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
134 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
135
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
136 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
137 // additional metadata
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
138 //
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
139 // year, date, genre, formatter, mtime
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
140 //
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
141 else if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"meta")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
142 xmlChar *rel = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
143
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
144 rel = xmlGetProp(nptr, (xmlChar *)"rel");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
145
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
146 if(!xmlStrcmp(rel, (xmlChar *)"year")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
147 xmlChar *cont = xmlNodeGetContent(nptr);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
148 tuple->year = atol((char *)cont);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
149 xmlFree(cont);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
150 continue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
151 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
152 else if(!xmlStrcmp(rel, (xmlChar *)"date")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
153 tuple->date = (gchar *)xmlNodeGetContent(nptr);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
154 continue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
155 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
156 else if(!xmlStrcmp(rel, (xmlChar *)"genre")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
157 tuple->genre = (gchar *)xmlNodeGetContent(nptr);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
158 continue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
159 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
160 else if(!xmlStrcmp(rel, (xmlChar *)"formatter")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
161 tuple->formatter = (gchar *)xmlNodeGetContent(nptr);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
162 continue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
163 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
164 else if(!xmlStrcmp(rel, (xmlChar *)"mtime")){
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
165 xmlChar *str = NULL;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
166 str = xmlNodeGetContent(nptr);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
167 tuple->mtime = (time_t)atoll((char *)str);
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
168 xmlFree(str);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
169 continue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
170 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
171 xmlFree(rel);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
172 rel = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
173 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
174
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
175 }
87
fabe64e89949 [svn] - mtime=-1 has been introduced to represent "uninitialized".
yaz
parents: 47
diff changeset
176
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
177 if(location){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
178 tuple->file_name = g_path_get_basename(location);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
179 tuple->file_path = g_path_get_dirname(location);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
180 tuple->file_ext = g_strdup(strrchr(location, '.'));
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
181 // add file to playlist
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
182 playlist_load_ins_file_tuple(playlist, location, filename, pos, tuple);
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
183 pos++;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
184 }
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
185
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
186 g_free(location);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
187 location = NULL;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
188 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
189
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
190 static void
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
191 find_track(xmlNode *tracklist, const gchar *filename, gint pos)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
192 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
193 xmlNode *nptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
194 for(nptr = tracklist->children; nptr != NULL; nptr = nptr->next){
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
195 if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"track")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
196 add_file(nptr, filename, pos);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
197 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
198 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
199 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
200
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
201 static void
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
202 find_audoptions(xmlNode *tracklist, const gchar *filename, gint pos)
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
203 {
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
204 xmlNode *nptr;
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
205 Playlist *playlist = playlist_get_active();
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
206
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
207 for(nptr = tracklist->children; nptr != NULL; nptr = nptr->next){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
208 if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"options")){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
209 xmlChar *opt = NULL;
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
210
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
211 opt = xmlGetProp(nptr, (xmlChar *)"staticlist");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
212 if(!strcasecmp((char *)opt, "true")){
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
213 playlist->attribute |= PLAYLIST_STATIC;
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
214 }
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
215 else
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
216 playlist->attribute ^= PLAYLIST_STATIC;
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
217 xmlFree(opt);
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
218 opt = NULL;
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
219 }
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
220 }
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
221 }
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
222
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
223 static void
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
224 playlist_load_xspf(const gchar * filename, gint pos)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
225 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
226 xmlDocPtr doc;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
227 xmlNode *nptr, *nptr2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
228
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
229 g_return_if_fail(filename != NULL);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
230
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
231 doc = xmlParseFile(filename);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
232 if (doc == NULL)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
233 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
234
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
235 xmlFree(base);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
236 base = NULL;
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
237
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
238 // find trackList
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
239 for(nptr = doc->children; nptr != NULL; nptr = nptr->next) {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
240 if(nptr->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr->name, (xmlChar *)"playlist")){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
241 base = (gchar *)xmlNodeGetBase(doc, nptr);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
242 if(!strcmp(base, filename)) {
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
243 xmlFree(base);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
244 base = NULL;
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
245 }
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
246
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
247 for(nptr2 = nptr->children; nptr2 != NULL; nptr2 = nptr2->next){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
248
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
249 if(nptr2->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr2->name, (xmlChar *)"extension")){
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
250 //check if application is audacious
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
251 xmlChar *app = NULL;
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
252 app = xmlGetProp(nptr2, (xmlChar *)"application");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
253 if(!xmlStrcmp(app, (xmlChar *)"audacious")) {
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
254 find_audoptions(nptr2, filename, pos);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
255 }
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
256 xmlFree(app);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
257 }
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
258
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
259 if(nptr2->type == XML_ELEMENT_NODE && !xmlStrcmp(nptr2->name, (xmlChar *)"trackList")){
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
260 find_track(nptr2, filename, pos);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
261 }
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
262
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
263 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
264
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
265 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
266 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
267
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
268 xmlFreeDoc(doc);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
269
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
270 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
271
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
272 static void
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
273 playlist_save_xspf(const gchar *filename, gint pos)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
274 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
275 xmlDocPtr doc;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
276 xmlNodePtr rootnode, tmp, tracklist;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
277 GList *node;
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
278 Playlist *playlist = playlist_get_active();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
279
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
280 doc = xmlNewDoc((xmlChar *)"1.0");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
281
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
282 doc->charset = XML_CHAR_ENCODING_UTF8;
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
283 doc->encoding = xmlStrdup((xmlChar *)"UTF-8");
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
284
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
285 rootnode = xmlNewNode(NULL, (xmlChar *)XSPF_ROOT_NODE_NAME);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
286 xmlSetProp(rootnode, (xmlChar *)"xmlns", (xmlChar *)XSPF_XMLNS);
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
287 xmlSetProp(rootnode, (xmlChar *)"version", (xmlChar *)"1");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
288 xmlDocSetRootElement(doc, rootnode);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
289
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
290 tmp = xmlNewNode(NULL, (xmlChar *)"creator");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
291 xmlAddChild(tmp, xmlNewText((xmlChar *)PACKAGE "-" VERSION));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
292 xmlAddChild(rootnode, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
293
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
294 // add staticlist marker
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
295 if(playlist->attribute & PLAYLIST_STATIC) {
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
296 xmlNodePtr extension, options;
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
297
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
298 extension = xmlNewNode(NULL, (xmlChar *)"extension");
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
299 xmlSetProp(extension, (xmlChar *)"application", (xmlChar *)"audacious");
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
300
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
301 options = xmlNewNode(NULL, (xmlChar *)"options");
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
302 xmlSetProp(options, (xmlChar *)"staticlist", (xmlChar *)"true");
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
303
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
304 xmlAddChild(extension, options);
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
305 xmlAddChild(rootnode, extension);
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
306 }
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
307
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
308 tracklist = xmlNewNode(NULL, (xmlChar *)"trackList");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
309 xmlAddChild(rootnode, tracklist);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
310
386
de15b9e09d2d [svn] - updated m3u.c, xspf.c, pls.c to use the playlist->mutex and no more playlist_get
giacomo
parents: 384
diff changeset
311 PLAYLIST_LOCK(playlist->mutex);
92
fadf346ddde3 [svn] - pls doesn't go along with PLAYLIST_LOCK in playlist_save().
yaz
parents: 87
diff changeset
312
384
a91923634161 [svn] - don't use deprecated function playlist_get().
nenolod
parents: 361
diff changeset
313 for (node = playlist->entries; node != NULL; node = g_list_next(node))
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
314 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
315 PlaylistEntry *entry = PLAYLIST_ENTRY(node->data);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
316 xmlNodePtr track, location;
95
b5a1b762f586 [svn] - xspf now uses url encoding for location entry.
yaz
parents: 92
diff changeset
317 gchar *filename = NULL;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
318
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
319 track = xmlNewNode(NULL, (xmlChar *)"track");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
320 location = xmlNewNode(NULL, (xmlChar *)"location");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
321
647
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
322 /* uri escape entry->filename */
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
323 if ( !strncasecmp("http://", entry->filename, 7) ||
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
324 !strncasecmp("https://", entry->filename, 8) ||
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
325 !strncasecmp("mms://", entry->filename, 6) ) /* streaming */
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
326 {
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
327 gchar *tmp = (gchar *)xmlURIEscape((xmlChar *)entry->filename);
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
328 filename = g_strdup(tmp ? tmp : entry->filename);
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
329 g_free(tmp);
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
330 }
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
331 else /* local file */
f684905cf688 [svn] - add mms:// as a streaming scheme.
yaz
parents: 644
diff changeset
332 {
652
7f865e3cd285 [svn] - import xmlPathToURI() from libxml2-2.6.27 as audPathToURI(). this function is newly introduced at 2.6.27.
yaz
parents: 647
diff changeset
333 gchar *tmp = (gchar *)audPathToURI((const xmlChar *)entry->filename);
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
334 filename = g_strdup_printf("file://%s", tmp);
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
335 g_free(tmp);
577
8182837f7a82 [svn] - don't percent encode urls beginning with http:// or https:// for now.
yaz
parents: 386
diff changeset
336 }
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
337
95
b5a1b762f586 [svn] - xspf now uses url encoding for location entry.
yaz
parents: 92
diff changeset
338 if(!g_utf8_validate(filename, -1, NULL))
b5a1b762f586 [svn] - xspf now uses url encoding for location entry.
yaz
parents: 92
diff changeset
339 continue;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
340
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
341 xmlAddChild(location, xmlNewText((xmlChar *)filename));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
342 xmlAddChild(track, location);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
343 xmlAddChild(tracklist, track);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
344
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
345 /* do we have a tuple? */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
346 if (entry->tuple != NULL)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
347 {
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
348 if (entry->tuple->track_name != NULL &&
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
349 g_utf8_validate(entry->tuple->track_name, -1, NULL))
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
350 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
351 tmp = xmlNewNode(NULL, (xmlChar *)"title");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
352 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->track_name));
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
353 xmlAddChild(track, tmp);
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
354 }
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
355
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
356 if (entry->tuple->performer != NULL &&
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
357 g_utf8_validate(entry->tuple->performer, -1, NULL))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
358 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
359 tmp = xmlNewNode(NULL, (xmlChar *)"creator");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
360 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->performer));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
361 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
362 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
363
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
364 if (entry->tuple->comment != NULL &&
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
365 g_utf8_validate(entry->tuple->comment, -1, NULL))
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
366 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
367 tmp = xmlNewNode(NULL, (xmlChar *)"annotation");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
368 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->comment));
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
369 xmlAddChild(track, tmp);
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
370 }
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
371
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
372 if (entry->tuple->album_name != NULL &&
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
373 g_utf8_validate(entry->tuple->album_name, -1, NULL))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
374 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
375 tmp = xmlNewNode(NULL, (xmlChar *)"album");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
376 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->album_name));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
377 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
378 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
379
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
380 if (entry->tuple->track_number != 0)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
381 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
382 gchar *str;
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
383 str = g_malloc(TMP_BUF_LEN);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
384 tmp = xmlNewNode(NULL, (xmlChar *)"trackNum");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
385 sprintf(str, "%d", entry->tuple->track_number);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
386 xmlAddChild(tmp, xmlNewText((xmlChar *)str));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
387 g_free(str);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
388 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
389 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
390
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
391 if (entry->tuple->length > 0)
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
392 {
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
393 gchar *str;
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
394 str = g_malloc(TMP_BUF_LEN);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
395 tmp = xmlNewNode(NULL, (xmlChar *)"duration");
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
396 sprintf(str, "%d", entry->tuple->length);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
397 xmlAddChild(tmp, xmlNewText((xmlChar *)str));
585
2d20bc58a290 [svn] tweak xspf plugin to conform xspf specification version 1.
yaz
parents: 577
diff changeset
398 g_free(str);
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
399 xmlAddChild(track, tmp);
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
400 }
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
401
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
402 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
403 // additional metadata
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
404 //
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
405 // year, date, genre, formatter, mtime
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
406 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
407 if (entry->tuple->year != 0)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
408 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
409 gchar *str;
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
410 str = g_malloc(TMP_BUF_LEN);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
411 tmp = xmlNewNode(NULL, (xmlChar *)"meta");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
412 xmlSetProp(tmp, (xmlChar *)"rel", (xmlChar *)"year");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
413 sprintf(str, "%d", entry->tuple->year);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
414 xmlAddChild(tmp, xmlNewText((xmlChar *)str));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
415 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
416 g_free(str);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
417 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
418
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
419 if (entry->tuple->date != NULL &&
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
420 g_utf8_validate(entry->tuple->date, -1, NULL))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
421 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
422 tmp = xmlNewNode(NULL, (xmlChar *)"meta");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
423 xmlSetProp(tmp, (xmlChar *)"rel", (xmlChar *)"date");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
424 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->date));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
425 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
426 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
427
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
428 if (entry->tuple->genre != NULL &&
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
429 g_utf8_validate(entry->tuple->genre, -1, NULL))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
430 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
431 tmp = xmlNewNode(NULL, (xmlChar *)"meta");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
432 xmlSetProp(tmp, (xmlChar *)"rel", (xmlChar *)"genre");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
433 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->genre));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
434 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
435 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
436
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
437 if (entry->tuple->formatter != NULL &&
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
438 g_utf8_validate(entry->tuple->formatter, -1, NULL))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
439 {
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
440 tmp = xmlNewNode(NULL, (xmlChar *)"meta");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
441 xmlSetProp(tmp, (xmlChar *)"rel", (xmlChar *)"formatter");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
442 xmlAddChild(tmp, xmlNewText((xmlChar *)entry->tuple->formatter));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
443 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
444 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
445
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
446 // mtime: write mtime unconditionally to support staticlist.
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
447 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
448 gchar *str;
47
85d7e55b29d2 [svn] - redundant metadata has been removed.
yaz
parents: 12
diff changeset
449 str = g_malloc(TMP_BUF_LEN);
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
450 tmp = xmlNewNode(NULL, (xmlChar *)"meta");
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
451 xmlSetProp(tmp, (xmlChar *)"rel", (xmlChar *)"mtime");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
452 sprintf(str, "%ld", (long) entry->tuple->mtime);
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
453
641
3f0a3c24f2b9 [svn] libxspf improvements:
yaz
parents: 585
diff changeset
454 xmlAddChild(tmp, xmlNewText((xmlChar *)str));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
455 xmlAddChild(track, tmp);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
456 g_free(str);
884
4fd90f2d1832 [svn] improve support for static playlist:
yaz
parents: 657
diff changeset
457 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
458 }
95
b5a1b762f586 [svn] - xspf now uses url encoding for location entry.
yaz
parents: 92
diff changeset
459 g_free(filename);
b5a1b762f586 [svn] - xspf now uses url encoding for location entry.
yaz
parents: 92
diff changeset
460 filename = NULL;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
461 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
462
386
de15b9e09d2d [svn] - updated m3u.c, xspf.c, pls.c to use the playlist->mutex and no more playlist_get
giacomo
parents: 384
diff changeset
463 PLAYLIST_UNLOCK(playlist->mutex);
92
fadf346ddde3 [svn] - pls doesn't go along with PLAYLIST_LOCK in playlist_save().
yaz
parents: 87
diff changeset
464
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
465 xmlSaveFormatFile(filename, doc, 1);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
466 xmlFreeDoc(doc);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
467 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
468
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
469 PlaylistContainer plc_xspf = {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
470 .name = "XSPF Playlist Format",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
471 .ext = "xspf",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
472 .plc_read = playlist_load_xspf,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
473 .plc_write = playlist_save_xspf,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
474 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
475
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
476 static void init(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
477 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
478 playlist_container_register(&plc_xspf);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
479 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
480
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
481 static void cleanup(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
482 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
483 playlist_container_unregister(&plc_xspf);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
484 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
485
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
486 LowlevelPlugin llp_xspf = {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
487 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
488 NULL,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
489 "XSPF Playlist Format",
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
490 init,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
491 cleanup,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
492 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
493
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
494 LowlevelPlugin *get_lplugin_info(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
495 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
496 return &llp_xspf;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
497 }