* Added a Miscellaneous Panel in wxwindows stream output.
authorMohammed Adnène Trojette <adn@videolan.org>
Fri, 4 Jul 2003 12:20:32 +0000 (12:20 +0000)
committerMohammed Adnène Trojette <adn@videolan.org>
Fri, 4 Jul 2003 12:20:32 +0000 (12:20 +0000)
* Added a SAP Announce button in this panel.

modules/gui/wxwindows/streamout.cpp
modules/gui/wxwindows/wxwindows.h

index f941ed3..7809b1e 100644 (file)
@@ -2,7 +2,7 @@
  * streamout.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
  * streamout.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: streamout.cpp,v 1.17 2003/06/22 15:43:54 gbazin Exp $
+ * $Id: streamout.cpp,v 1.18 2003/07/04 12:20:32 adn Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -79,6 +79,12 @@ enum
     MP4_ENCAPSULATION
 };
 
     MP4_ENCAPSULATION
 };
 
+enum
+{
+    SAP_ANNOUNCE = 0
+};
+
+
 /*****************************************************************************
  * Event Table.
  *****************************************************************************/
 /*****************************************************************************
  * Event Table.
  *****************************************************************************/
@@ -103,6 +109,8 @@ enum
 
     VideoTranscEnable_Event, VideoTranscCodec_Event, VideoTranscBitrate_Event,
     AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
 
     VideoTranscEnable_Event, VideoTranscCodec_Event, VideoTranscBitrate_Event,
     AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
+
+    SAPType_Event, SAPAddr_Event
 };
 
 BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
 };
 
 BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
