]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwidgets/dialogs/open.cpp
* modules/gui/wxwidgets: fix breakage introduced by changeset 23581 and 23579. Breaki...
[vlc] / modules / gui / wxwidgets / dialogs / open.cpp
index dc10cfeec349c57986cf50ed19ce45aad1a4f18d..f85150cac1d05e3d93043977c8afc5d1219b39ae 100644 (file)
@@ -29,7 +29,7 @@
 #include "dialogs/preferences_widgets.h"
 #include "dialogs/subtitles.hpp"
 
-#include "charset.h"
+#include "vlc_charset.h"
 
 #undef HAVE_LIBCDIO // Disable broken code
 
@@ -219,16 +219,20 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
                                 intf_thread_t *_p_intf,
                                 const module_t *p_module )
   : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize ),
-    name( wxU(p_module->psz_object_name) ),
+    name( wxU(module_GetObjName(p_module)) ),
     p_advanced_mrl_combo( NULL ),
     p_intf( _p_intf ), p_open_dialog( dialog ), p_advanced_dialog( NULL )
 {
     wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
-    module_config_t *p_item = p_module->p_config;
     bool b_advanced = false;
+    unsigned int i_confsize; 
+    module_config_t *p_config;
+    int n;
 
-    if( p_item ) do
+    p_config = module_GetConfig (p_module, &i_confsize);
+    for( n = 0; n < i_confsize; n++ )
     {
+        module_config_t *p_item = p_config + n;
         if( !(p_item->i_type & CONFIG_HINT) && p_item->b_advanced )
             b_advanced = true;
 
@@ -247,7 +251,6 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
 
         sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
     }
-    while( p_item->i_type != CONFIG_HINT_END && p_item++ );
 
     if( b_advanced )
     {
@@ -259,8 +262,8 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
         /* Build the advanced dialog */
         p_advanced_dialog =
             new wxDialog( this, -1, ((wxString)wxU(_("Advanced options"))) +
-                          wxT(" (") + wxU( p_module->psz_longname ) + wxT(")"),
-                          wxDefaultPosition, wxDefaultSize,
+                          wxT(" (") + wxU( module_GetLongName(p_module) ) +
+                          wxT(")"), wxDefaultPosition, wxDefaultSize,
                           wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
 
         wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
@@ -283,9 +286,9 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
         sizer->Add( mrl_sizer_sizer, 0, wxEXPAND | wxALL, 2 );
 
         /* Add advanced options to panel */
-        module_config_t *p_item = p_module->p_config;
-        if( p_item ) do
+        for( n = 0; n < i_confsize; n++ )
         {
+            module_config_t *p_item = p_config + n;
             if( p_item->i_type & CONFIG_HINT || !p_item->b_advanced )
                 continue;
 
@@ -303,7 +306,6 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
 
             sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
         }
-        while( p_item->i_type != CONFIG_HINT_END && p_item++ );
 
         /* Separation */
         wxPanel *dummy_panel = new wxPanel( p_advanced_dialog, -1 );
@@ -328,6 +330,8 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
         p_advanced_dialog->SetSizerAndFit( sizer );
     }
 
+    module_PutConfig (p_config);
+
     this->SetSizerAndFit( sizer );
 }
 
@@ -503,48 +507,48 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     notebook->AddPage( NetPanel( notebook ), wxU(_("Network")),
                        i_access_method == NET_ACCESS );
 
-    module_t *p_module = config_FindModule( VLC_OBJECT(p_intf), "v4l" );
+    module_t *p_module = module_Find( VLC_OBJECT(p_intf), "v4l" );
     if( p_module )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
-                        p_module->psz_shortname : p_module->psz_object_name ),
+        notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
+        module_Put( p_module );
     }
 
-    p_module = config_FindModule( VLC_OBJECT(p_intf), "pvr" );
+    p_module = module_Find( VLC_OBJECT(p_intf), "pvr" );
     if( p_module )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
-                        p_module->psz_shortname : p_module->psz_object_name ),
+        notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
+        module_Put( p_module );
     }
 
-    p_module = config_FindModule( VLC_OBJECT(p_intf), "dvb" );
+    p_module = module_Find( VLC_OBJECT(p_intf), "dvb" );
     if( p_module )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
-                        p_module->psz_shortname : p_module->psz_object_name ),
+        notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
+        module_Put( p_module );
     }
 
-    p_module = config_FindModule( VLC_OBJECT(p_intf), "dshow" );
+    p_module = module_Find( VLC_OBJECT(p_intf), "dshow" );
     if( p_module )
     {
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
-                        p_module->psz_shortname : p_module->psz_object_name ),
+        notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
                            i_access_method == CAPTURE_ACCESS );
