Commit 2ebf1f92 authored by Gildas Bazin's avatar Gildas Bazin

*  modules/gui/wxwindows/*: Added a stream output dialog box.
parent b33fa8a5
...@@ -3,6 +3,7 @@ SOURCES_wxwindows = \ ...@@ -3,6 +3,7 @@ SOURCES_wxwindows = \
modules/gui/wxwindows/wxwindows.h \ modules/gui/wxwindows/wxwindows.h \
modules/gui/wxwindows/interface.cpp \ modules/gui/wxwindows/interface.cpp \
modules/gui/wxwindows/open.cpp \ modules/gui/wxwindows/open.cpp \
modules/gui/wxwindows/streamout.cpp \
modules/gui/wxwindows/messages.cpp \ modules/gui/wxwindows/messages.cpp \
modules/gui/wxwindows/playlist.cpp \ modules/gui/wxwindows/playlist.cpp \
modules/gui/wxwindows/popup.cpp \ modules/gui/wxwindows/popup.cpp \
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.5 2003/02/27 13:19:44 gbazin Exp $ * $Id: open.cpp,v 1.6 2003/03/22 03:14:34 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/combobox.h> #include <wx/combobox.h>
#include <wx/spinctrl.h> #include <wx/spinctrl.h>
#include <wx/statline.h>
#include <vlc/intf.h> #include <vlc/intf.h>
...@@ -76,13 +77,15 @@ enum ...@@ -76,13 +77,15 @@ enum
NetRadio1_Event, NetRadio2_Event, NetRadio3_Event, NetRadio4_Event, NetRadio1_Event, NetRadio2_Event, NetRadio3_Event, NetRadio4_Event,
NetPort1_Event, NetPort2_Event, NetPort3_Event, NetPort4_Event, NetPort1_Event, NetPort2_Event, NetPort3_Event, NetPort4_Event,
NetAddr1_Event, NetAddr2_Event, NetAddr3_Event, NetAddr4_Event, NetAddr1_Event, NetAddr2_Event, NetAddr3_Event, NetAddr4_Event,
SoutEnable_Event,
SoutSettings_Event,
}; };
BEGIN_EVENT_TABLE(OpenDialog, wxDialog) BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
/* Button events */ /* Button events */
EVT_BUTTON(wxID_OK, OpenDialog::OnOk) EVT_BUTTON(wxID_OK, OpenDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, OpenDialog::OnCancel) EVT_BUTTON(wxID_CANCEL, OpenDialog::OnCancel)
EVT_BUTTON(FileBrowse_Event, OpenDialog::OnFileBrowse)
EVT_NOTEBOOK_PAGE_CHANGED(Notebook_Event, OpenDialog::OnPageChange) EVT_NOTEBOOK_PAGE_CHANGED(Notebook_Event, OpenDialog::OnPageChange)
...@@ -90,6 +93,7 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog) ...@@ -90,6 +93,7 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
/* Events generated by the file panel */ /* Events generated by the file panel */
EVT_TEXT(FileName_Event, OpenDialog::OnFilePanelChange) EVT_TEXT(FileName_Event, OpenDialog::OnFilePanelChange)
EVT_BUTTON(FileBrowse_Event, OpenDialog::OnFileBrowse)
/* Events generated by the disc panel */ /* Events generated by the disc panel */
EVT_RADIOBOX(DiscType_Event, OpenDialog::OnDiscTypeChange) EVT_RADIOBOX(DiscType_Event, OpenDialog::OnDiscTypeChange)
...@@ -114,6 +118,9 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog) ...@@ -114,6 +118,9 @@ BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
EVT_TEXT(NetAddr3_Event, OpenDialog::OnNetPanelChange) EVT_TEXT(NetAddr3_Event, OpenDialog::OnNetPanelChange)
EVT_TEXT(NetAddr4_Event, OpenDialog::OnNetPanelChange) EVT_TEXT(NetAddr4_Event, OpenDialog::OnNetPanelChange)
/* Events generated by the stream output buttons */
EVT_CHECKBOX(SoutEnable_Event, OpenDialog::OnSoutEnable)
EVT_BUTTON(SoutSettings_Event, OpenDialog::OnSoutSettings)
END_EVENT_TABLE() END_EVENT_TABLE()
/***************************************************************************** /*****************************************************************************
...@@ -166,6 +173,28 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface, ...@@ -166,6 +173,28 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface,
notebook->AddPage( SatPanel( notebook ), _("Satellite"), notebook->AddPage( SatPanel( notebook ), _("Satellite"),
i_access_method == SAT_ACCESS ); i_access_method == SAT_ACCESS );
/* Create Stream Output checkox */
wxFlexGridSizer *sout_sizer = new wxFlexGridSizer( 2, 1, 20 );
wxCheckBox *checkbox = new wxCheckBox( panel, SoutEnable_Event,
_("Stream Output") );
checkbox->SetToolTip( _("Use VLC has a stream server") );
sout_sizer->Add( checkbox, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
sout_button = new wxButton( panel, SoutSettings_Event, _("Settings...") );
sout_button->Disable();
char *psz_sout = config_GetPsz( p_intf, "sout" );
if( psz_sout && *psz_sout )
{
checkbox->SetValue(TRUE);
sout_button->Enable();
}
if( psz_sout ) free( psz_sout );
sout_sizer->Add( sout_button, 1, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
/* Separation */
wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
/* Create the buttons */ /* Create the buttons */
wxButton *ok_button = new wxButton( panel, wxID_OK, _("OK") ); wxButton *ok_button = new wxButton( panel, wxID_OK, _("OK") );
ok_button->SetDefault(); ok_button->SetDefault();
...@@ -186,7 +215,9 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface, ...@@ -186,7 +215,9 @@ OpenDialog::OpenDialog( intf_thread_t *_p_intf, Interface *_p_main_interface,
panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 ); panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 ); panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 ); panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT ); panel_sizer->Add( sout_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
panel_sizer->Layout(); panel_sizer->Layout();
panel->SetSizerAndFit( panel_sizer ); panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( panel, 1, wxGROW, 0 ); main_sizer->Add( panel, 1, wxGROW, 0 );
...@@ -571,3 +602,26 @@ void OpenDialog::OnNetTypeChange( wxCommandEvent& event ) ...@@ -571,3 +602,26 @@ void OpenDialog::OnNetTypeChange( wxCommandEvent& event )
UpdateMRL( NET_ACCESS ); UpdateMRL( NET_ACCESS );
} }
/*****************************************************************************
* Stream output event methods.
*****************************************************************************/
void OpenDialog::OnSoutEnable( wxCommandEvent& event )
{
sout_button->Enable( event.GetInt() != 0 );
if( !event.GetInt() )
{
config_PutPsz( p_intf, "sout", "" );
}
}
void OpenDialog::OnSoutSettings( wxCommandEvent& WXUNUSED(event) )
{
/* Show/hide the open dialog */
SoutDialog dialog( p_intf, p_main_interface );
if( dialog.ShowModal() == wxID_OK )
{
config_PutPsz( p_intf, "sout", (char *)dialog.mrl.c_str() );
}
}
/*****************************************************************************
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.1 2003/03/22 03:14:34 gbazin Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <errno.h> /* ENOMEM */
#include <string.h> /* strerror() */
#include <stdio.h>
#include <vlc/vlc.h>
#ifdef WIN32 /* mingw32 hack */
#undef Yield
#undef CreateDialog
#endif
/* Let vlc take care of the i18n stuff */
#define WXINTL_NO_GETTEXT_MACRO
#include <wx/wxprec.h>
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/textctrl.h>
#include <wx/combobox.h>
#include <wx/spinctrl.h>
#include <wx/statline.h>
#include <vlc/intf.h>
#include "wxwindows.h"
#ifndef wxRB_SINGLE
# define wxRB_SINGLE 0
#endif
enum
{
FILE_ACCESS_OUT = 0,
HTTP_ACCESS_OUT,
UDP_ACCESS_OUT,
RTP_ACCESS_OUT
};
enum
{
TS_ENCAPSULATION = 0,
PS_ENCAPSULATION,
AVI_ENCAPSULATION,
OGG_ENCAPSULATION
};
/*****************************************************************************
* Event Table.
*****************************************************************************/
/* IDs for the controls and the menu commands */
enum
{
Notebook_Event = wxID_HIGHEST,
MRL_Event,
FileBrowse_Event,
FileName_Event,
AccessType_Event,
AccessRadio1_Event, AccessRadio2_Event,
AccessRadio3_Event, AccessRadio4_Event,
NetPort_Event,
NetAddr_Event,
MulticastCheckbox_Event,
EncapsulationRadio1_Event, EncapsulationRadio2_Event,
EncapsulationRadio3_Event, EncapsulationRadio4_Event,
};
BEGIN_EVENT_TABLE(SoutDialog, wxDialog)
/* Button events */
EVT_BUTTON(wxID_OK, SoutDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, SoutDialog::OnCancel)
/* Events generated by the access output panel */
EVT_RADIOBUTTON(AccessRadio1_Event, SoutDialog::OnAccessTypeChange)
EVT_RADIOBUTTON(AccessRadio2_Event, SoutDialog::OnAccessTypeChange)
EVT_RADIOBUTTON(AccessRadio3_Event, SoutDialog::OnAccessTypeChange)
EVT_RADIOBUTTON(AccessRadio4_Event, SoutDialog::OnAccessTypeChange)
EVT_TEXT(FileName_Event, SoutDialog::OnFileChange)
EVT_BUTTON(FileBrowse_Event, SoutDialog::OnFileBrowse)
EVT_TEXT(NetPort_Event, SoutDialog::OnNetChange)
EVT_SPINCTRL(NetPort_Event, SoutDialog::OnNetChange)
EVT_TEXT(NetAddr_Event, SoutDialog::OnNetChange)
EVT_CHECKBOX(MulticastCheckbox_Event, SoutDialog::OnMulticastChange)
/* Events generated by the encapsulation panel */
EVT_RADIOBUTTON(EncapsulationRadio1_Event,
SoutDialog::OnEncapsulationChange)
EVT_RADIOBUTTON(EncapsulationRadio2_Event,
SoutDialog::OnEncapsulationChange)
EVT_RADIOBUTTON(EncapsulationRadio3_Event,
SoutDialog::OnEncapsulationChange)
EVT_RADIOBUTTON(EncapsulationRadio4_Event,
SoutDialog::OnEncapsulationChange)
END_EVENT_TABLE()
/*****************************************************************************
* Constructor.
*****************************************************************************/
SoutDialog::SoutDialog( intf_thread_t *_p_intf, Interface *_p_main_interface ):
wxDialog( _p_main_interface, -1, _("Stream Output"), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
p_main_interface = _p_main_interface;
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
panel->SetAutoLayout( TRUE );
/* Initialise MRL value */
char *psz_sout = config_GetPsz( p_intf, "sout" );
if( psz_sout )
{
mrl = psz_sout;
free( psz_sout );
}
/* Create MRL combobox */
wxBoxSizer *mrl_sizer_sizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBox *mrl_box = new wxStaticBox( panel, -1,
_("Stream Output MRL") );
wxStaticBoxSizer *mrl_sizer = new wxStaticBoxSizer( mrl_box,
wxHORIZONTAL );
wxStaticText *mrl_label = new wxStaticText( panel, -1,
_("Destination Target:") );
mrl_combo = new wxComboBox( panel, MRL_Event, mrl,
wxPoint(20,25), wxSize(120, -1),
0, NULL );
mrl_sizer->Add( mrl_label, 0, wxEXPAND | wxALL, 5 );
mrl_sizer->Add( mrl_combo, 1, wxEXPAND | wxALL, 5 );
mrl_sizer_sizer->Add( mrl_sizer, 1, wxEXPAND | wxALL, 5 );
/* Create the output encapsulation panel */
encapsulation_panel = EncapsulationPanel( panel );
/* Create the access output panel */
access_panel = AccessPanel( panel );
/* Separation */
wxStaticLine *static_line = new wxStaticLine( panel, wxID_OK );
/* Create the buttons */
wxButton *ok_button = new wxButton( panel, wxID_OK, _("OK") );
ok_button->SetDefault();
wxButton *cancel_button = new wxButton( panel, wxID_CANCEL, _("Cancel") );
/* Place everything in sizers */
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( ok_button, 0, wxALL, 5 );
button_sizer->Add( cancel_button, 0, wxALL, 5 );
button_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
panel_sizer->Add( access_panel, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( encapsulation_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->Layout();
panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( panel, 1, wxGROW, 0 );
main_sizer->Layout();
SetSizerAndFit( main_sizer );
}
SoutDialog::~SoutDialog()
{
}
/*****************************************************************************
* Private methods.
*****************************************************************************/
void SoutDialog::UpdateMRL()
{
wxString encapsulation;
switch( i_encapsulation_type )
{
case PS_ENCAPSULATION:
encapsulation = "/ps";
break;
case AVI_ENCAPSULATION:
encapsulation = "/avi";
break;
case OGG_ENCAPSULATION:
encapsulation = "/ogg";
break;
case TS_ENCAPSULATION:
default:
encapsulation = "/ts";
break;
}
switch( i_access_type )
{
case FILE_ACCESS_OUT:
mrl = "file" + encapsulation + "://" + file_combo->GetValue();
break;
case HTTP_ACCESS_OUT:
mrl = "http" + encapsulation + "://" + net_addr->GetLineText(0)
+ wxString::Format( ":%d", net_port->GetValue() );
break;
case UDP_ACCESS_OUT:
mrl = "udp" + encapsulation + (b_multicast ? "://@" : "://")
+ net_addr->GetLineText(0)
+ wxString::Format( ":%d", net_port->GetValue() );
break;
case RTP_ACCESS_OUT:
mrl = "rtp" + encapsulation + (b_multicast ? "://@" : "://")
+ net_addr->GetLineText(0)
+ wxString::Format( ":%d", net_port->GetValue() );
break;
}
mrl_combo->SetValue( mrl );
}
wxPanel *SoutDialog::AccessPanel( wxWindow* parent )
{
int i;
wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
wxSize(200, 200) );
wxFlexGridSizer *sizer = new wxFlexGridSizer( 2, 4, 20 );
wxStaticBox *panel_box = new wxStaticBox( panel, -1, _("Output Method") );
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxHORIZONTAL );
static const wxString access_output_array[] =
{
_("File"),
_("HTTP"),
_("UDP"),
_("RTP")
};
for( i=0; i<4; i++ )
{
access_radios[i] = new wxRadioButton( panel, AccessRadio1_Event + i,
access_output_array[i],
wxDefaultPosition, wxDefaultSize,
wxRB_SINGLE );
access_subpanels[i] = new wxPanel( panel, -1,
wxDefaultPosition, wxDefaultSize );
}
/* File row */
wxFlexGridSizer *subpanel_sizer;
wxStaticText *label;
subpanel_sizer = new wxFlexGridSizer( 3, 1, 20 );
label = new wxStaticText( access_subpanels[0], -1, _("Filename") );
file_combo = new wxComboBox( access_subpanels[0], FileName_Event, "",
wxPoint(20,25), wxSize(200, -1), 0, NULL );
wxButton *browse_button = new wxButton( access_subpanels[0],
FileBrowse_Event, _("Browse...") );
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( file_combo, 1,
wxEXPAND | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( browse_button, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
access_subpanels[0]->SetSizerAndFit( subpanel_sizer );
/* Net row */
subpanel_sizer = new wxFlexGridSizer( 4, 1, 20 );
label = new wxStaticText( access_subpanels[2], -1, _("Address") );
net_addr = new wxTextCtrl( access_subpanels[2], NetAddr_Event, "",
wxDefaultPosition, wxSize( 200, -1 ),
wxTE_PROCESS_ENTER);
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( net_addr, 1,
wxEXPAND | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
label = new wxStaticText( access_subpanels[2], -1, _("Port") );
net_port = new wxSpinCtrl( access_subpanels[2], NetPort_Event,
wxString::Format(_("%d"), 0/*val*/),
wxDefaultPosition, wxDefaultSize,
wxSP_ARROW_KEYS,
0, 16000, 0/*val*/);
subpanel_sizer->Add( label, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
subpanel_sizer->Add( net_port, 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
access_subpanels[2]->SetSizerAndFit( subpanel_sizer );
/* Multicast row */
subpanel_sizer = new wxFlexGridSizer( 1, 1, 20 );
b_multicast = VLC_FALSE;
multicast_checkbox = new wxCheckBox( access_subpanels[3],
MulticastCheckbox_Event,
_("Multicast") );
subpanel_sizer->Add( multicast_checkbox, 0, wxEXPAND |
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL );
access_subpanels[3]->SetSizerAndFit( subpanel_sizer );
/* Stuff everything into the main panel */
for( i=0; i<4; i++ )
{
sizer->Add( access_radios[i], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
sizer->Add( access_subpanels[i], 1, wxEXPAND | wxALIGN_CENTER_VERTICAL
| wxALIGN_LEFT );
}
panel_sizer->Add( sizer, 1, wxEXPAND, 0 );
panel->SetSizerAndFit( panel_sizer );
/* Update access output panel */
net_addr->SetValue( "127.0.0.1" );
net_port->SetValue( config_GetInt( p_intf, "server-port" ) );
wxCommandEvent dummy_event;
dummy_event.SetId( AccessRadio1_Event );
OnAccessTypeChange( dummy_event );
return panel;
}
wxPanel *SoutDialog::EncapsulationPanel( wxWindow* parent )
{
int i;
wxPanel *panel = new wxPanel( parent, -1, wxDefaultPosition,
wxSize(200, 200) );
wxStaticBox *panel_box = new wxStaticBox( panel, -1,
_("Encapsulation Method") );
wxStaticBoxSizer *panel_sizer = new wxStaticBoxSizer( panel_box,
wxHORIZONTAL );
static const wxString encapsulation_array[] =
{
_("MPEG TS"),
_("MPEG PS"),
_("AVI"),
_("Ogg")
};
/* Stuff everything into the main panel */
for( i=0; i<4; i++ )
{
encapsulation_radios[i] =
new wxRadioButton( panel, EncapsulationRadio1_Event + i,
encapsulation_array[i] );
panel_sizer->Add( encapsulation_radios[i], 0,
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL );
}
panel->SetSizerAndFit( panel_sizer );
/* Update encapsulation panel */
encapsulation_radios[0]->Enable();
i_encapsulation_type = TS_ENCAPSULATION;
return panel;
}
/*****************************************************************************
* Events methods.
*****************************************************************************/
void SoutDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{
EndModal( wxID_OK );
}
void SoutDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
{
EndModal( wxID_CANCEL );
}
void SoutDialog::OnMRLChange( wxCommandEvent& event )
{
mrl = event.GetString();
}
/*****************************************************************************
* Access output panel event methods.
*****************************************************************************/
void SoutDialog::OnAccessTypeChange( wxCommandEvent& event )
{
int i;
i_access_type = event.GetId() - AccessRadio1_Event;
switch( i_access_type )
{
case FILE_ACCESS_OUT:
access_subpanels[0]->Enable();
access_subpanels[2]->Disable();
access_subpanels[3]->Disable();
for( i = 1; i < 4; i++ )
{
encapsulation_radios[i]->Enable();
}
break;
case HTTP_ACCESS_OUT:
access_subpanels[0]->Disable();
access_subpanels[2]->Enable();
access_subpanels[3]->Disable();
for( i = 1; i < 4; i++ )
{
encapsulation_radios[i]->Enable();
}
break;
case UDP_ACCESS_OUT:
case RTP_ACCESS_OUT:
access_subpanels[0]->Disable();
access_subpanels[2]->Enable();
access_subpanels[3]->Enable();
for( i = 1; i < 4; i++ )
{
encapsulation_radios[i]->Disable();
}
encapsulation_radios[TS_ENCAPSULATION]->SetValue(true);
i_encapsulation_type = TS_ENCAPSULATION;
break;
}
for( i = 0; i < 4; i++ )
{
access_radios[i]->SetValue( event.GetId() == (AccessRadio1_Event+i) );
}
UpdateMRL();
}
/*****************************************************************************
* File access output event methods.
*****************************************************************************/
void SoutDialog::OnFileChange( wxCommandEvent& WXUNUSED(event) )
{
UpdateMRL();
}
void SoutDialog::OnFileBrowse( wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog( this, _("Save file"), "", "", "*.*", wxSAVE );
if( dialog.ShowModal() == wxID_OK )
{
file_combo->SetValue( dialog.GetPath() );
UpdateMRL();
}
}
/*****************************************************************************
* Net access output event methods.
*****************************************************************************/
void SoutDialog::OnNetChange( wxCommandEvent& WXUNUSED(event) )
{
UpdateMRL();
}
void SoutDialog::OnMulticastChange( wxCommandEvent& event )
{
b_multicast = event.GetInt();
UpdateMRL();
}
/*****************************************************************************
* Encapsulation panel event methods.
*****************************************************************************/
void SoutDialog::OnEncapsulationChange( wxCommandEvent& event )
{
i_encapsulation_type = event.GetId() - EncapsulationRadio1_Event;
UpdateMRL();
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wxwindows.h: private wxWindows interface description * wxwindows.h: private wxWindows interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: wxwindows.h,v 1.8 2003/01/23 23:57:50 gbazin Exp $ * $Id: wxwindows.h,v 1.9 2003/03/22 03:14:34 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -175,7 +175,7 @@ private: ...@@ -175,7 +175,7 @@ private:
wxPanel *NetPanel( wxWindow* parent ); wxPanel *NetPanel( wxWindow* parent );
wxPanel *SatPanel( wxWindow* parent ); wxPanel *SatPanel( wxWindow* parent );
void OpenDialog::UpdateMRL( int i_access_method ); void UpdateMRL( int i_access_method );
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnOk( wxCommandEvent& event ); void OnOk( wxCommandEvent& event );
...@@ -184,7 +184,7 @@ private: ...@@ -184,7 +184,7 @@ private:
void OnPageChange( wxNotebookEvent& event ); void OnPageChange( wxNotebookEvent& event );
void OnMRLChange( wxCommandEvent& event ); void OnMRLChange( wxCommandEvent& event );
/* Event handlers for the disc page */ /* Event handlers for the file page */
void OnFilePanelChange( wxCommandEvent& event ); void OnFilePanelChange( wxCommandEvent& event );
void OnFileBrowse( wxCommandEvent& event ); void OnFileBrowse( wxCommandEvent& event );
...@@ -196,6 +196,10 @@ private: ...@@ -196,6 +196,10 @@ private:
void OnNetPanelChange( wxCommandEvent& event ); void OnNetPanelChange( wxCommandEvent& event );
void OnNetTypeChange( wxCommandEvent& event ); void OnNetTypeChange( wxCommandEvent& event );
/* Event handlers for the stream output */
void OnSoutEnable( wxCommandEvent& event );
void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
DECLARE_EVENT_TABLE(); DECLARE_EVENT_TABLE();
intf_thread_t *p_intf; intf_thread_t *p_intf;
...@@ -219,6 +223,9 @@ private: ...@@ -219,6 +223,9 @@ private:
wxRadioButton *net_radios[4]; wxRadioButton *net_radios[4];
wxSpinCtrl *net_ports[4]; wxSpinCtrl *net_ports[4];
wxTextCtrl *net_addrs[4]; wxTextCtrl *net_addrs[4];
/* Controls for the stream output */
wxButton *sout_button;
}; };
enum enum
...@@ -229,6 +236,65 @@ enum ...@@ -229,6 +236,65 @@ enum
SAT_ACCESS SAT_ACCESS
}; };
/* Stream output Dialog */
class SoutDialog: public wxDialog
{
public:
/* Constructor */
SoutDialog( intf_thread_t *p_intf, Interface *p_main_interface );
virtual ~SoutDialog();
wxString mrl;
private:
void UpdateMRL();
wxPanel *AccessPanel( wxWindow* parent );
wxPanel *EncapsulationPanel( wxWindow* parent );
/* Event handlers (these functions should _not_ be virtual) */
void OnOk( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event );
void OnMRLChange( wxCommandEvent& event );
void OnAccessTypeChange( wxCommandEvent& event );
/* Event handlers for the file access output */
void OnFileChange( wxCommandEvent& event );
void OnFileBrowse( wxCommandEvent& event );
/* Event handlers for the net access output */
void OnNetChange( wxCommandEvent& event );
void OnMulticastChange( wxCommandEvent& event );
/* Event handlers for the encapsulation panel */
void OnEncapsulationChange( wxCommandEvent& event );
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
Interface *p_main_interface;
wxComboBox *mrl_combo;
wxPanel *access_panel;
wxPanel *encapsulation_panel;
/* Controls for the access outputs */
wxPanel *access_subpanels[4];
wxRadioButton *access_radios[4];
wxCheckBox *multicast_checkbox;
int i_access_type;
vlc_bool_t b_multicast;
wxComboBox *file_combo;
wxSpinCtrl *net_port;
wxTextCtrl *net_addr;
/* Controls for the encapsulation */
wxRadioButton *encapsulation_radios[4];
int i_encapsulation_type;
};
/* Messages */ /* Messages */
class Messages: public wxFrame class Messages: public wxFrame
{ {
......
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