@@ -146,6 +154,10 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
     EVT_COMBOBOX(VideoTranscBitrate_Event, SoutDialog::OnTranscodingChange)
     EVT_COMBOBOX(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
 
     EVT_COMBOBOX(VideoTranscBitrate_Event, SoutDialog::OnTranscodingChange)
     EVT_COMBOBOX(AudioTranscBitrate_Event, SoutDialog::OnTranscodingChange)
 
+    /* Events generated by the misc panel */
+    EVT_CHECKBOX(SAPType_Event, SoutDialog::OnSAPTypeChange)
+    EVT_TEXT(SAPAddr_Event, SoutDialog::OnSAPAddrChange)
+
 END_EVENT_TABLE()
 
 /*****************************************************************************
 END_EVENT_TABLE()
 
 /*****************************************************************************
@@ -191,6 +203,9 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     /* Create the transcoding panel */
     wxPanel *transcoding_panel = TranscodingPanel( panel );
 
     /* Create the transcoding panel */
     wxPanel *transcoding_panel = TranscodingPanel( panel );
 
+    /* Create the Misc panel */
+    wxPanel *misc_panel = MiscPanel( panel );
+    
     /* Separation */
     wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
 
     /* Separation */
     wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
 
@@ -211,6 +226,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
     panel_sizer->Add( access_panel, 1, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( encapsulation_panel, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( transcoding_panel, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( access_panel, 1, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( encapsulation_panel, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( transcoding_panel, 0, wxEXPAND | wxALL, 5 );
+    panel_sizer->Add( misc_panel, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
                       wxALL, 5 );
     panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
     panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALIGN_BOTTOM |
                       wxALL, 5 );
@@ -303,7 +319,15 @@ void SoutDialog::UpdateMRL()
         dup_opts += net_addrs[UDP_ACCESS_OUT]->GetLineText(0);
         dup_opts += wxString::Format( wxT(":%d"),
                                       net_ports[UDP_ACCESS_OUT]->GetValue() );
         dup_opts += net_addrs[UDP_ACCESS_OUT]->GetLineText(0);
         dup_opts += wxString::Format( wxT(":%d"),
                                       net_ports[UDP_ACCESS_OUT]->GetValue() );
-        dup_opts += wxT("}");
+    }
+    if( access_checkboxes[UDP_ACCESS_OUT]->IsChecked() && misc_checkboxes[SAP_ANNOUNCE]->IsChecked() ) /* SAP only if UDP ÃÃ*/
+    {
+        dup_opts += wxT(",sap=");
+        dup_opts += misc_addrs[SAP_ANNOUNCE]-> GetLineText(0);
+    }
+    if( access_checkboxes[UDP_ACCESS_OUT]->IsChecked() )
+    {
+        dup_opts += wxT("}"); /* the bracket must be closed after SAP ! */
     }
     if( access_checkboxes[RTP_ACCESS_OUT]->IsChecked() )
     {
     }
     if( access_checkboxes[RTP_ACCESS_OUT]->IsChecked() )
     {
@@ -436,6 +460,62 @@ wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
     return panel;
 }
 
     return panel;
 }
 
+wxPanel *SoutDialog::MiscPanel( wxWindow* parent )
+{
+    wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
+                                  wxSize(200, 200) );
+
+    // wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 4, 20 );
+    wxStaticBox *panel_box = new wxStaticBox( panel, -1,
+                                              wxU(_("Miscellaneous Options")) );
+    wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
+                                                          wxVERTICAL );
+
+    static const wxString misc_output_array[] =
+    {
+        wxU(_("SAP Announce"))
+    };
+
+        misc_checkboxes[SAP_ANNOUNCE] = new wxCheckBox( panel,SAPType_Event,
+                                               misc_output_array[SAP_ANNOUNCE] );
+        misc_subpanels[SAP_ANNOUNCE] = new wxPanel( panel, -1 );
+    
+       /* SAP Row */
+
+    wxStaticText *label;
+    wxFlexGridSizer *subpanel_sizer;
+
+    subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 );
+    label = new wxStaticText( misc_subpanels[SAP_ANNOUNCE], -1, wxU(_("Channel Name ")) );
+    misc_addrs[SAP_ANNOUNCE] = new wxTextCtrl( misc_subpanels[SAP_ANNOUNCE],
+                                               SAPAddr_Event,
+                                               wxT(""), wxDefaultPosition,
+                                               wxSize( 200, -1 ), wxTE_PROCESS_ENTER);
+
+    subpanel_sizer->Add( label, 0,
+                         wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
+    subpanel_sizer->Add( misc_addrs[SAP_ANNOUNCE], 1, wxEXPAND |
+                         wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
+
+    misc_subpanels[SAP_ANNOUNCE]->SetSizerAndFit( subpanel_sizer );
+
+        /* Stuff everything into the main panel */
+        
+       panel_sizer->Add( misc_checkboxes[SAP_ANNOUNCE], 0,
+                      wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
+        panel_sizer->Add( misc_subpanels[SAP_ANNOUNCE], 1,
+                      wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
+
+        panel->SetSizerAndFit( panel_sizer );
+
+    /* Update access type panel */
+
+        misc_checkboxes[SAP_ANNOUNCE]->Disable();
+        misc_subpanels[SAP_ANNOUNCE]->Disable();
+
+        return panel;
+} 
+
 wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
 {
     int i;
 wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
 {
     int i;
@@ -620,6 +700,9 @@ void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
     switch( i_access_type )
     {
     case UDP_ACCESS_OUT:
     switch( i_access_type )
     {
     case UDP_ACCESS_OUT:
+       {    
+            misc_checkboxes[SAP_ANNOUNCE]->Enable( event.GetInt() );
+        }
     case RTP_ACCESS_OUT:
         for( i = 1; i < ENCAPS_NUM; i++ )
         {
     case RTP_ACCESS_OUT:
         for( i = 1; i < ENCAPS_NUM; i++ )
         {
@@ -632,10 +715,29 @@ void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
         }
         break;
     }
         }
         break;
     }
+    UpdateMRL();
+}
+
+/*****************************************************************************
+ * SAPType panel event methods.
+ *****************************************************************************/
+void SoutDialog::OnSAPTypeChange( wxCommandEvent& event )
+{
+    i_sap_type = event.GetId()-SAPType_Event;
+    misc_subpanels[i_sap_type]->Enable( event.GetInt() );
 
     UpdateMRL();
 }
 
 
     UpdateMRL();
 }
 
+/*****************************************************************************
+ * SAPAddr panel event methods.
+ *****************************************************************************/
+void SoutDialog::OnSAPAddrChange( wxCommandEvent& WXUNUSED(event) )
+{
+    UpdateMRL();
+}
+
+
 /*****************************************************************************
  * File access output event methods.
  *****************************************************************************/
 /*****************************************************************************
  * File access output event methods.
  *****************************************************************************/
index d31deae..db2ea6c 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.36 2003/06/12 21:28:39 gbazin Exp $
+ * $Id: wxwindows.h,v 1.37 2003/07/04 12:20:32 adn Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -305,6 +305,7 @@ public:
 private:
     void UpdateMRL();
     wxPanel *AccessPanel( wxWindow* parent );
 private:
     void UpdateMRL();
     wxPanel *AccessPanel( wxWindow* parent );
+    wxPanel *MiscPanel( wxWindow* parent );
     wxPanel *EncapsulationPanel( wxWindow* parent );
     wxPanel *TranscodingPanel( wxWindow* parent );
     void    ParseMRL();
     wxPanel *EncapsulationPanel( wxWindow* parent );
     wxPanel *TranscodingPanel( wxWindow* parent );
     void    ParseMRL();
@@ -314,6 +315,7 @@ private:
     void OnCancel( wxCommandEvent& event );
     void OnMRLChange( wxCommandEvent& event );
     void OnAccessTypeChange( wxCommandEvent& event );
     void OnCancel( wxCommandEvent& event );
     void OnMRLChange( wxCommandEvent& event );
     void OnAccessTypeChange( wxCommandEvent& event );
+    void OnSAPTypeChange( wxCommandEvent& event );
 
     /* Event handlers for the file access output */
     void OnFileChange( wxCommandEvent& event );
 
     /* Event handlers for the file access output */
     void OnFileChange( wxCommandEvent& event );
@@ -322,6 +324,9 @@ private:
     /* Event handlers for the net access output */
     void OnNetChange( wxCommandEvent& event );
 
     /* Event handlers for the net access output */
     void OnNetChange( wxCommandEvent& event );
 
+    /* Event specific to the sap address */
+    void OnSAPAddrChange( wxCommandEvent& event );
+    
     /* Event handlers for the encapsulation panel */
     void OnEncapsulationChange( wxCommandEvent& event );
 
     /* Event handlers for the encapsulation panel */
     void OnEncapsulationChange( wxCommandEvent& event );
 
@@ -346,6 +351,14 @@ private:
     wxSpinCtrl *net_ports[5];
     wxTextCtrl *net_addrs[5];
 
     wxSpinCtrl *net_ports[5];
     wxTextCtrl *net_addrs[5];
 
+    /* Controls for the SAP announces */
+     wxPanel *misc_subpanels[1];
+     wxCheckBox *misc_checkboxes[1];
+     
+     int i_sap_type;
+     
+     wxTextCtrl *misc_addrs[1];
+                            
     /* Controls for the encapsulation */
     wxRadioButton *encapsulation_radios[5];
     int i_encapsulation_type;
     /* Controls for the encapsulation */
     wxRadioButton *encapsulation_radios[5];
     int i_encapsulation_type;