Mercurial > audlegacy-plugins
annotate src/metronom/metronom.c @ 923:053baea2cbef trunk
[svn] - replace SSE2 detection macro.
author | yaz |
---|---|
date | Mon, 09 Apr 2007 02:26:28 -0700 |
parents | acace9812961 |
children | f61ed3f66f2a |
rev | line source |
---|---|
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
1 /* |
698 | 2 * Copyright 2000 Martin Strau? <mys@faveve.uni-stuttgart.de> |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
3 * |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
4 * |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
6 * it under the terms of the GNU General Public License as published by |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
7 * the Free Software Foundation; either version 2 of the License, or |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
8 * (at your option) any later version. |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
9 * |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
13 * GNU General Public License for more details. |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
14 * |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
16 * along with this program; if not, write to the Free Software |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
18 */ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
19 |
434
7385182ae4b8
[svn] - add missing config.h inclusion for wavpack, null and metronom plugin
giacomo
parents:
315
diff
changeset
|
20 #include <audacious/plugin.h> |
7385182ae4b8
[svn] - add missing config.h inclusion for wavpack, null and metronom plugin
giacomo
parents:
315
diff
changeset
|
21 #include <audacious/util.h> |
7385182ae4b8
[svn] - add missing config.h inclusion for wavpack, null and metronom plugin
giacomo
parents:
315
diff
changeset
|
22 #include "../../config.h" |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
23 #include <glib.h> |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
24 #include <string.h> |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
25 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
26 #define MIN_BPM 1 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
27 #define MAX_BPM 512 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
28 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
29 static InputPlugin metronom_ip; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
30 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
31 static gboolean going; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
32 static gboolean audio_error; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
33 static GThread *play_thread; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
34 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
35 struct metronom_struct { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
36 gint bpm; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
37 gint num; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
38 gint den; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
39 gint id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
40 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
41 typedef struct metronom_struct metronom_t; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
42 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
43 #define tact_id_max 12 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
44 gint tact_id[tact_id_max][2]= |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
45 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
46 {1,1}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
47 {2,2}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
48 {3,2}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
49 {4,2}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
50 {2,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
51 {3,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
52 {4,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
53 {6,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
54 {2,8}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
55 {3,8}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
56 {4,8}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
57 {6,8} |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
58 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
59 #define tact_form_max 8 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
60 gdouble tact_form[tact_id_max][tact_form_max]= |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
61 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
62 {1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
63 {1.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
64 {1.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
65 {1.0,0.5,0.6,0.5,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
66 {1.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
67 {1.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
68 {1.0,0.5,0.6,0.5,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
69 {1.0,0.5,0.5,0.6,0.5,0.5,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
70 {1.0,0.5,0.0,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
71 {1.0,0.5,0.5,0.0,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
72 {1.0,0.5,0.6,0.5,0.0,0.0,0.0,0.0}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
73 {1.0,0.5,0.5,0.6,0.5,0.5,0.0,0.0} |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
74 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
75 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
76 static void metronom_about(void) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
77 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
78 static GtkWidget *box; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
79 box = xmms_show_message( |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
80 "About Metronom", |
698 | 81 "A Tact Generator by Martin Strau? <mys@faveve.uni-stuttgart.de>\n\nTo use it, add a URL: tact://beats*num/den\ne.g. tact://77 to play 77 beats per minute\nor tact://60*3/4 to play 60 bpm in 3/4 tacts", "Ok", |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
82 FALSE, NULL, NULL); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
83 gtk_signal_connect(GTK_OBJECT(box), "destroy", |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
84 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &box); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
85 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
86 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
87 static int metronom_is_our_file(char *filename) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
88 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
89 if (!strncmp(filename, "tact://", 7)) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
90 return TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
91 return FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
92 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
93 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
94 #define BUF_SAMPLES 512 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
95 #define BUF_BYTES BUF_SAMPLES * 2 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
96 #define MAX_AMPL (GINT16_TO_LE((1<<15) - 1)) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
97 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
98 static void* play_loop(void *arg) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
99 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
100 gint16 data[BUF_SAMPLES]; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
101 InputPlayback *playback = arg; |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
102 metronom_t *pmetronom=(metronom_t *)playback->data; |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
103 gint i; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
104 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
105 gint16 t = 0,tact; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
106 gint16 datagoal = 0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
107 gint16 datamiddle = 0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
108 gint16 datacurrent = datamiddle; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
109 gint16 datalast = datamiddle; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
110 gint16 data_form[tact_form_max]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
111 gint num; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
112 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
113 tact = 60*44100/pmetronom->bpm; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
114 /* prepare weighted amplitudes */ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
115 for(num=0;num<pmetronom->num;num++){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
116 data_form[num]=MAX_AMPL*tact_form[pmetronom->id][num]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
117 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
118 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
119 num=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
120 while (going) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
121 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
122 for (i = 0; i < BUF_SAMPLES; i++){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
123 if(t==tact){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
124 t=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
125 datagoal = data_form[num]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
126 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
127 else if(t==10) { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
128 datagoal = -data_form[num]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
129 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
130 else if(t==25) { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
131 datagoal = data_form[num]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
132 /* circle through weighted amplitudes */ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
133 num++; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
134 if(num==pmetronom->num)num=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
135 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
136 /* makes curve a little bit smoother */ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
137 data[i]=(datalast+datacurrent+datagoal)/3; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
138 datalast=datacurrent; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
139 datacurrent=data[i]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
140 if(t > 35) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
141 datagoal=(datamiddle+7*datagoal)/8; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
142 t++; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
143 } |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
144 while(playback->output->buffer_free() < BUF_BYTES && going) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
145 xmms_usleep(30000); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
146 if (going) |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
147 produce_audio(playback->output->written_time(), FMT_S16_LE, 1, BUF_BYTES, data, &going); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
148 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
149 /* Make sure the output plugin stops prebuffering */ |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
150 playback->output->buffer_free(); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
151 playback->output->buffer_free(); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
152 g_thread_exit(NULL); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
153 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
154 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
155 static void metronom_play(InputPlayback *playback) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
156 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
157 char *filename = playback->filename; |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
158 gchar *name; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
159 size_t count; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
160 metronom_t *pmetronom; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
161 gint flag,id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
162 |
526 | 163 pmetronom=(metronom_t *)g_malloc(sizeof(metronom_t)); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
164 if(!pmetronom)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
165 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
166 count=sscanf(filename, "tact://%d*%d/%d", &pmetronom->bpm,&pmetronom->num,&pmetronom->den); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
167 if (count != 1 && count !=3)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
168 if(!(pmetronom->bpm >= MIN_BPM && pmetronom->bpm <= MAX_BPM))return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
169 pmetronom->id=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
170 if(count==1){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
171 pmetronom->num=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
172 pmetronom->den=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
173 } else { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
174 if(pmetronom->num==0 || pmetronom->den==0)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
175 flag=FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
176 for(id=0;(id<tact_id_max && (!flag));id++){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
177 if(pmetronom->num==tact_id[id][0] && pmetronom->den==tact_id[id][1]){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
178 flag=TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
179 pmetronom->id=id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
180 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
181 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
182 if(!flag)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
183 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
184 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
185 going = TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
186 audio_error = FALSE; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
187 if (playback->output->open_audio(FMT_S16_LE, 44100, 1) == 0) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
188 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
189 audio_error = TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
190 going = FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
191 return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
192 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
193 if(pmetronom->num==1 && pmetronom->den==1){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
194 name = g_strdup_printf("Tact generator: %d bpm", pmetronom->bpm); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
195 } else { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
196 name = g_strdup_printf("Tact generator: %d bpm %d/%d", pmetronom->bpm,pmetronom->num,pmetronom->den); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
197 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
198 metronom_ip.set_info(name, -1, 16 * 44100, 44100, 1); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
199 g_free(name); |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
200 playback->data = pmetronom; |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
201 play_thread = g_thread_create((GThreadFunc)play_loop, playback, TRUE, NULL); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
202 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
203 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
204 static void metronom_stop(InputPlayback *playback) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
205 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
206 if (going) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
207 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
208 going = FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
209 g_thread_join(play_thread); |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
210 playback->output->close_audio(); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
211 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
212 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
213 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
214 static void metronom_pause(InputPlayback *playback, short paused) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
215 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
216 playback->output->pause(paused); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
217 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
218 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
219 static int metronom_get_time(InputPlayback *playback) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
220 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
221 if (audio_error) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
222 return -2; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
223 if (!going && !playback->output->buffer_playing()) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
224 return -1; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
225 return playback->output->output_time(); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
226 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
227 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
228 static void metronom_song_info(char *filename, char **title, int *length) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
229 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
230 metronom_t metronom; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
231 metronom_t *pmetronom=&metronom; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
232 size_t count; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
233 gint flag,id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
234 *length = -1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
235 *title = NULL; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
236 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
237 count=sscanf(filename, "tact://%d*%d/%d", &pmetronom->bpm,&pmetronom->num,&pmetronom->den); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
238 if (count != 1 && count !=3)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
239 if(!(pmetronom->bpm >= MIN_BPM && pmetronom->bpm <= MAX_BPM))return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
240 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
241 if (count == 1) { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
242 pmetronom->num=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
243 pmetronom->den=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
244 pmetronom->id=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
245 } else { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
246 if(pmetronom->num==0 || pmetronom->den==0)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
247 flag=FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
248 for(id=0;(id<tact_id_max && (!flag));id++){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
249 if(pmetronom->num==tact_id[id][0] && pmetronom->den==tact_id[id][1])flag=TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
250 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
251 if(!flag)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
252 else pmetronom->id=id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
253 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
254 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
255 if(pmetronom->num==1 && pmetronom->den==1){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
256 *title = g_strdup_printf("Tact generator: %d bpm", pmetronom->bpm); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
257 } else { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
258 *title = g_strdup_printf("Tact generator: %d bpm %d/%d", pmetronom->bpm,pmetronom->num,pmetronom->den); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
259 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
260 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
261 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
262 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
263 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
264 static InputPlugin metronom_ip = |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
265 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
266 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
267 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
268 "Tact Generator " VERSION, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
269 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
270 metronom_about, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
271 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
272 metronom_is_our_file, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
273 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
274 metronom_play, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
275 metronom_stop, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
276 metronom_pause, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
277 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
278 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
279 metronom_get_time, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
280 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
281 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
282 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
283 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
284 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
285 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
286 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
287 metronom_song_info, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
288 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
289 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
290 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
291 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
292 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
293 NULL, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
294 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
295 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
296 InputPlugin *get_iplugin_info(void) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
297 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
298 return &metronom_ip; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
299 } |