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() );
}
}
This diff is collapsed.
...@@ -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