annotate src/cdaudio-ng/configure.c @ 1212:36cc5e56246e trunk

Added title changes event for songchange plugin
author Giacomo Lozito <james@develia.org>
date Fri, 06 Jul 2007 17:37:21 +0200
parents 483b8d900d5e
children 2a7c9e0b9c0f
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;
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
27 static GtkWidget *debugcheckbutton;
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
28
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
29 static gboolean *usedae;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
30 static int *limitspeed;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
31 static gboolean *usecdtext;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
32 static gboolean *usecddb;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
33 static char *device;
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
34 static gboolean *debug;
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
35
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
36 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
37 static void button_clicked(GtkWidget *widget, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
38 static void checkbutton_toggled(GtkWidget *widget, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
39 static void values_to_gui();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
40 static void gui_to_values();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
41
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
42
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
43 void configure_set_variables(gboolean *_usedae, int *_limitspeed, gboolean *_usecdtext, gboolean *_usecddb, char *_device, gboolean *_debug)
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
44 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
45 usedae = _usedae;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
46 limitspeed = _limitspeed;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
47 usecdtext = _usecdtext;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
48 usecddb = _usecddb;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
49 device = _device;
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
50 debug = _debug;
1189
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
53 void configure_create_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
54 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
55 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
56 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
57 gtk_window_set_resizable(GTK_WINDOW(configwindow), FALSE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
58 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
59 gtk_container_set_border_width(GTK_CONTAINER(configwindow), 10);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
60 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
61
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
62 maintable = gtk_table_new(4, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
63 gtk_container_add(GTK_CONTAINER(configwindow), maintable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
64
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
65 daeframe = gtk_frame_new("Digital audio extraction");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
66 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
67 daetable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
68 gtk_container_add(GTK_CONTAINER(daeframe), daetable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
69
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
70 titleinfoframe = gtk_frame_new("Title information");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
71 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
72 titleinfotable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
73 gtk_container_add(GTK_CONTAINER(titleinfoframe), titleinfotable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
74
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
75 miscframe = gtk_frame_new("Misc");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
76 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
77 misctable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
78 gtk_container_add(GTK_CONTAINER(miscframe), misctable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
79
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
80
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
81 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
82 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
83 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
84
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
85 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
86 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
87 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
88
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
89 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
90 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
91
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
92 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
93 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
94 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
95
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
96 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
97 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
98 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
99
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
100 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
101 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
102 gtk_table_attach_defaults(GTK_TABLE(misctable), usedevicecheckbutton, 0, 1, 0, 1);
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
103
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
104 deviceentry = gtk_entry_new();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
105 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
106
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
107 debugcheckbutton = gtk_check_button_new_with_label("Print debug information");
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
108 g_signal_connect(G_OBJECT(debugcheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL);
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
109 gtk_table_attach_defaults(GTK_TABLE(misctable), debugcheckbutton, 0, 1, 1, 2);
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
110
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
111
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
112 buttonbox = gtk_hbutton_box_new();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
113 gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_END);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
114 gtk_hbutton_box_set_spacing_default(10);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
115 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
116
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
117 okbutton = gtk_button_new_with_label("Ok");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
118 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
119 gtk_container_add(GTK_CONTAINER(buttonbox), okbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
120
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
121 cancelbutton = gtk_button_new_with_label("Cancel");
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
122 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
123 gtk_container_add(GTK_CONTAINER(buttonbox), cancelbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
124
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
125
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
126 gtk_widget_show(usedaecheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
127 gtk_widget_show(limitcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
128 gtk_widget_show(limitspinbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
129 gtk_widget_show(usecdtextcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
130 gtk_widget_show(usecddbcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
131 gtk_widget_show(usedevicecheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
132 gtk_widget_show(deviceentry);
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
133 gtk_widget_show(debugcheckbutton);
1189
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(daetable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
136 gtk_widget_show(daeframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
137 gtk_widget_show(titleinfotable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
138 gtk_widget_show(titleinfoframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
139 gtk_widget_show(misctable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
140 gtk_widget_show(miscframe);
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 gtk_widget_show(buttonbox);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
143 gtk_widget_show(okbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
144 gtk_widget_show(cancelbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
145
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
146 gtk_widget_show(maintable);
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
149 void configure_show_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
150 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
151 values_to_gui();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
152 gtk_widget_show(configwindow);
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
155 gboolean delete_window(GtkWidget *widget, GdkEvent *event, gpointer data)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
156 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
157 gtk_widget_hide(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
158 return TRUE;
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 void button_clicked(GtkWidget *widget, gpointer data)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
162 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
163 gtk_widget_hide(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
164 if (widget == okbutton)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
165 gui_to_values();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
166 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
167
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
168
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
169 void checkbutton_toggled(GtkWidget *widget, gpointer data)
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(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
172
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
173 gtk_widget_set_sensitive(
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
174 limitspinbutton,
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
175 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limitcheckbutton)) &&
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
176 GTK_WIDGET_IS_SENSITIVE(limitcheckbutton));
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(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
179 }
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 void values_to_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
182 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
183 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
184
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
185 gtk_widget_set_sensitive(limitcheckbutton, *usedae);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
186 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
187
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
188 gtk_widget_set_sensitive(limitspinbutton, *usedae && *limitspeed > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
189 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
190
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
191 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
192 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
193
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
194 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
195
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
196 gtk_widget_set_sensitive(deviceentry, strlen(device) > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
197 gtk_entry_set_text(GTK_ENTRY(deviceentry), device);
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
198
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
199 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(debugcheckbutton), *debug);
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
200 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
201
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
202 void gui_to_values()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
203 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
204 *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
205 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
206 *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
207 else
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
208 *limitspeed = 0;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
209 *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
210 *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
211 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
212 strcpy(device, gtk_entry_get_text(GTK_ENTRY(deviceentry)));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
213 else
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
214 strcpy(device, "");
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
215 *debug = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(debugcheckbutton));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
216 }