* modules/gui/wxwindows/*: small fixes and improvements.
authorGildas Bazin <gbazin@videolan.org>
Thu, 15 May 2003 15:59:35 +0000 (15:59 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 15 May 2003 15:59:35 +0000 (15:59 +0000)
modules/gui/wxwindows/menus.cpp
modules/gui/wxwindows/open.cpp
modules/gui/wxwindows/streamout.cpp
modules/gui/wxwindows/wxwindows.h

index 7f5d170..46670c9 100644 (file)
@@ -2,7 +2,7 @@
  * menus.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: menus.cpp,v 1.8 2003/05/13 23:41:17 gbazin Exp $
+ * $Id: menus.cpp,v 1.9 2003/05/15 15:59:35 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -147,6 +147,8 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
         pi_objects[i++] = p_object->i_object_id;
         ppsz_varnames[i] = "navigation";
         pi_objects[i++] = p_object->i_object_id;
+        ppsz_varnames[i] = "program";
+        pi_objects[i++] = p_object->i_object_id;
 
         ppsz_varnames[i] = "video-es";
         pi_objects[i++] = p_object->i_object_id;
@@ -243,8 +245,8 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
 wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
 {
     vlc_object_t *p_object;
-    char *ppsz_varnames[4];
-    int pi_objects[4];
+    char *ppsz_varnames[6];
+    int pi_objects[6];
     int i = 0;
 
     /* Initializations */
@@ -261,6 +263,8 @@ wxMenu *NavigMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
         ppsz_varnames[i] = "navigation";
         pi_objects[i++] = p_object->i_object_id;
         vlc_object_release( p_object );
+        ppsz_varnames[i] = "program";
+        pi_objects[i++] = p_object->i_object_id;
     }
 
     /* Build menu */
index 48a8188..22526ed 100644 (file)
@@ -2,7 +2,7 @@
  * open.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: open.cpp,v 1.21 2003/05/13 22:33:33 gbazin Exp $
+ * $Id: open.cpp,v 1.22 2003/05/15 15:59:35 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -154,6 +154,10 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
     p_intf = _p_intf;
     p_parent = _p_parent;
     SetIcon( *p_intf->p_sys->p_icon );
+    file_dialog = NULL;
+    sout_dialog = NULL;
+    subsfile_dialog = NULL;
+    demuxdump_dialog = NULL;
 
     /* Create a panel to put everything in */
     wxPanel *panel = new wxPanel( this, -1 );
@@ -315,6 +319,11 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, wxWindow *_p_parent,
 
 OpenDialog::~OpenDialog()
 {
+    /* Clean up */
+    if( file_dialog ) delete file_dialog;
+    if( sout_dialog ) delete sout_dialog;
+    if( subsfile_dialog ) delete subsfile_dialog;
+    if( demuxdump_dialog ) delete demuxdump_dialog;
 }
 
 /*****************************************************************************
@@ -587,12 +596,13 @@ void OpenDialog::OnFilePanelChange( wxCommandEvent& WXUNUSED(event) )
 
 void OpenDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
 {
-    wxFileDialog dialog( this, wxU(_("Open file")),
-                         wxT(""), wxT(""), wxT("*.*"), wxOPEN );
+    if( file_dialog == NULL )
+        file_dialog = new wxFileDialog( this, wxU(_("Open file")),
+                                        wxT(""), wxT(""), wxT("*.*"), wxOPEN );
 
-    if( dialog.ShowModal() == wxID_OK )
+    if( file_dialog && file_dialog->ShowModal() == wxID_OK )
     {
-        file_combo->SetValue( dialog.GetPath() );      
+        file_combo->SetValue( file_dialog->GetPath() );      
         UpdateMRL( FILE_ACCESS );
     }
 }
@@ -688,16 +698,17 @@ void OpenDialog::OnSubsFileEnable( wxCommandEvent& event )
 void OpenDialog::OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) )
 {
     /* Show/hide the open dialog */
-    SubsFileDialog dialog( p_intf, p_parent );
+    if( subsfile_dialog == NULL )
+        subsfile_dialog = new SubsFileDialog( p_intf, p_parent );
 
-    if( dialog.ShowModal() == wxID_OK )
+    if( subsfile_dialog && subsfile_dialog->ShowModal() == wxID_OK )
     {
         config_PutPsz( p_intf, "sub-file",
-                       (const char *)dialog.file_combo->GetValue().mb_str() );
+            (const char *)subsfile_dialog->file_combo->GetValue().mb_str() );
         config_PutInt( p_intf, "sub-delay",
-                       dialog.delay_spinctrl->GetValue() );
+                       subsfile_dialog->delay_spinctrl->GetValue() );
         config_PutFloat( p_intf, "sub-fps",
-                         dialog.fps_spinctrl->GetValue() );
+                         subsfile_dialog->fps_spinctrl->GetValue() );
     }
 }
 
@@ -723,11 +734,13 @@ void OpenDialog::OnSoutEnable( wxCommandEvent& event )
 void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
 {
     /* Show/hide the open dialog */
-    SoutDialog dialog( p_intf, p_parent );
+    if( sout_dialog == NULL )
+        sout_dialog = new SoutDialog( p_intf, p_parent );
 
-    if( dialog.ShowModal() == wxID_OK )
+    if( sout_dialog && sout_dialog->ShowModal() == wxID_OK )
     {
-        config_PutPsz( p_intf, "sout", (const char *)dialog.mrl.mb_str() );
+        config_PutPsz( p_intf, "sout",
+                       (const char *)sout_dialog->mrl.mb_str() );
     }
 }
 
@@ -754,12 +767,13 @@ void OpenDialog::OnDemuxDumpEnable( wxCommandEvent& event )
 
 void OpenDialog::OnDemuxDumpBrowse( wxCommandEvent& WXUNUSED(event) )
 {
-    wxFileDialog dialog( this, wxU(_("Save file")),
-                         wxT(""), wxT(""), wxT("*.*"), wxSAVE );
+    if( demuxdump_dialog == NULL )
+        demuxdump_dialog = new wxFileDialog( this, wxU(_("Save file")),
+                               wxT(""), wxT(""), wxT("*.*"), wxSAVE );
 
-    if( dialog.ShowModal() == wxID_OK )
+    if( demuxdump_dialog && demuxdump_dialog->ShowModal() == wxID_OK )
     {
-        demuxdump_textctrl->SetValue( dialog.GetPath() );
+        demuxdump_textctrl->SetValue( demuxdump_dialog->GetPath() );
         wxCommandEvent event = wxCommandEvent( wxEVT_NULL );
         OnDemuxDumpChange( event );
     }
index b6166f0..58b2c83 100644 (file)
@@ -2,7 +2,7 @@
  * streamout.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.10 2003/05/15 01:33:53 gbazin Exp $
+ * $Id: streamout.cpp,v 1.11 2003/05/15 15:59:35 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -217,7 +217,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     SetSizerAndFit( main_sizer );
 
     /* Update all the values */
-    ParseMRL();
+    //ParseMRL();
 }
 
 SoutDialog::~SoutDialog()
@@ -337,7 +337,7 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
     wxStaticBox *panel_box = new wxStaticBox( panel, -1,
                                               wxU(_("Output Methods")) );
     wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
-                                                          wxHORIZONTAL );
+                                                          wxVERTICAL );
 
     static const wxString access_output_array[] =
     {
@@ -409,15 +409,17 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
 
 
     /* Stuff everything into the main panel */
-    for( i=0; i < ACCESS_OUT_NUM; i++ )
+    for( i=1; i < ACCESS_OUT_NUM; i++ )
     {
         sizer->Add( access_checkboxes[i], 0,
-                    wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
+                    wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL  | wxALL, 5 );
         sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL
-                    | wxALIGN_LEFT );
+                    | wxALIGN_LEFT  | wxALL, 5 );
     }
 
-    panel_sizer->Add( sizer, 1, wxEXPAND, 0 );
+    panel_sizer->Add( access_checkboxes[0], 0,
+                      wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL  | wxALL, 5 );
+    panel_sizer->Add( sizer, 1, wxEXPAND | wxTOP, 3 );
 
     panel->SetSizerAndFit( panel_sizer );
 
@@ -457,13 +459,13 @@ wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
             new wxRadioButton( panel, EncapsulationRadio1_Event + i,
                                encapsulation_array[i] );
         panel_sizer->Add( encapsulation_radios[i], 0,
-                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
+                          wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 8 );
     }
 
     panel->SetSizerAndFit( panel_sizer );
 
     /* Update encapsulation panel */
-    encapsulation_radios[0]->Enable();
+    encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
     i_encapsulation_type = TS_ENCAPSULATION;
 
     return panel;
index 5c80098..dc349fa 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.26 2003/05/15 01:33:53 gbazin Exp $
+ * $Id: wxwindows.h,v 1.27 2003/05/15 15:59:35 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -190,6 +190,8 @@ private:
 };
 
 /* Open Dialog */
+class SoutDialog;
+class SubsFileDialog;
 class OpenDialog: public wxDialog
 {
 public:
@@ -250,6 +252,7 @@ private:
 
     /* Controls for the file panel */
     wxComboBox *file_combo;
+    wxFileDialog *file_dialog;
 
     /* Controls for the disc panel */
     wxRadioBox *disc_type;
@@ -268,15 +271,18 @@ private:
     /* Controls for the subtitles file */
     wxButton *subsfile_button;
     wxCheckBox *subsfile_checkbox;
+    SubsFileDialog *subsfile_dialog;
 
     /* Controls for the stream output */
     wxButton *sout_button;
     wxCheckBox *sout_checkbox;
+    SoutDialog *sout_dialog;
 
     /* Controls for the demux dump */
     wxTextCtrl *demuxdump_textctrl;
     wxButton *demuxdump_button;
     wxCheckBox *demuxdump_checkbox;
+    wxFileDialog *demuxdump_dialog;
 };
 
 enum