X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fwxwidgets%2Fdialogs%2Fwizard.cpp;h=6ee53449be73db1a640e85771353a0ad6a038dbf;hb=6ee1e193fd896ab9a4729fde14f009d9ce629815;hp=4181b4d690ddf652ab9cccc1907ba7ffb3efa23d;hpb=857b51f9c9ace345a6b6a9a45a20829101830abb;p=vlc diff --git a/modules/gui/wxwidgets/dialogs/wizard.cpp b/modules/gui/wxwidgets/dialogs/wizard.cpp index 4181b4d690..6ee53449be 100644 --- a/modules/gui/wxwidgets/dialogs/wizard.cpp +++ b/modules/gui/wxwidgets/dialogs/wizard.cpp @@ -30,8 +30,8 @@ #include #include -#include -#include +#include +#include class wizHelloPage; class wizInputPage; @@ -208,7 +208,7 @@ class wizInputPage : public wxWizardPage { public: wizInputPage( wxWizard *, wxWizardPage *, intf_thread_t *); - wizInputPage::~wizInputPage(); + ~wizInputPage(); void OnWizardPageChanging(wxWizardEvent& event); void OnInputChange( wxCommandEvent& event ); void OnEnablePartial(wxCommandEvent& event); @@ -262,7 +262,7 @@ class wizTranscodeCodecPage : public wxWizardPage public: wizTranscodeCodecPage( wxWizard *parent, wxWizardPage *next); ~wizTranscodeCodecPage(); - void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event); + void OnWizardPageChanging(wxWizardEvent& event); virtual wxWizardPage *GetPrev() const; virtual wxWizardPage *GetNext() const; void SetPrev( wxWizardPage *page); @@ -339,7 +339,7 @@ class wizEncapPage : public wxWizardPage { public: wizEncapPage( wxWizard *parent); - wizEncapPage::~wizEncapPage(); + ~wizEncapPage(); void OnWizardPageChanging(wxWizardEvent& event); virtual wxWizardPage *GetPrev() const; virtual wxWizardPage *GetNext() const; @@ -387,7 +387,7 @@ public: void OnWizardPageChanging( wxWizardEvent& event ); protected: DECLARE_EVENT_TABLE() - void wizTranscodeExtraPage::OnSelectFile(wxCommandEvent&); + void OnSelectFile(wxCommandEvent&); wxTextCtrl *file_text; WizardDialog *p_parent; wxWizardPage *p_prev; @@ -550,7 +550,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t wxU( INPUT_OPEN ) ); radioSizer->Add( input_radios[0], 0, wxALL, 5 ); input_radios[1] = new wxRadioButton( radio_panel, InputRadio1_Event , - wxU( INPUT_PL ) ); + wxU( INPUT_PL ) ); radioSizer->Add( input_radios[1], 0, wxALL, 5 ); radio_panel->SetSizer( radioSizer ); @@ -582,7 +582,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t if( p_playlist ) { - if( p_playlist->i_size > 0) + if( !playlist_IsEmpty( p_playlist ) ) { listview = new wxListView( this, ListView_Event, wxDefaultPosition, wxDefaultSize, @@ -591,19 +591,6 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t listview->InsertColumn( 1, wxU(_("URI")) ); listview->SetColumnWidth( 0, 250 ); listview->SetColumnWidth( 1, 100 ); -#if 0 - for( int i=0 ; i < p_playlist->i_size ; i++ ) - { - wxString filename = wxL2U( p_playlist->pp_items[i]->input. - psz_name ); - listview->InsertItem( i, filename ); - listview->SetItem( i, 1, wxL2U( p_playlist->pp_items[i]-> - input.psz_uri) ); - listview->SetItemData( i, - (long)p_playlist->pp_items[i]->input.i_id ); - } - listview->Select( p_playlist->i_index , TRUE); -#endif mainSizer->Add( listview, 1, wxALL|wxEXPAND, 5 ); listview->Hide(); @@ -720,7 +707,7 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event) } else { - p_parent->SetMrl( (const char *)mrl_text->GetValue().mb_str() ); + p_parent->SetMrl( (const char *)mrl_text->GetValue().mb_str(wxConvUTF8) ); } } else @@ -734,11 +721,12 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event) VLC_OBJECT_PLAYLIST, FIND_ANYWHERE); if( p_playlist ) { - playlist_item_t * p_item = playlist_LockItemGetById( - p_playlist, (int)data ); + playlist_item_t * p_item = playlist_ItemGetById( p_playlist, (int)data, VLC_FALSE ); if( p_item ) { - p_parent->SetMrl( (const char*)p_item->p_input->psz_uri ); + const char *psz_uri = input_item_GetURI( p_item->p_input ); + p_parent->SetMrl( psz_uri ); + free( psz_uri ); } else event.Veto(); @@ -749,8 +737,8 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event) } if( enable_checkbox->IsChecked() ) { - int i_from = atoi( from_text->GetValue().mb_str() ); - int i_to = atoi( to_text->GetValue().mb_str() ); + int i_from = atoi( from_text->GetValue().mb_str(wxConvUTF8) ); + int i_to = atoi( to_text->GetValue().mb_str(wxConvUTF8) ); p_parent->SetPartial( i_from, i_to ); } return; @@ -833,7 +821,7 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent, /* Line 2 : codec */ video_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT ,5); video_combo = new wxComboBox( this, VideoCodec_Event, wxT(""), - wxDefaultPosition, wxSize(200,25), 0, NULL, + wxDefaultPosition, wxSize(200,25), 0, NULL, wxCB_DROPDOWN| wxCB_READONLY ); for( i= 0; vcodecs_array[i].psz_display != NULL; i++ ) { @@ -873,7 +861,7 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent, /* Line 2 : codec */ audio_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT,5); audio_combo = new wxComboBox( this, AudioCodec_Event, wxT(""), - wxDefaultPosition, wxSize(200,25), 0, NULL, + wxDefaultPosition, wxSize(200,25), 0, NULL, wxCB_DROPDOWN| wxCB_READONLY ); for( i= 0; acodecs_array[i].psz_display != NULL; i++ ) { @@ -994,12 +982,12 @@ void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event) audio_combo->GetSelection() : i_audio_codec )); acodec = strdup(c->psz_codec); - int vb = atoi(vb_combo->GetValue().mb_str() ); + int vb = atoi(vb_combo->GetValue().mb_str(wxConvUTF8) ); if( vb == 0 ) { vb = 1024; } - int ab = atoi(ab_combo->GetValue().mb_str() ); + int ab = atoi(ab_combo->GetValue().mb_str(wxConvUTF8) ); if( ab == 0) { ab = 192; @@ -1093,7 +1081,7 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event) /* Check valid address */ if( i_method == 1 && !net_AddressIsMulticast( (vlc_object_t *)p_intf, - address_txtctrl->GetValue().mb_str()) ) + address_txtctrl->GetValue().mb_str(wxConvUTF8)) ) { wxMessageBox( wxU( INVALID_MCAST_ADDRESS ) , wxU( ERROR_MSG ), wxICON_WARNING | wxOK, this->p_parent ); @@ -1118,7 +1106,7 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event) } } p_parent->SetStream( methods_array[i_method].psz_access , - address_txtctrl->GetValue().mb_str() ); + address_txtctrl->GetValue().mb_str(wxConvUTF8) ); /* Set the action for the muxer page */ ((wizEncapPage*)GetNext())->SetAction( p_parent->GetAction() ); @@ -1293,7 +1281,7 @@ void wizTranscodeExtraPage::OnSelectFile( wxCommandEvent &event) if( file_dialog && file_dialog->ShowModal() == wxID_OK ) { - if( file_dialog->GetFilename().mb_str() ) + if( file_dialog->GetFilename().mb_str(wxConvUTF8) ) { file_text->SetValue( file_dialog->GetPath() ); } @@ -1310,7 +1298,7 @@ void wizTranscodeExtraPage::OnWizardPageChanging( wxWizardEvent& event ) } if( event.GetDirection() ) { - p_parent->SetTranscodeOut( file_text->GetValue().mb_str()); + p_parent->SetTranscodeOut( file_text->GetValue() ); } } @@ -1377,7 +1365,7 @@ void wizStreamingExtraPage::OnWizardPageChanging(wxWizardEvent& event) else { p_parent->SetSAP( true, - (const char *)sap_text->GetValue().mb_str() ); + (const char *)sap_text->GetValue().mb_str(wxConvUTF8) ); } } else @@ -1523,11 +1511,11 @@ void WizardDialog::SetStream( char const *method, char const *address ) this->address = strdup( address ); } -void WizardDialog::SetTranscodeOut( char const *address ) +void WizardDialog::SetTranscodeOut( wxString address ) { - char *psz_utf8 = FromLocale( address ); + char *psz_utf8 = wxFromLocale( address ); this->address = strdup( psz_utf8 ); - LocaleFree( psz_utf8 ); + wxLocaleFree( psz_utf8 ); } void WizardDialog::SetMux( char const *mux ) @@ -1623,8 +1611,8 @@ void WizardDialog::Run() /* Add brackets automatically for IPv6 if they are missing */ v6 = ( address[0] != '[' ) && ( strchr( address, ':' ) != NULL ); asprintf( &psz_opt, - ":sout=#standard{mux=%s,dst=%s%s%s,access=%s%s}", - mux, v6 ? "[" : "", address, v6 ? "]" : "", method, + ":sout=#%smux=%s,dst=%s%s%s%s}", method, + mux, v6 ? "[" : "", address, v6 ? "]" : "", psz_sap_option ?: "" ); if( psz_sap_option ) free( psz_sap_option ); } @@ -1653,8 +1641,8 @@ void WizardDialog::Run() snprintf( psz_ttl, 20, "ttl=%i",i_ttl ); input_ItemAddOption( p_input, psz_ttl ); - playlist_PlaylistAddInput( p_playlist, p_input, - PLAYLIST_GO, PLAYLIST_END ); + playlist_AddInput( p_playlist, p_input, + PLAYLIST_GO, PLAYLIST_END, VLC_TRUE, VLC_FALSE ); vlc_object_release(p_playlist); } else