Removed the old streaming wizard\nSplitted the interface file into interface+extrapanel\nExtrapanel is now a notebook\nReworked the video extrapanel (removed ratio,added filters)\nImplemented a graphical equaliwer

This commit is contained in:
Clément Stenac 2004-07-12 06:47:15 +00:00
parent da38b336b9
commit 6c43e73ea9
9 changed files with 1320 additions and 690 deletions

View File

@ -2,10 +2,10 @@ SOURCES_wxwindows = \
wxwindows.cpp \
wxwindows.h \
interface.cpp \
extrapanel.cpp \
dialogs.cpp \
open.cpp \
streamout.cpp \
streamwizard.cpp \
wizard.cpp \
messages.cpp \
playlist.cpp \

View File

@ -55,7 +55,6 @@ private:
void OnMessages( wxCommandEvent& event );
void OnFileInfo( wxCommandEvent& event );
void OnPreferences( wxCommandEvent& event );
void OnStreamWizardDialog( wxCommandEvent& event );
void OnWizardDialog( wxCommandEvent& event );
void OnBookmarks( wxCommandEvent& event );
@ -84,7 +83,6 @@ public:
Playlist *p_playlist_dialog;
Messages *p_messages_dialog;
FileInfo *p_fileinfo_dialog;
StreamDialog *p_streamwizard_dialog;
WizardDialog *p_wizard_dialog;
wxFrame *p_prefs_dialog;
wxWindow *p_bookmarks_dialog;
@ -114,8 +112,6 @@ BEGIN_EVENT_TABLE(DialogsProvider, wxFrame)
DialogsProvider::OnMessages)
EVT_COMMAND(INTF_DIALOG_PREFS, wxEVT_DIALOG,
DialogsProvider::OnPreferences)
EVT_COMMAND(INTF_DIALOG_STREAMWIZARD, wxEVT_DIALOG,
DialogsProvider::OnStreamWizardDialog)
EVT_COMMAND(INTF_DIALOG_WIZARD, wxEVT_DIALOG,
DialogsProvider::OnWizardDialog)
EVT_COMMAND(INTF_DIALOG_FILEINFO, wxEVT_DIALOG,
@ -148,7 +144,6 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent )
p_fileinfo_dialog = NULL;
p_prefs_dialog = NULL;
p_file_generic_dialog = NULL;
p_streamwizard_dialog = NULL;
p_wizard_dialog = NULL;
p_bookmarks_dialog = NULL;
@ -177,7 +172,6 @@ DialogsProvider::~DialogsProvider()
if( p_messages_dialog ) delete p_messages_dialog;
if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
if( p_file_generic_dialog ) delete p_file_generic_dialog;
if( p_streamwizard_dialog ) delete p_streamwizard_dialog;
if( p_wizard_dialog ) delete p_wizard_dialog;
if( p_bookmarks_dialog ) delete p_bookmarks_dialog;
@ -254,18 +248,6 @@ void DialogsProvider::OnPreferences( wxCommandEvent& WXUNUSED(event) )
}
}
void DialogsProvider::OnStreamWizardDialog( wxCommandEvent& WXUNUSED(event) )
{
/* Show/hide the stream window */
if( !p_streamwizard_dialog )
p_streamwizard_dialog = new StreamDialog( p_intf, this );
if( p_streamwizard_dialog )
{
p_streamwizard_dialog->Show( !p_streamwizard_dialog->IsShown() );
}
}
void DialogsProvider::OnWizardDialog( wxCommandEvent& WXUNUSED(event) )
{
p_wizard_dialog = new WizardDialog( p_intf, this, NULL, 0, 0 );

File diff suppressed because it is too large Load Diff

View File

@ -118,7 +118,6 @@ enum
OpenOther_Event,
EjectDisc_Event,
StreamWizard_Event,
Wizard_Event,
Playlist_Event,
@ -127,6 +126,7 @@ enum
Prefs_Event,
Extended_Event,
// Undock_Event,
Bookmarks_Event,
Skins_Event,
@ -138,17 +138,6 @@ enum
SlowStream_Event,
FastStream_Event,
Adjust_Event,
RestoreDefaults_Event,
Hue_Event,
Contrast_Event,
Brightness_Event,
Saturation_Event,
Gamma_Event,
Ratio_Event,
Visual_Event,
/* it is important for the id corresponding to the "About" command to have
* this standard value as otherwise it won't be handled properly under Mac
* (where it is special and put into the "Apple" menu) */
@ -167,13 +156,10 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
EVT_MENU_OPEN(Interface::OnMenuOpen)
EVT_MENU( Extended_Event, Interface::OnExtended)
EVT_MENU( Bookmarks_Event, Interface::OnShowDialog)
EVT_MENU( Extended_Event, Interface::OnExtended )
// EVT_MENU( Undock_Event, Interface::OnUndock )
EVT_CHECKBOX( Adjust_Event, Interface::OnEnableAdjust)
EVT_BUTTON( RestoreDefaults_Event, Interface::OnRestoreDefaults)
EVT_TEXT( Ratio_Event, Interface::OnRatio)
EVT_CHECKBOX( Visual_Event, Interface::OnEnableVisual)
EVT_MENU( Bookmarks_Event, Interface::OnShowDialog)
#if defined( __WXMSW__ ) || defined( __WXMAC__ )
EVT_CONTEXT_MENU(Interface::OnContextMenu2)
@ -188,7 +174,6 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
EVT_MENU(OpenNet_Event, Interface::OnShowDialog)
EVT_MENU(OpenCapture_Event, Interface::OnShowDialog)
EVT_MENU(OpenSat_Event, Interface::OnShowDialog)
EVT_MENU(StreamWizard_Event, Interface::OnShowDialog)
EVT_MENU(Wizard_Event, Interface::OnShowDialog)
EVT_MENU(StopStream_Event, Interface::OnStopStream)
EVT_MENU(PlayStream_Event, Interface::OnPlayStream)
@ -199,12 +184,6 @@ BEGIN_EVENT_TABLE(Interface, wxFrame)
/* Slider events */
EVT_COMMAND_SCROLL(SliderScroll_Event, Interface::OnSliderUpdate)
EVT_COMMAND_SCROLL(Hue_Event, Interface::OnAdjustUpdate)
EVT_COMMAND_SCROLL(Contrast_Event, Interface::OnAdjustUpdate)
EVT_COMMAND_SCROLL(Brightness_Event, Interface::OnAdjustUpdate)
EVT_COMMAND_SCROLL(Saturation_Event, Interface::OnAdjustUpdate)
EVT_COMMAND_SCROLL(Gamma_Event, Interface::OnAdjustUpdate)
/* Custom events */
EVT_COMMAND(0, wxEVT_INTF, Interface::OnControlEvent)
@ -223,6 +202,9 @@ Interface::Interface( intf_thread_t *_p_intf ):
p_intf = _p_intf;
i_old_playing_status = PAUSE_S;
b_extra = VLC_FALSE;
// b_undock = VLC_FALSE;
extra_window = NULL;
/* Give our interface a nice little icon */
SetIcon( wxIcon( vlc_xpm ) );
@ -244,7 +226,7 @@ Interface::Interface( intf_thread_t *_p_intf ):
CreateOurToolBar();
/* Create the extra panel */
CreateOurExtendedPanel();
extra_frame = new ExtraPanel( p_intf, this );
frame_sizer->Add( extra_frame, 0, wxEXPAND , 0 );
frame_sizer->Hide( extra_frame );
@ -341,8 +323,6 @@ void Interface::CreateOurMenuBar()
file_menu->AppendSeparator();
file_menu->Append( Wizard_Event, wxU(_("&Wizard...\tCtrl-W")) );
file_menu->Append( StreamWizard_Event,
wxU(_("Old streaming Wizard...")) );
file_menu->AppendSeparator();
file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")) );
@ -523,201 +503,6 @@ void Interface::CreateOurSlider()
}
void Interface::CreateOurExtendedPanel()
{
char *psz_filters;
extra_frame = new wxPanel( this, -1, wxDefaultPosition, wxDefaultSize );
extra_frame->SetAutoLayout( TRUE );
wxBoxSizer *extra_sizer = new wxBoxSizer( wxHORIZONTAL );
/* Create static box to surround the adjust controls */
wxStaticBox *adjust_box =
new wxStaticBox( extra_frame, -1, wxU(_("Adjust Image")) );
/* Create the size for the frame */
wxStaticBoxSizer *adjust_sizer =
new wxStaticBoxSizer( adjust_box, wxVERTICAL );
adjust_sizer->SetMinSize( -1, 50 );
/* Create flex grid */
wxFlexGridSizer *adjust_gridsizer =
new wxFlexGridSizer( 6, 2, 0, 0);
adjust_gridsizer->AddGrowableCol(1);
/* Create every controls */
/* Create the adjust button */
wxCheckBox * adjust_check = new wxCheckBox( extra_frame, Adjust_Event,
wxU(_("Enable")));
/* Create the restore to defaults button */
restoredefaults_button =
new wxButton( extra_frame, RestoreDefaults_Event,
wxU(_("Restore Defaults")), wxDefaultPosition);
wxStaticText *hue_text = new wxStaticText( extra_frame, -1,
wxU(_("Hue")) );
hue_slider = new wxSlider ( extra_frame, Hue_Event, 0, 0,
360, wxDefaultPosition, wxDefaultSize );
wxStaticText *contrast_text = new wxStaticText( extra_frame, -1,
wxU(_("Contrast")) );
contrast_slider = new wxSlider ( extra_frame, Contrast_Event, 0, 0,
200, wxDefaultPosition, wxDefaultSize);
wxStaticText *brightness_text = new wxStaticText( extra_frame, -1,
wxU(_("Brightness")) );
brightness_slider = new wxSlider ( extra_frame, Brightness_Event, 0, 0,
200, wxDefaultPosition, wxDefaultSize) ;
wxStaticText *saturation_text = new wxStaticText( extra_frame, -1,
wxU(_("Saturation")) );
saturation_slider = new wxSlider ( extra_frame, Saturation_Event, 0, 0,
300, wxDefaultPosition, wxDefaultSize );
wxStaticText *gamma_text = new wxStaticText( extra_frame, -1,
wxU(_("Gamma")) );
gamma_slider = new wxSlider ( extra_frame, Gamma_Event, 0, 0,
100, wxDefaultPosition, wxDefaultSize );
adjust_gridsizer->Add(adjust_check, 1, wxEXPAND, 0);
adjust_gridsizer->Add(restoredefaults_button, 1, wxEXPAND, 0);
adjust_gridsizer->Add(hue_text, 1, wxEXPAND, 0);
adjust_gridsizer->Add(hue_slider, 1, wxEXPAND, 0);
adjust_gridsizer->Add(contrast_text, 1, wxEXPAND, 0);
adjust_gridsizer->Add(contrast_slider, 1, wxEXPAND, 0);
adjust_gridsizer->Add(brightness_text, 1, wxEXPAND, 0);
adjust_gridsizer->Add(brightness_slider, 1, wxEXPAND, 0);
adjust_gridsizer->Add(saturation_text, 1, wxEXPAND, 0);
adjust_gridsizer->Add(saturation_slider, 1, wxEXPAND, 0);
adjust_gridsizer->Add(gamma_text, 1, wxEXPAND, 0);
adjust_gridsizer->Add(gamma_slider, 1, wxEXPAND, 0);
adjust_sizer->Add(adjust_gridsizer,1,wxEXPAND, 0);
extra_sizer->Add(adjust_sizer,1,wxBOTTOM,5);
/* Create sizer to surround the other controls */
wxBoxSizer *other_sizer = new wxBoxSizer( wxVERTICAL );
wxStaticBox *video_box =
new wxStaticBox( extra_frame, -1, wxU(_("Video Options")) );
/* Create the sizer for the frame */
wxStaticBoxSizer *video_sizer =
new wxStaticBoxSizer( video_box, wxVERTICAL );
video_sizer->SetMinSize( -1, 50 );
static const wxString ratio_array[] =
{
wxT("4:3"),
wxT("16:9"),
};
wxBoxSizer *ratio_sizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticText *ratio_text = new wxStaticText( extra_frame, -1,
wxU(_("Aspect Ratio")) );
ratio_combo = new wxComboBox( extra_frame, Ratio_Event, wxT(""),
wxDefaultPosition, wxSize(120,-1),
WXSIZEOF(ratio_array), ratio_array,
0 );
ratio_sizer->Add( ratio_text, 0, wxALL, 2 );
ratio_sizer->Add( ratio_combo, 0, wxALL, 2 );
ratio_sizer->Layout();
video_sizer->Add( ratio_sizer , 0 , wxALL , 0 );
video_sizer->Layout();
#if 0
wxBoxSizer *visual_sizer = new wxBoxSizer( wxHORIZONTAL );
wxCheckBox *visual_checkbox = new wxCheckBox( extra_frame, Visual_Event,
wxU(_("Visualizations")) );
visual_sizer->Add( visual_checkbox, 0, wxEXPAND, 0);
visual_sizer->Layout();
wxStaticBox *audio_box =
new wxStaticBox( extra_frame, -1, wxU(_("Audio Options")) );
/* Create the sizer for the frame */
wxStaticBoxSizer *audio_sizer =
new wxStaticBoxSizer( audio_box, wxVERTICAL );
audio_sizer->SetMinSize( -1, 50 );
audio_sizer->Add( visual_sizer, 0, wxALL, 0);
audio_sizer->Layout();
other_sizer->Add( audio_sizer , 0 , wxALL | wxEXPAND , 0 );
#endif
other_sizer->Add( video_sizer, 0, wxALL | wxEXPAND , 0);
other_sizer->Layout();
extra_sizer->Add(other_sizer,0,wxBOTTOM,5);
extra_frame->SetSizer( extra_sizer );
/* Layout the whole panel */
extra_sizer->Layout();
extra_sizer->SetSizeHints(extra_frame);
/* Write down initial values */
#if 0
psz_filters = config_GetPsz( p_intf, "audio-filter" );
if( psz_filters && strstr( psz_filters, "visual" ) )
{
visual_checkbox->SetValue(1);
}
if( psz_filters ) free( psz_filters );
#endif
psz_filters = config_GetPsz( p_intf, "filter" );
if( psz_filters && strstr( psz_filters, "adjust" ) )
{
adjust_check->SetValue( 1 );
restoredefaults_button->Enable();
saturation_slider->Enable();
contrast_slider->Enable();
brightness_slider->Enable();
hue_slider->Enable();
gamma_slider->Enable();
}
else
{
adjust_check->SetValue( 0 );
restoredefaults_button->Disable();
saturation_slider->Disable();
contrast_slider->Disable();
brightness_slider->Disable();
hue_slider->Disable();
gamma_slider->Disable();
}
if( psz_filters ) free( psz_filters );
int i_value = config_GetInt( p_intf, "hue" );
if( i_value > 0 && i_value < 360 )
hue_slider->SetValue( i_value );
float f_value;
f_value = config_GetFloat( p_intf, "saturation" );
if( f_value > 0 && f_value < 5 )
saturation_slider->SetValue( (int)(100 * f_value) );
f_value = config_GetFloat( p_intf, "contrast" );
if( f_value > 0 && f_value < 4 )
contrast_slider->SetValue( (int)(100 * f_value) );
f_value = config_GetFloat( p_intf, "brightness" );
if( f_value > 0 && f_value < 2 )
brightness_slider->SetValue( (int)(100 * f_value) );
f_value = config_GetFloat( p_intf, "gamma" );
if( f_value > 0 && f_value < 10 )
gamma_slider->SetValue( (int)(10 * f_value) );
extra_frame->Hide();
}
static int ConvertHotkeyModifiers( int i_hotkey )
{
int i_accel_flags = 0;
@ -819,6 +604,11 @@ void Interface::OnMenuOpen(wxMenuEvent& event)
p_settings_menu->AppendCheckItem( Extended_Event,
wxU(_("&Extended GUI") ) );
if( b_extra ) p_settings_menu->Check( Extended_Event, TRUE );
#if 0
p_settings_menu->AppendCheckItem( Undock_Event,
wxU(_("&Undock Ext. GUI") ) );
if( b_undock ) p_settings_menu->Check( Undock_Event, TRUE );
#endif
p_settings_menu->AppendCheckItem( Bookmarks_Event,
wxU(_("&Bookmarks...") ) );
p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")) );
@ -924,9 +714,6 @@ void Interface::OnShowDialog( wxCommandEvent& event )
case Prefs_Event:
i_id = INTF_DIALOG_PREFS;
break;
case StreamWizard_Event:
i_id = INTF_DIALOG_STREAMWIZARD;
break;
case Wizard_Event:
i_id = INTF_DIALOG_WIZARD;
break;
@ -944,205 +731,99 @@ void Interface::OnShowDialog( wxCommandEvent& event )
void Interface::OnExtended(wxCommandEvent& event)
{
if( b_extra == VLC_FALSE)
{
extra_frame->Show();
frame_sizer->Show( extra_frame );
b_extra = VLC_TRUE;
}
else
b_extra = (b_extra == VLC_TRUE ? VLC_FALSE : VLC_TRUE );
if( b_extra == VLC_FALSE )
{
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
b_extra = VLC_FALSE;
}
else
{
extra_frame->Show();
frame_sizer->Show( extra_frame );
}
frame_sizer->Layout();
frame_sizer->Fit(this);
}
void Interface::OnEnableAdjust(wxCommandEvent& event)
{
char *psz_filters=config_GetPsz( p_intf, "filter");
char *psz_new = NULL;
if( event.IsChecked() )
{
if(psz_filters == NULL)
#if 0
if( b_undock == VLC_TRUE )
{
psz_new = strdup( "adjust" );
fprintf(stderr,"Deleting window\n");
if( extra_window )
{
delete extra_window;
extra_window = NULL;
}
}
else
{
psz_new= (char *) malloc(strlen(psz_filters) + 8 );
sprintf( psz_new, "%s:adjust", psz_filters);
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
frame_sizer->Layout();
frame_sizer->Fit(this);
}
config_PutPsz( p_intf, "filter", psz_new );
vlc_value_t val;
vout_thread_t *p_vout =
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout != NULL )
{
val.psz_string = strdup( psz_new );
var_Set( p_vout, "filter", val);
vlc_object_release( p_vout );
}
if( val.psz_string ) free( val.psz_string );
restoredefaults_button->Enable();
brightness_slider->Enable();
saturation_slider->Enable();
contrast_slider->Enable();
hue_slider->Enable();
gamma_slider->Enable();
}
else
{
if( psz_filters != NULL )
if( b_undock == VLC_TRUE )
{
char *psz_current;
unsigned int i=0;
for( i = 0; i< strlen(psz_filters ); i++)
fprintf(stderr,"Creating window\n");
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
frame_sizer->Detach( extra_frame );
frame_sizer->Layout();
frame_sizer->Fit(this);
extra_window = new ExtraWindow( p_intf, this, extra_frame );
}
else
{
fprintf(stderr,"Deleting window\n");
if( extra_window )
{
if ( !strncasecmp( &psz_filters[i],"adjust",6 ))
{
if(i > 0)
if( psz_filters[i-1] == ':' ) i--;
psz_current = strchr( &psz_filters[i+1] , ':' );
if( !psz_current )
psz_filters[i] = '\0';
else
{
memmove( &psz_filters[i] , psz_current,
&psz_filters[strlen(psz_filters)]-psz_current
+1);
}
}
delete extra_window;
}
config_PutPsz( p_intf, "filter", psz_filters);
vlc_value_t val;
val.psz_string = strdup( psz_filters );
vout_thread_t *p_vout =
(vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout != NULL )
extra_frame->Show();
frame_sizer->Show( extra_frame );
frame_sizer->Layout();
frame_sizer->Fit(this);
}
}
}
void Interface::OnUndock(wxCommandEvent& event)
{
b_undock = (b_undock == VLC_TRUE ? VLC_FALSE : VLC_TRUE );
if( b_extra == VLC_TRUE )
{
if( b_undock == VLC_FALSE )
{
fprintf(stderr,"Deleting window\n");
if( extra_window )
{
var_Set( p_vout, "filter", val);
vlc_object_release( p_vout );
delete extra_window;
extra_window = NULL;
}
if( val.psz_string ) free( val.psz_string );
extra_frame->Show();
frame_sizer->Show( extra_frame );
frame_sizer->Layout();
frame_sizer->Fit(this);
}
restoredefaults_button->Disable();
brightness_slider->Disable();
saturation_slider->Disable();
contrast_slider->Disable();
hue_slider->Disable();
gamma_slider->Disable();
}
if(psz_filters) free(psz_filters);
if(psz_new) free(psz_new);
}
void Interface::OnRestoreDefaults( wxCommandEvent &event)
{
hue_slider->SetValue(0);
saturation_slider->SetValue(100);
brightness_slider->SetValue(100);
contrast_slider->SetValue(100),
gamma_slider->SetValue(10);
wxScrollEvent *hscroll_event = new wxScrollEvent(0, Hue_Event, 0);
OnAdjustUpdate(*hscroll_event);
wxScrollEvent *sscroll_event = new wxScrollEvent(0, Saturation_Event, 100);
OnAdjustUpdate(*sscroll_event);
wxScrollEvent *bscroll_event = new wxScrollEvent(0, Brightness_Event, 100);
OnAdjustUpdate(*bscroll_event);
wxScrollEvent *cscroll_event = new wxScrollEvent(0, Contrast_Event, 100);
OnAdjustUpdate(*cscroll_event);
wxScrollEvent *gscroll_event = new wxScrollEvent(0, Gamma_Event, 10);
OnAdjustUpdate(*gscroll_event);
}
void Interface::OnAdjustUpdate( wxScrollEvent &event)
{
vout_thread_t *p_vout = (vout_thread_t *)vlc_object_find(p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE);
if(p_vout == NULL)
switch(event.GetId())
else
{
case Hue_Event:
config_PutInt( p_intf , "hue" , event.GetPosition() );
break;
case Saturation_Event:
config_PutFloat( p_intf , "saturation" , (float)event.GetPosition()/100 );
break;
case Brightness_Event:
config_PutFloat( p_intf , "brightness" , (float)event.GetPosition()/100 );
break;
case Contrast_Event:
config_PutFloat( p_intf , "contrast" , (float)event.GetPosition()/100 );
break;
case Gamma_Event:
config_PutFloat( p_intf , "gamma" , (float)event.GetPosition()/10 );
break;
fprintf(stderr,"Creating window\n");
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
frame_sizer->Detach( extra_frame );
frame_sizer->Layout();
frame_sizer->Fit(this);
extra_window = new ExtraWindow( p_intf, this, extra_frame );
}
else
{
vlc_value_t val;
switch(event.GetId())
{
case Hue_Event:
val.i_int = event.GetPosition();
var_Set(p_vout, "hue", val);
break;
case Saturation_Event:
val.f_float = (float)event.GetPosition()/100;
var_Set(p_vout, "saturation", val);
break;
case Brightness_Event:
val.f_float = (float)event.GetPosition()/100;
var_Set(p_vout, "brightness", val);
break;
case Contrast_Event:
val.f_float = (float)event.GetPosition()/100;
var_Set(p_vout, "contrast", val);
break;
case Gamma_Event:
val.f_float = (float)event.GetPosition()/10;
var_Set(p_vout, "gamma", val);
break;
}
vlc_object_release(p_vout);
}
}
void Interface::OnRatio( wxCommandEvent& event )
{
config_PutPsz( p_intf, "aspect-ratio", ratio_combo->GetValue().mb_str() );
}
void Interface::OnEnableVisual(wxCommandEvent& event)
{
if( event.IsChecked() )
{
config_PutPsz( p_intf, "audio-filter", "visual" );
}
else
{
config_PutPsz( p_intf, "audio-filter", "" );
}
}
#endif
void Interface::OnPlayStream( wxCommandEvent& WXUNUSED(event) )
{

View File

@ -897,7 +897,6 @@ void MenuEvtHandler::OnMenuEvent( wxCommandEvent& event )
/* Get the key combination and send it to the hotkey handler */
var_Set( p_intf->p_vlc, "key-pressed", val );
msg_Err( p_intf, "received key event: %i", event.GetId() );
return;
}

View File

@ -2,7 +2,7 @@
* messages.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id: messages.cpp,v 1.20 2004/01/25 03:29:01 hartman Exp $
* $Id$
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
*

View File

@ -1,251 +0,0 @@
/*****************************************************************************
* stream.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
*
* 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>
#include <vlc/intf.h>
#include "wxwindows.h"
#include <wx/statline.h>
#define STREAM_INTRO N_( "Stream with VLC in three steps." )
#define STREAM_STEP1 N_( "Step 1: Select what to stream." )
#define STREAM_STEP2 N_( "Step 2: Define streaming method." )
#define STREAM_STEP3 N_( "Step 3: Start streaming." )
/*****************************************************************************
* Event Table.
*****************************************************************************/
/* IDs for the controls and the menu commands */
enum
{
Open_Event,
Sout_Event,
Start_Event,
Close_Event
};
BEGIN_EVENT_TABLE(StreamDialog, wxFrame)
/* Button events */
EVT_BUTTON(wxID_OK, StreamDialog::OnClose)
EVT_BUTTON(Open_Event,StreamDialog::OnOpen)
EVT_BUTTON(Sout_Event,StreamDialog::OnSout)
EVT_BUTTON(Start_Event,StreamDialog::OnStart)
/* Hide the window when the user closes the window */
EVT_CLOSE(StreamDialog::OnClose)
END_EVENT_TABLE()
/*****************************************************************************
* Constructor.
*****************************************************************************/
StreamDialog::StreamDialog( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxFrame( p_parent, -1, wxU(_("Stream")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
/* Initializations */
p_intf = _p_intf;
SetIcon( *p_intf->p_sys->p_icon );
SetAutoLayout( TRUE );
p_open_dialog = NULL;
p_sout_dialog = NULL;
/* Create a panel to put everything in */
wxPanel *panel = new wxPanel( this, -1 );
panel->SetAutoLayout( TRUE );
wxStaticText *intro_label = new wxStaticText( panel,
-1 , wxU(_( STREAM_INTRO )));
wxStaticText *step1_label = new wxStaticText( panel,
-1 , wxU(_( STREAM_STEP1 )));
step2_label = new wxStaticText( panel,
-1 , wxU(_( STREAM_STEP2 )));
step3_label = new wxStaticText( panel,
-1 , wxU(_( STREAM_STEP3 )));
wxButton *open_button = new wxButton( panel,
Open_Event, wxU(_("Open...")));
sout_button = new wxButton( panel,
Sout_Event, wxU(_("Choose...")));
start_button = new wxButton( panel,
Start_Event, wxU(_("Start!")));
step2_label->Disable();
step3_label->Disable();
sout_button->Disable();
start_button->Disable();
/* Place everything in sizers */
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *step1_sizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *step2_sizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer *step3_sizer = new wxBoxSizer( wxHORIZONTAL );
step1_sizer->Add( step1_label, 1, wxALL | wxEXPAND | wxALIGN_LEFT, 10 );
step1_sizer->Add( open_button, 1, wxALL | wxEXPAND | wxALIGN_RIGHT, 10 );
step2_sizer->Add( step2_label, 1, wxALL | wxEXPAND | wxALIGN_LEFT, 10 );
step2_sizer->Add( sout_button, 1, wxALL | wxEXPAND | wxALIGN_RIGHT, 10 );
step3_sizer->Add( step3_label, 1, wxALL | wxEXPAND | wxLEFT, 10 );
step3_sizer->Add( start_button, 1, wxALL | wxEXPAND | wxLEFT, 10 );
panel_sizer->Add( intro_label, 0, wxEXPAND | wxALL, 10 );
panel_sizer->Add( new wxStaticLine( panel, 0), 0,
wxEXPAND | wxLEFT | wxRIGHT, 2 );
panel_sizer->Add( step1_sizer, 0, wxEXPAND, 10 );
panel_sizer->Add( new wxStaticLine( panel, 0), 0,
wxEXPAND | wxLEFT | wxRIGHT, 2 );
panel_sizer->Add( step2_sizer, 0, wxEXPAND, 10 );
panel_sizer->Add( new wxStaticLine( panel, 0), 0,
wxEXPAND | wxLEFT | wxRIGHT, 2 );
panel_sizer->Add( step3_sizer, 0, wxEXPAND, 10 );
panel_sizer->Layout();
panel->SetSizerAndFit( panel_sizer );
main_sizer->Add( panel, 1, wxEXPAND, 0 );
main_sizer->Layout();
SetSizerAndFit( main_sizer );
}
/*****************************************************************************
* Destructor.
*****************************************************************************/
StreamDialog::~StreamDialog()
{
if( p_open_dialog ) delete p_open_dialog;
if( p_sout_dialog ) delete p_sout_dialog;
}
void StreamDialog::OnOpen( wxCommandEvent& event )
{
if( !p_open_dialog )
{
p_open_dialog =
new OpenDialog( p_intf, this, FILE_ACCESS, 1 , OPEN_STREAM );
}
if( p_open_dialog)
{
p_open_dialog->Show();
p_open_dialog->Enable();
mrl = p_open_dialog->mrl;
sout_button->Enable();
step2_label->Enable();
}
}
void StreamDialog::OnSout( wxCommandEvent& event )
{
/* Show/hide the sout dialog */
if( p_sout_dialog == NULL )
p_sout_dialog = new SoutDialog( p_intf, this );
if( p_sout_dialog && p_sout_dialog->ShowModal() == wxID_OK )
{
sout_mrl = p_sout_dialog->GetOptions();
start_button->Enable();
step3_label->Enable();
}
}
void StreamDialog::OnStart( wxCommandEvent& event )
{
/* Update the playlist */
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL ) return;
for( int i = 0; i < (int)p_open_dialog->mrl.GetCount(); i++ )
{
playlist_item_t *p_item = playlist_ItemNew( p_intf,
(const char *)p_open_dialog->mrl[i].mb_str(),
(const char *)p_open_dialog->mrl[i].mb_str() );
int i_options = 0;
/* Count the input options */
while( i + i_options + 1 < (int)p_open_dialog->mrl.GetCount() &&
((const char *)p_open_dialog->mrl[i + i_options + 1].
mb_str())[0] == ':' )
{
i_options++;
}
/* Insert options */
for( int j = 0; j < i_options; j++ )
{
playlist_ItemAddOption( p_item ,
p_open_dialog->mrl[i + j + 1].mb_str() );
}
/* Get the options from the stream output dialog */
if( sout_mrl.GetCount() )
{
for( int j = 0; j < (int)sout_mrl.GetCount(); j++ )
{
playlist_ItemAddOption( p_item , sout_mrl[j].mb_str() );
}
}
playlist_AddItem( p_playlist, p_item,
PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO),
PLAYLIST_END );
msg_Dbg( p_intf,"playings %s",
(const char *)p_open_dialog->mrl[i].mb_str() );
i += i_options;
}
vlc_object_release( p_playlist );
Hide();
}
void StreamDialog::OnClose( wxCommandEvent& event )
{
Hide();
}

