* 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>
*
MP4_ENCAPSULATION
};
+enum
+{
+ SAP_ANNOUNCE = 0
+};
+
+
/*****************************************************************************
* Event Table.
*****************************************************************************/
VideoTranscEnable_Event, VideoTranscCodec_Event, VideoTranscBitrate_Event,
AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
+
+ SAPType_Event, SAPAddr_Event
};
BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
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()
/*****************************************************************************
/* 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 );
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 );
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() )
{
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;
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++ )
{
}
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();
}
+/*****************************************************************************
+ * SAPAddr panel event methods.
+ *****************************************************************************/
+void SoutDialog::OnSAPAddrChange( wxCommandEvent& WXUNUSED(event) )
+{
+ UpdateMRL();
+}
+
+
/*****************************************************************************
* File access output event methods.
*****************************************************************************/
* 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>
*
private:
void UpdateMRL();
wxPanel *AccessPanel( wxWindow* parent );
+ wxPanel *MiscPanel( wxWindow* parent );
wxPanel *EncapsulationPanel( wxWindow* parent );
wxPanel *TranscodingPanel( wxWindow* parent );
void ParseMRL();
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 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 );
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;