SLP Announce :)

parent 6db05717
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc * streamout.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.27 2003/07/24 21:50:28 gbazin Exp $ * $Id: streamout.cpp,v 1.28 2003/08/19 21:54:07 adn Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -78,7 +78,7 @@ enum ...@@ -78,7 +78,7 @@ enum
enum enum
{ {
SAP_MISC = 0 ANN_MISC = 0
}; };
...@@ -108,7 +108,7 @@ enum ...@@ -108,7 +108,7 @@ enum
AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event, AudioTranscEnable_Event, AudioTranscCodec_Event, AudioTranscBitrate_Event,
AudioTranscChans_Event, AudioTranscChans_Event,
SAPMisc_Event, SAPAddr_Event SAPMisc_Event, SLPMisc_Event, AnnounceAddr_Event
}; };
BEGIN_EVENT_TABLE(SoutDialog, wxDialog) BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
...@@ -131,7 +131,7 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog) ...@@ -131,7 +131,7 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
EVT_TEXT(NetAddr2_Event, SoutDialog::OnNetChange) EVT_TEXT(NetAddr2_Event, SoutDialog::OnNetChange)
EVT_TEXT(NetPort3_Event, SoutDialog::OnNetChange) EVT_TEXT(NetPort3_Event, SoutDialog::OnNetChange)
EVT_TEXT(NetAddr3_Event, SoutDialog::OnNetChange) EVT_TEXT(NetAddr3_Event, SoutDialog::OnNetChange)
/* Events generated by the encapsulation panel */ /* Events generated by the encapsulation panel */
EVT_RADIOBUTTON(EncapsulationRadio1_Event, EVT_RADIOBUTTON(EncapsulationRadio1_Event,
SoutDialog::OnEncapsulationChange) SoutDialog::OnEncapsulationChange)
...@@ -160,7 +160,8 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog) ...@@ -160,7 +160,8 @@ BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
/* Events generated by the misc panel */ /* Events generated by the misc panel */
EVT_CHECKBOX(SAPMisc_Event, SoutDialog::OnSAPMiscChange) EVT_CHECKBOX(SAPMisc_Event, SoutDialog::OnSAPMiscChange)
EVT_TEXT(SAPAddr_Event, SoutDialog::OnSAPAddrChange) EVT_CHECKBOX(SLPMisc_Event, SoutDialog::OnSLPMiscChange)
EVT_TEXT(AnnounceAddr_Event, SoutDialog::OnAnnounceAddrChange)
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -209,7 +210,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ): ...@@ -209,7 +210,7 @@ SoutDialog::SoutDialog( intf_thread_t *_p_intf, wxWindow* _p_parent ):
/* Create the Misc panel */ /* Create the Misc panel */
wxPanel *misc_panel = MiscPanel( panel ); wxPanel *misc_panel = MiscPanel( panel );
/* Separation */ /* Separation */
wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK ); wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
...@@ -337,7 +338,15 @@ void SoutDialog::UpdateMRL() ...@@ -337,7 +338,15 @@ void SoutDialog::UpdateMRL()
if( sap_checkbox->IsChecked() ) if( sap_checkbox->IsChecked() )
{ {
dup_opts += wxT(",sap=\""); dup_opts += wxT(",sap=\"");
dup_opts += sap_addr->GetLineText(0); dup_opts += announce_addr->GetLineText(0);
dup_opts += wxT("\"");
}
/* SLP only if UDP */
if( slp_checkbox->IsChecked() )
{
dup_opts += wxT(",slp=\"");
dup_opts += announce_addr->GetLineText(0);
dup_opts += wxT("\""); dup_opts += wxT("\"");
} }
...@@ -485,41 +494,46 @@ wxPanel *SoutDialog::MiscPanel( wxWindow* parent ) ...@@ -485,41 +494,46 @@ wxPanel *SoutDialog::MiscPanel( wxWindow* parent )
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box, wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxVERTICAL ); wxVERTICAL );
/* SAP Row */ /* Announce Row */
wxStaticText *label; wxStaticText *label;
wxFlexGridSizer *subpanel_sizer; wxFlexGridSizer *subpanel_sizer;
misc_subpanels[SAP_MISC] = new wxPanel( panel, -1 ); misc_subpanels[ANN_MISC] = new wxPanel( panel, -1 );
subpanel_sizer = new wxFlexGridSizer( 4, 2, 20 ); subpanel_sizer = new wxFlexGridSizer( 2, 2, 20 );
sap_checkbox = new wxCheckBox( misc_subpanels[SAP_MISC], SAPMisc_Event, sap_checkbox = new wxCheckBox( misc_subpanels[ANN_MISC], SAPMisc_Event,
wxU(_("SAP Announce")) ); wxU(_("SAP Announce")) );
label = new wxStaticText( misc_subpanels[SAP_MISC], -1, slp_checkbox = new wxCheckBox( misc_subpanels[ANN_MISC], SLPMisc_Event,
wxU(_("SLP Announce")) );
label = new wxStaticText( misc_subpanels[ANN_MISC], -1,
wxU(_("Channel Name ")) ); wxU(_("Channel Name ")) );
sap_addr = new wxTextCtrl( misc_subpanels[SAP_MISC], SAPAddr_Event, announce_addr = new wxTextCtrl( misc_subpanels[ANN_MISC],
wxT(""), wxDefaultPosition, AnnounceAddr_Event,
wxSize( 200, -1 ), wxTE_PROCESS_ENTER); wxT(""), wxDefaultPosition,
wxSize( 200, -1 ), wxTE_PROCESS_ENTER);
subpanel_sizer->Add( sap_checkbox, 0, subpanel_sizer->Add( sap_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( slp_checkbox, 0,
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL ); subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( sap_addr, 1, wxEXPAND | subpanel_sizer->Add( announce_addr, 1, wxEXPAND |
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
misc_subpanels[SAP_MISC]->SetSizerAndFit( subpanel_sizer ); misc_subpanels[ANN_MISC]->SetSizerAndFit( subpanel_sizer );
/* Stuff everything into the main panel */ /* Stuff everything into the main panel */
panel_sizer->Add( misc_subpanels[SAP_MISC], 1, panel_sizer->Add( misc_subpanels[ANN_MISC], 1,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 ); wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxALL, 5 );
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
/* Update misc panel */ /* Update misc panel */
misc_subpanels[SAP_MISC]->Disable(); misc_subpanels[ANN_MISC]->Disable();
sap_addr->Disable(); announce_addr->Disable();
return panel; return panel;
} }
wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent ) wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
{ {
...@@ -737,7 +751,7 @@ void SoutDialog::OnAccessTypeChange( wxCommandEvent& event ) ...@@ -737,7 +751,7 @@ void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
switch( i_access_type ) switch( i_access_type )
{ {
case UDP_ACCESS_OUT: case UDP_ACCESS_OUT:
misc_subpanels[SAP_MISC]->Enable( event.GetInt() ); misc_subpanels[ANN_MISC]->Enable( event.GetInt() );
case RTP_ACCESS_OUT: case RTP_ACCESS_OUT:
for( i = 1; i < ENCAPS_NUM; i++ ) for( i = 1; i < ENCAPS_NUM; i++ )
...@@ -755,18 +769,32 @@ void SoutDialog::OnAccessTypeChange( wxCommandEvent& event ) ...@@ -755,18 +769,32 @@ void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
} }
/***************************************************************************** /*****************************************************************************
* SAPMisc panel event methods. * AnnounceMisc panel event methods.
*****************************************************************************/ *****************************************************************************/
void SoutDialog::OnSAPMiscChange( wxCommandEvent& event ) void SoutDialog::OnSAPMiscChange( wxCommandEvent& event )
{ {
sap_addr->Enable( event.GetInt() ); if(!slp_checkbox->IsChecked())
UpdateMRL(); {
announce_addr->Enable( event.GetInt() );
}
UpdateMRL();
}
void SoutDialog::OnSLPMiscChange( wxCommandEvent& event )
{
if(!sap_checkbox->IsChecked())
{
announce_addr->Enable( event.GetInt() );
}
UpdateMRL();
} }
/***************************************************************************** /*****************************************************************************
* SAPAddr panel event methods. * SAPAddr panel event methods.
*****************************************************************************/ *****************************************************************************/
void SoutDialog::OnSAPAddrChange( wxCommandEvent& WXUNUSED(event) ) void SoutDialog::OnAnnounceAddrChange( wxCommandEvent& WXUNUSED(event) )
{ {
UpdateMRL(); UpdateMRL();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment