📄 configure.c
字号:
decode_freq_vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(decode_freq_vbox), 5); gtk_container_add(GTK_CONTAINER(decode_freq_frame), decode_freq_vbox); decode_freq_1to1 = gtk_radio_button_new_with_label(NULL, _("1:1 (44 kHz)")); if (mpg123_cfg.downsample == 0) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to1), TRUE); gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to1, FALSE, FALSE, 0); decode_freq_1to2 = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(decode_freq_1to1)), _("1:2 (22 kHz)")); if (mpg123_cfg.downsample == 1) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to2), TRUE); gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to2, FALSE, FALSE, 0); decode_freq_1to4 = gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(decode_freq_1to1)), _("1:4 (11 kHz)")); if (mpg123_cfg.downsample == 2) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decode_freq_1to4), TRUE); gtk_box_pack_start(GTK_BOX(decode_freq_vbox), decode_freq_1to4, FALSE, FALSE, 0);#ifdef USE_SIMD{ GtkWidget *decoder_frame, *decoder_vbox; decoder_frame = gtk_frame_new(_("Decoder:")); gtk_box_pack_start(GTK_BOX(decode_vbox), decoder_frame, FALSE, FALSE, 0); decoder_vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(decoder_vbox), 5); gtk_container_add(GTK_CONTAINER(decoder_frame), decoder_vbox); auto_select = gtk_check_button_new_with_label(_("Automatic detection")); gtk_box_pack_start(GTK_BOX(decoder_vbox), auto_select, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(auto_select), "clicked", GTK_SIGNAL_FUNC(auto_select_cb), NULL); decoder_3dnow = gtk_radio_button_new_with_label(NULL, _("3DNow! optimized decoder")); gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_3dnow, FALSE, FALSE, 0); decoder_mmx = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(decoder_3dnow), _("MMX optimized decoder")); gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_mmx, FALSE, FALSE, 0); decoder_fpu = gtk_radio_button_new_with_label_from_widget( GTK_RADIO_BUTTON(decoder_3dnow), _("FPU decoder")); gtk_box_pack_start(GTK_BOX(decoder_vbox), decoder_fpu, FALSE, FALSE, 0); switch (mpg123_cfg.default_synth) { case SYNTH_3DNOW: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_3dnow), TRUE); break; case SYNTH_MMX: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_mmx), TRUE); break; case SYNTH_FPU: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_fpu), TRUE); break; default: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(decoder_fpu), TRUE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(auto_select), TRUE); break; }}#endif option_frame = gtk_frame_new(_("Options")); gtk_box_pack_start(GTK_BOX(decode_vbox), option_frame, FALSE, FALSE, 0); option_vbox = gtk_vbox_new(FALSE, 5); gtk_container_set_border_width(GTK_CONTAINER(option_vbox), 5); gtk_container_add(GTK_CONTAINER(option_frame), option_vbox); detect_by_content = gtk_radio_button_new_with_label(NULL, _("Content")); detect_by_extension = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(detect_by_content)), _("Extension")); detect_by_both = gtk_radio_button_new_with_label( gtk_radio_button_group(GTK_RADIO_BUTTON(detect_by_content)), _("Extension and content")); switch (mpg123_cfg.detect_by) { case DETECT_CONTENT: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(detect_by_content), TRUE); break; case DETECT_BOTH: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(detect_by_both), TRUE); break; case DETECT_EXTENSION: default: gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(detect_by_extension), TRUE); break; } gtk_box_pack_start(GTK_BOX(option_vbox), detect_by_content, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(option_vbox), detect_by_extension, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(option_vbox), detect_by_both, FALSE, FALSE, 0); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), decode_vbox, gtk_label_new(_("Decoder"))); 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(mpg123_cfg.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(mpg123_cfg.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), mpg123_cfg.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, mpg123_cfg.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), mpg123_cfg.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", mpg123_cfg.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, mpg123_cfg.use_proxy); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(streaming_proxy_auth_use), mpg123_cfg.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, mpg123_cfg.use_proxy && mpg123_cfg.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(mpg123_cfg.proxy_user) gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_user_entry), mpg123_cfg.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(mpg123_cfg.proxy_pass) gtk_entry_set_text(GTK_ENTRY(streaming_proxy_auth_pass_entry), mpg123_cfg.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), mpg123_cfg.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, mpg123_cfg.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), mpg123_cfg.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); 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), mpg123_cfg.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), mpg123_cfg.use_udp_channel); gtk_box_pack_start(GTK_BOX(streaming_cast_vbox), streaming_udp_title, FALSE, FALSE, 0); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), streaming_vbox, gtk_label_new(_("Streaming"))); title_frame = gtk_frame_new(_("ID3 Tags:")); gtk_container_border_width(GTK_CONTAINER(title_frame), 5); title_id3_vbox = gtk_vbox_new(FALSE, 10); gtk_container_border_width(GTK_CONTAINER(title_id3_vbox), 5); gtk_container_add(GTK_CONTAINER(title_frame), title_id3_vbox); title_id3v2_disable = gtk_check_button_new_with_label(_("Disable ID3V2 tags")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_id3v2_disable), mpg123_cfg.disable_id3v2); gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3v2_disable, FALSE, FALSE, 0); title_override = gtk_check_button_new_with_label(_("Override generic titles")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(title_override), mpg123_cfg.title_override); gtk_signal_connect(GTK_OBJECT(title_override), "clicked", title_override_cb, NULL); gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_override, FALSE, FALSE, 0); title_id3_box = gtk_hbox_new(FALSE, 5); gtk_widget_set_sensitive(title_id3_box, mpg123_cfg.title_override); gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_id3_box, FALSE, FALSE, 0); title_id3_label = gtk_label_new(_("ID3 format:")); gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_label, FALSE, FALSE, 0); title_id3_entry = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(title_id3_entry), mpg123_cfg.id3_format); gtk_box_pack_start(GTK_BOX(title_id3_box), title_id3_entry, TRUE, TRUE, 0); title_tag_desc = xmms_titlestring_descriptions("pafFetnygc", 2); gtk_widget_set_sensitive(title_tag_desc, mpg123_cfg.title_override); gtk_box_pack_start(GTK_BOX(title_id3_vbox), title_tag_desc, FALSE, FALSE, 0); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), title_frame, gtk_label_new(_("Title"))); 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(mpg123_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(mpg123_configurewin)); GTK_WIDGET_SET_FLAGS(cancel, GTK_CAN_DEFAULT); gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); gtk_widget_show_all(mpg123_configurewin);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -