annotate Plugins/Input/mpg123/configure.c @ 257:256b3acc87d4 trunk

[svn] Properly report Audacious instead of XMMS or BMP in all places. Patch by laci; closes bug #379.
author chainsaw
date Sun, 04 Dec 2005 09:29:14 -0800
parents f394090439df
children 3fb3657d2e14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 #include "mpg123.h"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 #include <glib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 #include <glib/gi18n.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 #include <gtk/gtk.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 #include <stdlib.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 #include <string.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 #include <math.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 #include <libaudacious/configdb.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 #include <libaudacious/dirbrowser.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 #include <libaudacious/titlestring.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 static GtkWidget *mpg123_configurewin = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 static GtkWidget *vbox, *notebook;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 static GtkWidget *decode_vbox, *decode_hbox1;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 static GtkWidget *decode_res_frame, *decode_res_vbox, *decode_res_16,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 *decode_res_8;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 static GtkWidget *decode_ch_frame, *decode_ch_vbox, *decode_ch_stereo,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 *decode_ch_mono;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 static GtkWidget *decode_freq_frame, *decode_freq_vbox, *decode_freq_1to1,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 *decode_freq_1to2, *decode_freq_1to4;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 static GtkWidget *option_frame, *option_vbox, *detect_by_content,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26 *detect_by_extension, *detect_by_both;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 static GtkObject *streaming_size_adj, *streaming_pre_adj;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 static GtkWidget *streaming_proxy_use, *streaming_proxy_host_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 static GtkWidget *streaming_proxy_port_entry, *streaming_save_use,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 *streaming_save_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 static GtkWidget *streaming_proxy_auth_use;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 static GtkWidget *streaming_proxy_auth_pass_entry,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34 *streaming_proxy_auth_user_entry;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 static GtkWidget *streaming_proxy_auth_user_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 *streaming_proxy_auth_pass_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 static GtkWidget *streaming_cast_title, *streaming_udp_title;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 static GtkWidget *streaming_proxy_hbox, *streaming_proxy_auth_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 *streaming_save_dirbrowser;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40 static GtkWidget *streaming_save_hbox, *title_id3_box, *title_tag_desc;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 static GtkWidget *title_override, *title_id3_entry, *title_id3v2_disable;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44 static GtkWidget *title_encoding_hbox, *title_encoding_enabled, *title_encoding, *title_encoding_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 MPG123Config mpg123_cfg;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 mpg123_configurewin_ok(GtkWidget * widget, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 ConfigDb *db;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 if (GTK_TOGGLE_BUTTON(decode_res_16)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55 mpg123_cfg.resolution = 16;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 else if (GTK_TOGGLE_BUTTON(decode_res_8)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 mpg123_cfg.resolution = 8;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59 if (GTK_TOGGLE_BUTTON(decode_ch_stereo)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 mpg123_cfg.channels = 2;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61 else if (GTK_TOGGLE_BUTTON(decode_ch_mono)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 mpg123_cfg.channels = 1;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 if (GTK_TOGGLE_BUTTON(decode_freq_1to1)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65 mpg123_cfg.downsample = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 else if (GTK_TOGGLE_BUTTON(decode_freq_1to2)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 mpg123_cfg.downsample = 1;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 if (GTK_TOGGLE_BUTTON(decode_freq_1to4)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 mpg123_cfg.downsample = 2;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71 if (GTK_TOGGLE_BUTTON(detect_by_content)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 mpg123_cfg.detect_by = DETECT_CONTENT;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
73 else if (GTK_TOGGLE_BUTTON(detect_by_extension)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
74 mpg123_cfg.detect_by = DETECT_EXTENSION;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
75 else if (GTK_TOGGLE_BUTTON(detect_by_both)->active)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76 mpg123_cfg.detect_by = DETECT_BOTH;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78 mpg123_cfg.detect_by = DETECT_EXTENSION;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
79
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 mpg123_cfg.http_buffer_size =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
81 (gint) GTK_ADJUSTMENT(streaming_size_adj)->value;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
82 mpg123_cfg.http_prebuffer =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
83 (gint) GTK_ADJUSTMENT(streaming_pre_adj)->value;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
84
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85 mpg123_cfg.use_proxy =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
86 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
87 g_free(mpg123_cfg.proxy_host);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88 mpg123_cfg.proxy_host =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
89 g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_host_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
90 mpg123_cfg.proxy_port =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
91 atoi(gtk_entry_get_text(GTK_ENTRY(streaming_proxy_port_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
92
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
93 mpg123_cfg.proxy_use_auth =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
94 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95 (streaming_proxy_auth_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
96
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 if (mpg123_cfg.proxy_user)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
98 g_free(mpg123_cfg.proxy_user);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99 mpg123_cfg.proxy_user = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
100 if (strlen
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
101 (gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_user_entry))) > 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
102 mpg123_cfg.proxy_user =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
103 g_strdup(gtk_entry_get_text
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
104 (GTK_ENTRY(streaming_proxy_auth_user_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
105
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106 if (mpg123_cfg.proxy_pass)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
107 g_free(mpg123_cfg.proxy_pass);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
108 mpg123_cfg.proxy_pass = NULL;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
109 if (strlen
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
110 (gtk_entry_get_text(GTK_ENTRY(streaming_proxy_auth_pass_entry))) > 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
111 mpg123_cfg.proxy_pass =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
112 g_strdup(gtk_entry_get_text
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 (GTK_ENTRY(streaming_proxy_auth_pass_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
115
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
116 mpg123_cfg.save_http_stream =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
118 if (mpg123_cfg.save_http_path)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
119 g_free(mpg123_cfg.save_http_path);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
120 mpg123_cfg.save_http_path =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
121 g_strdup(gtk_entry_get_text(GTK_ENTRY(streaming_save_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
122
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
123 mpg123_cfg.use_udp_channel =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
124 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_udp_title));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
125
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
126 mpg123_cfg.title_override =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
127 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
128 mpg123_cfg.disable_id3v2 =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
129 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_id3v2_disable));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
130 g_free(mpg123_cfg.id3_format);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
131 mpg123_cfg.id3_format =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
132 g_strdup(gtk_entry_get_text(GTK_ENTRY(title_id3_entry)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
133
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
134 mpg123_cfg.title_encoding_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_encoding_enabled));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
135 mpg123_cfg.title_encoding = g_strdup(gtk_entry_get_text(GTK_ENTRY(title_encoding)));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
136 if (mpg123_cfg.title_encoding_enabled)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
137 mpg123_id3_encoding_list = g_strsplit_set(mpg123_cfg.title_encoding, ENCODING_SEPARATOR, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
138 db = bmp_cfg_db_open();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
139 bmp_cfg_db_set_int(db, "MPG123", "resolution", mpg123_cfg.resolution);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
140 bmp_cfg_db_set_int(db, "MPG123", "channels", mpg123_cfg.channels);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
141 bmp_cfg_db_set_int(db, "MPG123", "downsample", mpg123_cfg.downsample);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
142 bmp_cfg_db_set_int(db, "MPG123", "http_buffer_size",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
143 mpg123_cfg.http_buffer_size);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
144 bmp_cfg_db_set_int(db, "MPG123", "http_prebuffer",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
145 mpg123_cfg.http_prebuffer);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
146 bmp_cfg_db_set_bool(db, "MPG123", "use_proxy", mpg123_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147 bmp_cfg_db_set_string(db, "MPG123", "proxy_host", mpg123_cfg.proxy_host);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
148 bmp_cfg_db_set_int(db, "MPG123", "proxy_port", mpg123_cfg.proxy_port);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
149 bmp_cfg_db_set_bool(db, "MPG123", "proxy_use_auth",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
150 mpg123_cfg.proxy_use_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
151 if (mpg123_cfg.proxy_user)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
152 bmp_cfg_db_set_string(db, "MPG123", "proxy_user",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
153 mpg123_cfg.proxy_user);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
154 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
155 bmp_cfg_db_unset_key(db, "MPG123", "proxy_user");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
156 if (mpg123_cfg.proxy_pass)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
157 bmp_cfg_db_set_string(db, "MPG123", "proxy_pass",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
158 mpg123_cfg.proxy_pass);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
159 else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
160 bmp_cfg_db_unset_key(db, "MPG123", "proxy_pass");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
161 bmp_cfg_db_set_bool(db, "MPG123", "save_http_stream",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
162 mpg123_cfg.save_http_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
163 bmp_cfg_db_set_string(db, "MPG123", "save_http_path",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
164 mpg123_cfg.save_http_path);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
165 bmp_cfg_db_set_bool(db, "MPG123", "use_udp_channel",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
166 mpg123_cfg.use_udp_channel);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
167 bmp_cfg_db_set_bool(db, "MPG123", "title_override",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
168 mpg123_cfg.title_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
169 bmp_cfg_db_set_bool(db, "MPG123", "disable_id3v2",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
170 mpg123_cfg.disable_id3v2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
171 bmp_cfg_db_set_string(db, "MPG123", "id3_format", mpg123_cfg.id3_format);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
172 bmp_cfg_db_set_int(db, "MPG123", "detect_by", mpg123_cfg.detect_by);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
173
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
174 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
175 bmp_cfg_db_set_bool(db, "MPG123", "title_encoding_enabled", mpg123_cfg.title_encoding_enabled);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
176 bmp_cfg_db_set_string(db, "MPG123", "title_encoding", mpg123_cfg.title_encoding);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
177 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
178
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
179 bmp_cfg_db_close(db);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
180 gtk_widget_destroy(mpg123_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
181 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
182
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
183 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
184 proxy_use_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
185 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
186 gboolean use_proxy, use_proxy_auth;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
187
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
188 use_proxy =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
189 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
190 use_proxy_auth =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
191 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
192 (streaming_proxy_auth_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
193
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
194 gtk_widget_set_sensitive(streaming_proxy_hbox, use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
195 gtk_widget_set_sensitive(streaming_proxy_auth_use, use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
196 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
197 && use_proxy_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
198 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
199
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
200 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
201 proxy_auth_use_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
202 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
203 gboolean use_proxy, use_proxy_auth;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
204
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
205 use_proxy =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
206 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_proxy_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
207 use_proxy_auth =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
208 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
209 (streaming_proxy_auth_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
210
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
211 gtk_widget_set_sensitive(streaming_proxy_auth_hbox, use_proxy
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
212 && use_proxy_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
213 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
214
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
215 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
216 streaming_save_dirbrowser_cb(gchar * dir)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
217 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
218 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), dir);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
219 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
220
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
221 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
222 streaming_save_browse_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
223 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
224 if (!streaming_save_dirbrowser) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
225 streaming_save_dirbrowser =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
226 xmms_create_dir_browser(_
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
227 ("Select the directory where you want to store the MPEG streams:"),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
228 mpg123_cfg.save_http_path,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
229 GTK_SELECTION_SINGLE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
230 streaming_save_dirbrowser_cb);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
231 g_signal_connect(G_OBJECT(streaming_save_dirbrowser), "destroy",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
232 G_CALLBACK(gtk_widget_destroyed),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
233 &streaming_save_dirbrowser);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
234 gtk_window_set_transient_for(GTK_WINDOW(streaming_save_dirbrowser),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
235 GTK_WINDOW(mpg123_configurewin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
236 gtk_widget_show(streaming_save_dirbrowser);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
237 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
238 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
239
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
240 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
241 streaming_save_use_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
242 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
243 gboolean save_stream;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
244
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
245 save_stream =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
246 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(streaming_save_use));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
247
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
248 gtk_widget_set_sensitive(streaming_save_hbox, save_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
249 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
250
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
251 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
252 title_override_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
253 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
254 gboolean override;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
255 override =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
256 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_override));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
257 gtk_widget_set_sensitive(title_id3_box, override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
258 gtk_widget_set_sensitive(title_tag_desc, override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
259 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
260
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
261 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
262 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
263 title_encoding_enabled_cb(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
264 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
265 gboolean encoding_enabled;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
266 encoding_enabled =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
267 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(title_encoding_enabled));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
268 gtk_widget_set_sensitive(title_encoding_hbox, encoding_enabled);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
269 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
270 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
271
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
272 static void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
273 configure_destroy(GtkWidget * w, gpointer data)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
274 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
275 if (streaming_save_dirbrowser)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
276 gtk_widget_destroy(streaming_save_dirbrowser);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
277 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
278
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
279 void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
280 mpg123_configure(void)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
281 {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
282 GtkWidget *streaming_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
283 GtkWidget *streaming_buf_frame, *streaming_buf_hbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
284 GtkWidget *streaming_size_box, *streaming_size_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
285 *streaming_size_spin;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
286 GtkWidget *streaming_pre_box, *streaming_pre_label, *streaming_pre_spin;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
287 GtkWidget *streaming_proxy_frame, *streaming_proxy_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
288 GtkWidget *streaming_proxy_port_label, *streaming_proxy_host_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
289 GtkWidget *streaming_save_frame, *streaming_save_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
290 GtkWidget *streaming_save_label, *streaming_save_browse;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
291 GtkWidget *streaming_cast_frame, *streaming_cast_vbox;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
292 GtkWidget *title_frame, *title_id3_vbox, *title_id3_label;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
293 GtkWidget *bbox, *ok, *cancel;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
294
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
295 char *temp;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
296
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
297 if (mpg123_configurewin != NULL) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
298 gtk_window_present(GTK_WINDOW(mpg123_configurewin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
299 return;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
300 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
301 mpg123_configurewin = gtk_window_new(GTK_WINDOW_TOPLEVEL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
302 gtk_window_set_type_hint(GTK_WINDOW(mpg123_configurewin),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
303 GDK_WINDOW_TYPE_HINT_DIALOG);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
304 gtk_window_set_position(GTK_WINDOW(mpg123_configurewin),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
305 GTK_WIN_POS_CENTER);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
306 g_signal_connect(G_OBJECT(mpg123_configurewin), "destroy",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
307 G_CALLBACK(gtk_widget_destroyed), &mpg123_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
308 g_signal_connect(G_OBJECT(mpg123_configurewin), "destroy",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
309 G_CALLBACK(configure_destroy), &mpg123_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
310 gtk_window_set_title(GTK_WINDOW(mpg123_configurewin),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
311 _("MPEG Audio Plugin Configuration"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
312 gtk_window_set_resizable(GTK_WINDOW(mpg123_configurewin), FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
313 /* gtk_window_set_position(GTK_WINDOW(mpg123_configurewin), GTK_WIN_POS_MOUSE); */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
314 gtk_container_border_width(GTK_CONTAINER(mpg123_configurewin), 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
315
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
316 vbox = gtk_vbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
317 gtk_container_add(GTK_CONTAINER(mpg123_configurewin), vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
318
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
319 notebook = gtk_notebook_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
320 gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
321
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
322 decode_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
323 gtk_container_set_border_width(GTK_CONTAINER(decode_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
324
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
325 decode_hbox1 = gtk_hbox_new(TRUE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
326 gtk_box_pack_start(GTK_BOX(decode_vbox), decode_hbox1, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
327
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
328 decode_res_frame = gtk_frame_new(_("Resolution:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
329 gtk_box_pack_start(GTK_BOX(decode_hbox1), decode_res_frame, TRUE, TRUE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
330 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
331
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
332 decode_res_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
333 gtk_container_set_border_width(GTK_CONTAINER(decode_res_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
334 gtk_container_add(GTK_CONTAINER(decode_res_frame), decode_res_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
335
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
336 decode_res_16 = gtk_radio_button_new_with_label(NULL, _("16 bit"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
337 if (mpg123_cfg.resolution == 16)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
338 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_res_16), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
339 gtk_box_pack_start(GTK_BOX(decode_res_vbox), decode_res_16, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
340 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
341
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
342 decode_res_8 =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
343 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
344 (GTK_RADIO_BUTTON(decode_res_16)),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
345 _("8 bit"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
346 if (mpg123_cfg.resolution == 8)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
347 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_res_8), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
348
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
349 gtk_box_pack_start(GTK_BOX(decode_res_vbox), decode_res_8, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
350 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
351
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
352 decode_ch_frame = gtk_frame_new(_("Channels:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
353 gtk_box_pack_start(GTK_BOX(decode_hbox1), decode_ch_frame, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
354
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
355 decode_ch_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
356 gtk_container_set_border_width(GTK_CONTAINER(decode_ch_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
357 gtk_container_add(GTK_CONTAINER(decode_ch_frame), decode_ch_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
358
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
359 decode_ch_stereo =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
360 gtk_radio_button_new_with_label(NULL, _("Stereo (if available)"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
361 if (mpg123_cfg.channels == 2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
362 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_ch_stereo),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
363 TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
364
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
365 gtk_box_pack_start(GTK_BOX(decode_ch_vbox), decode_ch_stereo, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
366 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
367
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
368 decode_ch_mono =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
369 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
370 (GTK_RADIO_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
371 (decode_ch_stereo)), _("Mono"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
372 if (mpg123_cfg.channels == 1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
373 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_ch_mono), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
374
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
375 gtk_box_pack_start(GTK_BOX(decode_ch_vbox), decode_ch_mono, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
376 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
377
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
378 decode_freq_frame = gtk_frame_new(_("Down sample:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
379 gtk_box_pack_start(GTK_BOX(decode_vbox), decode_freq_frame, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
380 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
381
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
382 decode_freq_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
383 gtk_container_set_border_width(GTK_CONTAINER(decode_freq_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
384 gtk_container_add(GTK_CONTAINER(decode_freq_frame), decode_freq_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
385
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
386 decode_freq_1to1 =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
387 gtk_radio_button_new_with_label(NULL, _("1:1 (44 kHz)"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
388 if (mpg123_cfg.downsample == 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
389 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to1),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
390 TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
391 gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to1, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
392 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
393
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
394 decode_freq_1to2 =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
395 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
396 (GTK_RADIO_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
397 (decode_freq_1to1)),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
398 _("1:2 (22 kHz)"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
399 if (mpg123_cfg.downsample == 1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
400 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to2),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
401 TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
402 gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to2, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
403 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
404
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
405 decode_freq_1to4 =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
406 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
407 (GTK_RADIO_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
408 (decode_freq_1to1)),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
409 _("1:4 (11 kHz)"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
410 if (mpg123_cfg.downsample == 2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
411 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to4),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
412 TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
413
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
414 gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to4, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
415 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
416
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
417 option_frame = gtk_frame_new(_("Options"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
418 gtk_box_pack_start(GTK_BOX(decode_vbox), option_frame, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
419
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
420 option_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
421 gtk_container_set_border_width(GTK_CONTAINER(option_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
422 gtk_container_add(GTK_CONTAINER(option_frame), option_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
423
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
424 detect_by_content = gtk_radio_button_new_with_label(NULL, _("Content"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
425
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
426 detect_by_extension =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
427 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
428 (GTK_RADIO_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
429 (detect_by_content)),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
430 _("Extension"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
431
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
432 detect_by_both =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
433 gtk_radio_button_new_with_label(gtk_radio_button_group
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
434 (GTK_RADIO_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
435 (detect_by_content)),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
436 _("Extension and content"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
437
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
438 switch (mpg123_cfg.detect_by) {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
439 case DETECT_CONTENT:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
440 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(detect_by_content),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
441 TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
442 break;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
443 case DETECT_BOTH:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
444 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(detect_by_both), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
445 break;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
446 case DETECT_EXTENSION:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
447 default:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
448 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
449 (detect_by_extension), TRUE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
450 break;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
451 }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
452
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
453 gtk_box_pack_start(GTK_BOX(option_vbox), detect_by_content, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
454 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
455 gtk_box_pack_start(GTK_BOX(option_vbox), detect_by_extension, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
456 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
457 gtk_box_pack_start(GTK_BOX(option_vbox), detect_by_both, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
458
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
459 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), decode_vbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
460 gtk_label_new(_("Decoder")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
461
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
462 streaming_vbox = gtk_vbox_new(FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
463
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
464 streaming_buf_frame = gtk_frame_new(_("Buffering:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
465 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
466 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
467 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
468
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
469 streaming_buf_hbox = gtk_hbox_new(TRUE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
470 gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
471 gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
472
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
473 streaming_size_box = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
474 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_size_box,0,1,0,1); */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
475 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
476 TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
477 streaming_size_label = gtk_label_new(_("Buffer size (kb):"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
478 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
479 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
480 streaming_size_adj =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
481 gtk_adjustment_new(mpg123_cfg.http_buffer_size, 4, 4096, 4, 4, 4);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
482 streaming_size_spin =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
483 gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
484 gtk_widget_set_usize(streaming_size_spin, 60, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
485 gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
486 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
487
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
488 streaming_pre_box = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
489 /*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_pre_box,1,2,0,1); */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
490 gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
491 TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
492 streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
493 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
494 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
495 streaming_pre_adj =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
496 gtk_adjustment_new(mpg123_cfg.http_prebuffer, 0, 90, 1, 1, 1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
497 streaming_pre_spin =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
498 gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
499 gtk_widget_set_usize(streaming_pre_spin, 60, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
500 gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
501 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
502
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
503 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
504 * Proxy config.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
505 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
506 streaming_proxy_frame = gtk_frame_new(_("Proxy:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
507 gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
508 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_proxy_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
509 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
510
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
511 streaming_proxy_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
512 gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
513 gtk_container_add(GTK_CONTAINER(streaming_proxy_frame),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
514 streaming_proxy_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
515
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
516 streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
517 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
518 mpg123_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
519 g_signal_connect(G_OBJECT(streaming_proxy_use), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
520 G_CALLBACK(proxy_use_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
521 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
522 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
523
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
524 streaming_proxy_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
525 gtk_widget_set_sensitive(streaming_proxy_hbox, mpg123_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
526 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
527 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
528
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
529 streaming_proxy_host_label = gtk_label_new(_("Host:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
530 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
531 streaming_proxy_host_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
532
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
533 streaming_proxy_host_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
534 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
535 mpg123_cfg.proxy_host);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
536 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
537 streaming_proxy_host_entry, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
538
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
539 streaming_proxy_port_label = gtk_label_new(_("Port:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
540 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
541 streaming_proxy_port_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
542
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
543 streaming_proxy_port_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
544 gtk_widget_set_usize(streaming_proxy_port_entry, 50, -1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
545 temp = g_strdup_printf("%d", mpg123_cfg.proxy_port);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
546 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_port_entry), temp);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
547 g_free(temp);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
548 gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
549 streaming_proxy_port_entry, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
550
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
551 streaming_proxy_auth_use =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
552 gtk_check_button_new_with_label(_("Use authentication"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
553 gtk_widget_set_sensitive(streaming_proxy_auth_use, mpg123_cfg.use_proxy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
554 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
555 (streaming_proxy_auth_use),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
556 mpg123_cfg.proxy_use_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
557 g_signal_connect(G_OBJECT(streaming_proxy_auth_use), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
558 G_CALLBACK(proxy_auth_use_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
559 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
560 streaming_proxy_auth_use, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
561
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
562 streaming_proxy_auth_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
563 gtk_widget_set_sensitive(streaming_proxy_auth_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
564 mpg123_cfg.use_proxy
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
565 && mpg123_cfg.proxy_use_auth);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
566 gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
567 streaming_proxy_auth_hbox, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
568
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
569 streaming_proxy_auth_user_label = gtk_label_new(_("Username:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
570 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
571 streaming_proxy_auth_user_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
572
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
573 streaming_proxy_auth_user_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
574 if (mpg123_cfg.proxy_user)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
575 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_user_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
576 mpg123_cfg.proxy_user);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
577 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
578 streaming_proxy_auth_user_entry, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
579
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
580 streaming_proxy_auth_pass_label = gtk_label_new(_("Password:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
581 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
582 streaming_proxy_auth_pass_label, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
583
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
584 streaming_proxy_auth_pass_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
585 if (mpg123_cfg.proxy_pass)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
586 gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_pass_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
587 mpg123_cfg.proxy_pass);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
588 gtk_entry_set_visibility(GTK_ENTRY(streaming_proxy_auth_pass_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
589 FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
590 gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
591 streaming_proxy_auth_pass_entry, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
592
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
593
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
594 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
595 * Save to disk config.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
596 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
597 streaming_save_frame = gtk_frame_new(_("Save stream to disk:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
598 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
599 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
600 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
601
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
602 streaming_save_vbox = gtk_vbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
603 gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
604 gtk_container_add(GTK_CONTAINER(streaming_save_frame),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
605 streaming_save_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
606
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
607 streaming_save_use =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
608 gtk_check_button_new_with_label(_("Save stream to disk"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
609 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
610 mpg123_cfg.save_http_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
611 g_signal_connect(G_OBJECT(streaming_save_use), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
612 G_CALLBACK(streaming_save_use_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
613 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
614 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
615
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
616 streaming_save_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
617 gtk_widget_set_sensitive(streaming_save_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
618 mpg123_cfg.save_http_stream);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
619 gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
620 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
621
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
622 streaming_save_label = gtk_label_new(_("Path:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
623 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
624 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
625
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
626 streaming_save_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
627 gtk_entry_set_text(GTK_ENTRY(streaming_save_entry),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
628 mpg123_cfg.save_http_path);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
629 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
630 TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
631
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
632 streaming_save_browse = gtk_button_new_with_label(_("Browse"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
633 g_signal_connect(G_OBJECT(streaming_save_browse), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
634 G_CALLBACK(streaming_save_browse_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
635 gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
636 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
637
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
638 streaming_cast_frame = gtk_frame_new(_("SHOUT/Icecast:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
639 gtk_container_set_border_width(GTK_CONTAINER(streaming_cast_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
640 gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_cast_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
641 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
642
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
643 streaming_cast_vbox = gtk_vbox_new(5, FALSE);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
644 gtk_container_add(GTK_CONTAINER(streaming_cast_frame),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
645 streaming_cast_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
646
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
647 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_cast_title,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
648 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
649
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
650 streaming_udp_title =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
651 gtk_check_button_new_with_label(_
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
652 ("Enable Icecast Metadata UDP Channel"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
653 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_udp_title),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
654 mpg123_cfg.use_udp_channel);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
655 gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
656 FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
657
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
658 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
659 gtk_label_new(_("Streaming")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
660
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
661 title_frame = gtk_frame_new(_("ID3 Tags:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
662 gtk_container_border_width(GTK_CONTAINER(title_frame), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
663
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
664 title_id3_vbox = gtk_vbox_new(FALSE, 10);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
665 gtk_container_border_width(GTK_CONTAINER(title_id3_vbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
666 gtk_container_add(GTK_CONTAINER(title_frame), title_id3_vbox);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
667
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
668 title_id3v2_disable =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
669 gtk_check_button_new_with_label(_("Disable ID3V2 tags"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
670 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_id3v2_disable),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
671 mpg123_cfg.disable_id3v2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
672 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3v2_disable, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
673 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
674
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
675
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
676 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
677 title_encoding_enabled =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
678 gtk_check_button_new_with_label(_("Convert non-UTF8 ID3 tags to UTF8"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
679 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_encoding_enabled),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
680 mpg123_cfg.title_encoding_enabled);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
681 g_signal_connect(G_OBJECT(title_encoding_enabled), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
682 G_CALLBACK(title_encoding_enabled_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
683 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_encoding_enabled, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
684 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
685
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
686 title_encoding_hbox = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
687 gtk_widget_set_sensitive(title_encoding_hbox, mpg123_cfg.title_encoding_enabled);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
688 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_encoding_hbox, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
689 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
690
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
691 title_encoding_label = gtk_label_new(_("ID3 encoding:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
692 gtk_box_pack_start(GTK_BOX(title_encoding_hbox), title_encoding_label, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
693 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
694
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
695 title_encoding = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
696 gtk_entry_set_text(GTK_ENTRY(title_encoding), mpg123_cfg.title_encoding);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
697 gtk_box_pack_start(GTK_BOX(title_encoding_hbox), title_encoding, TRUE, TRUE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
698 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
699 /* Encoding patch */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
700
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
701
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
702 title_override =
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
703 gtk_check_button_new_with_label(_("Override generic titles"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
704 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_override),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
705 mpg123_cfg.title_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
706 g_signal_connect(G_OBJECT(title_override), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
707 G_CALLBACK(title_override_cb), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
708 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_override, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
709 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
710
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
711 title_id3_box = gtk_hbox_new(FALSE, 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
712 gtk_widget_set_sensitive(title_id3_box, mpg123_cfg.title_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
713 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3_box, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
714 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
715
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
716 title_id3_label = gtk_label_new(_("ID3 format:"));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
717 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_label, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
718 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
719
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
720 title_id3_entry = gtk_entry_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
721 gtk_entry_set_text(GTK_ENTRY(title_id3_entry), mpg123_cfg.id3_format);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
722 gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_entry, TRUE, TRUE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
723 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
724
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
725 title_tag_desc = xmms_titlestring_descriptions("pafFetnygc", 2);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
726 gtk_widget_set_sensitive(title_tag_desc, mpg123_cfg.title_override);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
727 gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_tag_desc, FALSE,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
728 FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
729 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
730 gtk_label_new(_("Title")));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
731
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
732 bbox = gtk_hbutton_box_new();
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
733 gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
734 gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
735 gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
736
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
737 cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
738 g_signal_connect_swapped(G_OBJECT(cancel), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
739 G_CALLBACK(gtk_widget_destroy),
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
740 GTK_OBJECT(mpg123_configurewin));
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
741 GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
742 gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
743
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
744
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
745 ok = gtk_button_new_from_stock(GTK_STOCK_OK);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
746 g_signal_connect(G_OBJECT(ok), "clicked",
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
747 G_CALLBACK(mpg123_configurewin_ok), NULL);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
748 GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
749 gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
750 gtk_widget_grab_default(ok);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
751
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
752 gtk_widget_show_all(mpg123_configurewin);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
753 }