2
terminatorX - realtime audio scratching software
3
Copyright (C) 1999-2003 Alexander K�nig
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27
#include "tX_glade_callbacks.h"
28
#include "tX_glade_interface.h"
29
#include "tX_glade_support.h"
30
#include "tX_dialog.h"
31
#include "tX_global.h"
32
#include "tX_mastergui.h"
33
#include "tX_sequencer.h"
36
on_pref_cancel_clicked (GtkButton *button,
39
gtk_widget_destroy(opt_dialog);
44
on_pref_apply_clicked (GtkButton *button,
47
apply_options(opt_dialog);
52
on_pref_ok_clicked (GtkButton *button,
55
apply_options(opt_dialog);
56
gtk_widget_destroy(opt_dialog);
61
on_tx_options_destroy (GtkObject *object,
69
on_alsa_buffer_time_value_changed (GtkRange *range,
72
GtkAdjustment *buffer_time=gtk_range_get_adjustment(GTK_RANGE(user_data));
73
GtkAdjustment *period_time=gtk_range_get_adjustment(GTK_RANGE(range));
75
period_time->upper=buffer_time->value;
76
gtk_adjustment_changed(period_time);
80
on_pref_reset_clicked (GtkButton *button,
83
GtkWidget *dialog=gtk_message_dialog_new(GTK_WINDOW(opt_dialog->window),
84
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
85
"Loose all your settings and set default values?");
87
int res=gtk_dialog_run(GTK_DIALOG(dialog));
88
gtk_widget_destroy(dialog);
90
if (res!=GTK_RESPONSE_YES) {
94
set_global_defaults();
95
init_tx_options(opt_dialog);
99
on_del_mode_cancel_clicked (GtkButton *button,
102
gtk_widget_destroy(del_dialog);
108
on_del_mode_ok_clicked (GtkButton *button,
111
tX_sequencer::del_mode mode;
113
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(del_dialog, "all_events")))) {
114
mode=tX_sequencer::DELETE_ALL;
115
} else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(del_dialog, "upto_current")))) {
116
mode=tX_sequencer::DELETE_UPTO_CURRENT;
117
} else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(del_dialog, "from_current")))) {
118
mode=tX_sequencer::DELETE_FROM_CURRENT;
120
tX_error("Invalid tX_sequencer::del_mode selected.");
124
switch(menu_del_mode) {
125
case ALL_EVENTS_ALL_TURNTABLES:
126
sequencer.delete_all_events(mode);
128
case ALL_EVENTS_FOR_TURNTABLE:
129
sequencer.delete_all_events_for_vtt(del_vtt, mode);
131
case ALL_EVENTS_FOR_SP:
132
sequencer.delete_all_events_for_sp(del_sp, mode);
135
tX_error("Invalid del_mode");
138
gtk_widget_destroy(del_dialog);
143
color_clicked (GtkButton *button,
147
GtkWidget *dialog=create_tX_color_selection();
148
GtkWidget *sel=lookup_widget(dialog, "color_selection");
149
g_object_set_data(G_OBJECT(dialog), "Button", button);
151
gdk_color_parse((const char *) g_object_get_data(G_OBJECT(button), "Color"), &p);
152
gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(sel), &p);
153
gtk_widget_show(dialog);
158
on_color_selection_ok_clicked (GtkButton *button,
165
GtkWidget *dialog=gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(button))));
166
GtkWidget *c_but=(GtkWidget *) g_object_get_data(G_OBJECT(dialog), "Button");
168
GtkWidget *sel=lookup_widget(dialog, "color_selection");
169
gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(sel), &p);
171
col=(char *) g_object_get_data(G_OBJECT(c_but), "Color");
172
sprintf(col, "#%02X%02X%02X", p.red >> 8, p.green >> 8, p.blue >> 8);
173
sprintf(tmp, "<span foreground=\"%s\"><b>%s</b></span>", col, col);
174
gtk_label_set_markup(GTK_LABEL(gtk_container_get_children(GTK_CONTAINER(c_but))->data), tmp);
176
gtk_widget_destroy(dialog);
181
on_color_selection_cancel_clicked (GtkButton *button,
185
gtk_widget_get_parent(
186
gtk_widget_get_parent(
187
gtk_widget_get_parent(GTK_WIDGET(button))