]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/open.cpp
* modules/gui/wxwindows: do not use INSERT_ELEM in c++ code.
[vlc] / modules / gui / wxwindows / open.cpp
index 75c0399535e864b4e0f93a4c668f9a3e318fd5a1..d1d0d5fdce0f96be508cf1644298d17be49682c3 100644 (file)
@@ -37,6 +37,8 @@
 
 #include <vlc/intf.h>
 
+#include <vector>
+
 #include "wxwindows.h"
 #include "preferences_widgets.h"
 
@@ -221,9 +223,6 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
 
     if( b_advanced )
     {
-        wxPanel *dummy_panel = new wxPanel( this, -1 );
-        sizer->Add( dummy_panel, 1 );
-
         wxButton *button =
             new wxButton( this, AdvancedOptions_Event,
                           wxU(_("Advanced options...")) );
@@ -279,7 +278,7 @@ AutoBuiltPanel::AutoBuiltPanel( wxWindow *parent, OpenDialog *dialog,
         while( p_item->i_type != CONFIG_HINT_END && p_item++ );
 
         /* Separation */
-        dummy_panel = new wxPanel( p_advanced_dialog, -1 );
+        wxPanel *dummy_panel = new wxPanel( p_advanced_dialog, -1 );
         sizer->Add( dummy_panel, 1 );
         wxStaticLine *static_line =
             new wxStaticLine( p_advanced_dialog, wxID_OK );
@@ -373,6 +372,7 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     SetIcon( *p_intf->p_sys->p_icon );
     file_dialog = NULL;
     i_disc_type_selection = 0;
+    i_disc_title = 0;
     i_open_arg = i_arg;
 
     sout_dialog = NULL;
@@ -447,7 +447,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     common_opt_sizer->Add( caching_checkbox, 0,
                            wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
     caching_value = new wxSpinCtrl( panel, CachingChange_Event );
+#ifdef WIN32  /* WIN32 uses 16 bit integer */
+    caching_value->SetRange( 0, 32767 );
+#else
     caching_value->SetRange( 0, 1000000 );
+#endif
     caching_value->Disable();
     common_opt_sizer->Add( caching_value, 0,
                            wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
@@ -478,7 +482,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ),
+        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
+                        p_module->psz_shortname : p_module->psz_object_name ),
                            i_access_method == CAPTURE_ACCESS );
     }
 
@@ -488,7 +493,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ),
+        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
+                        p_module->psz_shortname : p_module->psz_object_name ),
                            i_access_method == CAPTURE_ACCESS );
     }
 
@@ -498,7 +504,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ),
+        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
+                        p_module->psz_shortname : p_module->psz_object_name ),
                            i_access_method == CAPTURE_ACCESS );
     }
 
@@ -508,7 +515,8 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
         AutoBuiltPanel *autopanel =
             new AutoBuiltPanel( notebook, this, p_intf, p_module );
         input_tab_array.Add( autopanel );
-        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ),
+        notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
+                        p_module->psz_shortname : p_module->psz_object_name ),
                            i_access_method == CAPTURE_ACCESS );
     }
 
@@ -785,7 +793,7 @@ void OpenDialog::UpdateMRL()
 
 void OpenDialog::UpdateMRL( int i_access_method )
 {
-    wxString demux, mrltemp, caching_name;
+    wxString mrltemp, caching_name;
 
     i_current_access_method = i_access_method;
 
@@ -848,7 +856,13 @@ void OpenDialog::UpdateMRL( int i_access_method )
             break;
 
         case 3: /* CD-DA */
-            mrltemp = wxT("cdda://") + disc_device->GetValue();
+            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 );
 
@@ -866,7 +880,7 @@ void OpenDialog::UpdateMRL( int i_access_method )
         switch( i_net_type )
         {
         case 0:
-            mrltemp = wxT("udp") + demux + wxT("://");
+            mrltemp = wxT("udp://");
             if ( net_ipv6->GetValue() )
             {
                 mrltemp += wxT("@[::]");
@@ -881,7 +895,7 @@ void OpenDialog::UpdateMRL( int i_access_method )
             break;
 
         case 1:
-            mrltemp = wxT("udp") + demux + wxT("://@");
+            mrltemp = wxT("udp://@");
             if ((net_addrs[1]->GetLineText(0).Find (':') != -1)
                 && (net_addrs[1]->GetLineText(0)[0u] != '['))
             {
@@ -903,10 +917,9 @@ void OpenDialog::UpdateMRL( int i_access_method )
 
         case 2:
             /* http access */
-            if( net_addrs[2]->GetLineText(0).Find(wxT("http://")) )
-            {
-                mrltemp = wxT("http") + demux + wxT("://");
-            }
+            if( net_addrs[2]->GetLineText(0).Find(wxT("://")) == -1 )
+                mrltemp = wxT("http://");
+
             mrltemp += net_addrs[2]->GetLineText(0);
 
             caching_name = wxT("http-caching");
@@ -916,7 +929,7 @@ void OpenDialog::UpdateMRL( int i_access_method )
             /* RTSP access */
             if( net_addrs[3]->GetLineText(0).Find(wxT("rtsp://")) != 0 )
             {
-                mrltemp = wxT("rtsp") + demux + wxT("://");
+                mrltemp = wxT("rtsp://");
             }
             mrltemp += net_addrs[3]->GetLineText(0);
 
@@ -1054,8 +1067,7 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
 
         if( b_start )
         {
-            int i_pos = playlist_GetPositionById( p_playlist , i_id );
-            playlist_Command( p_playlist, PLAYLIST_GOTO, i_pos );
+            playlist_Control( p_playlist, PLAYLIST_ITEMPLAY , p_item );
         }
     }
 
@@ -1280,10 +1292,17 @@ void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
         if( subsfile_dialog->encoding_combo )
             subsfile_mrl.Add( wxString(wxT("subsdec-encoding=")) +
                               subsfile_dialog->encoding_combo->GetValue() );
-        subsfile_mrl.Add( wxString::Format( wxT("sub-delay=%i"),
-                          subsfile_dialog->delay_spinctrl->GetValue() ) );
+        subsfile_mrl.Add( wxString::Format(wxT("subsdec-align=%i"),
+                           (int)subsfile_dialog->align_combo->GetClientData(
+                           subsfile_dialog->align_combo->GetSelection()) ) );
+
+        subsfile_mrl.Add( wxString::Format( wxT("freetype-rel-fontsize=%i"),
+                          (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::Format( wxT("sub-delay=%i"),
+                          subsfile_dialog->delay_spinctrl->GetValue() ) );
     }
 }