+        module_Put( p_module );
     }
 
     /* Update Disc panel */
@@ -1128,7 +1132,7 @@ void OpenDialog::UpdateMRL( int i_access_method )
         }
         else
         {
-            int i_value = config_GetInt( p_intf, caching_name.mb_str() );
+            int i_value = config_GetInt( p_intf, caching_name.mb_str(wxConvUTF8) );
             caching_value->SetValue( i_value );
         }
     }
@@ -1171,7 +1175,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
 
         /* Insert options */
         while( i + 1 < (int)mrl.GetCount() &&
-               ((const char *)mrl[i + 1].mb_str())[0] == ':' )
+               ((const char *)mrl[i + 1].mb_str(wxConvUTF8))[0] == ':' )
         {
             psz_utf8 = wxFromLocale( mrl[i + 1] );
             input_ItemAddOption( p_input, psz_utf8 );
@@ -1203,15 +1207,15 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
 
         if( b_start )
         {
-            playlist_PlaylistAddInput( p_playlist, p_input,
-                                       PLAYLIST_APPEND | PLAYLIST_GO,
-                                       PLAYLIST_END );
+            playlist_AddInput( p_playlist, p_input,
+                               PLAYLIST_APPEND | PLAYLIST_GO,
+                               PLAYLIST_END, VLC_TRUE, VLC_FALSE );
         }
         else
         {
-            playlist_PlaylistAddInput( p_playlist, p_input,
+            playlist_AddInput( p_playlist, p_input,
                                        PLAYLIST_APPEND|PLAYLIST_PREPARSE,
-                                       PLAYLIST_END );
+                                       PLAYLIST_END, VLC_TRUE, VLC_FALSE );
         }
     }
 
@@ -1667,14 +1671,12 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
         disc_audio->SetRange( 0, 7 );  // up to 8 audio channels
         disc_chapter->SetRange( 0, 255 );
         disc_title->SetToolTip( wxU(_("Title number.")) );
-        // \bug [string] needs to be DVDs instead of DVD's
         disc_sub->SetToolTip( wxU(_(
-          "DVD's can have up to 32 subtitles numbered 0..31. "
+          "DVDs can have up to 32 subtitles numbered 0..31. "
           "Note this is not the same thing as a subtitle name (e.g. 'en'). "
           "If a value -1 is used, no subtitle will be shown." )) );
-        // \bug [string] needs to be DVDs instead of DVD's
         disc_audio->SetToolTip( wxU(_("Audio track number. "
-          "DVD's can have up to 8 audio tracks numbered 0..7."
+          "DVDs can have up to 8 audio tracks numbered 0..7."
         )) );
         break;
 
@@ -1710,13 +1712,11 @@ void OpenDialog::OnDiscTypeChange( wxCommandEvent& WXUNUSED(event) )
         disc_title->SetRange( 0, 99 );  // only 100 tracks allowed on VCDs
         disc_sub->SetRange( -1, 3 );    // up to 4 subtitles -1 = no subtitle
         disc_audio->SetRange( 0, 1 );   // up to 2 audio tracks
-        // \bug [string] needs to be SVCDs instead of SVCD's
         disc_sub->SetToolTip( wxU(_(
-          "SVCD's can have up to 4 subtitles numbered 0..3. "
+          "SVCDs can have up to 4 subtitles numbered 0..3. "
           "If a value -1 is used, no subtitle will be shown." )) );
-        // \bug [string] needs to be SVCDs instead of SVCD's
         disc_audio->SetToolTip( wxU(_("Audio track number. "
-          "VCD's can have up to 2 audio tracks numbered 0 or 1. "
+          "VCDs can have up to 2 audio tracks numbered 0 or 1. "
         )) );
         break;
 
@@ -1837,8 +1837,8 @@ void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
                         (int)subsfile_dialog->size_combo->GetClientData(
                         subsfile_dialog->size_combo->GetSelection()) ) );
         }
-        subsfile_mrl.Add( wxString::Format( wxT("sub-fps=%i"),
-                          subsfile_dialog->fps_spinctrl->GetValue() ) );
+        subsfile_mrl.Add( wxString( wxT("sub-fps="))+
+                                    subsfile_dialog->fps_ctrl->GetValue()  );
         subsfile_mrl.Add( wxString::Format( wxT("sub-delay=%i"),
                           subsfile_dialog->delay_spinctrl->GetValue() ) );
     }