Mercurial > audlegacy-plugins
annotate src/metronom/metronom.c @ 2734:8a102490a8c0
compilation fix
author | Paula Stanciu <paula.stanciu@gmail.com> |
---|---|
date | Mon, 30 Jun 2008 01:04:29 +0300 |
parents | bd3a24b39058 |
children | f1b6f1b2cdb3 |
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 |
1961
e8ea3a76a84e
Various #include cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
1677
diff
changeset
|
20 #include "config.h" |
434
7385182ae4b8
[svn] - add missing config.h inclusion for wavpack, null and metronom plugin
giacomo
parents:
315
diff
changeset
|
21 #include <audacious/plugin.h> |
1973
f86cb7fc1d4f
Add -pipe -Wall if gcc and fix a few warnings.
Jonathan Schleifer <js@h3c.de>
parents:
1961
diff
changeset
|
22 #include <audacious/output.h> |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
23 #include <audacious/i18n.h> |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
24 #include <glib.h> |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
25 #include <string.h> |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
26 |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
27 #define MIN_BPM 1 |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
28 #define MAX_BPM 512 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
29 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
30 static InputPlugin metronom_ip; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
31 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
32 static gboolean going; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
33 static gboolean audio_error; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
34 static GThread *play_thread; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
35 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
36 struct metronom_struct { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
37 gint bpm; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
38 gint num; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
39 gint den; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
40 gint id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
41 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
42 typedef struct metronom_struct metronom_t; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
43 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
44 #define tact_id_max 12 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
45 gint tact_id[tact_id_max][2]= |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
46 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
47 {1,1}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
48 {2,2}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
49 {3,2}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
50 {4,2}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
51 {2,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
52 {3,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
53 {4,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
54 {6,4}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
55 {2,8}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
56 {3,8}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
57 {4,8}, |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
58 {6,8} |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
59 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
60 #define tact_form_max 8 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
61 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
|
62 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
63 {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
|
64 {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
|
65 {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
|
66 {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
|
67 {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
|
68 {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
|
69 {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
|
70 {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
|
71 {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
|
72 {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
|
73 {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
|
74 {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
|
75 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
76 |
1481
469419424896
Register tact:// with uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents:
1447
diff
changeset
|
77 static void metronom_init(void) |
469419424896
Register tact:// with uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents:
1447
diff
changeset
|
78 { |
1997 | 79 aud_uri_set_plugin("tact://", &metronom_ip); |
1481
469419424896
Register tact:// with uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents:
1447
diff
changeset
|
80 } |
469419424896
Register tact:// with uri_set_plugin
Christian Birchinger <joker@netswarm.net>
parents:
1447
diff
changeset
|
81 |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
82 static void metronom_about(void) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
83 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
84 static GtkWidget *box; |
1677
f6f5603a0954
xmms_show_message() changed to audacious_info_dialog()
Matti Hamalainen <ccr@tnsp.org>
parents:
1676
diff
changeset
|
85 box = audacious_info_dialog( |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
86 _("About Metronom"), |
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
87 _("A Tact Generator by Martin Strauss <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
|
88 FALSE, NULL, NULL); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
89 gtk_signal_connect(GTK_OBJECT(box), "destroy", |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
90 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &box); |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
91 } |
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 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
|
94 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
95 if (!strncmp(filename, "tact://", 7)) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
96 return TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
97 return FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
98 } |
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 #define BUF_SAMPLES 512 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
101 #define BUF_BYTES BUF_SAMPLES * 2 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
102 #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
|
103 |
1973
f86cb7fc1d4f
Add -pipe -Wall if gcc and fix a few warnings.
Jonathan Schleifer <js@h3c.de>
parents:
1961
diff
changeset
|
104 static void play_loop(void *arg) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
105 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
106 gint16 data[BUF_SAMPLES]; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
107 InputPlayback *playback = arg; |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
108 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
|
109 gint i; |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
110 |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
111 gint16 t = 0,tact; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
112 gint16 datagoal = 0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
113 gint16 datamiddle = 0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
114 gint16 datacurrent = datamiddle; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
115 gint16 datalast = datamiddle; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
116 gint16 data_form[tact_form_max]; |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
117 gint num; |
315
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 tact = 60*44100/pmetronom->bpm; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
120 /* prepare weighted amplitudes */ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
121 for(num=0;num<pmetronom->num;num++){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
122 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
|
123 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
124 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
125 num=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
126 while (going) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
127 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
128 for (i = 0; i < BUF_SAMPLES; i++){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
129 if(t==tact){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
130 t=0; |
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 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
133 else if(t==10) { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
134 datagoal = -data_form[num]; |
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 else if(t==25) { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
137 datagoal = data_form[num]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
138 /* circle through weighted amplitudes */ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
139 num++; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
140 if(num==pmetronom->num)num=0; |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
141 } |
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
142 /* makes curve a little bit smoother */ |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
143 data[i]=(datalast+datacurrent+datagoal)/3; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
144 datalast=datacurrent; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
145 datacurrent=data[i]; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
146 if(t > 35) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
147 datagoal=(datamiddle+7*datagoal)/8; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
148 t++; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
149 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
150 if (going) |
1998
8f3188746b64
chase last changeset in aud
William Pitcock <nenolod@atheme.org>
parents:
1997
diff
changeset
|
151 playback->pass_audio(playback, 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
|
152 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
153 /* 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
|
154 playback->output->buffer_free(); |
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
155 playback->output->buffer_free(); |
315
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 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
158 static void metronom_play(InputPlayback *playback) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
159 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
160 char *filename = playback->filename; |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
161 gchar *name; |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
162 size_t count; |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
163 metronom_t *pmetronom; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
164 gint flag,id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
165 |
526 | 166 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
|
167 if(!pmetronom)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
168 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
169 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
|
170 if (count != 1 && count !=3)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
171 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
|
172 pmetronom->id=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
173 if(count==1){ |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
174 pmetronom->num=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
175 pmetronom->den=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
176 } else { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
177 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
|
178 flag=FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
179 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
|
180 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
|
181 flag=TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
182 pmetronom->id=id; |
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 if(!flag)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
186 } |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
187 |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
188 going = TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
189 audio_error = FALSE; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
190 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
|
191 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
192 audio_error = TRUE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
193 going = FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
194 return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
195 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
196 if(pmetronom->num==1 && pmetronom->den==1){ |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
197 name = g_strdup_printf(_("Tact generator: %d bpm"), pmetronom->bpm); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
198 } else { |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
199 name = g_strdup_printf(_("Tact generator: %d bpm %d/%d"), pmetronom->bpm,pmetronom->num,pmetronom->den); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
200 } |
1986 | 201 playback->set_params(playback, name, -1, 16 * 44100, 44100, 1); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
202 g_free(name); |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
203 playback->data = pmetronom; |
1356
996430ebc1c8
metronom: new threading model
William Pitcock <nenolod@atheme-project.org>
parents:
1288
diff
changeset
|
204 play_thread = g_thread_self(); |
1447
195b5657303e
updated input plugins to use set_pb_ready to signal to the core that they're ready for playback
Giacomo Lozito <james@develia.org>
parents:
1395
diff
changeset
|
205 playback->set_pb_ready(playback); |
1356
996430ebc1c8
metronom: new threading model
William Pitcock <nenolod@atheme-project.org>
parents:
1288
diff
changeset
|
206 play_loop(playback); |
315
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 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
209 static void metronom_stop(InputPlayback *playback) |
315
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 if (going) |
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 going = FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
214 g_thread_join(play_thread); |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
215 playback->output->close_audio(); |
315
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 } |
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 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
|
220 { |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
221 playback->output->pause(paused); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
222 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
223 |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
224 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
|
225 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
226 if (audio_error) |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
227 return -2; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
228 if (!going && !playback->output->buffer_playing()) |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
229 return -1; |
561
914c96de3244
[svn] Convert plugins to use InputPlayback.output instead of InputPlugin.output
iabervon
parents:
559
diff
changeset
|
230 return playback->output->output_time(); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
231 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
232 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
233 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
|
234 { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
235 metronom_t metronom; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
236 metronom_t *pmetronom=&metronom; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
237 size_t count; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
238 gint flag,id; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
239 *length = -1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
240 *title = NULL; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
241 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
242 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
|
243 if (count != 1 && count !=3)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
244 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
|
245 |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
246 if (count == 1) { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
247 pmetronom->num=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
248 pmetronom->den=1; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
249 pmetronom->id=0; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
250 } else { |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
251 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
|
252 flag=FALSE; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
253 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
|
254 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
|
255 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
256 if(!flag)return; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
257 else pmetronom->id=id; |
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 if(pmetronom->num==1 && pmetronom->den==1){ |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
261 *title = g_strdup_printf(_("Tact generator: %d bpm"), pmetronom->bpm); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
262 } else { |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
263 *title = g_strdup_printf(_("Tact generator: %d bpm %d/%d"), pmetronom->bpm,pmetronom->num,pmetronom->den); |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
264 } |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
265 } |
1288
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
266 |
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
267 |
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
268 |
a3a59254d286
All strings are now translatable.
Stany HENRY <StrassBoy@gmail.com>
parents:
1089
diff
changeset
|
269 static InputPlugin metronom_ip = |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
270 { |
1616
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
271 .description = "Tact Generator", |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
272 .init = metronom_init, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
273 .about = metronom_about, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
274 .is_our_file = metronom_is_our_file, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
275 .play_file = metronom_play, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
276 .stop = metronom_stop, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
277 .pause = metronom_pause, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
278 .get_time = metronom_get_time, |
13ac6cc08bfa
metronom: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents:
1481
diff
changeset
|
279 .get_song_info = metronom_song_info, |
315
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
280 }; |
2294f3a6f136
[svn] Metronom (a.k.a. tact generator) input plugin, ported from XMMS.
chainsaw
parents:
diff
changeset
|
281 |
1089 | 282 InputPlugin *metronom_iplist[] = { &metronom_ip, NULL }; |
283 | |
1395
761e17b23e0c
added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents:
1356
diff
changeset
|
284 DECLARE_PLUGIN(metronom, NULL, NULL, metronom_iplist, NULL, NULL, NULL, NULL, NULL); |