annotate src/cdaudio-ng/configure.c @ 1189:af5bd4592100 trunk

Added cdaudio-ng.h; added a configure dialog
author zither@litestep.network
date Wed, 20 Jun 2007 22:27:48 +0300
parents
children 483b8d900d5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
1
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
2 #include <stdio.h>
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
3 #include <string.h>
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
4 #include <gtk/gtk.h>
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
5
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
6 #include "configure.h"
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
7
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
8
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
9 static GtkWidget *configwindow;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
10 static GtkWidget *okbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
11 static GtkWidget *cancelbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
12 static GtkWidget *maintable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
13 static GtkWidget *daeframe;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
14 static GtkWidget *titleinfoframe;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
15 static GtkWidget *miscframe;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
16 static GtkWidget *daetable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
17 static GtkWidget *titleinfotable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
18 static GtkWidget *misctable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
19 static GtkWidget *usedaecheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
20 static GtkWidget *limitcheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
21 static GtkWidget *usecdtextcheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
22 static GtkWidget *usecddbcheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
23 static GtkWidget *usedevicecheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
24 static GtkWidget *buttonbox;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
25 static GtkWidget *limitspinbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
26 static GtkWidget *deviceentry;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
27
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
28 static gboolean *usedae;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
29 static int *limitspeed;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
30 static gboolean *usecdtext;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
31 static gboolean *usecddb;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
32 static char *device;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
33
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
34 static gboolean delete_window(GtkWidget *widget, GdkEvent *event, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
35 static void button_clicked(GtkWidget *widget, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
36 static void checkbutton_toggled(GtkWidget *widget, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
37 static void values_to_gui();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
38 static void gui_to_values();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
39
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
40
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
41 void configure_set_variables(gboolean *_usedae, int *_limitspeed, gboolean *_usecdtext, gboolean *_usecddb, char *_device)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
42 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
43 usedae = _usedae;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
44 limitspeed = _limitspeed;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
45 usecdtext = _usecdtext;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
46 usecddb = _usecddb;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
47 device = _device;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
48 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
49
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
50 void configure_create_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
51 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
52 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
53 gtk_window_set_title(GTK_WINDOW(configwindow), "CD Audio Plugin Configuration");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
54 gtk_window_set_resizable(GTK_WINDOW(configwindow), FALSE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
55 gtk_window_set_position(GTK_WINDOW(configwindow), GTK_WIN_POS_CENTER_ALWAYS);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
56 gtk_container_set_border_width(GTK_CONTAINER(configwindow), 10);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
57 g_signal_connect(G_OBJECT(configwindow), "delete_event", G_CALLBACK(delete_window), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
58
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
59 maintable = gtk_table_new(4, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
60 gtk_container_add(GTK_CONTAINER(configwindow), maintable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
61
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
62
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
63 daeframe = gtk_frame_new("Digital audio extraction");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
64 gtk_table_attach_defaults(GTK_TABLE(maintable), daeframe, 0, 2, 0, 1);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
65 daetable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
66 gtk_container_add(GTK_CONTAINER(daeframe), daetable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
67
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
68 titleinfoframe = gtk_frame_new("Title information");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
69 gtk_table_attach_defaults(GTK_TABLE(maintable), titleinfoframe, 0, 2, 1, 2);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
70 titleinfotable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
71 gtk_container_add(GTK_CONTAINER(titleinfoframe), titleinfotable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
72
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
73 miscframe = gtk_frame_new("Misc");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
74 gtk_table_attach_defaults(GTK_TABLE(maintable), miscframe, 0, 2, 2, 3);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
75 misctable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
76 gtk_container_add(GTK_CONTAINER(miscframe), misctable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
77
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
78
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
79 usedaecheckbutton = gtk_check_button_new_with_label("Use digital audio extraction");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
80 g_signal_connect(G_OBJECT(usedaecheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
81 gtk_table_attach_defaults(GTK_TABLE(daetable), usedaecheckbutton, 0, 2, 0, 1);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
82
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
83 limitcheckbutton = gtk_check_button_new_with_label("Limit read speed to: ");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
84 g_signal_connect(G_OBJECT(limitcheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
85 gtk_table_attach_defaults(GTK_TABLE(daetable), limitcheckbutton, 0, 1, 1, 2);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
86
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
87 limitspinbutton = gtk_spin_button_new_with_range(1.0, 24.0, 1.0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
88 gtk_table_attach_defaults(GTK_TABLE(daetable), limitspinbutton, 1, 2, 1, 2);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
89
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
90 usecdtextcheckbutton = gtk_check_button_new_with_label("Use cd-text if available");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
91 g_signal_connect(G_OBJECT(usecdtextcheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
92 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), usecdtextcheckbutton, 0, 2, 0, 1);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
93
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
94 usecddbcheckbutton = gtk_check_button_new_with_label("Use CDDB if available");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
95 g_signal_connect(G_OBJECT(usecddbcheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
96 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), usecddbcheckbutton, 0, 2, 1, 2);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
97
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
98 usedevicecheckbutton = gtk_check_button_new_with_label("Override default device: ");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
99 g_signal_connect(G_OBJECT(usedevicecheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
100 gtk_table_attach_defaults(GTK_TABLE(misctable), usedevicecheckbutton, 0, 1, 0, 1);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
101
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
102 deviceentry = gtk_entry_new();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
103 gtk_table_attach_defaults(GTK_TABLE(misctable), deviceentry, 1, 2, 0, 1);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
104
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
105
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
106 buttonbox = gtk_hbutton_box_new();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
107 gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_END);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
108 gtk_hbutton_box_set_spacing_default(10);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
109 gtk_table_attach_defaults(GTK_TABLE(maintable), buttonbox, 0, 2, 3, 4);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
110
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
111 okbutton = gtk_button_new_with_label("Ok");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
112 g_signal_connect(G_OBJECT(okbutton), "clicked", G_CALLBACK(button_clicked), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
113 gtk_container_add(GTK_CONTAINER(buttonbox), okbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
114
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
115 cancelbutton = gtk_button_new_with_label("Cancel");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
116 g_signal_connect(G_OBJECT(cancelbutton), "clicked", G_CALLBACK(button_clicked), NULL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
117 gtk_container_add(GTK_CONTAINER(buttonbox), cancelbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
118
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
119
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
120 gtk_widget_show(usedaecheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
121 gtk_widget_show(limitcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
122 gtk_widget_show(limitspinbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
123 gtk_widget_show(usecdtextcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
124 gtk_widget_show(usecddbcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
125 gtk_widget_show(usedevicecheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
126 gtk_widget_show(deviceentry);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
127
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
128 gtk_widget_show(daetable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
129 gtk_widget_show(daeframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
130 gtk_widget_show(titleinfotable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
131 gtk_widget_show(titleinfoframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
132 gtk_widget_show(misctable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
133 gtk_widget_show(miscframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
134
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
135 gtk_widget_show(buttonbox);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
136 gtk_widget_show(okbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
137 gtk_widget_show(cancelbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
138
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
139 gtk_widget_show(maintable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
140 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
141
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
142 void configure_show_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
143 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
144 values_to_gui();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
145 gtk_widget_show(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
146 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
147
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
148 gboolean delete_window(GtkWidget *widget, GdkEvent *event, gpointer data)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
149 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
150 gtk_widget_hide(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
151 return TRUE;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
152 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
153
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
154 void button_clicked(GtkWidget *widget, gpointer data)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
155 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
156 gtk_widget_hide(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
157 if (widget == okbutton)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
158 gui_to_values();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
159 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
160
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
161
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
162 void checkbutton_toggled(GtkWidget *widget, gpointer data)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
163 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
164 gtk_widget_set_sensitive(limitcheckbutton, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usedaecheckbutton)));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
165
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
166 gtk_widget_set_sensitive(
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
167 limitspinbutton,
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
168 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limitcheckbutton)) &&
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
169 GTK_WIDGET_IS_SENSITIVE(limitcheckbutton));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
170
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
171 gtk_widget_set_sensitive(deviceentry, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usedevicecheckbutton)));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
172 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
173
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
174 void values_to_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
175 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
176 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(usedaecheckbutton), *usedae);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
177
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
178 gtk_widget_set_sensitive(limitcheckbutton, *usedae);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
179 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(limitcheckbutton), *limitspeed > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
180
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
181 gtk_widget_set_sensitive(limitspinbutton, *usedae && *limitspeed > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
182 gtk_spin_button_set_value(GTK_SPIN_BUTTON(limitspinbutton), *limitspeed);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
183
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
184 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(usecdtextcheckbutton), *usecdtext);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
185 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton), *usecddb);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
186
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
187 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(usedevicecheckbutton), strlen(device) > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
188
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
189 gtk_widget_set_sensitive(deviceentry, strlen(device) > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
190 gtk_entry_set_text(GTK_ENTRY(deviceentry), device);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
191 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
192
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
193 void gui_to_values()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
194 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
195 *usedae = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usedaecheckbutton));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
196 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limitcheckbutton)))
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
197 *limitspeed = gtk_spin_button_get_value(GTK_SPIN_BUTTON(limitspinbutton));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
198 else
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
199 *limitspeed = 0;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
200 *usecdtext = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecdtextcheckbutton));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
201 *usecddb = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
202 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usedevicecheckbutton)))
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
203 strcpy(device, gtk_entry_get_text(GTK_ENTRY(deviceentry)));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
204 else
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
205 strcpy(device, "");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
206 }