View File

@ -2,7 +2,7 @@
* subtitles.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: subtitles.cpp,v 1.11 2004/02/14 12:36:16 gbazin Exp $
* $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*

View File

@ -137,6 +137,9 @@ struct intf_sys_t
/* Embedded vout */
VideoWindow *p_video_window;
wxBoxSizer *p_video_sizer;
/* Aout */
aout_instance_t *p_aout;
};
/*****************************************************************************
@ -183,6 +186,104 @@ private:
vlc_bool_t b_old_seekable;
};
/* Extended panel */
class ExtraPanel: public wxPanel
{
public:
/* Constructor */
ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent );
virtual ~ExtraPanel();
wxStaticBox *adjust_box;
wxButton *restoredefaults_button;
wxSlider *brightness_slider;
wxSlider *contrast_slider;
wxSlider *saturation_slider;
wxSlider *hue_slider;
wxSlider *gamma_slider;
wxStaticBox *other_box;
wxComboBox *ratio_combo;
char *psz_bands;
float f_preamp;
vlc_bool_t b_update;
private:
wxPanel *VideoPanel( wxWindow * );
wxPanel *EqzPanel( wxWindow * );
wxPanel *AudioPanel( wxWindow * );
wxNotebook *notebook;
wxCheckBox *eq_chkbox;
wxCheckBox *eq_2p_chkbox;
wxSlider *smooth_slider;
wxSlider *preamp_slider;
wxStaticText * preamp_text;
int i_smooth;
wxWindow *p_parent;
wxSlider *band_sliders[10];
wxStaticText *band_texts[10];
int i_values[10];
void CheckAout();
/* Event handlers (these functions should _not_ be virtual) */
void OnEnableAdjust( wxCommandEvent& );
void OnEnableEqualizer( wxCommandEvent& );
void OnRestoreDefaults( wxCommandEvent& );
void OnChangeEqualizer( wxScrollEvent& );
void OnAdjustUpdate( wxScrollEvent& );
void OnRatio( wxCommandEvent& );
void OnFiltersInfo( wxCommandEvent& );
void OnSelectFilter( wxCommandEvent& );
void OnEqSmooth( wxScrollEvent& );
void OnPreamp( wxScrollEvent& );
void OnEq2Pass( wxCommandEvent& );
void OnEqRestore( wxCommandEvent& );
void OnHeadphone( wxCommandEvent& );
void OnNormvol( wxCommandEvent& );
void OnNormvolSlider( wxScrollEvent& );
void OnIdle( wxIdleEvent& );
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
vlc_bool_t b_my_update;
};
#if 0
/* Extended Window */
class ExtraWindow: public wxFrame
{
public:
/* Constructor */
ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel );
virtual ~ExtraWindow();
private:
wxPanel *panel;
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
};
#endif
/* Main Interface */
class Interface: public wxFrame
{
@ -198,20 +299,13 @@ public:
wxSlider *slider;
wxWindow *slider_frame;
wxWindow *extra_frame;
wxPanel *extra_frame;
wxFrame *extra_window;
vlc_bool_t b_extra;
vlc_bool_t b_undock;
wxStaticBox *adjust_box;
wxButton *restoredefaults_button;
wxSlider *brightness_slider;
wxSlider *contrast_slider;
wxSlider *saturation_slider;
wxSlider *hue_slider;
wxSlider *gamma_slider;
wxStaticBox *other_box;
wxComboBox *ratio_combo;
wxGauge *volctrl;
@ -232,7 +326,10 @@ private:
void OnOpenDisc( wxCommandEvent& event );
void OnOpenNet( wxCommandEvent& event );
void OnOpenSat( wxCommandEvent& event );
void OnExtended( wxCommandEvent& event );
//void OnUndock( wxCommandEvent& event );
void OnBookmarks( wxCommandEvent& event );
void OnShowDialog( wxCommandEvent& event );
void OnPlayStream( wxCommandEvent& event );
@ -243,13 +340,6 @@ private:
void OnSlowStream( wxCommandEvent& event );
void OnFastStream( wxCommandEvent& event );
void OnEnableAdjust( wxCommandEvent& event );
void OnRestoreDefaults( wxCommandEvent& event);
void OnAdjustUpdate( wxScrollEvent& event );
void OnRatio( wxCommandEvent& event );
void OnEnableVisual( wxCommandEvent& event );
void OnMenuOpen( wxMenuEvent& event );
#if defined( __WXMSW__ ) || defined( __WXMAC__ )