Mercurial > audlegacy-plugins
annotate src/cdaudio-ng/configure.c @ 1374:e17e009b3d9b
Finally removed the old cdaudio plugin
author | Calin Crisan ccrisan@gmail.com |
---|---|
date | Thu, 26 Jul 2007 12:13:04 +0300 |
parents | 83cbc6968a0b |
children | 28766475ca0a |
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> |
1303 | 3 #include <stdlib.h> |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
4 #include <string.h> |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
5 #include <gtk/gtk.h> |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
6 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
7 #include "configure.h" |
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 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
10 static GtkWidget *configwindow; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
11 static GtkWidget *okbutton; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
12 static GtkWidget *cancelbutton; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
13 static GtkWidget *maintable; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
14 static GtkWidget *daeframe; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
15 static GtkWidget *titleinfoframe; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
16 static GtkWidget *miscframe; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
17 static GtkWidget *daetable; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
18 static GtkWidget *titleinfotable; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
19 static GtkWidget *misctable; |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
20 /*static GtkWidget *usedaecheckbutton;*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
21 static GtkWidget *limitcheckbutton; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
22 static GtkWidget *usecdtextcheckbutton; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
23 static GtkWidget *usecddbcheckbutton; |
1303 | 24 static GtkWidget *cddbserverlabel; |
25 static GtkWidget *cddbportlabel; | |
26 static GtkWidget *cddbserverentry; | |
27 static GtkWidget *cddbportentry; | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
28 static GtkWidget *usedevicecheckbutton; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
29 static GtkWidget *buttonbox; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
30 static GtkWidget *limitspinbutton; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
31 static GtkWidget *deviceentry; |
1193 | 32 static GtkWidget *debugcheckbutton; |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
33 |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
34 /*static gboolean *usedae;*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
35 static int *limitspeed; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
36 static gboolean *usecdtext; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
37 static gboolean *usecddb; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
38 static char *device; |
1193 | 39 static gboolean *debug; |
1303 | 40 static char *cddbserver; |
41 static int *cddbport; | |
1189
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 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
|
44 static void button_clicked(GtkWidget *widget, gpointer data); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
45 static void checkbutton_toggled(GtkWidget *widget, gpointer data); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
46 static void values_to_gui(); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
47 static void gui_to_values(); |
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 |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
50 void configure_set_variables(/*gboolean *_usedae, */int *_limitspeed, gboolean *_usecdtext, gboolean *_usecddb, char *_device, gboolean *_debug, char *_cddbserver, int *_cddbport) |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
51 { |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
52 /*usedae = _usedae;*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
53 limitspeed = _limitspeed; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
54 usecdtext = _usecdtext; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
55 usecddb = _usecddb; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
56 device = _device; |
1193 | 57 debug = _debug; |
1303 | 58 cddbserver = _cddbserver; |
59 cddbport = _cddbport; | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
60 } |
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 void configure_create_gui() |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
63 { |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
64 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
65 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
|
66 gtk_window_set_resizable(GTK_WINDOW(configwindow), FALSE); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
67 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
|
68 gtk_container_set_border_width(GTK_CONTAINER(configwindow), 10); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
69 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
|
70 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
71 maintable = gtk_table_new(4, 2, TRUE); |
1303 | 72 gtk_table_set_homogeneous(GTK_TABLE(maintable), FALSE); |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
73 gtk_container_add(GTK_CONTAINER(configwindow), maintable); |
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 daeframe = gtk_frame_new("Digital audio extraction"); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
76 gtk_table_attach_defaults(GTK_TABLE(maintable), daeframe, 0, 2, 0, 1); |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
77 daetable = gtk_table_new(1, 2, TRUE); |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
78 gtk_container_add(GTK_CONTAINER(daeframe), daetable); |
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 titleinfoframe = gtk_frame_new("Title information"); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
81 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
|
82 titleinfotable = gtk_table_new(2, 2, TRUE); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
83 gtk_container_add(GTK_CONTAINER(titleinfoframe), titleinfotable); |
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 miscframe = gtk_frame_new("Misc"); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
86 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
|
87 misctable = gtk_table_new(2, 2, TRUE); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
88 gtk_container_add(GTK_CONTAINER(miscframe), misctable); |
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 |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
91 /* |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
92 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
|
93 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
|
94 gtk_table_attach_defaults(GTK_TABLE(daetable), usedaecheckbutton, 0, 2, 0, 1); |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
95 */ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
96 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
97 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
|
98 g_signal_connect(G_OBJECT(limitcheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL); |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
99 gtk_table_attach_defaults(GTK_TABLE(daetable), limitcheckbutton, 0, 1, 0, 1); |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
100 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
101 limitspinbutton = gtk_spin_button_new_with_range(1.0, 24.0, 1.0); |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
102 gtk_table_attach_defaults(GTK_TABLE(daetable), limitspinbutton, 1, 2, 0, 1); |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
103 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
104 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
|
105 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
|
106 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
|
107 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
108 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
|
109 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
|
110 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), usecddbcheckbutton, 0, 2, 1, 2); |
1303 | 111 |
112 cddbserverlabel = gtk_label_new("Server: "); | |
113 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbserverlabel, 0, 1, 2, 3); | |
114 | |
115 cddbportlabel = gtk_label_new("Port: "); | |
116 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbportlabel, 0, 1, 3, 4); | |
117 | |
118 cddbserverentry = gtk_entry_new(); | |
119 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbserverentry, 1, 2, 2, 3); | |
120 | |
121 cddbportentry = gtk_entry_new(); | |
122 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbportentry, 1, 2, 3, 4); | |
123 | |
1189
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 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
|
126 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
|
127 gtk_table_attach_defaults(GTK_TABLE(misctable), usedevicecheckbutton, 0, 1, 0, 1); |
1193 | 128 |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
129 deviceentry = gtk_entry_new(); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
130 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
|
131 |
1193 | 132 debugcheckbutton = gtk_check_button_new_with_label("Print debug information"); |
133 g_signal_connect(G_OBJECT(debugcheckbutton), "toggled", G_CALLBACK(checkbutton_toggled), NULL); | |
134 gtk_table_attach_defaults(GTK_TABLE(misctable), debugcheckbutton, 0, 1, 1, 2); | |
135 | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
136 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
137 buttonbox = gtk_hbutton_box_new(); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
138 gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_END); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
139 gtk_hbutton_box_set_spacing_default(10); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
140 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
|
141 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
142 okbutton = gtk_button_new_with_label("Ok"); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
143 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
|
144 gtk_container_add(GTK_CONTAINER(buttonbox), okbutton); |
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 cancelbutton = gtk_button_new_with_label("Cancel"); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
147 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
|
148 gtk_container_add(GTK_CONTAINER(buttonbox), cancelbutton); |
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 |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
151 /*gtk_widget_show(usedaecheckbutton);*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
152 gtk_widget_show(limitcheckbutton); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
153 gtk_widget_show(limitspinbutton); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
154 gtk_widget_show(usecdtextcheckbutton); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
155 gtk_widget_show(usecddbcheckbutton); |
1303 | 156 gtk_widget_show(cddbserverentry); |
157 gtk_widget_show(cddbportentry); | |
158 gtk_widget_show(cddbserverlabel); | |
159 gtk_widget_show(cddbportlabel); | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
160 gtk_widget_show(usedevicecheckbutton); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
161 gtk_widget_show(deviceentry); |
1193 | 162 gtk_widget_show(debugcheckbutton); |
1189
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_show(daetable); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
165 gtk_widget_show(daeframe); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
166 gtk_widget_show(titleinfotable); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
167 gtk_widget_show(titleinfoframe); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
168 gtk_widget_show(misctable); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
169 gtk_widget_show(miscframe); |
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_show(buttonbox); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
172 gtk_widget_show(okbutton); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
173 gtk_widget_show(cancelbutton); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
174 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
175 gtk_widget_show(maintable); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
176 } |
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 void configure_show_gui() |
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 values_to_gui(); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
181 gtk_widget_show(configwindow); |
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 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
184 gboolean delete_window(GtkWidget *widget, GdkEvent *event, gpointer data) |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
185 { |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
186 gtk_widget_hide(configwindow); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
187 return TRUE; |
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 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
190 void button_clicked(GtkWidget *widget, gpointer data) |
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 gtk_widget_hide(configwindow); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
193 if (widget == okbutton) |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
194 gui_to_values(); |
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 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
197 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
198 void checkbutton_toggled(GtkWidget *widget, gpointer data) |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
199 { |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
200 /*gtk_widget_set_sensitive(limitcheckbutton, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usedaecheckbutton)));*/ |
1189
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 gtk_widget_set_sensitive( |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
203 limitspinbutton, |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
204 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limitcheckbutton)) && |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
205 GTK_WIDGET_IS_SENSITIVE(limitcheckbutton)); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
206 |
1303 | 207 gtk_widget_set_sensitive(cddbserverentry, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton))); |
208 gtk_widget_set_sensitive(cddbportentry, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton))); | |
209 | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
210 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
|
211 } |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
212 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
213 void values_to_gui() |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
214 { |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
215 /*gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(usedaecheckbutton), *usedae);*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
216 |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
217 /*gtk_widget_set_sensitive(limitcheckbutton, *usedae);*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
218 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
|
219 |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
220 /*gtk_widget_set_sensitive(limitspinbutton, *usedae && *limitspeed > 0);*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
221 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
|
222 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
223 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
|
224 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
|
225 |
1303 | 226 char portstr[10]; |
227 sprintf(portstr, "%d", *cddbport); | |
228 gtk_entry_set_text(GTK_ENTRY(cddbserverentry), cddbserver); | |
229 gtk_entry_set_text(GTK_ENTRY(cddbportentry), portstr); | |
230 gtk_widget_set_sensitive(cddbserverentry, *usecddb); | |
231 gtk_widget_set_sensitive(cddbportentry, *usecddb); | |
232 | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
233 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
|
234 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
235 gtk_widget_set_sensitive(deviceentry, strlen(device) > 0); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
236 gtk_entry_set_text(GTK_ENTRY(deviceentry), device); |
1193 | 237 |
238 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
|
239 } |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
240 |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
241 void gui_to_values() |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
242 { |
1339
83cbc6968a0b
Set DAE the default and non-optional play method; Configuring the plugin no longer stops the playback;
Calin Crisan ccrisan@gmail.com
parents:
1303
diff
changeset
|
243 /*usedae = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usedaecheckbutton));*/ |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
244 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
|
245 *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
|
246 else |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
247 *limitspeed = 0; |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
248 *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
|
249 *usecddb = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton)); |
1303 | 250 strcpy(cddbserver, gtk_entry_get_text(GTK_ENTRY(cddbserverentry))); |
251 *cddbport = strtol(gtk_entry_get_text(GTK_ENTRY(cddbportentry)), NULL, 10); | |
1189
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
252 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
|
253 strcpy(device, gtk_entry_get_text(GTK_ENTRY(deviceentry))); |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
254 else |
af5bd4592100
Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff
changeset
|
255 strcpy(device, ""); |
1193 | 256 *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
|
257 } |