📄 preferences.cpp
字号:
label177 = gtk_label_new_with_mnemonic(_("Browse")); gtk_widget_show(label177); gtk_box_pack_start(GTK_BOX(hbox86), label177, FALSE, FALSE, 0); label169 = gtk_label_new(_("Generic")); gtk_widget_show(label169); gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 0), label169); NetworkVbox = gtk_vbox_new(FALSE, 0); gtk_widget_show(NetworkVbox); gtk_container_add(GTK_CONTAINER(notebook1), NetworkVbox); NetworkTable = gtk_table_new(2, 2, TRUE); gtk_widget_show(NetworkTable); gtk_box_pack_start(GTK_BOX(NetworkVbox), NetworkTable, FALSE, TRUE, 6); gtk_table_set_row_spacings(GTK_TABLE(NetworkTable), 7); label178 = gtk_label_new(_("Multicast TTL")); gtk_widget_show(label178); gtk_table_attach(GTK_TABLE(NetworkTable), label178, 0, 1, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); gtk_misc_set_alignment(GTK_MISC(label178), 0, 0.5); label179 = gtk_label_new(_("MTU")); gtk_widget_show(label179); gtk_table_attach(GTK_TABLE(NetworkTable), label179, 0, 1, 1, 2, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); gtk_misc_set_alignment(GTK_MISC(label179), 0, 0.5); MulticastTtlMenu = gtk_option_menu_new(); gtk_widget_show(MulticastTtlMenu); gtk_table_attach(GTK_TABLE(NetworkTable), MulticastTtlMenu, 1, 2, 0, 1, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(0), 0, 0); menu16 = gtk_menu_new(); ttl_lan = gtk_menu_item_new_with_mnemonic(_("LAN - 1")); gtk_widget_show(ttl_lan); gtk_container_add(GTK_CONTAINER(menu16), ttl_lan); ttl_organization = gtk_menu_item_new_with_mnemonic(_("Organization - 15")); gtk_widget_show(ttl_organization); gtk_container_add(GTK_CONTAINER(menu16), ttl_organization); ttl_regional = gtk_menu_item_new_with_mnemonic(_("Regional - 63")); gtk_widget_show(ttl_regional); gtk_container_add(GTK_CONTAINER(menu16), ttl_regional); ttl_worldwide = gtk_menu_item_new_with_mnemonic(_("Worldwide -127")); gtk_widget_show(ttl_worldwide); gtk_container_add(GTK_CONTAINER(menu16), ttl_worldwide); gtk_option_menu_set_menu(GTK_OPTION_MENU(MulticastTtlMenu), menu16); MtuSpinButton_adj = gtk_adjustment_new(MyConfig->GetIntegerValue(CONFIG_RTP_PAYLOAD_SIZE), 256, 65535, 1, 100, 100); MtuSpinButton = gtk_spin_button_new(GTK_ADJUSTMENT (MtuSpinButton_adj), 1, 0); gtk_widget_show(MtuSpinButton); gtk_table_attach(GTK_TABLE (NetworkTable), MtuSpinButton, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_spin_button_set_numeric(GTK_SPIN_BUTTON (MtuSpinButton), TRUE); vbox39 = gtk_vbox_new(FALSE, 4); gtk_widget_show(vbox39); gtk_box_pack_start(GTK_BOX(NetworkVbox), vbox39, FALSE, FALSE, 5); hbox89 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox89); gtk_box_pack_start(GTK_BOX(vbox39), hbox89, TRUE, TRUE, 4); AllowRtcpCheck = gtk_check_button_new_with_mnemonic(_("Allow Clients to Send RTCP")); gtk_widget_show(AllowRtcpCheck); gtk_box_pack_start(GTK_BOX(hbox89), AllowRtcpCheck, FALSE, FALSE, 94); gtk_tooltips_set_tip(tooltips, AllowRtcpCheck, _("Allow clients to send RTCP - default off"), NULL); hbox87 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox87); gtk_box_pack_start(GTK_BOX(vbox39), hbox87, TRUE, TRUE, 0); AllowSSMCheck = gtk_check_button_new_with_mnemonic(_("Use Single Source Multicast")); gtk_widget_show(AllowSSMCheck); gtk_box_pack_start(GTK_BOX(hbox87), AllowSSMCheck, TRUE, FALSE, 0); gtk_widget_set_sensitive(AllowSSMCheck, FALSE); label170 = gtk_label_new(_("Network Settings")); gtk_widget_show(label170); gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 1), label170); MP4FileSettingsVbox = gtk_vbox_new(FALSE, 0); gtk_widget_show(MP4FileSettingsVbox); gtk_container_add(GTK_CONTAINER(notebook1), MP4FileSettingsVbox); gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(notebook1), MP4FileSettingsVbox, FALSE, FALSE, GTK_PACK_START); FileStatusFrame = gtk_frame_new(NULL); gtk_widget_show(FileStatusFrame); gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), FileStatusFrame, TRUE, TRUE, 0); FileStatusVbox = gtk_vbox_new(FALSE, 0); gtk_widget_show(FileStatusVbox); gtk_container_add(GTK_CONTAINER(FileStatusFrame), FileStatusVbox); hbox90 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox90); gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox90, TRUE, TRUE, 0); FileStatus1 = gtk_radio_button_new_with_mnemonic(NULL, _("Always overwrite existing file")); gtk_widget_show(FileStatus1); gtk_box_pack_start(GTK_BOX(hbox90), FileStatus1, TRUE, TRUE, 46); gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus1), FileStatus1_group); FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus1)); hbox91 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox91); gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox91, FALSE, FALSE, 0); FileStatus2 = gtk_radio_button_new_with_mnemonic(NULL, _("Append to file")); gtk_widget_show(FileStatus2); gtk_box_pack_start(GTK_BOX(hbox91), FileStatus2, TRUE, TRUE, 46); gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus2), FileStatus1_group); FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus2)); hbox92 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox92); gtk_box_pack_start(GTK_BOX(FileStatusVbox), hbox92, FALSE, FALSE, 0); FileStatus3 = gtk_radio_button_new_with_mnemonic(NULL, _("Create new file based on name")); gtk_widget_show(FileStatus3); gtk_box_pack_start(GTK_BOX(hbox92), FileStatus3, FALSE, FALSE, 46); gtk_radio_button_set_group(GTK_RADIO_BUTTON(FileStatus3), FileStatus1_group); FileStatus1_group = gtk_radio_button_get_group(GTK_RADIO_BUTTON(FileStatus3)); label180 = gtk_label_new(_("File Status")); gtk_widget_show(label180); gtk_frame_set_label_widget(GTK_FRAME(FileStatusFrame), label180); hbox93 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox93); gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox93, TRUE, TRUE, 4); RecordHintTrackButton = gtk_check_button_new_with_mnemonic(_("Record Hint Tracks when Finished")); gtk_widget_show(RecordHintTrackButton); gtk_box_pack_start(GTK_BOX(hbox93), RecordHintTrackButton, TRUE, FALSE, 0); gtk_tooltips_set_tip(tooltips, RecordHintTrackButton, _("If set, this can cause application to appear to freeze when finished"), NULL); hbox94 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox94); gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox94, TRUE, TRUE, 4); OptimizeMP4FileButton = gtk_check_button_new_with_mnemonic(_("Optimize When Finished")); gtk_widget_show(OptimizeMP4FileButton); gtk_box_pack_start(GTK_BOX(hbox94), OptimizeMP4FileButton, FALSE, FALSE, 79); hbox95 = gtk_hbox_new(FALSE, 0); gtk_widget_show(hbox95); gtk_box_pack_start(GTK_BOX(MP4FileSettingsVbox), hbox95, TRUE, TRUE, 0); RecordRawDataButton = gtk_check_button_new_with_mnemonic(_("Record Raw Data ")); gtk_widget_show(RecordRawDataButton); gtk_box_pack_start(GTK_BOX(hbox95), RecordRawDataButton, FALSE, FALSE, 0); RawFileName = gtk_entry_new(); gtk_widget_show(RawFileName); gtk_box_pack_start(GTK_BOX(hbox95), RawFileName, TRUE, TRUE, 0); gtk_tooltips_set_tip(tooltips, RawFileName, _("Raw Data MP4 File Name"), NULL); RawFileNameBrowse = gtk_button_new(); gtk_widget_show(RawFileNameBrowse); gtk_box_pack_start(GTK_BOX(hbox95), RawFileNameBrowse, FALSE, FALSE, 0); alignment26 = gtk_alignment_new(0.5, 0.5, 0, 0); gtk_widget_show(alignment26); gtk_container_add(GTK_CONTAINER(RawFileNameBrowse), alignment26); hbox96 = gtk_hbox_new(FALSE, 2); gtk_widget_show(hbox96); gtk_container_add(GTK_CONTAINER(alignment26), hbox96); image26 = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON); gtk_widget_show(image26); gtk_box_pack_start(GTK_BOX(hbox96), image26, FALSE, FALSE, 0); label181 = gtk_label_new_with_mnemonic(_("Browse")); gtk_widget_show(label181); gtk_box_pack_start(GTK_BOX(hbox96), label181, FALSE, FALSE, 0); label171 = gtk_label_new(_("MP4 File Settings")); gtk_widget_show(label171); gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook1), gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook1), 2), label171); dialog_action_area8 = GTK_DIALOG(PreferencesDialog)->action_area; gtk_widget_show(dialog_action_area8); gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area8), GTK_BUTTONBOX_END); cancelbutton6 = gtk_button_new_from_stock("gtk-cancel"); gtk_widget_show(cancelbutton6); gtk_dialog_add_action_widget(GTK_DIALOG(PreferencesDialog), cancelbutton6, GTK_RESPONSE_CANCEL); GTK_WIDGET_SET_FLAGS(cancelbutton6, GTK_CAN_DEFAULT); okbutton8 = gtk_button_new_from_stock("gtk-ok"); gtk_widget_show(okbutton8); gtk_dialog_add_action_widget(GTK_DIALOG(PreferencesDialog), okbutton8, GTK_RESPONSE_OK); GTK_WIDGET_SET_FLAGS(okbutton8, GTK_CAN_DEFAULT); g_signal_connect((gpointer) PreferencesDialog, "response", G_CALLBACK(on_PreferencesDialog_response), NULL); g_signal_connect((gpointer)StreamDirectoryButton, "clicked", G_CALLBACK(on_stream_directory_clicked), PreferencesDialog); g_signal_connect((gpointer)ProfileDirectoryButton, "clicked", G_CALLBACK(on_profile_directory_clicked), PreferencesDialog); g_signal_connect((gpointer)RawFileNameBrowse, "clicked", G_CALLBACK(on_raw_file_clicked), PreferencesDialog); /* Store pointers to all widgets, for use by lookup_widget(). */ GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, PreferencesDialog, "PreferencesDialog"); GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_vbox9, "dialog_vbox9"); GLADE_HOOKUP_OBJECT(PreferencesDialog, notebook1, "notebook1"); GLADE_HOOKUP_OBJECT(PreferencesDialog, GenericTable, "GenericTable"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label173, "label173"); GLADE_HOOKUP_OBJECT(PreferencesDialog, LogLevelSpinner, "LogLevelSpinner"); GLADE_HOOKUP_OBJECT(PreferencesDialog, DebugCheckButton, "DebugCheckButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label174, "label174"); GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectoryHbox, "StreamDirectoryHbox"); GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectory, "StreamDirectory"); GLADE_HOOKUP_OBJECT(PreferencesDialog, StreamDirectoryButton, "StreamDirectoryButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment24, "alignment24"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox84, "hbox84"); GLADE_HOOKUP_OBJECT(PreferencesDialog, image24, "image24"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label175, "label175"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label176, "label176"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectoryHbox, "ProfileDirectoryHbox"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectory, "ProfileDirectory"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ProfileDirectoryButton, "ProfileDirectoryButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment25, "alignment25"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox86, "hbox86"); GLADE_HOOKUP_OBJECT(PreferencesDialog, image25, "image25"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label177, "label177"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label169, "label169"); GLADE_HOOKUP_OBJECT(PreferencesDialog, NetworkVbox, "NetworkVbox"); GLADE_HOOKUP_OBJECT(PreferencesDialog, NetworkTable, "NetworkTable"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label178, "label178"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label179, "label179"); GLADE_HOOKUP_OBJECT(PreferencesDialog, MulticastTtlMenu, "MulticastTtlMenu"); GLADE_HOOKUP_OBJECT(PreferencesDialog, menu16, "menu16"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_lan, "ttl_lan"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_organization, "ttl_organization"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_regional, "ttl_regional"); GLADE_HOOKUP_OBJECT(PreferencesDialog, ttl_worldwide, "ttl_worldwide"); GLADE_HOOKUP_OBJECT (PreferencesDialog, MtuSpinButton, "MtuSpinButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, vbox39, "vbox39"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox89, "hbox89"); GLADE_HOOKUP_OBJECT(PreferencesDialog, AllowRtcpCheck, "AllowRtcpCheck"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox87, "hbox87"); GLADE_HOOKUP_OBJECT(PreferencesDialog, AllowSSMCheck, "AllowSSMCheck"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label170, "label170"); GLADE_HOOKUP_OBJECT(PreferencesDialog, MP4FileSettingsVbox, "MP4FileSettingsVbox"); GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatusFrame, "FileStatusFrame"); GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatusVbox, "FileStatusVbox"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox90, "hbox90"); GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus1, "FileStatus1"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox91, "hbox91"); GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus2, "FileStatus2"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox92, "hbox92"); GLADE_HOOKUP_OBJECT(PreferencesDialog, FileStatus3, "FileStatus3"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label180, "label180"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox93, "hbox93"); GLADE_HOOKUP_OBJECT(PreferencesDialog, RecordHintTrackButton, "RecordHintTrackButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox94, "hbox94"); GLADE_HOOKUP_OBJECT(PreferencesDialog, OptimizeMP4FileButton, "OptimizeMP4FileButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox95, "hbox95"); GLADE_HOOKUP_OBJECT(PreferencesDialog, RecordRawDataButton, "RecordRawDataButton"); GLADE_HOOKUP_OBJECT(PreferencesDialog, RawFileName, "RawFileName"); GLADE_HOOKUP_OBJECT(PreferencesDialog, RawFileNameBrowse, "RawFileNameBrowse"); GLADE_HOOKUP_OBJECT(PreferencesDialog, alignment26, "alignment26"); GLADE_HOOKUP_OBJECT(PreferencesDialog, hbox96, "hbox96"); GLADE_HOOKUP_OBJECT(PreferencesDialog, image26, "image26"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label181, "label181"); GLADE_HOOKUP_OBJECT(PreferencesDialog, label171, "label171"); GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, dialog_action_area8, "dialog_action_area8"); GLADE_HOOKUP_OBJECT(PreferencesDialog, cancelbutton6, "cancelbutton6"); GLADE_HOOKUP_OBJECT(PreferencesDialog, okbutton8, "okbutton8"); GLADE_HOOKUP_OBJECT_NO_REF(PreferencesDialog, tooltips, "tooltips"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(DebugCheckButton), MyConfig->GetBoolValue(CONFIG_APP_DEBUG)); const char *dir; char dirname[PATH_MAX]; dir = MyConfig->GetStringValue(CONFIG_APP_STREAM_DIRECTORY); if (dir != NULL) { gtk_entry_set_text(GTK_ENTRY(StreamDirectory), dir); } else { GetHomeDirectory(dirname); strcat(dirname, ".mp4live_d/Streams/"); gtk_entry_set_text(GTK_ENTRY(StreamDirectory), dirname); } dir = MyConfig->GetStringValue(CONFIG_APP_PROFILE_DIRECTORY); if (dir != NULL) { gtk_entry_set_text(GTK_ENTRY(ProfileDirectory), dir); } else { GetHomeDirectory(dirname); strcat(dirname, ".mp4live_d/"); gtk_entry_set_text(GTK_ENTRY(ProfileDirectory), dirname); } uint ttl = MyConfig->GetIntegerValue(CONFIG_RTP_MCAST_TTL); uint index; if (ttl <= 1) { index = 0; } else if (ttl <= 15) { index = 1; } else if (ttl <= 64) { index = 2; } else index = 3; gtk_option_menu_set_history(GTK_OPTION_MENU(MulticastTtlMenu), index); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AllowRtcpCheck), MyConfig->GetBoolValue(CONFIG_RTP_NO_B_RR_0)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(AllowSSMCheck), MyConfig->GetBoolValue(CONFIG_RTP_USE_SSM)); uint fstatus = MyConfig->GetIntegerValue(CONFIG_RECORD_MP4_FILE_STATUS); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus1), fstatus == FILE_MP4_OVERWRITE); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus2), fstatus == FILE_MP4_APPEND); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(FileStatus3), fstatus == FILE_MP4_CREATE_NEW); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RecordHintTrackButton), MyConfig->GetBoolValue(CONFIG_RECORD_MP4_HINT_TRACKS)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(OptimizeMP4FileButton), MyConfig->GetBoolValue(CONFIG_RECORD_MP4_OPTIMIZE)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(RecordRawDataButton), MyConfig->GetBoolValue(CONFIG_RECORD_RAW_IN_MP4)); gtk_entry_set_text(GTK_ENTRY(RawFileName), MyConfig->GetStringValue(CONFIG_RECORD_RAW_MP4_FILE_NAME)); gtk_widget_show(PreferencesDialog);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -