annotate src/metronom/metronom.c @ 472:69b8baad0b24 trunk

[svn] - stuff from vfs_get_metadata is already strdup'd
author nenolod
date Sun, 21 Jan 2007 02:16:17 -0800
parents 7385182ae4b8
children 5fa8b0ca6d61
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
315
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
1 /*
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
2 * Copyright 2000 Martin Strauß <mys@faveve.uni-stuttgart.de>
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",
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
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",
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];
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
101 metronom_t *pmetronom=(metronom_t *)arg;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
102 gint i;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
103
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
104 gint16 t = 0,tact;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
105 gint16 datagoal = 0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
106 gint16 datamiddle = 0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
107 gint16 datacurrent = datamiddle;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
108 gint16 datalast = datamiddle;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
109 gint16 data_form[tact_form_max];
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
110 gint num;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
111
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
112 tact = 60*44100/pmetronom->bpm;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
113 /* prepare weighted amplitudes */
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
114 for(num=0;num<pmetronom->num;num++){
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
115 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
116 }
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 num=0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
119 while (going)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
120 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
121 for (i = 0; i < BUF_SAMPLES; i++){
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
122 if(t==tact){
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
123 t=0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
124 datagoal = data_form[num];
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
125 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
126 else if(t==10) {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
127 datagoal = -data_form[num];
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
128 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
129 else if(t==25) {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
130 datagoal = data_form[num];
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
131 /* circle through weighted amplitudes */
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
132 num++;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
133 if(num==pmetronom->num)num=0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
134 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
135 /* makes curve a little bit smoother */
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
136 data[i]=(datalast+datacurrent+datagoal)/3;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
137 datalast=datacurrent;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
138 datacurrent=data[i];
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
139 if(t > 35)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
140 datagoal=(datamiddle+7*datagoal)/8;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
141 t++;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
142 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
143 while(metronom_ip.output->buffer_free() < BUF_BYTES && going)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
144 xmms_usleep(30000);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
145 if (going)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
146 produce_audio(metronom_ip.output->written_time(), FMT_S16_LE, 1, BUF_BYTES, data, &going);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
147 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
148 /* Make sure the output plugin stops prebuffering */
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
149 free(arg);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
150 metronom_ip.output->buffer_free();
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
151 metronom_ip.output->buffer_free();
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
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
155 static void metronom_play(char *filename)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
156 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
157 gchar *name;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
158 size_t count;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
159 metronom_t *pmetronom;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
160 gint flag,id;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
161
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
162 pmetronom=(metronom_t *)malloc(sizeof(metronom_t));
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
163 if(!pmetronom)return;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
164
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
165 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
166 if (count != 1 && count !=3)return;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
167 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
168 pmetronom->id=0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
169 if(count==1){
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
170 pmetronom->num=1;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
171 pmetronom->den=1;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
172 } else {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
173 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
174 flag=FALSE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
175 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
176 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
177 flag=TRUE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
178 pmetronom->id=id;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
179 }
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 if(!flag)return;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
182 }
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 going = TRUE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
185 audio_error = FALSE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
186 if (metronom_ip.output->open_audio(FMT_S16_LE, 44100, 1) == 0)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
187 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
188 audio_error = TRUE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
189 going = FALSE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
190 return;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
191 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
192 if(pmetronom->num==1 && pmetronom->den==1){
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
193 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
194 } else {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
195 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
196 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
197 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
198 g_free(name);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
199 play_thread = g_thread_create((GThreadFunc)play_loop, pmetronom, TRUE, NULL);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
200 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
201
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
202 static void metronom_stop(void)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
203 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
204 if (going)
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 going = FALSE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
207 g_thread_join(play_thread);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
208 metronom_ip.output->close_audio();
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
209 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
210 }
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 static void metronom_pause(short paused)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
213 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
214 metronom_ip.output->pause(paused);
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
215 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
216
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
217 static int metronom_get_time(void)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
218 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
219 if (audio_error)
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
220 return -2;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
221 if (!going && !metronom_ip.output->buffer_playing())
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
222 return -1;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
223 return metronom_ip.output->output_time();
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
224 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
225
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
226 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
227 {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
228 metronom_t metronom;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
229 metronom_t *pmetronom=&metronom;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
230 size_t count;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
231 gint flag,id;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
232 *length = -1;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
233 *title = NULL;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
234
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
235 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
236 if (count != 1 && count !=3)return;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
237 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
238
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
239 if (count == 1) {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
240 pmetronom->num=1;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
241 pmetronom->den=1;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
242 pmetronom->id=0;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
243 } else {
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
244 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
245 flag=FALSE;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
246 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
247 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
248 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
249 if(!flag)return;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
250 else pmetronom->id=id;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
251 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
252
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
253 if(pmetronom->num==1 && pmetronom->den==1){
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
254 *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
255 } else {
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 %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
257 }
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
258 }
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 static InputPlugin metronom_ip =
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 NULL,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
265 NULL,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
266 "Tact Generator " VERSION,
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 metronom_about,
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_is_our_file,
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_play,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
273 metronom_stop,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
274 metronom_pause,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
275 NULL,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
276 NULL,
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
277 metronom_get_time,
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 NULL,
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 metronom_song_info,
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 NULL,
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 };
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
293
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
294 InputPlugin *get_iplugin_info(void)
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 return &metronom_ip;
2294f3a6f136 [svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff changeset
297 }