Mercurial > audlegacy-plugins
annotate src/vtx/vtx.c @ 1307:fbeb9446aa2e audacious-plugins-1.4.0-DR1
Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Fri, 20 Jul 2007 10:30:28 -0500 |
parents | cd854e8ced20 |
children | 761e17b23e0c |
rev | line source |
---|---|
749
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
1 /* VTXplugin - VTX player for XMMS |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
2 * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
3 * Copyright (C) 2002-2004 Sashnov Alexander |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
4 * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
7 * the Free Software Foundation; either version 2 of the License, or |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
8 * (at your option) any later version. |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
9 * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
13 * GNU General Public License for more details. |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
14 * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
18 */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
19 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
20 #include <audacious/plugin.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
21 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
22 #include <audacious/output.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
23 #include <audacious/util.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
24 #include <audacious/titlestring.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
25 #include <audacious/vfs.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
26 #include <audacious/strings.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
27 #include <audacious/i18n.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
28 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
29 #include "vtx.h" |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
30 #include <ayemu.h> |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
31 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
32 extern InputPlugin vtx_ip; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
33 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
34 #define SNDBUFSIZE 1024 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
35 char sndbuf[SNDBUFSIZE]; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
36 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
37 static GThread *play_thread = NULL; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
38 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
39 int seek_to; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
40 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
41 int freq = 44100; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
42 int chans = 2; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
43 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
44 /* NOTE: if you change 'bits' you also need change constant FMT_S16_NE |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
45 * to more appropriate in line |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
46 * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
47 * (vtx_ip.output->open_audio (FMT_S16_NE, * freq, chans) == 0) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
48 * in function vtx_play_file() |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
49 * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
50 * and in produce_audio() function call. |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
51 */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
52 const int bits = 16; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
53 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
54 ayemu_ay_t ay; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
55 ayemu_vtx_t vtx; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
56 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
57 static gchar *vtx_fmts[] = { "vtx", NULL }; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
58 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
59 int |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
60 vtx_is_our_fd (char *filename, VFSFile *fp) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
61 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
62 char buf[2]; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
63 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
64 vfs_fread (buf, 2, 1, fp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
65 return (!strncasecmp (buf, "ay", 2) || !strncasecmp (buf, "ym", 2)); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
66 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
67 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
68 int |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
69 vtx_is_our_file (char *filename) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
70 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
71 gboolean ret; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
72 VFSFile *fp; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
73 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
74 fp = vfs_fopen(filename, "rb"); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
75 ret = vtx_is_our_fd(filename, fp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
76 vfs_fclose(fp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
77 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
78 return ret; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
79 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
80 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
81 TitleInput * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
82 vtx_get_song_tuple_from_vtx(const gchar *filename, ayemu_vtx_t *in) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
83 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
84 TitleInput *out = bmp_title_input_new(); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
85 gchar *string; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
86 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
87 out->performer = g_strdup(in->hdr.author); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
88 out->track_name = g_strdup(in->hdr.title); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
89 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
90 out->file_name = g_strdup(g_basename(filename)); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
91 out->file_path = g_path_get_dirname(filename); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
92 if ((string = strrchr(out->file_name, '.'))) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
93 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
94 out->file_ext = string + 1; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
95 *string = '\0'; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
96 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
97 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
98 out->length = in->hdr.regdata_size / 14 * 1000 / 50; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
99 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
100 return out; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
101 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
102 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
103 TitleInput * |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
104 vtx_get_song_tuple(gchar *filename) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
105 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
106 ayemu_vtx_t tmp; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
107 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
108 if (ayemu_vtx_open (&tmp, filename)) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
109 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
110 TitleInput *ti = vtx_get_song_tuple_from_vtx(filename, &tmp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
111 ayemu_vtx_free(&tmp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
112 return ti; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
113 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
114 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
115 return NULL; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
116 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
117 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
118 /* sound playing thread, runing by vtx_play_file() */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
119 static gpointer |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
120 play_loop (gpointer args) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
121 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
122 InputPlayback *playback = (InputPlayback *) args; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
123 void *stream; /* pointer to current position in sound buffer */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
124 unsigned char regs[14]; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
125 int need; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
126 int left; /* how many sound frames can play with current AY register frame */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
127 int donow; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
128 int rate; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
129 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
130 left = 0; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
131 rate = chans * (bits / 8); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
132 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
133 while (playback->playing && !playback->eof) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
134 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
135 /* fill sound buffer */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
136 stream = sndbuf; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
137 for (need = SNDBUFSIZE / rate ; need > 0 ; need -= donow) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
138 if (left > 0) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
139 { /* use current AY register frame */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
140 donow = (need > left) ? left : need; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
141 left -= donow; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
142 stream = ayemu_gen_sound (&ay, (char *)stream, donow * rate); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
143 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
144 else |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
145 { /* get next AY register frame */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
146 if (ayemu_vtx_get_next_frame (&vtx, regs) == 0) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
147 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
148 playback->eof = TRUE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
149 donow = need; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
150 memset (stream, 0, donow * rate); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
151 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
152 else |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
153 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
154 left = freq / vtx.hdr.playerFreq; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
155 ayemu_set_regs (&ay, regs); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
156 donow = 0; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
157 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
158 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
159 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
160 while (playback->output->buffer_free () < SNDBUFSIZE && playback->playing |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
161 && seek_to == -1) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
162 g_usleep(10000); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
163 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
164 if (playback->playing && seek_to == -1) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
165 produce_audio(playback->output->written_time (), FMT_S16_NE, |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
166 chans , SNDBUFSIZE, sndbuf, &playback->playing); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
167 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
168 if (playback->eof) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
169 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
170 playback->output->buffer_free (); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
171 playback->output->buffer_free (); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
172 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
173 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
174 /* jump to time in seek_to (in seconds) */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
175 if (seek_to != -1) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
176 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
177 vtx.pos = seek_to * 50; /* (time in sec) * 50 = offset in AY register data frames */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
178 playback->output->flush (seek_to * 1000); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
179 seek_to = -1; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
180 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
181 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
182 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
183 /* close sound and release vtx file must be done in vtx_stop() */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
184 g_thread_exit (NULL); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
185 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
186 return NULL; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
187 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
188 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
189 void vtx_play_file (InputPlayback *playback) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
190 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
191 gchar *filename = playback->filename; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
192 gchar *buf; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
193 TitleInput *ti; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
194 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
195 memset (&ay, 0, sizeof(ay)); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
196 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
197 if (!ayemu_vtx_open (&vtx, filename)) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
198 g_print ("libvtx: Error read vtx header from %s\n", filename); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
199 else if (!ayemu_vtx_load_data (&vtx)) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
200 g_print ("libvtx: Error read vtx data from %s\n", filename); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
201 else |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
202 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
203 ayemu_init(&ay); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
204 ayemu_set_chip_type(&ay, vtx.hdr.chiptype, NULL); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
205 ayemu_set_chip_freq(&ay, vtx.hdr.chipFreq); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
206 ayemu_set_stereo(&ay, vtx.hdr.stereo, NULL); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
207 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
208 playback->error = FALSE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
209 if (playback->output->open_audio (FMT_S16_NE, freq, chans) == 0) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
210 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
211 g_print ("libvtx: output audio error!\n"); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
212 playback->error = TRUE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
213 playback->playing = FALSE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
214 return; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
215 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
216 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
217 playback->eof = FALSE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
218 seek_to = -1; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
219 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
220 ti = vtx_get_song_tuple_from_vtx(playback->filename, &vtx); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
221 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
222 buf = xmms_get_titlestring(xmms_get_gentitle_format(), ti); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
223 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
224 vtx_ip.set_info (buf, vtx.hdr.regdata_size / 14 * 1000 / 50, |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
225 14 * 50 * 8, freq, bits / 8); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
226 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
227 g_free (buf); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
228 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
229 bmp_title_input_free(ti); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
230 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
231 playback->playing = TRUE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
232 play_thread = g_thread_create (play_loop, playback, TRUE, NULL); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
233 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
234 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
235 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
236 void |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
237 vtx_stop (InputPlayback *playback) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
238 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
239 if (playback->playing && play_thread != NULL) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
240 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
241 playback->playing = FALSE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
242 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
243 g_thread_join (play_thread); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
244 play_thread = NULL; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
245 playback->output->close_audio (); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
246 ayemu_vtx_free (&vtx); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
247 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
248 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
249 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
250 /* seek to specified number of seconds */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
251 void |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
252 vtx_seek (InputPlayback *playback, int time) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
253 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
254 if (time * 50 < vtx.hdr.regdata_size / 14) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
255 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
256 playback->eof = FALSE; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
257 seek_to = time; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
258 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
259 /* wait for affect changes in parallel thread */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
260 while (seek_to != -1) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
261 g_usleep (10000); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
262 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
263 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
264 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
265 /* Pause or unpause */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
266 void |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
267 vtx_pause (InputPlayback *playback, short p) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
268 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
269 playback->output->pause (p); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
270 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
271 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
272 /* Function to grab the title string */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
273 void |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
274 vtx_get_song_info (char *filename, char **title, int *length) |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
275 { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
276 ayemu_vtx_t tmp; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
277 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
278 (*length) = -1; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
279 (*title) = NULL; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
280 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
281 if (ayemu_vtx_open (&tmp, filename)) { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
282 TitleInput *ti = vtx_get_song_tuple_from_vtx(filename, &tmp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
283 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
284 *title = xmms_get_titlestring(xmms_get_gentitle_format(), ti); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
285 *length = ti->length; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
286 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
287 ayemu_vtx_free (&tmp); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
288 bmp_title_input_free(ti); |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
289 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
290 } |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
291 |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
292 InputPlugin vtx_ip = { |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
293 NULL, /* FILLED BY XMMS */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
294 NULL, /* FILLED BY XMMS */ |
1086 | 295 "VTX Audio Plugin", /* Plugin description */ |
749
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
296 NULL, /* Initialization */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
297 vtx_about, /* Show aboutbox */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
298 vtx_config, /* Show/edit configuration */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
299 vtx_is_our_file, /* Check file, return 1 if the plugin can handle this file */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
300 NULL, /* Scan directory */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
301 vtx_play_file, /* Play given file */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
302 vtx_stop, /* Stop playing */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
303 vtx_pause, /* Pause playing */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
304 vtx_seek, /* Seek time */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
305 NULL, /* Set equalizer */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
306 NULL, /* Get playing time (obsoleted by InputPlayback API) */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
307 NULL, /* Get volume */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
308 NULL, /* Set volume */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
309 NULL, /* Cleanup */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
310 NULL, /* OBSOLETE! */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
311 NULL, /* Send data to Visualization plugin */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
312 NULL, NULL, /* FILLED BY XMMS */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
313 vtx_get_song_info, /* Get song title and length */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
314 vtx_file_info, /* Show file-information dialog */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
315 NULL, /* FILLED BY XMMS */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
316 vtx_get_song_tuple, /* Tuple */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
317 NULL, /* Tuple */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
318 NULL, /* Buffer */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
319 vtx_is_our_fd, /* VFS */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
320 vtx_fmts /* ext assist */ |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
321 }; |
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
322 |
1086 | 323 InputPlugin *vtx_iplist[] = { &vtx_ip, NULL }; |
749
26ff35aa9b2b
[svn] - vtx input plugin based on a submission from Pavel Vymetalek.
nenolod
parents:
diff
changeset
|
324 |
1086 | 325 DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL); |