📄 open.cpp
字号:
disc_title_label = new wxStaticText( panel, -1, wxU(_("Title")) ); disc_title = new wxSpinCtrl( panel, DiscTitle_Event ); sizer->Add( disc_title_label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); sizer->Add( disc_title, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); disc_chapter_label = new wxStaticText( panel, -1, wxU(_("Chapter")) ); disc_chapter = new wxSpinCtrl( panel, DiscChapter_Event ); sizer->Add( disc_chapter_label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); sizer->Add( disc_chapter, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); disc_sub_label = new wxStaticText( panel, -1, wxU(_("Subtitles track")) ); disc_sub = new wxSpinCtrl( panel, DiscSub_Event ); sizer->Add( disc_sub_label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); sizer->Add( disc_sub, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); disc_sub->SetRange( -1, 255 ); i_disc_sub = config_GetInt( p_intf, "sub-track" ); disc_sub->SetValue( i_disc_sub ); disc_audio_label = new wxStaticText( panel, -1, wxU(_("Audio track")) ); disc_audio = new wxSpinCtrl( panel, DiscAudio_Event ); sizer->Add( disc_audio_label, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); sizer->Add( disc_audio, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); disc_audio->SetRange( -1, 255 ); i_disc_audio = config_GetInt( p_intf, "audio-track" ); disc_audio->SetValue( i_disc_audio ); sizer_row->Add( sizer, 0, wxEXPAND | wxALL, 5 ); panel->SetSizerAndFit( sizer_row ); return panel;}wxPanel *OpenDialog::NetPanel( wxWindow* parent ){ int i; wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition, wxSize(200, 200) ); wxBoxSizer *sizer_row = new wxBoxSizer( wxVERTICAL ); wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 4, 20 ); static const wxString net_type_array[] = { wxU(_("UDP/RTP")), wxU(_("UDP/RTP Multicast")), wxU(_("HTTP/HTTPS/FTP/MMS")), wxU(_("RTSP")) }; for( i=0; i<4; i++ ) { net_radios[i] = new wxRadioButton( panel, NetRadio1_Event + i, net_type_array[i], wxDefaultPosition, wxDefaultSize, wxRB_SINGLE ); net_subpanels[i] = new wxPanel( panel, -1, wxDefaultPosition, wxDefaultSize ); } /* Timeshift */ net_timeshift = new wxCheckBox( panel, NetTimeshift_Event, wxU(_("Allow timeshifting")) ); /* UDP/RTP row */ wxFlexGridSizer *subpanel_sizer; wxStaticText *label; i_net_ports[0] = config_GetInt( p_intf, "server-port" ); subpanel_sizer = new wxFlexGridSizer( 3, 1, 20 ); label = new wxStaticText( net_subpanels[0], -1, wxU(_("Port")) ); net_ports[0] = new wxSpinCtrl( net_subpanels[0], NetPort1_Event, wxString::Format(wxT("%d"), i_net_ports[0]), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, i_net_ports[0] ); subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( net_ports[0], 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); net_ipv6 = new wxCheckBox( net_subpanels[0], NetForceIPv6_Event, wxU(_("Force IPv6"))); subpanel_sizer->Add( net_ipv6, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); net_subpanels[0]->SetSizerAndFit( subpanel_sizer ); net_radios[0]->SetValue( TRUE ); /* UDP/RTP Multicast row */ subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 ); label = new wxStaticText( net_subpanels[1], -1, wxU(_("Address")) ); net_addrs[1] = new wxTextCtrl( net_subpanels[1], NetAddr2_Event, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( net_addrs[1], 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); label = new wxStaticText( net_subpanels[1], -1, wxU(_("Port")) ); i_net_ports[1] = i_net_ports[0]; net_ports[1] = new wxSpinCtrl( net_subpanels[1], NetPort2_Event, wxString::Format(wxT("%d"), i_net_ports[1]), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 65535, i_net_ports[1] ); subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( net_ports[1], 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); net_subpanels[1]->SetSizerAndFit( subpanel_sizer ); /* HTTP and RTSP rows */ for( i=2; i<4; i++ ) { subpanel_sizer = new wxFlexGridSizer( 2, 1, 20 ); label = new wxStaticText( net_subpanels[i], -1, wxU(_("URL")) ); net_addrs[i] = new wxTextCtrl( net_subpanels[i], NetAddr1_Event + i, (i == 2) ? wxT("") : wxT("rtsp://"), wxDefaultPosition, wxSize( 200, -1 ), wxTE_PROCESS_ENTER); subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( net_addrs[i], 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); net_subpanels[i]->SetSizerAndFit( subpanel_sizer ); } /* Stuff everything into the main panel */ for( i=0; i<4; i++ ) { sizer->Add( net_radios[i], 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); sizer->Add( net_subpanels[i], 1, wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); } sizer->Add( net_timeshift, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); sizer_row->Add( sizer, 0, wxEXPAND | wxALL, 5 ); panel->SetSizerAndFit( sizer_row ); return panel;}void OpenDialog::UpdateMRL(){ UpdateMRL( i_current_access_method );}void OpenDialog::UpdateMRL( int i_access_method ){ wxString mrltemp, caching_name; i_current_access_method = i_access_method; switch( i_access_method ) { case FILE_ACCESS: mrltemp = file_combo->GetValue(); caching_name = wxT("file-caching"); break; case DISC_ACCESS: i_disc_type_selection = disc_type->GetSelection(); switch ( i_disc_type_selection ) { case 0: /* DVD with menus */ case 1: /* DVD without menus */ disc_device->SetToolTip( wxU(_("DVD device to use" ) ) ); if( i_disc_type_selection == 0 ) { mrltemp = wxT("dvd://") + disc_device->GetValue(); caching_name = wxT("dvdnav-caching"); } else { mrltemp = wxT("dvdsimple://") + disc_device->GetValue(); caching_name = wxT("dvdread-caching"); } if( i_disc_title > 0 ) { mrltemp += wxString::Format( wxT("@%d"), i_disc_title ); if( i_disc_chapter > 0 ) mrltemp += wxString::Format( wxT(":%d"), i_disc_chapter ); } if( i_disc_sub >= 0 ) mrltemp += wxString::Format( wxT(" :sub-track=%d"), i_disc_sub ); if( i_disc_audio >= 0 ) mrltemp += wxString::Format( wxT(" :audio-track=%d"), i_disc_audio ); break; case 2: /* VCD of some sort */#ifdef HAVE_VCDX disc_device->SetToolTip( wxU(_("Name of CD-ROM device " "to read Video CD from. If this field is left empty, we will scan " "for a CD-ROM with a VCD in it.")) ); mrltemp = wxT("vcdx://") + disc_device->GetValue(); if( i_disc_title > 0 ) mrltemp += wxString::Format( wxT("@%c%d"), config_GetInt( p_intf, "vcdx-PBC" ) ? 'P' : 'E', i_disc_title );#else disc_device->SetToolTip( wxU(_("CD-ROM device to use" ) ) ); mrltemp = wxT("vcd://") + disc_device->GetValue(); if( i_disc_title > 0 ) mrltemp += wxString::Format( wxT("@%d"), i_disc_title );#endif if( i_disc_sub >= 0 ) mrltemp += wxString::Format( wxT(" :sub-track=%d"), i_disc_sub ); if( i_disc_audio >= 0 ) mrltemp += wxString::Format( wxT(" :audio-track=%d"), i_disc_audio ); caching_name = wxT("vcd-caching"); break; case 3: /* CD-DA */#ifdef HAVE_CDDAX disc_device->SetToolTip( wxU(_("Name of CD-ROM device " "to read audio CD from. If this field is left empty, we will scan " "for a CD-ROM with an audio CD in it." )) ); mrltemp = wxT("cddax://")#else disc_device->SetToolTip( wxU(_("CD-ROM device to use" ) ) ) ; mrltemp = wxT("cdda://")#endif + disc_device->GetValue(); if( i_disc_title > 0 ) mrltemp += wxString::Format( wxT("@%d"), i_disc_title ); caching_name = wxT("cdda-caching"); break; default: msg_Err( p_intf, "invalid selection (%d)", disc_type->GetSelection() ); } break; case NET_ACCESS: switch( i_net_type ) { case 0: mrltemp = wxT("udp://@"); if ( net_ipv6->GetValue() ) { mrltemp += wxT("[::]"); } if( i_net_ports[0] != config_GetInt( p_intf, "server-port" ) ) { mrltemp += wxString::Format( wxT(":%d"), i_net_ports[0] ); } caching_name = wxT("udp-caching"); break; case 1: mrltemp = wxT("udp://@"); if ((net_addrs[1]->GetLineText(0).Find (':') != -1) && (net_addrs[1]->GetLineText(0)[0u] != '[')) { /* automatically adds '[' and ']' to IPv6 addresses */ mrltemp += wxT("[") + net_addrs[1]->GetLineText(0) + wxT("]"); } else { mrltemp += net_addrs[1]->GetLineText(0); } if( i_net_ports[1] != config_GetInt( p_intf, "server-port" ) ) { mrltemp += wxString::Format( wxT(":%d"), i_net_ports[1] ); } caching_name = wxT("udp-caching"); break; case 2: /* http access */ if( net_addrs[2]->GetLineText(0).Find(wxT("://")) == -1 ) mrltemp = wxT("http://"); mrltemp += net_addrs[2]->GetLineText(0); if( ! mrltemp.Left(4).CmpNoCase(wxT("http")) ) caching_name = wxT("http-caching"); else if( ! mrltemp.Left(3).CmpNoCase(wxT("mms")) ) caching_name = wxT("mms-caching"); else caching_name= wxT("ftp-caching"); break; case 3: /* RTSP access */ if( net_addrs[3]->GetLineText(0).Find(wxT("rtsp://")) != 0 ) { mrltemp = wxT("rtsp://"); } mrltemp += net_addrs[3]->GetLineText(0); caching_name = wxT("rtsp-caching"); break; } if( net_timeshift->IsEnabled() && net_timeshift->IsChecked() ) mrltemp += wxT(" :access-filter=timeshift"); break; default: { int i_item = i_access_method - MAX_ACCESS; if( i_item < 0 || i_item >= (int)input_tab_array.GetCount() ) break; AutoBuiltPanel *input_panel = input_tab_array.Item( i_item ); mrltemp = input_panel->name + wxT("://"); for( int i=0; i < (int)input_panel->config_array.GetCount(); i++ ) { ConfigControl *control = input_panel->config_array.Item(i); mrltemp += wxT(" :"); if( control->GetType() == CONFIG_ITEM_BOOL && !control->GetIntValue() ) mrltemp += wxT("no-"); mrltemp += control->GetName(); switch( control->GetType() ) { case CONFIG_ITEM_STRING: case CONFIG_ITEM_FILE: case CONFIG_ITEM_DIRECTORY: case CONFIG_ITEM_MODULE: mrltemp += wxT("=\"") + control->GetPszValue() + wxT("\""); break; case CONFIG_ITEM_INTEGER: mrltemp += wxString::Format( wxT("=%i"), control->GetIntValue() ); break; case CONFIG_ITEM_FLOAT: mrltemp += wxString::Format(wxT("=%f"), control->GetFloatValue()); break; } } if( input_panel->p_advanced_mrl_combo && input_panel->p_advanced_mrl_combo->GetValue() ) { mrltemp += wxT(" ") + input_panel->p_advanced_mrl_combo->GetValue(); } } break; } if( caching_name.size() ) { if( caching_value->IsEnabled() ) { mrltemp += wxT(" :") + caching_name + wxString::Format( wxT("=%d"), i_caching ); } else { int i_value = config_GetInt( p_intf, caching_name.mb_str(wxConvUTF8) ); caching_value->SetValue( i_value ); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -