Mercurial > audlegacy
annotate Plugins/Input/flac/configure.c @ 1236:fc478bfe6fe6 trunk
[svn] - disconnect the scrobbler client from metatag logically
author | nenolod |
---|---|
date | Wed, 14 Jun 2006 22:30:04 -0700 |
parents | 592ef16386aa |
children | f12d7e208b43 |
rev | line source |
---|---|
61 | 1 /* libxmms-flac - XMMS FLAC input plugin |
2 * Copyright (C) 2002,2003,2004,2005 Daisuke Shimamura | |
3 * | |
4 * Based on mpg123 plugin | |
5 * and prefs.c - 2000/05/06 | |
6 * EasyTAG - Tag editor for MP3 and OGG files | |
7 * Copyright (C) 2000-2002 Jerome Couderc <j.couderc@ifrance.com> | |
8 * | |
9 * This program is free software; you can redistribute it and/or | |
10 * modify it under the terms of the GNU General Public License | |
11 * as published by the Free Software Foundation; either version 2 | |
12 * of the License, or (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, | |
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 * GNU General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program; if not, write to the Free Software | |
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
22 */ | |
23 | |
24 #include <stdlib.h> | |
25 #include <string.h> | |
26 #include <glib.h> | |
27 #include <gtk/gtk.h> | |
28 #include <math.h> | |
29 | |
303 | 30 #include <libaudacious/configdb.h> |
61 | 31 #include <libaudacious/dirbrowser.h> |
32 #include <libaudacious/titlestring.h> | |
188
6bdc6841b0a9
[svn] Fix includes to avoid implicit declaration warnings.
chainsaw
parents:
181
diff
changeset
|
33 #include <libaudacious/util.h> |
61 | 34 #include <audacious/plugin.h> |
35 | |
36 #include "plugin_common/locale_hack.h" | |
37 #include "replaygain_synthesis.h" /* for NOISE_SHAPING_LOW */ | |
38 #include "charset.h" | |
39 #include "configure.h" | |
40 | |
41 /* | |
42 * Initialize Global Valueable | |
43 */ | |
44 flac_config_t flac_cfg = { | |
45 /* title */ | |
46 { | |
47 FALSE, /* tag_override */ | |
48 NULL, /* tag_format */ | |
49 FALSE, /* convert_char_set */ | |
50 NULL /* user_char_set */ | |
51 }, | |
52 /* stream */ | |
53 { | |
54 100 /* KB */, /* http_buffer_size */ | |
55 50, /* http_prebuffer */ | |
56 FALSE, /* use_proxy */ | |
57 "", /* proxy_host */ | |
58 0, /* proxy_port */ | |
59 FALSE, /* proxy_use_auth */ | |
60 "", /* proxy_user */ | |
61 "", /* proxy_pass */ | |
62 FALSE, /* save_http_stream */ | |
63 "", /* save_http_path */ | |
64 FALSE, /* cast_title_streaming */ | |
65 FALSE /* use_udp_channel */ | |
66 }, | |
67 /* output */ | |
68 { | |
69 /* replaygain */ | |
70 { | |
71 FALSE, /* enable */ | |
72 TRUE, /* album_mode */ | |
73 0, /* preamp */ | |
74 FALSE /* hard_limit */ | |
75 }, | |
76 /* resolution */ | |
77 { | |
78 /* normal */ | |
79 { | |
80 TRUE /* dither_24_to_16 */ | |
81 }, | |
82 /* replaygain */ | |
83 { | |
84 TRUE, /* dither */ | |
85 NOISE_SHAPING_LOW, /* noise_shaping */ | |
86 16 /* bps_out */ | |
87 } | |
88 } | |
89 } | |
90 }; | |
91 | |
92 | |
93 static GtkWidget *flac_configurewin = NULL; | |
94 static GtkWidget *vbox, *notebook; | |
95 | |
96 static GtkWidget *title_tag_override, *title_tag_box, *title_tag_entry, *title_desc; | |
97 static GtkWidget *convert_char_set, *fileCharacterSetEntry, *userCharacterSetEntry; | |
98 static GtkWidget *replaygain_enable, *replaygain_album_mode; | |
99 static GtkWidget *replaygain_preamp_hscale, *replaygain_preamp_label, *replaygain_hard_limit; | |
100 static GtkObject *replaygain_preamp; | |
101 static GtkWidget *resolution_normal_dither_24_to_16; | |
102 static GtkWidget *resolution_replaygain_dither; | |
103 static GtkWidget *resolution_replaygain_noise_shaping_frame; | |
104 static GtkWidget *resolution_replaygain_noise_shaping_radio_none; | |
105 static GtkWidget *resolution_replaygain_noise_shaping_radio_low; | |
106 static GtkWidget *resolution_replaygain_noise_shaping_radio_medium; | |
107 static GtkWidget *resolution_replaygain_noise_shaping_radio_high; | |
108 static GtkWidget *resolution_replaygain_bps_out_frame; | |
109 static GtkWidget *resolution_replaygain_bps_out_radio_16bps; | |
110 static GtkWidget *resolution_replaygain_bps_out_radio_24bps; | |
111 | |
112 static GtkObject *streaming_size_adj, *streaming_pre_adj; | |
1071
592ef16386aa
[svn] - use global proxy configuration instead of individual configurations (chainsaw)
nenolod
parents:
867
diff
changeset
|
113 static GtkWidget *streaming_save_use, *streaming_save_entry; |
61 | 114 #ifdef FLAC_ICECAST |
115 static GtkWidget *streaming_cast_title, *streaming_udp_title; | |
116 #endif | |
1071
592ef16386aa
[svn] - use global proxy configuration instead of individual configurations (chainsaw)
nenolod
parents:
867
diff
changeset
|
117 static GtkWidget *streaming_save_dirbrowser; |
61 | 118 static GtkWidget *streaming_save_hbox; |
119 | |
248 | 120 static const gchar *gtk_entry_get_text_1 (GtkWidget *widget); |
61 | 121 static void flac_configurewin_ok(GtkWidget * widget, gpointer data); |
122 static void configure_destroy(GtkWidget * w, gpointer data); | |
123 | |
124 static void flac_configurewin_ok(GtkWidget * widget, gpointer data) | |
125 { | |
303 | 126 ConfigDb *db; |
61 | 127 |
128 (void)widget, (void)data; /* unused arguments */ | |
129 g_free(flac_cfg.title.tag_format); | |
130 flac_cfg.title.tag_format = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_tag_entry))); | |
131 flac_cfg.title.user_char_set = Charset_Get_Name_From_Title(gtk_entry_get_text_1(userCharacterSetEntry)); | |
132 | |
303 | 133 db = bmp_cfg_db_open(); |
61 | 134 /* title */ |
303 | 135 bmp_cfg_db_set_bool(db, "flac", "title.tag_override", flac_cfg.title.tag_override); |
136 bmp_cfg_db_set_string(db, "flac", "title.tag_format", flac_cfg.title.tag_format); | |
137 bmp_cfg_db_set_bool(db, "flac", "title.convert_char_set", flac_cfg.title.convert_char_set); | |
138 bmp_cfg_db_set_string(db, "flac", "title.user_char_set", flac_cfg.title.user_char_set); | |
61 | 139 /* output */ |
303 | 140 bmp_cfg_db_set_bool(db, "flac", "output.replaygain.enable", flac_cfg.output.replaygain.enable); |
141 bmp_cfg_db_set_bool(db, "flac", "output.replaygain.album_mode", flac_cfg.output.replaygain.album_mode); | |
142 bmp_cfg_db_set_int(db, "flac", "output.replaygain.preamp", flac_cfg.output.replaygain.preamp); | |
143 bmp_cfg_db_set_bool(db, "flac", "output.replaygain.hard_limit", flac_cfg.output.replaygain.hard_limit); | |
144 bmp_cfg_db_set_bool(db, "flac", "output.resolution.normal.dither_24_to_16", flac_cfg.output.resolution.normal.dither_24_to_16); | |
145 bmp_cfg_db_set_bool(db, "flac", "output.resolution.replaygain.dither", flac_cfg.output.resolution.replaygain.dither); | |
146 bmp_cfg_db_set_int(db, "flac", "output.resolution.replaygain.noise_shaping", flac_cfg.output.resolution.replaygain.noise_shaping); | |
147 bmp_cfg_db_set_int(db, "flac", "output.resolution.replaygain.bps_out", flac_cfg.output.resolution.replaygain.bps_out); | |
61 | 148 /* streaming */ |
149 flac_cfg.stream.http_buffer_size = (gint) GTK_ADJUSTMENT(streaming_size_adj)->value; | |
150 flac_cfg.stream.http_prebuffer = (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value; | |
151 | |
152 flac_cfg.stream.save_http_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use)); | |
675
632e797d9509
[svn] - Fix a crash relating to changing FLAC plugin settings. Closes bug #412.
nenolod
parents:
303
diff
changeset
|
153 |
632e797d9509
[svn] - Fix a crash relating to changing FLAC plugin settings. Closes bug #412.
nenolod
parents:
303
diff
changeset
|
154 if (flac_cfg.stream.save_http_path != NULL) |
61 | 155 g_free(flac_cfg.stream.save_http_path); |
675
632e797d9509
[svn] - Fix a crash relating to changing FLAC plugin settings. Closes bug #412.
nenolod
parents:
303
diff
changeset
|
156 |
61 | 157 flac_cfg.stream.save_http_path = g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry))); |
158 | |
159 #ifdef FLAC_ICECAST | |
160 flac_cfg.stream.cast_title_streaming = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_cast_title)); | |
161 flac_cfg.stream.use_udp_channel = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_udp_title)); | |
162 #endif | |
163 | |
303 | 164 bmp_cfg_db_set_int(db, "flac", "stream.http_buffer_size", flac_cfg.stream.http_buffer_size); |
165 bmp_cfg_db_set_int(db, "flac", "stream.http_prebuffer", flac_cfg.stream.http_prebuffer); | |
166 bmp_cfg_db_set_bool(db, "flac", "stream.save_http_stream", flac_cfg.stream.save_http_stream); | |
167 bmp_cfg_db_set_string(db, "flac", "stream.save_http_path", flac_cfg.stream.save_http_path); | |
61 | 168 #ifdef FLAC_ICECAST |
303 | 169 bmp_cfg_db_set_bool(db, "flac", "stream.cast_title_streaming", flac_cfg.stream.cast_title_streaming); |
170 bmp_cfg_db_set_bool(db, "flac", "stream.use_udp_channel", flac_cfg.stream.use_udp_channel); | |
61 | 171 #endif |
172 | |
303 | 173 bmp_cfg_db_close(db); |
61 | 174 gtk_widget_destroy(flac_configurewin); |
175 } | |
176 | |
177 static void configure_destroy(GtkWidget *widget, gpointer data) | |
178 { | |
179 (void)widget, (void)data; /* unused arguments */ | |
180 } | |
181 | |
182 static void title_tag_override_cb(GtkWidget *widget, gpointer data) | |
183 { | |
184 (void)widget, (void)data; /* unused arguments */ | |
185 flac_cfg.title.tag_override = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_tag_override)); | |
186 | |
187 gtk_widget_set_sensitive(title_tag_box, flac_cfg.title.tag_override); | |
188 gtk_widget_set_sensitive(title_desc, flac_cfg.title.tag_override); | |
189 | |
190 } | |
191 | |
192 static void convert_char_set_cb(GtkWidget *widget, gpointer data) | |
193 { | |
194 (void)widget, (void)data; /* unused arguments */ | |
195 flac_cfg.title.convert_char_set = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(convert_char_set)); | |
196 | |
197 gtk_widget_set_sensitive(fileCharacterSetEntry, FALSE); | |
198 gtk_widget_set_sensitive(userCharacterSetEntry, flac_cfg.title.convert_char_set); | |
199 } | |
200 | |
201 static void replaygain_enable_cb(GtkWidget *widget, gpointer data) | |
202 { | |
203 (void)widget, (void)data; /* unused arguments */ | |
204 flac_cfg.output.replaygain.enable = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_enable)); | |
205 | |
206 gtk_widget_set_sensitive(replaygain_album_mode, flac_cfg.output.replaygain.enable); | |
207 gtk_widget_set_sensitive(replaygain_preamp_hscale, flac_cfg.output.replaygain.enable); | |
208 gtk_widget_set_sensitive(replaygain_hard_limit, flac_cfg.output.replaygain.enable); | |
209 } | |
210 | |
211 static void replaygain_album_mode_cb(GtkWidget *widget, gpointer data) | |
212 { | |
213 (void)widget, (void)data; /* unused arguments */ | |
214 flac_cfg.output.replaygain.album_mode = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_album_mode)); | |
215 } | |
216 | |
217 static void replaygain_hard_limit_cb(GtkWidget *widget, gpointer data) | |
218 { | |
219 (void)widget, (void)data; /* unused arguments */ | |
220 flac_cfg.output.replaygain.hard_limit = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(replaygain_hard_limit)); | |
221 } | |
222 | |
223 static void replaygain_preamp_cb(GtkWidget *widget, gpointer data) | |
224 { | |
225 GString *gstring = g_string_new(""); | |
226 (void)widget, (void)data; /* unused arguments */ | |
227 flac_cfg.output.replaygain.preamp = (int) floor(GTK_ADJUSTMENT(replaygain_preamp)->value + 0.5); | |
228 | |
229 g_string_sprintf(gstring, "%i dB", flac_cfg.output.replaygain.preamp); | |
230 gtk_label_set_text(GTK_LABEL(replaygain_preamp_label), _(gstring->str)); | |
231 } | |
232 | |
233 static void resolution_normal_dither_24_to_16_cb(GtkWidget *widget, gpointer data) | |
234 { | |
235 (void)widget, (void)data; /* unused arguments */ | |
236 flac_cfg.output.resolution.normal.dither_24_to_16 = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_normal_dither_24_to_16)); | |
237 } | |
238 | |
239 static void resolution_replaygain_dither_cb(GtkWidget *widget, gpointer data) | |
240 { | |
241 (void)widget, (void)data; /* unused arguments */ | |
242 flac_cfg.output.resolution.replaygain.dither = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither)); | |
243 | |
244 gtk_widget_set_sensitive(resolution_replaygain_noise_shaping_frame, flac_cfg.output.resolution.replaygain.dither); | |
245 } | |
246 | |
247 static void resolution_replaygain_noise_shaping_cb(GtkWidget *widget, gpointer data) | |
248 { | |
249 (void)widget, (void)data; /* unused arguments */ | |
250 flac_cfg.output.resolution.replaygain.noise_shaping = | |
251 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none))? 0 : | |
252 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low))? 1 : | |
253 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium))? 2 : | |
254 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high))? 3 : | |
255 0 | |
256 ; | |
257 } | |
258 | |
259 static void resolution_replaygain_bps_out_cb(GtkWidget *widget, gpointer data) | |
260 { | |
261 (void)widget, (void)data; /* unused arguments */ | |
262 flac_cfg.output.resolution.replaygain.bps_out = | |
263 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps))? 16 : | |
264 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps))? 24 : | |
265 16 | |
266 ; | |
267 } | |
268 | |
269 static void streaming_save_dirbrowser_cb(gchar * dir) | |
270 { | |
271 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), dir); | |
272 } | |
273 | |
274 static void streaming_save_browse_cb(GtkWidget * w, gpointer data) | |
275 { | |
276 (void) w; | |
277 (void) data; | |
278 if (!streaming_save_dirbrowser) | |
279 { | |
280 streaming_save_dirbrowser = xmms_create_dir_browser(_("Select the directory where you want to store the MPEG streams:"), | |
281 flac_cfg.stream.save_http_path, GTK_SELECTION_SINGLE, streaming_save_dirbrowser_cb); | |
282 gtk_signal_connect(GTK_OBJECT(streaming_save_dirbrowser), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &streaming_save_dirbrowser); | |
283 gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser), GTK_WINDOW(flac_configurewin)); | |
284 gtk_widget_show(streaming_save_dirbrowser); | |
285 } | |
286 } | |
287 | |
288 static void streaming_save_use_cb(GtkWidget * w, gpointer data) | |
289 { | |
290 gboolean save_stream; | |
291 (void) w; | |
292 (void) data; | |
293 | |
294 save_stream = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use)); | |
295 | |
296 gtk_widget_set_sensitive(streaming_save_hbox, save_stream); | |
297 } | |
298 | |
299 | |
300 void FLAC_XMMS__configure(void) | |
301 { | |
302 GtkWidget *title_frame, *title_tag_vbox, *title_tag_label; | |
303 GtkWidget *replaygain_frame, *resolution_frame, *output_vbox, *resolution_normal_frame, *resolution_replaygain_frame; | |
304 GtkWidget *replaygain_vbox, *resolution_hbox, *resolution_normal_vbox, *resolution_replaygain_vbox; | |
305 GtkWidget *resolution_replaygain_noise_shaping_vbox; | |
306 GtkWidget *resolution_replaygain_bps_out_vbox; | |
307 GtkWidget *label, *hbox; | |
308 GtkWidget *bbox, *ok, *cancel; | |
309 GList *list; | |
310 | |
311 GtkWidget *streaming_vbox; | |
312 GtkWidget *streaming_buf_frame, *streaming_buf_hbox; | |
313 GtkWidget *streaming_size_box, *streaming_size_label, *streaming_size_spin; | |
314 GtkWidget *streaming_pre_box, *streaming_pre_label, *streaming_pre_spin; | |
315 GtkWidget *streaming_save_frame, *streaming_save_vbox; | |
316 GtkWidget *streaming_save_label, *streaming_save_browse; | |
317 #ifdef FLAC_ICECAST | |
318 GtkWidget *streaming_cast_frame, *streaming_cast_vbox; | |
319 #endif | |
320 | |
321 if (flac_configurewin != NULL) { | |
322 gdk_window_raise(flac_configurewin->window); | |
323 return; | |
324 } | |
325 flac_configurewin = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
326 gtk_signal_connect(GTK_OBJECT(flac_configurewin), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &flac_configurewin); | |
327 gtk_signal_connect(GTK_OBJECT(flac_configurewin), "destroy", GTK_SIGNAL_FUNC(configure_destroy), &flac_configurewin); | |
328 gtk_window_set_title(GTK_WINDOW(flac_configurewin), _("Flac Configuration")); | |
329 gtk_window_set_policy(GTK_WINDOW(flac_configurewin), FALSE, FALSE, FALSE); | |
330 gtk_container_border_width(GTK_CONTAINER(flac_configurewin), 10); | |
331 | |
332 vbox = gtk_vbox_new(FALSE, 10); | |
333 gtk_container_add(GTK_CONTAINER(flac_configurewin), vbox); | |
334 | |
335 notebook = gtk_notebook_new(); | |
336 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); | |
337 | |
338 /* Title config.. */ | |
339 | |
340 title_frame = gtk_frame_new(_("Tag Handling")); | |
341 gtk_container_border_width(GTK_CONTAINER(title_frame), 5); | |
342 | |
343 title_tag_vbox = gtk_vbox_new(FALSE, 10); | |
344 gtk_container_border_width(GTK_CONTAINER(title_tag_vbox), 5); | |
345 gtk_container_add(GTK_CONTAINER(title_frame), title_tag_vbox); | |
346 | |
347 /* Convert Char Set */ | |
348 | |
349 convert_char_set = gtk_check_button_new_with_label(_("Convert Character Set")); | |
350 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(convert_char_set), flac_cfg.title.convert_char_set); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
351 gtk_signal_connect(GTK_OBJECT(convert_char_set), "clicked", (GCallback)convert_char_set_cb, NULL); |
61 | 352 gtk_box_pack_start(GTK_BOX(title_tag_vbox), convert_char_set, FALSE, FALSE, 0); |
353 /* Combo boxes... */ | |
354 hbox = gtk_hbox_new(FALSE,4); | |
355 gtk_container_add(GTK_CONTAINER(title_tag_vbox),hbox); | |
356 label = gtk_label_new(_("Convert character set from :")); | |
357 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); | |
358 fileCharacterSetEntry = gtk_combo_new(); | |
359 gtk_box_pack_start(GTK_BOX(hbox),fileCharacterSetEntry,TRUE,TRUE,0); | |
360 | |
361 label = gtk_label_new (_("to :")); | |
362 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); | |
363 userCharacterSetEntry = gtk_combo_new(); | |
364 gtk_box_pack_start(GTK_BOX(hbox),userCharacterSetEntry,TRUE,TRUE,0); | |
365 | |
366 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(fileCharacterSetEntry)->entry),FALSE); | |
367 gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(userCharacterSetEntry)->entry),FALSE); | |
368 gtk_combo_set_value_in_list(GTK_COMBO(fileCharacterSetEntry),TRUE,FALSE); | |
369 gtk_combo_set_value_in_list(GTK_COMBO(userCharacterSetEntry),TRUE,FALSE); | |
370 | |
371 list = Charset_Create_List(); | |
372 gtk_combo_set_popdown_strings(GTK_COMBO(fileCharacterSetEntry),Charset_Create_List_UTF8_Only()); | |
373 gtk_combo_set_popdown_strings(GTK_COMBO(userCharacterSetEntry),list); | |
374 gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(userCharacterSetEntry)->entry),Charset_Get_Title_From_Name(flac_cfg.title.user_char_set)); | |
375 gtk_widget_set_sensitive(fileCharacterSetEntry, FALSE); | |
376 gtk_widget_set_sensitive(userCharacterSetEntry, flac_cfg.title.convert_char_set); | |
377 | |
378 /* Override Tagging Format */ | |
379 | |
380 title_tag_override = gtk_check_button_new_with_label(_("Override generic titles")); | |
381 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_tag_override), flac_cfg.title.tag_override); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
382 gtk_signal_connect(GTK_OBJECT(title_tag_override), "clicked", (GCallback)title_tag_override_cb, NULL); |
61 | 383 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_override, FALSE, FALSE, 0); |
384 | |
385 title_tag_box = gtk_hbox_new(FALSE, 5); | |
386 gtk_widget_set_sensitive(title_tag_box, flac_cfg.title.tag_override); | |
387 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_tag_box, FALSE, FALSE, 0); | |
388 | |
389 title_tag_label = gtk_label_new(_("Title format:")); | |
390 gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_label, FALSE, FALSE, 0); | |
391 | |
392 title_tag_entry = gtk_entry_new(); | |
393 gtk_entry_set_text(GTK_ENTRY(title_tag_entry), flac_cfg.title.tag_format); | |
394 gtk_box_pack_start(GTK_BOX(title_tag_box), title_tag_entry, TRUE, TRUE, 0); | |
395 | |
396 title_desc = xmms_titlestring_descriptions("pafFetnygc", 2); | |
397 gtk_widget_set_sensitive(title_desc, flac_cfg.title.tag_override); | |
398 gtk_box_pack_start(GTK_BOX(title_tag_vbox), title_desc, FALSE, FALSE, 0); | |
399 | |
400 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame, gtk_label_new(_("Title"))); | |
401 | |
402 /* Output config.. */ | |
403 | |
404 output_vbox = gtk_vbox_new(FALSE, 10); | |
405 gtk_container_border_width(GTK_CONTAINER(output_vbox), 5); | |
406 | |
407 /* replaygain */ | |
408 | |
409 replaygain_frame = gtk_frame_new(_("ReplayGain")); | |
410 gtk_container_border_width(GTK_CONTAINER(replaygain_frame), 5); | |
411 gtk_box_pack_start(GTK_BOX(output_vbox), replaygain_frame, TRUE, TRUE, 0); | |
412 | |
413 replaygain_vbox = gtk_vbox_new(FALSE, 10); | |
414 gtk_container_border_width(GTK_CONTAINER(replaygain_vbox), 5); | |
415 gtk_container_add(GTK_CONTAINER(replaygain_frame), replaygain_vbox); | |
416 | |
417 replaygain_enable = gtk_check_button_new_with_label(_("Enable ReplayGain processing")); | |
418 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_enable), flac_cfg.output.replaygain.enable); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
419 gtk_signal_connect(GTK_OBJECT(replaygain_enable), "clicked", (GCallback)replaygain_enable_cb, NULL); |
61 | 420 gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_enable, FALSE, FALSE, 0); |
421 | |
422 replaygain_album_mode = gtk_check_button_new_with_label(_("Album mode")); | |
423 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_album_mode), flac_cfg.output.replaygain.album_mode); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
424 gtk_signal_connect(GTK_OBJECT(replaygain_album_mode), "clicked", (GCallback)replaygain_album_mode_cb, NULL); |
61 | 425 gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_album_mode, FALSE, FALSE, 0); |
426 | |
427 hbox = gtk_hbox_new(FALSE,3); | |
428 gtk_container_add(GTK_CONTAINER(replaygain_vbox),hbox); | |
429 label = gtk_label_new(_("Preamp:")); | |
430 gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); | |
431 replaygain_preamp = gtk_adjustment_new(flac_cfg.output.replaygain.preamp, -24.0, +24.0, 1.0, 6.0, 0.0); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
432 gtk_signal_connect(GTK_OBJECT(replaygain_preamp), "value-changed", (GCallback)replaygain_preamp_cb, NULL); |
61 | 433 replaygain_preamp_hscale = gtk_hscale_new(GTK_ADJUSTMENT(replaygain_preamp)); |
434 gtk_scale_set_draw_value(GTK_SCALE(replaygain_preamp_hscale), FALSE); | |
435 gtk_box_pack_start(GTK_BOX(hbox),replaygain_preamp_hscale,TRUE,TRUE,0); | |
436 replaygain_preamp_label = gtk_label_new(_("0 dB")); | |
437 gtk_box_pack_start(GTK_BOX(hbox),replaygain_preamp_label,FALSE,FALSE,0); | |
438 gtk_adjustment_value_changed(GTK_ADJUSTMENT(replaygain_preamp)); | |
439 | |
440 replaygain_hard_limit = gtk_check_button_new_with_label(_("6dB hard limiting")); | |
441 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(replaygain_hard_limit), flac_cfg.output.replaygain.hard_limit); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
442 gtk_signal_connect(GTK_OBJECT(replaygain_hard_limit), "clicked", (GCallback)replaygain_hard_limit_cb, NULL); |
61 | 443 gtk_box_pack_start(GTK_BOX(replaygain_vbox), replaygain_hard_limit, FALSE, FALSE, 0); |
444 | |
445 replaygain_enable_cb(replaygain_enable, NULL); | |
446 | |
447 /* resolution */ | |
448 | |
449 resolution_frame = gtk_frame_new(_("Resolution")); | |
450 gtk_container_border_width(GTK_CONTAINER(resolution_frame), 5); | |
451 gtk_box_pack_start(GTK_BOX(output_vbox), resolution_frame, TRUE, TRUE, 0); | |
452 | |
453 resolution_hbox = gtk_hbox_new(FALSE, 10); | |
454 gtk_container_border_width(GTK_CONTAINER(resolution_hbox), 5); | |
455 gtk_container_add(GTK_CONTAINER(resolution_frame), resolution_hbox); | |
456 | |
457 resolution_normal_frame = gtk_frame_new(_("Without ReplayGain")); | |
458 gtk_container_border_width(GTK_CONTAINER(resolution_normal_frame), 5); | |
459 gtk_box_pack_start(GTK_BOX(resolution_hbox), resolution_normal_frame, TRUE, TRUE, 0); | |
460 | |
461 resolution_normal_vbox = gtk_vbox_new(FALSE, 10); | |
462 gtk_container_border_width(GTK_CONTAINER(resolution_normal_vbox), 5); | |
463 gtk_container_add(GTK_CONTAINER(resolution_normal_frame), resolution_normal_vbox); | |
464 | |
465 resolution_normal_dither_24_to_16 = gtk_check_button_new_with_label(_("Dither 24bps to 16bps")); | |
466 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_normal_dither_24_to_16), flac_cfg.output.resolution.normal.dither_24_to_16); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
467 gtk_signal_connect(GTK_OBJECT(resolution_normal_dither_24_to_16), "clicked", (GCallback)resolution_normal_dither_24_to_16_cb, NULL); |
61 | 468 gtk_box_pack_start(GTK_BOX(resolution_normal_vbox), resolution_normal_dither_24_to_16, FALSE, FALSE, 0); |
469 | |
470 resolution_replaygain_frame = gtk_frame_new(_("With ReplayGain")); | |
471 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_frame), 5); | |
472 gtk_box_pack_start(GTK_BOX(resolution_hbox), resolution_replaygain_frame, TRUE, TRUE, 0); | |
473 | |
474 resolution_replaygain_vbox = gtk_vbox_new(FALSE, 10); | |
475 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_vbox), 5); | |
476 gtk_container_add(GTK_CONTAINER(resolution_replaygain_frame), resolution_replaygain_vbox); | |
477 | |
478 resolution_replaygain_dither = gtk_check_button_new_with_label(_("Enable dithering")); | |
479 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither), flac_cfg.output.resolution.replaygain.dither); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
480 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_dither), "clicked", (GCallback)resolution_replaygain_dither_cb, NULL); |
61 | 481 gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), resolution_replaygain_dither, FALSE, FALSE, 0); |
482 | |
483 hbox = gtk_hbox_new(FALSE, 10); | |
484 gtk_container_border_width(GTK_CONTAINER(hbox), 5); | |
485 gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), hbox, TRUE, TRUE, 0); | |
486 | |
487 resolution_replaygain_noise_shaping_frame = gtk_frame_new(_("Noise shaping")); | |
488 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), 5); | |
489 gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_noise_shaping_frame, TRUE, TRUE, 0); | |
490 | |
491 resolution_replaygain_noise_shaping_vbox = gtk_vbutton_box_new(); | |
492 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), 5); | |
493 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), resolution_replaygain_noise_shaping_vbox); | |
494 | |
495 resolution_replaygain_noise_shaping_radio_none = gtk_radio_button_new_with_label(NULL, _("none")); | |
496 if(flac_cfg.output.resolution.replaygain.noise_shaping == 0) | |
497 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none), TRUE); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
498 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_none), "clicked", (GCallback)resolution_replaygain_noise_shaping_cb, NULL); |
61 | 499 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_none); |
500 | |
501 resolution_replaygain_noise_shaping_radio_low = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("low")); | |
502 if(flac_cfg.output.resolution.replaygain.noise_shaping == 1) | |
503 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low), TRUE); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
504 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_low), "clicked", (GCallback)resolution_replaygain_noise_shaping_cb, NULL); |
61 | 505 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_low); |
506 | |
507 resolution_replaygain_noise_shaping_radio_medium = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("medium")); | |
508 if(flac_cfg.output.resolution.replaygain.noise_shaping == 2) | |
509 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium), TRUE); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
510 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_medium), "clicked", (GCallback)resolution_replaygain_noise_shaping_cb, NULL); |
61 | 511 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_medium); |
512 | |
513 resolution_replaygain_noise_shaping_radio_high = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("high")); | |
514 if(flac_cfg.output.resolution.replaygain.noise_shaping == 3) | |
515 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high), TRUE); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
516 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_high), "clicked", (GCallback)resolution_replaygain_noise_shaping_cb, NULL); |
61 | 517 gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_high); |
518 | |
519 resolution_replaygain_bps_out_frame = gtk_frame_new(_("Dither to")); | |
520 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_frame), 5); | |
521 gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_bps_out_frame, FALSE, FALSE, 0); | |
522 | |
523 resolution_replaygain_bps_out_vbox = gtk_vbutton_box_new(); | |
524 gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), 0); | |
525 gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_frame), resolution_replaygain_bps_out_vbox); | |
526 | |
527 resolution_replaygain_bps_out_radio_16bps = gtk_radio_button_new_with_label(NULL, _("16 bps")); | |
528 if(flac_cfg.output.resolution.replaygain.bps_out == 16) | |
529 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps), TRUE); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
530 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_16bps), "clicked", (GCallback)resolution_replaygain_bps_out_cb, NULL); |
61 | 531 gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_16bps); |
532 | |
533 resolution_replaygain_bps_out_radio_24bps = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_bps_out_radio_16bps), _("24 bps")); | |
534 if(flac_cfg.output.resolution.replaygain.bps_out == 24) | |
535 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps), TRUE); | |
209
bd8457b077cf
[svn] Add casts to callbacks in signal handlers to avoid warning. Remove stale pause handler declaration from wav-sndfile.h
chainsaw
parents:
188
diff
changeset
|
536 gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_24bps), "clicked", (GCallback)resolution_replaygain_bps_out_cb, NULL); |
61 | 537 gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_24bps); |
538 | |
539 resolution_replaygain_dither_cb(resolution_replaygain_dither, NULL); | |
540 | |
541 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), output_vbox, gtk_label_new(_("Output"))); | |
542 | |
543 /* Streaming */ | |
544 | |
545 streaming_vbox = gtk_vbox_new(FALSE, 0); | |
546 | |
547 streaming_buf_frame = gtk_frame_new(_("Buffering:")); | |
548 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5); | |
549 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE, FALSE, 0); | |
550 | |
551 streaming_buf_hbox = gtk_hbox_new(TRUE, 5); | |
552 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5); | |
553 gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox); | |
554 | |
555 streaming_size_box = gtk_hbox_new(FALSE, 5); | |
556 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_size_box,0,1,0,1); */ | |
557 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box, TRUE, TRUE, 0); | |
558 streaming_size_label = gtk_label_new(_("Buffer size (kb):")); | |
559 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label, FALSE, FALSE, 0); | |
560 streaming_size_adj = gtk_adjustment_new(flac_cfg.stream.http_buffer_size, 4, 4096, 4, 4, 4); | |
561 streaming_size_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0); | |
562 gtk_widget_set_usize(streaming_size_spin, 60, -1); | |
563 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin, FALSE, FALSE, 0); | |
564 | |
565 streaming_pre_box = gtk_hbox_new(FALSE, 5); | |
566 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_pre_box,1,2,0,1); */ | |
567 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box, TRUE, TRUE, 0); | |
568 streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):")); | |
569 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label, FALSE, FALSE, 0); | |
570 streaming_pre_adj = gtk_adjustment_new(flac_cfg.stream.http_prebuffer, 0, 90, 1, 1, 1); | |
571 streaming_pre_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0); | |
572 gtk_widget_set_usize(streaming_pre_spin, 60, -1); | |
573 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin, FALSE, FALSE, 0); | |
574 | |
575 /* | |
576 * Save to disk config. | |
577 */ | |
578 streaming_save_frame = gtk_frame_new(_("Save stream to disk:")); | |
579 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5); | |
580 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame, FALSE, FALSE, 0); | |
581 | |
582 streaming_save_vbox = gtk_vbox_new(FALSE, 5); | |
583 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5); | |
584 gtk_container_add(GTK_CONTAINER(streaming_save_frame), streaming_save_vbox); | |
585 | |
586 streaming_save_use = gtk_check_button_new_with_label(_("Save stream to disk")); | |
587 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), flac_cfg.stream.save_http_stream); | |
588 gtk_signal_connect(GTK_OBJECT(streaming_save_use), "clicked", GTK_SIGNAL_FUNC(streaming_save_use_cb), NULL); | |
589 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, FALSE, FALSE, 0); | |
590 | |
591 streaming_save_hbox = gtk_hbox_new(FALSE, 5); | |
592 gtk_widget_set_sensitive(streaming_save_hbox, flac_cfg.stream.save_http_stream); | |
593 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox, FALSE, FALSE, 0); | |
594 | |
595 streaming_save_label = gtk_label_new(_("Path:")); | |
596 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label, FALSE, FALSE, 0); | |
597 | |
598 streaming_save_entry = gtk_entry_new(); | |
599 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), flac_cfg.stream.save_http_path); | |
600 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry, TRUE, TRUE, 0); | |
601 | |
602 streaming_save_browse = gtk_button_new_with_label(_("Browse")); | |
603 gtk_signal_connect(GTK_OBJECT(streaming_save_browse), "clicked", GTK_SIGNAL_FUNC(streaming_save_browse_cb), NULL); | |
604 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, FALSE, FALSE, 0); | |
605 | |
606 #ifdef FLAC_ICECAST | |
607 streaming_cast_frame = gtk_frame_new(_("SHOUT/Icecast:")); | |
608 gtk_container_set_border_width(GTK_CONTAINER(streaming_cast_frame), 5); | |
609 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_cast_frame, FALSE, FALSE, 0); | |
610 | |
611 streaming_cast_vbox = gtk_vbox_new(5, FALSE); | |
612 gtk_container_add(GTK_CONTAINER(streaming_cast_frame), streaming_cast_vbox); | |
613 | |
614 streaming_cast_title = gtk_check_button_new_with_label(_("Enable SHOUT/Icecast title streaming")); | |
615 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_cast_title), flac_cfg.stream.cast_title_streaming); | |
616 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_cast_title, FALSE, FALSE, 0); | |
617 | |
618 streaming_udp_title = gtk_check_button_new_with_label(_("Enable Icecast Metadata UDP Channel")); | |
619 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_udp_title), flac_cfg.stream.use_udp_channel); | |
620 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title, FALSE, FALSE, 0); | |
621 #endif | |
622 | |
623 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox, gtk_label_new(_("Streaming"))); | |
624 | |
625 /* Buttons */ | |
626 | |
627 bbox = gtk_hbutton_box_new(); | |
628 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); | |
629 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); | |
630 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); | |
631 | |
632 ok = gtk_button_new_with_label(_("Ok")); | |
633 gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(flac_configurewin_ok), NULL); | |
634 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT); | |
635 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0); | |
636 gtk_widget_grab_default(ok); | |
637 | |
638 cancel = gtk_button_new_with_label(_("Cancel")); | |
639 gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(flac_configurewin)); | |
640 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); | |
641 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); | |
642 | |
643 gtk_widget_show_all(flac_configurewin); | |
644 } | |
645 | |
646 void FLAC_XMMS__aboutbox() | |
647 { | |
648 static GtkWidget *about_window; | |
649 | |
650 if (about_window) | |
651 gdk_window_raise(about_window->window); | |
867 | 652 else |
653 { | |
654 about_window = xmms_show_message( | |
655 _("About Flac Plugin"), | |
656 _("Flac Plugin by Josh Coalson\n" | |
657 "contributions by\n" | |
658 "......\n" | |
659 "......\n" | |
660 "and\n" | |
661 "Daisuke Shimamura\n" | |
662 "Visit http://flac.sourceforge.net/"), | |
663 _("Ok"), FALSE, NULL, NULL); | |
664 gtk_signal_connect(GTK_OBJECT(about_window), "destroy", | |
665 GTK_SIGNAL_FUNC(gtk_widget_destroyed), | |
666 &about_window); | |
667 } | |
61 | 668 } |
669 | |
670 /* | |
671 * Get text of an Entry or a ComboBox | |
672 */ | |
248 | 673 static const gchar *gtk_entry_get_text_1 (GtkWidget *widget) |
61 | 674 { |
675 if (GTK_IS_COMBO(widget)) | |
676 { | |
677 return gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(widget)->entry)); | |
678 }else if (GTK_IS_ENTRY(widget)) | |
679 { | |
680 return gtk_entry_get_text(GTK_ENTRY(widget)); | |
681 }else | |
682 { | |
683 return NULL; | |
684 } | |
685 } |