/* * Copyright (c) 2009 Tomasz Moń * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; under version 3 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include "gdigi.h" void value_changed_cb(GtkSpinButton *spinbutton, void (*callback)(struct usb_dev_handle*, int)) { int val = gtk_spin_button_get_value_as_int(spinbutton); callback(handle, val); } void toggled_cb(GtkToggleButton *button, void (*callback)(struct usb_dev_handle*, gboolean)) { gboolean val = gtk_toggle_button_get_active(button); callback(handle, val); } typedef struct { char *label; void (*callback)(struct usb_dev_handle*, int); gdouble min; gdouble max; } SettingsWidget; static SettingsWidget wah_widgets[] = { {"Wah min", set_wah_min, 0.0, 99.0}, {"Wah max", set_wah_max, 0.0, 99.0}, {"Wah level", set_wah_level, 0.0, 12.0}, }; static SettingsWidget comp_widgets[] = { {"Compressor sustain", set_comp_sustain, 0.0, 99.0}, {"Compressor tone (digi only!)", set_comp_tone, 0.0, 99.0}, {"Compressor attack", set_comp_attack, 0.0, 99.0}, {"Compressor level", set_comp_level, 0.0, 99.0}, }; GtkWidget *create_table(SettingsWidget *widgets, gint amt) { GtkWidget *table, *label, *widget; GtkObject *adj; int x; table = gtk_table_new(2, amt, FALSE); for (x = 0; x