📄 configure.c
字号:
resolution_replaygain_dither = gtk_check_button_new_with_label(_("Enable dithering"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_dither), flac_cfg.output.resolution.replaygain.dither);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_dither), "clicked", resolution_replaygain_dither_cb, NULL);
gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), resolution_replaygain_dither, FALSE, FALSE, 0);
hbox = gtk_hbox_new(FALSE, 10);
gtk_container_border_width(GTK_CONTAINER(hbox), 5);
gtk_box_pack_start(GTK_BOX(resolution_replaygain_vbox), hbox, TRUE, TRUE, 0);
resolution_replaygain_noise_shaping_frame = gtk_frame_new(_("Noise shaping"));
gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), 5);
gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_noise_shaping_frame, TRUE, TRUE, 0);
resolution_replaygain_noise_shaping_vbox = gtk_vbutton_box_new();
gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), 5);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_frame), resolution_replaygain_noise_shaping_vbox);
resolution_replaygain_noise_shaping_radio_none = gtk_radio_button_new_with_label(NULL, _("none"));
if(flac_cfg.output.resolution.replaygain.noise_shaping == 0)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_none), TRUE);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_none), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_none);
resolution_replaygain_noise_shaping_radio_low = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("low"));
if(flac_cfg.output.resolution.replaygain.noise_shaping == 1)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_low), TRUE);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_low), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_low);
resolution_replaygain_noise_shaping_radio_medium = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("medium"));
if(flac_cfg.output.resolution.replaygain.noise_shaping == 2)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_medium), TRUE);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_medium), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_medium);
resolution_replaygain_noise_shaping_radio_high = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(resolution_replaygain_noise_shaping_radio_none), _("high"));
if(flac_cfg.output.resolution.replaygain.noise_shaping == 3)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_noise_shaping_radio_high), TRUE);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_noise_shaping_radio_high), "clicked", resolution_replaygain_noise_shaping_cb, NULL);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_noise_shaping_vbox), resolution_replaygain_noise_shaping_radio_high);
resolution_replaygain_bps_out_frame = gtk_frame_new(_("Dither to"));
gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_frame), 5);
gtk_box_pack_start(GTK_BOX(hbox), resolution_replaygain_bps_out_frame, FALSE, FALSE, 0);
resolution_replaygain_bps_out_vbox = gtk_vbutton_box_new();
gtk_container_border_width(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), 0);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_frame), resolution_replaygain_bps_out_vbox);
resolution_replaygain_bps_out_radio_16bps = gtk_radio_button_new_with_label(NULL, _("16 bps"));
if(flac_cfg.output.resolution.replaygain.bps_out == 16)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_16bps), TRUE);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_16bps), "clicked", resolution_replaygain_bps_out_cb, NULL);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_16bps);
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"));
if(flac_cfg.output.resolution.replaygain.bps_out == 24)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(resolution_replaygain_bps_out_radio_24bps), TRUE);
gtk_signal_connect(GTK_OBJECT(resolution_replaygain_bps_out_radio_24bps), "clicked", resolution_replaygain_bps_out_cb, NULL);
gtk_container_add(GTK_CONTAINER(resolution_replaygain_bps_out_vbox), resolution_replaygain_bps_out_radio_24bps);
resolution_replaygain_dither_cb(resolution_replaygain_dither, NULL);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), output_vbox, gtk_label_new(_("Output")));
/* Streaming */
streaming_vbox = gtk_vbox_new(FALSE, 0);
streaming_buf_frame = gtk_frame_new(_("Buffering:"));
gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_frame), 5);
gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_buf_frame, FALSE, FALSE, 0);
streaming_buf_hbox = gtk_hbox_new(TRUE, 5);
gtk_container_set_border_width(GTK_CONTAINER(streaming_buf_hbox), 5);
gtk_container_add(GTK_CONTAINER(streaming_buf_frame), streaming_buf_hbox);
streaming_size_box = gtk_hbox_new(FALSE, 5);
/*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_size_box,0,1,0,1); */
gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_size_box, TRUE, TRUE, 0);
streaming_size_label = gtk_label_new(_("Buffer size (kb):"));
gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_label, FALSE, FALSE, 0);
streaming_size_adj = gtk_adjustment_new(flac_cfg.stream.http_buffer_size, 4, 4096, 4, 4, 4);
streaming_size_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_size_adj), 8, 0);
gtk_widget_set_usize(streaming_size_spin, 60, -1);
gtk_box_pack_start(GTK_BOX(streaming_size_box), streaming_size_spin, FALSE, FALSE, 0);
streaming_pre_box = gtk_hbox_new(FALSE, 5);
/*gtk_table_attach_defaults(GTK_TABLE(streaming_buf_table),streaming_pre_box,1,2,0,1); */
gtk_box_pack_start(GTK_BOX(streaming_buf_hbox), streaming_pre_box, TRUE, TRUE, 0);
streaming_pre_label = gtk_label_new(_("Pre-buffer (percent):"));
gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_label, FALSE, FALSE, 0);
streaming_pre_adj = gtk_adjustment_new(flac_cfg.stream.http_prebuffer, 0, 90, 1, 1, 1);
streaming_pre_spin = gtk_spin_button_new(GTK_ADJUSTMENT(streaming_pre_adj), 1, 0);
gtk_widget_set_usize(streaming_pre_spin, 60, -1);
gtk_box_pack_start(GTK_BOX(streaming_pre_box), streaming_pre_spin, FALSE, FALSE, 0);
/*
* Proxy config.
*/
streaming_proxy_frame = gtk_frame_new(_("Proxy:"));
gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_frame), 5);
gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_proxy_frame, FALSE, FALSE, 0);
streaming_proxy_vbox = gtk_vbox_new(FALSE, 5);
gtk_container_set_border_width(GTK_CONTAINER(streaming_proxy_vbox), 5);
gtk_container_add(GTK_CONTAINER(streaming_proxy_frame), streaming_proxy_vbox);
streaming_proxy_use = gtk_check_button_new_with_label(_("Use proxy"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_use), flac_cfg.stream.use_proxy);
gtk_signal_connect(GTK_OBJECT(streaming_proxy_use), "clicked", GTK_SIGNAL_FUNC(proxy_use_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_use, FALSE, FALSE, 0);
streaming_proxy_hbox = gtk_hbox_new(FALSE, 5);
gtk_widget_set_sensitive(streaming_proxy_hbox, flac_cfg.stream.use_proxy);
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_hbox, FALSE, FALSE, 0);
streaming_proxy_host_label = gtk_label_new(_("Host:"));
gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_label, FALSE, FALSE, 0);
streaming_proxy_host_entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(streaming_proxy_host_entry), flac_cfg.stream.proxy_host);
gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_host_entry, TRUE, TRUE, 0);
streaming_proxy_port_label = gtk_label_new(_("Port:"));
gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_port_label, FALSE, FALSE, 0);
streaming_proxy_port_entry = gtk_entry_new();
gtk_widget_set_usize(streaming_proxy_port_entry, 50, -1);
temp = g_strdup_printf("%d", flac_cfg.stream.proxy_port);
gtk_entry_set_text(GTK_ENTRY(streaming_proxy_port_entry), temp);
g_free(temp);
gtk_box_pack_start(GTK_BOX(streaming_proxy_hbox), streaming_proxy_port_entry, FALSE, FALSE, 0);
streaming_proxy_auth_use = gtk_check_button_new_with_label(_("Use authentication"));
gtk_widget_set_sensitive(streaming_proxy_auth_use, flac_cfg.stream.use_proxy);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use), flac_cfg.stream.proxy_use_auth);
gtk_signal_connect(GTK_OBJECT(streaming_proxy_auth_use), "clicked", GTK_SIGNAL_FUNC(proxy_auth_use_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_use, FALSE, FALSE, 0);
streaming_proxy_auth_hbox = gtk_hbox_new(FALSE, 5);
gtk_widget_set_sensitive(streaming_proxy_auth_hbox, flac_cfg.stream.use_proxy && flac_cfg.stream.proxy_use_auth);
gtk_box_pack_start(GTK_BOX(streaming_proxy_vbox), streaming_proxy_auth_hbox, FALSE, FALSE, 0);
streaming_proxy_auth_user_label = gtk_label_new(_("Username:"));
gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_user_label, FALSE, FALSE, 0);
streaming_proxy_auth_user_entry = gtk_entry_new();
if(flac_cfg.stream.proxy_user)
gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_user_entry), flac_cfg.stream.proxy_user);
gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_user_entry, TRUE, TRUE, 0);
streaming_proxy_auth_pass_label = gtk_label_new(_("Password:"));
gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_pass_label, FALSE, FALSE, 0);
streaming_proxy_auth_pass_entry = gtk_entry_new();
if(flac_cfg.stream.proxy_pass)
gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_pass_entry), flac_cfg.stream.proxy_pass);
gtk_entry_set_visibility(GTK_ENTRY(streaming_proxy_auth_pass_entry), FALSE);
gtk_box_pack_start(GTK_BOX(streaming_proxy_auth_hbox), streaming_proxy_auth_pass_entry, TRUE, TRUE, 0);
/*
* Save to disk config.
*/
streaming_save_frame = gtk_frame_new(_("Save stream to disk:"));
gtk_container_set_border_width(GTK_CONTAINER(streaming_save_frame), 5);
gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_save_frame, FALSE, FALSE, 0);
streaming_save_vbox = gtk_vbox_new(FALSE, 5);
gtk_container_set_border_width(GTK_CONTAINER(streaming_save_vbox), 5);
gtk_container_add(GTK_CONTAINER(streaming_save_frame), streaming_save_vbox);
streaming_save_use = gtk_check_button_new_with_label(_("Save stream to disk"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_save_use), flac_cfg.stream.save_http_stream);
gtk_signal_connect(GTK_OBJECT(streaming_save_use), "clicked", GTK_SIGNAL_FUNC(streaming_save_use_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_use, FALSE, FALSE, 0);
streaming_save_hbox = gtk_hbox_new(FALSE, 5);
gtk_widget_set_sensitive(streaming_save_hbox, flac_cfg.stream.save_http_stream);
gtk_box_pack_start(GTK_BOX(streaming_save_vbox), streaming_save_hbox, FALSE, FALSE, 0);
streaming_save_label = gtk_label_new(_("Path:"));
gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_label, FALSE, FALSE, 0);
streaming_save_entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(streaming_save_entry), flac_cfg.stream.save_http_path);
gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_entry, TRUE, TRUE, 0);
streaming_save_browse = gtk_button_new_with_label(_("Browse"));
gtk_signal_connect(GTK_OBJECT(streaming_save_browse), "clicked", GTK_SIGNAL_FUNC(streaming_save_browse_cb), NULL);
gtk_box_pack_start(GTK_BOX(streaming_save_hbox), streaming_save_browse, FALSE, FALSE, 0);
#ifdef FLAC_ICECAST
streaming_cast_frame = gtk_frame_new(_("SHOUT/Icecast:"));
gtk_container_set_border_width(GTK_CONTAINER(streaming_cast_frame), 5);
gtk_box_pack_start(GTK_BOX(streaming_vbox), streaming_cast_frame, FALSE, FALSE, 0);
streaming_cast_vbox = gtk_vbox_new(5, FALSE);
gtk_container_add(GTK_CONTAINER(streaming_cast_frame), streaming_cast_vbox);
streaming_cast_title = gtk_check_button_new_with_label(_("Enable SHOUT/Icecast title streaming"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_cast_title), flac_cfg.stream.cast_title_streaming);
gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_cast_title, FALSE, FALSE, 0);
streaming_udp_title = gtk_check_button_new_with_label(_("Enable Icecast Metadata UDP Channel"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_udp_title), flac_cfg.stream.use_udp_channel);
gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title, FALSE, FALSE, 0);
#endif
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox, gtk_label_new(_("Streaming")));
/* Buttons */
bbox = gtk_hbutton_box_new();
gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5);
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
ok = gtk_button_new_with_label(_("Ok"));
gtk_signal_connect(GTK_OBJECT(ok), "clicked", GTK_SIGNAL_FUNC(flac_configurewin_ok), NULL);
GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0);
gtk_widget_grab_default(ok);
cancel = gtk_button_new_with_label(_("Cancel"));
gtk_signal_connect_object(GTK_OBJECT(cancel), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(flac_configurewin));
GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0);
gtk_widget_show_all(flac_configurewin);
}
void FLAC_XMMS__aboutbox()
{
static GtkWidget *about_window;
if (about_window)
gdk_window_raise(about_window->window);
about_window = xmms_show_message(
_("About Flac Plugin"),
_("Flac Plugin by Josh Coalson\n"
"contributions by\n"
"......\n"
"......\n"
"and\n"
"Daisuke Shimamura\n"
"Visit http://flac.sourceforge.net/"),
_("Ok"), FALSE, NULL, NULL);
gtk_signal_connect(GTK_OBJECT(about_window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&about_window);
}
/*
* Get text of an Entry or a ComboBox
*/
static gchar *gtk_entry_get_text_1 (GtkWidget *widget)
{
if (GTK_IS_COMBO(widget))
{
return gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(widget)->entry));
}else if (GTK_IS_ENTRY(widget))
{
return gtk_entry_get_text(GTK_ENTRY(widget));
}else
{
return NULL;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -