3
open(SRC, "state-vars.txt") || die "Can't open 'state-vars.txt'";
4
open(OUT, "| indent -kr > state.h") || die "Can't invoke indent and write";
15
if (/([a-z-]+)\t+(.+)/) {
19
} elsif (/([a-z-]+)\((\d+)\)\t+(.+)/) {
24
die "Syntax error: $_";
32
/* This is a generated file DO NOT EDIT, see state-vars.txt */
36
typedef void(* s_callback_func)(int id, float value);
44
void s_set_value_ui(int id, float value);
45
void s_set_value(int id, float value, int time);
46
void s_set_value_block(float *values, int base, int count);
47
void s_set_value_no_history(int id, float value);
48
void s_set_description(int id, const char *desc);
49
void s_clear_history();
50
void s_set_callback(int id, s_callback_func callback);
51
void s_set_adjustment(int id, GtkAdjustment *adjustment);
52
void s_history_add(const char *description);
55
void s_save_session_from_ui (GtkWidget *w, gpointer user_data);
56
void s_save_session (const char *fname);
57
void s_load_session_from_ui (GtkWidget *w, gpointer user_data);
58
void s_load_session (const char *fname);
59
void s_set_filename (const char *fname);
60
void s_crossfade(const int nframes);
61
void s_crossfade_ui();
62
void s_suppress_push();
63
void s_suppress_pop();
64
int s_have_filename();
73
if ($card{$sym} == 1) {
74
print OUT "#define S_$macro ".$id++."\n";
76
print OUT "#define S_$macro(n) ($id + n)\n";
89
void s_restore_state(s_state *state);
90
void s_crossfade_to_state(s_state *state, float time);
91
void s_history_add_state(s_state state);
93
extern float s_value[S_SIZE];
95
/* fetch currently used value */
97
inline static float s_get_value(int id)
102
/* set value with no side effects */
104
inline static void s_set_value_ns(int id, float value)
112
print OUT "static const char * const s_description[S_SIZE] = {\n";
113
for $sym (@symbols) {
114
if ($card{$sym} > 1) {
115
for ($i = 1; $i <= $card{$sym}; $i++) {
121
print OUT "\"$desc{$sym} $i\"";
129
print OUT "\"$desc{$sym}\"";
135
print OUT "static const char * const s_symbol[S_SIZE] = {\n";
136
for $sym (@symbols) {
137
if ($card{$sym} > 1) {
138
for ($i = 0; $i < $card{$sym}; $i++) {
144
print OUT "\"$sym$i\"";
152
print OUT "\"$sym\"";
156
print OUT "#endif\n";