📄 open.cpp
字号:
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 */ 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 ); break; case 2: /* VCD of some sort */#ifdef HAVE_VCDX 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 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 ); caching_name = wxT("vcd-caching"); break; case 3: /* CD-DA */ mrltemp = #ifdef HAVE_CDDAX wxT("cddax://") #else 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); caching_name = wxT("http-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() ); caching_value->SetValue( i_value ); } } mrl_combo->SetValue( mrltemp );}/***************************************************************************** * Events methods. *****************************************************************************/void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ){ mrl = SeparateEntries( mrl_combo->GetValue() ); mrl_combo->Append( mrl_combo->GetValue() ); if( mrl_combo->GetCount() > 10 ) mrl_combo->Delete( 0 ); mrl_combo->SetSelection( mrl_combo->GetCount() - 1 ); if( i_method == OPEN_STREAM ) { if( IsModal() ) EndModal( wxID_OK ); Hide(); return; } /* Update the playlist */ playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); if( p_playlist == NULL ) return; for( int i = 0; i < (int)mrl.GetCount(); i++ ) { vlc_bool_t b_start = !i && i_open_arg; playlist_item_t *p_item = playlist_ItemNew( p_intf, (const char*)mrl[i].mb_str(), (const char *)mrl[i].mb_str() ); /* Insert options */ while( i + 1 < (int)mrl.GetCount() && ((const char *)mrl[i + 1].mb_str())[0] == ':' ) { playlist_ItemAddOption( p_item, mrl[i + 1].mb_str() ); i++; } /* Get the options from the subtitles dialog */ if( subsfile_checkbox->IsChecked() && subsfile_mrl.GetCount() ) { for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ ) { playlist_ItemAddOption( p_item, subsfile_mrl[j].mb_str() ); } } /* Get the options from the stream output dialog */ if( sout_checkbox->IsChecked() && sout_mrl.GetCount() ) { for( int j = 0; j < (int)sout_mrl.GetCount(); j++ ) { playlist_ItemAddOption( p_item, sout_mrl[j].mb_str() ); } } playlist_AddItem( p_playlist, p_item, PLAYLIST_APPEND, PLAYLIST_END ); if( b_start ) { playlist_Control( p_playlist, PLAYLIST_ITEMPLAY , p_item ); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -