annotate src/cdaudio-ng/configure.c @ 1382:28766475ca0a

More and more translatable strings... ;-)
author Stany HENRY <StrassBoy@gmail.com>
date Fri, 27 Jul 2007 00:02:44 +0200
parents 83cbc6968a0b
children 2db72dd92ee3
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>
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
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>
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
6 #include <audacious/i18n.h>
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
7 #include "config.h"
1189
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 #include "configure.h"
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
10
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
11
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
12 static GtkWidget *configwindow;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
13 static GtkWidget *okbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
14 static GtkWidget *cancelbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
15 static GtkWidget *maintable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
16 static GtkWidget *daeframe;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
17 static GtkWidget *titleinfoframe;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
18 static GtkWidget *miscframe;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
19 static GtkWidget *daetable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
20 static GtkWidget *titleinfotable;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
21 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
22 /*static GtkWidget *usedaecheckbutton;*/
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
23 static GtkWidget *limitcheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
24 static GtkWidget *usecdtextcheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
25 static GtkWidget *usecddbcheckbutton;
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
26 static GtkWidget *cddbserverlabel;
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
27 static GtkWidget *cddbportlabel;
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
28 static GtkWidget *cddbserverentry;
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
29 static GtkWidget *cddbportentry;
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
30 static GtkWidget *usedevicecheckbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
31 static GtkWidget *buttonbox;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
32 static GtkWidget *limitspinbutton;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
33 static GtkWidget *deviceentry;
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
34 static GtkWidget *debugcheckbutton;
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
35
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
36 /*static gboolean *usedae;*/
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
37 static int *limitspeed;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
38 static gboolean *usecdtext;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
39 static gboolean *usecddb;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
40 static char *device;
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
41 static gboolean *debug;
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
42 static char *cddbserver;
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
43 static int *cddbport;
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 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
46 static void button_clicked(GtkWidget *widget, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
47 static void checkbutton_toggled(GtkWidget *widget, gpointer data);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
48 static void values_to_gui();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
49 static void gui_to_values();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
50
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 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
53 {
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
54 /*usedae = _usedae;*/
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
55 limitspeed = _limitspeed;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
56 usecdtext = _usecdtext;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
57 usecddb = _usecddb;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
58 device = _device;
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
59 debug = _debug;
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
60 cddbserver = _cddbserver;
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
61 cddbport = _cddbport;
1189
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
64 void configure_create_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
65 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
66 configwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
67 gtk_window_set_title(GTK_WINDOW(configwindow), _("CD Audio Plugin Configuration"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
68 gtk_window_set_resizable(GTK_WINDOW(configwindow), FALSE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
69 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
70 gtk_container_set_border_width(GTK_CONTAINER(configwindow), 10);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
71 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
72
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
73 maintable = gtk_table_new(4, 2, TRUE);
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
74 gtk_table_set_homogeneous(GTK_TABLE(maintable), FALSE);
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
75 gtk_container_add(GTK_CONTAINER(configwindow), maintable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
76
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
77 daeframe = gtk_frame_new(_("Digital audio extraction"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
78 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
79 daetable = gtk_table_new(1, 2, TRUE);
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
80 gtk_container_add(GTK_CONTAINER(daeframe), daetable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
81
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
82 titleinfoframe = gtk_frame_new(_("Title information"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
83 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
84 titleinfotable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
85 gtk_container_add(GTK_CONTAINER(titleinfoframe), titleinfotable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
86
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
87 miscframe = gtk_frame_new(_("Misc"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
88 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
89 misctable = gtk_table_new(2, 2, TRUE);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
90 gtk_container_add(GTK_CONTAINER(miscframe), misctable);
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
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
93 /*
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
94 usedaecheckbutton = gtk_check_button_new_with_label(_("Use digital audio extraction"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
95 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
96 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
97 */
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
98
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
99 limitcheckbutton = gtk_check_button_new_with_label(_("Limit read speed to: "));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
100 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
101 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
102
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
103 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
104 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
105
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
106 usecdtextcheckbutton = gtk_check_button_new_with_label(_("Use cd-text if available"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
107 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
108 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
109
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
110 usecddbcheckbutton = gtk_check_button_new_with_label(_("Use CDDB if available"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
111 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
112 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), usecddbcheckbutton, 0, 2, 1, 2);
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
113
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
114 cddbserverlabel = gtk_label_new(_("Server: "));
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
115 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbserverlabel, 0, 1, 2, 3);
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
116
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
117 cddbportlabel = gtk_label_new(_("Port: "));
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
118 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbportlabel, 0, 1, 3, 4);
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
119
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
120 cddbserverentry = gtk_entry_new();
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
121 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbserverentry, 1, 2, 2, 3);
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
122
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
123 cddbportentry = gtk_entry_new();
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
124 gtk_table_attach_defaults(GTK_TABLE(titleinfotable), cddbportentry, 1, 2, 3, 4);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
125
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
126
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
127 usedevicecheckbutton = gtk_check_button_new_with_label(_("Override default device: "));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
128 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
129 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
130
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
131 deviceentry = gtk_entry_new();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
132 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
133
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
134 debugcheckbutton = gtk_check_button_new_with_label(_("Print debug information"));
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
135 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
136 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
137
1189
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 buttonbox = gtk_hbutton_box_new();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
140 gtk_hbutton_box_set_layout_default(GTK_BUTTONBOX_END);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
141 gtk_hbutton_box_set_spacing_default(10);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
142 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
143
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
144 okbutton = gtk_button_new_with_label(_("Ok"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
145 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
146 gtk_container_add(GTK_CONTAINER(buttonbox), okbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
147
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
148 cancelbutton = gtk_button_new_with_label(_("Cancel"));
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
149 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
150 gtk_container_add(GTK_CONTAINER(buttonbox), cancelbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
151
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
152
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
153 /*gtk_widget_show(usedaecheckbutton);*/
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
154 gtk_widget_show(limitcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
155 gtk_widget_show(limitspinbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
156 gtk_widget_show(usecdtextcheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
157 gtk_widget_show(usecddbcheckbutton);
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
158 gtk_widget_show(cddbserverentry);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
159 gtk_widget_show(cddbportentry);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
160 gtk_widget_show(cddbserverlabel);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
161 gtk_widget_show(cddbportlabel);
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
162 gtk_widget_show(usedevicecheckbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
163 gtk_widget_show(deviceentry);
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
164 gtk_widget_show(debugcheckbutton);
1189
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_show(daetable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
167 gtk_widget_show(daeframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
168 gtk_widget_show(titleinfotable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
169 gtk_widget_show(titleinfoframe);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
170 gtk_widget_show(misctable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
171 gtk_widget_show(miscframe);
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_show(buttonbox);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
174 gtk_widget_show(okbutton);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
175 gtk_widget_show(cancelbutton);
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 gtk_widget_show(maintable);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
178 }
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 void configure_show_gui()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
181 {
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
182 values_to_gui();
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
183 gtk_widget_show(configwindow);
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
186 gboolean delete_window(GtkWidget *widget, GdkEvent *event, gpointer data)
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_hide(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
189 return TRUE;
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
192 void button_clicked(GtkWidget *widget, gpointer data)
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_widget_hide(configwindow);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
195 if (widget == okbutton)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
196 gui_to_values();
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
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
199
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
200 void checkbutton_toggled(GtkWidget *widget, gpointer data)
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
201 {
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
202 /*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
203
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
204 gtk_widget_set_sensitive(
1382
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
205 limitspinbutton,
28766475ca0a More and more translatable strings... ;-)
Stany HENRY <StrassBoy@gmail.com>
parents: 1339
diff changeset
206 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(limitcheckbutton)) &&
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
207 GTK_WIDGET_IS_SENSITIVE(limitcheckbutton));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
208
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
209 gtk_widget_set_sensitive(cddbserverentry, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton)));
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
210 gtk_widget_set_sensitive(cddbportentry, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton)));
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
211
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
212 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
213 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
214
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
215 void values_to_gui()
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_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
218
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
219 /*gtk_widget_set_sensitive(limitcheckbutton, *usedae);*/
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
220 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
221
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
222 /*gtk_widget_set_sensitive(limitspinbutton, *usedae && *limitspeed > 0);*/
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
223 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
224
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
225 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
226 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
227
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
228 char portstr[10];
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
229 sprintf(portstr, "%d", *cddbport);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
230 gtk_entry_set_text(GTK_ENTRY(cddbserverentry), cddbserver);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
231 gtk_entry_set_text(GTK_ENTRY(cddbportentry), portstr);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
232 gtk_widget_set_sensitive(cddbserverentry, *usecddb);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
233 gtk_widget_set_sensitive(cddbportentry, *usecddb);
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
234
1189
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
235 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
236
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
237 gtk_widget_set_sensitive(deviceentry, strlen(device) > 0);
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
238 gtk_entry_set_text(GTK_ENTRY(deviceentry), device);
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
239
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
240 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
241 }
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
242
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
243 void gui_to_values()
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
244 {
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
245 /*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
246 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
247 *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
248 else
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
249 *limitspeed = 0;
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
250 *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
251 *usecddb = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(usecddbcheckbutton));
1303
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
252 strcpy(cddbserver, gtk_entry_get_text(GTK_ENTRY(cddbserverentry)));
2a7c9e0b9c0f Added configure options for cddb
zither@litestep.network
parents: 1193
diff changeset
253 *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
254 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
255 strcpy(device, gtk_entry_get_text(GTK_ENTRY(deviceentry)));
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
256 else
af5bd4592100 Added cdaudio-ng.h; added a configure dialog
zither@litestep.network
parents:
diff changeset
257 strcpy(device, "");
1193
483b8d900d5e Added enable/disable debug option
calin.crisan@ldev-006
parents: 1189
diff changeset
258 *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
259 }