Mercurial > audlegacy
annotate Plugins/Input/sexypsf/xmms.c @ 603:124891a14ae2 trunk
[svn] fixes
author | nenolod |
---|---|
date | Fri, 03 Feb 2006 06:36:31 -0800 |
parents | d4e91d775520 |
children | 7a1a46811a45 |
rev | line source |
---|---|
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
1 /* sexyPSF - PSF1 player |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
2 * Copyright (C) 2002-2004 xodnizel |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
3 * |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
4 * This library is free software; you can redistribute it and/or |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
5 * modify it under the terms of the GNU Lesser General Public |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
6 * License as published by the Free Software Foundation; either |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
7 * version 2.1 of the License, or (at your option) any later version. |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
8 * |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
9 * This library is distributed in the hope that it will be useful, |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
12 * Lesser General Public License for more details. |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
13 * |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
14 * You should have received a copy of the GNU Lesser General Public |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
15 * License along with this library; if not, write to the Free Software |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
17 */ |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
18 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
19 #include "audacious/output.h" |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
20 #include "audacious/plugin.h" |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
21 #include "libaudacious/titlestring.h" |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
22 #include "libaudacious/util.h" |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
23 #include "libaudacious/vfs.h" |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
24 #include <stdio.h> |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
25 #include <stdlib.h> |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
26 #include <string.h> |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
27 #include <unistd.h> |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
28 #include "driver.h" |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
29 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
30 #define CMD_SEEK 0x80000000 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
31 #define CMD_STOP 0x40000000 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
32 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
33 #define uint32 u32 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
34 #define int16 short |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
35 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
36 static volatile uint32 command; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
37 static volatile int playing=0; |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
38 static volatile int nextsong=0; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
39 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
40 extern InputPlugin sexypsf_ip; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
41 static char *fnsave=NULL; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
42 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
43 static gchar *get_title_psf(gchar *fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
44 static int paused; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
45 static GThread *dethread; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
46 static PSFINFO *PSFInfo=NULL; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
47 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
48 |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
49 InputPlugin *get_iplugin_info(void) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
50 { |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
51 sexypsf_ip.description = "sexyPSF PSF1 Player 0.4.8"; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
52 return &sexypsf_ip; |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
53 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
54 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
55 static int is_our_file(gchar *filename) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
56 VFSFile *file; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
57 gchar magic[4]; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
58 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
59 // Filter out psflib [we use them, but we can't play them] |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
60 gchar *tmps; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
61 static const gchar *teststr = "psflib"; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
62 if (strlen(teststr) < strlen(filename)) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
63 tmps = filename + strlen(filename); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
64 tmps -= strlen(teststr); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
65 if (!strcasecmp(tmps, teststr)) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
66 return 0; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
67 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
68 if ((file = vfs_fopen(filename,"rb"))) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
69 vfs_fread(magic,1,4,file); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
70 //Only allow PSF1 for now. |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
71 if (!strncmp(magic,"PSF\x01",4)) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
72 vfs_fclose(file); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
73 return 1; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
74 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
75 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
76 return 0; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
77 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
78 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
79 static void SI(gchar *filename) |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
80 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
81 gchar *name = get_title_psf(filename); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
82 sexypsf_ip.set_info(name,PSFInfo->length,44100*2*2*8,44100,2); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
83 g_free(name); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
84 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
85 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
86 void sexypsf_update(unsigned char *Buffer, long count) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
87 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
88 int mask = ~((((16 / 8) * 2)) - 1); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
89 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
90 while(count>0) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
91 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
92 int t=sexypsf_ip.output->buffer_free() & mask; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
93 if(t>count) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
94 produce_audio(sexypsf_ip.output->written_time(), FMT_S16_NE, 2, count, Buffer, NULL); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
95 else |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
96 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
97 if(t) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
98 produce_audio(sexypsf_ip.output->written_time(), FMT_S16_NE, 2, t, Buffer, NULL); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
99 usleep((count-t)*1000*5/441/2); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
100 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
101 count-=t; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
102 Buffer+=t; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
103 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
104 if(command&CMD_SEEK) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
105 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
106 int t=(command&~(CMD_SEEK|CMD_STOP))*1000; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
107 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
108 if(sexypsf_seek(t)) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
109 sexypsf_ip.output->flush(t); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
110 else // Negative time! Must make a C time machine. |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
111 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
112 sexypsf_stop(); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
113 return; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
114 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
115 command&=~CMD_SEEK; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
116 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
117 if(command&CMD_STOP) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
118 sexypsf_stop(); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
119 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
120 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
121 static void *sexypsf_playloop(void *arg) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
122 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
123 dofunky: |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
124 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
125 sexypsf_execute(); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
126 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
127 /* We have reached the end of the song. Now what... */ |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
128 sexypsf_ip.output->buffer_free(); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
129 sexypsf_ip.output->buffer_free(); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
130 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
131 while(!(command&CMD_STOP)) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
132 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
133 if(command&CMD_SEEK) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
134 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
135 int t=(command&~(CMD_SEEK|CMD_STOP))*1000; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
136 sexypsf_ip.output->flush(t); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
137 if(!(PSFInfo=sexypsf_load(fnsave))) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
138 break; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
139 sexypsf_seek(t); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
140 command&=~CMD_SEEK; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
141 goto dofunky; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
142 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
143 if(!sexypsf_ip.output->buffer_playing()) break; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
144 usleep(2000); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
145 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
146 sexypsf_ip.output->close_audio(); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
147 if(!(command&CMD_STOP)) nextsong=1; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
148 g_thread_exit(NULL); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
149 return(NULL); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
150 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
151 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
152 static void sexypsf_xmms_play(char *fn) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
153 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
154 if(playing) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
155 return; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
156 nextsong=0; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
157 paused = 0; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
158 if(!sexypsf_ip.output->open_audio(FMT_S16_NE, 44100, 2)) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
159 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
160 puts("Error opening audio."); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
161 return; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
162 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
163 fnsave=malloc(strlen(fn)+1); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
164 strcpy(fnsave,fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
165 if(!(PSFInfo=sexypsf_load(fn))) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
166 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
167 sexypsf_ip.output->close_audio(); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
168 nextsong=1; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
169 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
170 else |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
171 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
172 command=0; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
173 SI(fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
174 playing=1; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
175 dethread = g_thread_create((GThreadFunc)sexypsf_playloop,NULL,TRUE,NULL); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
176 } |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
177 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
178 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
179 static void sexypsf_xmms_stop(void) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
180 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
181 if(!playing) return; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
182 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
183 if(paused) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
184 sexypsf_ip.output->pause(0); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
185 paused = 0; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
186 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
187 command=CMD_STOP; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
188 g_thread_join(dethread); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
189 playing = 0; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
190 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
191 if(fnsave) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
192 { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
193 free(fnsave); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
194 fnsave=NULL; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
195 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
196 sexypsf_freepsfinfo(PSFInfo); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
197 PSFInfo=NULL; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
198 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
199 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
200 static void sexypsf_xmms_pause(short p) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
201 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
202 if(!playing) return; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
203 sexypsf_ip.output->pause(p); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
204 paused = p; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
205 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
206 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
207 static void sexypsf_xmms_seek(int time) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
208 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
209 if(!playing) return; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
210 command=CMD_SEEK|time; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
211 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
212 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
213 static int sexypsf_xmms_gettime(void) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
214 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
215 if(nextsong) |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
216 return(-1); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
217 if(!playing) return(0); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
218 return sexypsf_ip.output->output_time(); |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
219 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
220 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
221 static void sexypsf_xmms_getsonginfo(char *fn, char **title, int *length) |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
222 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
223 PSFINFO *tmp; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
224 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
225 if((tmp=sexypsf_getpsfinfo(fn))) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
226 *length = tmp->length; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
227 *title = get_title_psf(fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
228 sexypsf_freepsfinfo(tmp); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
229 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
230 } |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
231 |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
232 static gchar *get_title_psf(gchar *fn) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
233 gchar *title; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
234 PSFINFO *tmp = sexypsf_getpsfinfo(fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
235 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
236 if (tmp->length) { |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
237 TitleInput *tinput; |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
238 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
239 tinput = bmp_title_input_new(); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
240 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
241 tinput->performer = g_strdup(tmp->artist); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
242 tinput->album_name = g_strdup(tmp->game); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
243 tinput->track_name = g_strdup(tmp->title); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
244 tinput->file_name = g_path_get_basename(fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
245 tinput->file_path = g_path_get_dirname(fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
246 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
247 title = xmms_get_titlestring(xmms_get_gentitle_format(), |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
248 tinput); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
249 g_free(tinput); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
250 } |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
251 else |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
252 title = g_path_get_basename(fn); |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
253 |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
254 return title; |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
255 } |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
256 |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
257 InputPlugin sexypsf_ip = |
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
258 { |
457
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
259 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
260 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
261 "Plays PSF1 files.", |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
262 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
263 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
264 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
265 is_our_file, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
266 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
267 sexypsf_xmms_play, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
268 sexypsf_xmms_stop, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
269 sexypsf_xmms_pause, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
270 sexypsf_xmms_seek, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
271 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
272 sexypsf_xmms_gettime, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
273 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
274 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
275 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
276 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
277 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
278 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
279 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
280 sexypsf_xmms_getsonginfo, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
281 0, |
d4e91d775520
[svn] More complete title reporting and make coding style consistent with the rest of audacious. Contributed by Kiyoshi Aman <kiyoshi.aman -at- gmail.com>.
chainsaw
parents:
414
diff
changeset
|
282 0 |
333
42cdc99e395a
[svn] Now that the build system is ready, upload the plugin code.
chainsaw
parents:
diff
changeset
|
283 }; |