X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fdialogs%2Fextended.cpp;h=11342f15e75baa32afea0eade5de3aea03fd0af6;hb=9cc1540b8c973407d32c013489e2e1277141ef1e;hp=bc7d31a43f7a409f7e876177b1ec39255c0d5dad;hpb=3ba76bd83228994b472b72c47e892df3e5e06eda;p=vlc diff --git a/modules/gui/qt4/dialogs/extended.cpp b/modules/gui/qt4/dialogs/extended.cpp index bc7d31a43f..11342f15e7 100644 --- a/modules/gui/qt4/dialogs/extended.cpp +++ b/modules/gui/qt4/dialogs/extended.cpp @@ -1,10 +1,11 @@ /***************************************************************************** * extended.cpp : Extended controls - Undocked **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2008 the VideoLAN team * $Id$ * * Authors: Clément Stenac + * Jean-Baptiste Kempf * * 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 @@ -20,58 +21,114 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include "dialogs/extended.hpp" -#include "dialogs_provider.hpp" -#include "components/extended_panels.hpp" + +#include "main_interface.hpp" /* Needed for external MI size */ +#include "input_manager.hpp" #include #include - -ExtendedDialog *ExtendedDialog::instance = NULL; +#include +#include +#include ExtendedDialog::ExtendedDialog( intf_thread_t *_p_intf ): QVLCFrame( _p_intf ) { setWindowFlags( Qt::Tool ); - setWindowOpacity( config_GetFloat( p_intf, "qt-opacity" ) ); - + setWindowOpacity( var_InheritFloat( p_intf, "qt-opacity" ) ); setWindowTitle( qtr( "Adjustments and Effects" ) ); + setWindowRole( "vlc-extended" ); - QGridLayout *layout = new QGridLayout( this ); + QVBoxLayout *layout = new QVBoxLayout( this ); + layout->setContentsMargins( 0, 2, 0, 1 ); + layout->setSpacing( 3 ); - QTabWidget *mainTab = new QTabWidget( this ); - mainTab->setTabPosition( QTabWidget::West ); + mainTabW = new QTabWidget( this ); - QWidget *audioWidget = new QWidget( this ); + /* AUDIO effects */ + QWidget *audioWidget = new QWidget; QHBoxLayout *audioLayout = new QHBoxLayout( audioWidget ); - QTabWidget *audioTab = new QTabWidget( mainTab ); + QTabWidget *audioTab = new QTabWidget( audioWidget ); - Equalizer *equal = new Equalizer( p_intf, this ); + equal = new Equalizer( p_intf, audioTab ); audioTab->addTab( equal, qtr( "Graphic Equalizer" ) ); - Spatializer *spatial = new Spatializer( p_intf, this ); + Compressor *compres = new Compressor( p_intf, audioTab ); + audioTab->addTab( compres, qtr( "Compressor" ) ); + + Spatializer *spatial = new Spatializer( p_intf, audioTab ); audioTab->addTab( spatial, qtr( "Spatializer" ) ); audioLayout->addWidget( audioTab ); - mainTab->addTab( audioWidget, qtr( "Audio effects" ) ); + mainTabW->addTab( audioWidget, qtr( "Audio Effects" ) ); + + /* Video Effects */ + QWidget *videoWidget = new QWidget; + QHBoxLayout *videoLayout = new QHBoxLayout( videoWidget ); + QTabWidget *videoTab = new QTabWidget( videoWidget ); + + videoEffect = new ExtVideo( p_intf, videoTab ); + videoLayout->addWidget( videoTab ); + videoTab->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum ); + + mainTabW->addTab( videoWidget, qtr( "Video Effects" ) ); + + syncW = new SyncControls( p_intf, videoTab ); + mainTabW->addTab( syncW, qtr( "Synchronization" ) ); + + if( module_exists( "v4l2" ) ) + { + ExtV4l2 *v4l2 = new ExtV4l2( p_intf, mainTabW ); + mainTabW->addTab( v4l2, qtr( "v4l2 controls" ) ); + } + + layout->addWidget( mainTabW ); - ExtVideo *videoEffect = new ExtVideo( p_intf, this ); - mainTab->addTab( videoEffect, qtr( "Video Adjustments and Effects" ) ); + QDialogButtonBox *closeButtonBox = new QDialogButtonBox( Qt::Horizontal, this ); + closeButtonBox->addButton( + new QPushButton( qtr("&Close"), this ), QDialogButtonBox::RejectRole ); + layout->addWidget( closeButtonBox ); + CONNECT( closeButtonBox, rejected(), this, close() ); - layout->addWidget( mainTab, 0, 0, 1, 5 ); + /* Restore geometry or move this dialog on the left pane of the MI */ + if( !restoreGeometry( getSettings()->value("EPanel/geometry").toByteArray() ) ) + { + resize( QSize( 400, 280 ) ); - QPushButton *closeButton = new QPushButton( qtr( "Close" ) ); - layout->addWidget( closeButton, 1, 4, 1, 1); - CONNECT( closeButton, clicked(), this, close() ); + MainInterface *p_mi = p_intf->p_sys->p_mi; + if( p_mi && p_mi->x() > 50 ) + move( ( p_mi->x() - frameGeometry().width() - 10 ), p_mi->y() ); + else + move ( 450 , 0 ); + } - readSettings( "EPanel", QSize( 400, 300 ), QPoint( 450, 0 ) ); + CONNECT( THEMIM->getIM(), statusChanged( int ), this, changedItem( int ) ); } -void ExtendedDialog::savingSettings() +ExtendedDialog::~ExtendedDialog() { writeSettings( "EPanel" ); } -ExtendedDialog::~ExtendedDialog() -{} +void ExtendedDialog::showTab( int i ) +{ + mainTabW->setCurrentIndex( i ); + show(); +} +int ExtendedDialog::currentTab() +{ + return mainTabW->currentIndex(); +} + +void ExtendedDialog::changedItem( int i_status ) +{ + if( i_status != END_S ) return; + syncW->clean(); + videoEffect->clean(); + equal->clean(); +}