Commit ad732f4c authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Merge branch 'chouquette_sound_workflow' into chouquette_refactor_clipworkflow

parents 27cba699 5c57419e
......@@ -27,7 +27,7 @@
#include <QDir>
#include "EffectPluginTypeLoader.h"
#define PLUGINS_PATH "./src/EffectsEngine/Plugins/bin/"
#define PLUGINS_PATH "./src/EffectsEngine/Plugins/lib/"
class EffectPluginTypeManager
{
......
include(../../../PluginsAPI/PluginsAPI.pri)
INCLUDEPATH += ../../../PluginsAPI
DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_BlitInRectangleEffectPlugin
TEMPLATE = lib
CONFIG += plugin
HEADERS += BlitInRectangleEffectPlugin.h \
BlitInRectangleEffectPluginCreator.h
SOURCES += BlitInRectangleEffectPlugin.cpp \
BlitInRectangleEffectPluginCreator.cpp
DESTDIR = ../../lib
######################################################################
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009
######################################################################
TARGET = VLMC_BlitInRectangleEffectPlugin
TEMPLATE = lib
CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += BlitInRectangleEffectPlugin.h \
BlitInRectangleEffectPluginCreator.h \
../../../PluginsAPI/IEffectNode.h \
../../../PluginsAPI/IEffectPlugin.h \
../../../PluginsAPI/IEffectPluginCreator.h \
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += BlitInRectangleEffectPlugin.cpp BlitInRectangleEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
######################################################################
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009
######################################################################
include(../../../PluginsAPI/PluginsAPI.pri)
INCLUDEPATH += ../../../PluginsAPI
DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_GreenFilterEffectPlugin
TEMPLATE = lib
CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += GreenFilterEffectPlugin.h \
GreenFilterEffectPluginCreator.h \
../../../PluginsAPI/IEffectNode.h \
../../../PluginsAPI/IEffectPlugin.h \
../../../PluginsAPI/IEffectPluginCreator.h \
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += GreenFilterEffectPlugin.cpp GreenFilterEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
GreenFilterEffectPluginCreator.h
SOURCES += GreenFilterEffectPlugin.cpp \
GreenFilterEffectPluginCreator.cpp
DESTDIR = ../../lib
######################################################################
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009
######################################################################
include(../../../PluginsAPI/PluginsAPI.pri)
INCLUDEPATH += ../../../PluginsAPI
DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_InvertRNBEffectPlugin
TEMPLATE = lib
CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += InvertRNBEffectPlugin.h \
InvertRNBEffectPluginCreator.h \
../../../PluginsAPI/IEffectNode.h \
../../../PluginsAPI/IEffectPlugin.h \
../../../PluginsAPI/IEffectPluginCreator.h \
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += InvertRNBEffectPlugin.cpp InvertRNBEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
InvertRNBEffectPluginCreator.h
SOURCES += InvertRNBEffectPlugin.cpp \
InvertRNBEffectPluginCreator.cpp
DESTDIR = ../../lib
######################################################################
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009
######################################################################
include(../../../PluginsAPI/PluginsAPI.pri)
INCLUDEPATH += ../../../PluginsAPI
DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_MixerEffectPlugin
TEMPLATE = lib
CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += MixerEffectPlugin.h \
MixerEffectPluginCreator.h \
../../../PluginsAPI/IEffectNode.h \
../../../PluginsAPI/IEffectPlugin.h \
../../../PluginsAPI/IEffectPluginCreator.h \
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += MixerEffectPlugin.cpp MixerEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
MixerEffectPluginCreator.h
SOURCES += MixerEffectPlugin.cpp \
MixerEffectPluginCreator.cpp
DESTDIR = ../../lib
TEMPLATE = subdirs
DEPENDPATH += MixerEffect \
BlitInRectangle \
GreenFilterEffect \
InvertRNBEffect
SUBDIRS = MixerEffect \
BlitInRectangle \
GreenFilterEffect \
InvertRNBEffect
......@@ -91,6 +91,9 @@ MainWindow::MainWindow( QWidget *parent ) :
createGlobalPreferences();
createProjectPreferences();
initializeMenuKeyboardShortcut();
#ifdef DEBUG_CRASHHANDLER
setupCrashTester();
#endif
// Translations
connect( this, SIGNAL( translateDockWidgetTitle() ),
......@@ -304,7 +307,6 @@ void MainWindow::createGlobalPreferences()
new KeyboardShortcut( m_globalPreferences ),
QIcon( ":/images/keyboard" ),
tr( "Keyboard Settings" ) );
m_globalPreferences->build();
}
void MainWindow::createProjectPreferences()
......@@ -322,7 +324,6 @@ void MainWindow::createProjectPreferences()
new AudioProjectPreferences,
QIcon( ":/images/images/audio.png" ),
"Audio settings" );
m_projectPreferences->build();
}
......@@ -550,3 +551,14 @@ void MainWindow::on_actionImport_triggered()
{
m_importController->exec();
}
#ifdef DEBUG_CRASHHANDLER
void MainWindow::setupCrashTester()
{
QAction* actionCrash = new QAction( this );
actionCrash->setObjectName( QString::fromUtf8( "actionCrash" ) );
m_ui.menuTools->addAction( actionCrash );
actionCrash->setText( QApplication::translate( "MainWindow", "Crash", 0, QApplication::UnicodeUTF8 ) );
connect( actionCrash, SIGNAL( triggered( bool ) ), this, SLOT( on_actionCrash_triggered() ) );
}
#endif
......@@ -64,6 +64,9 @@ private:
void createGlobalPreferences();
void createProjectPreferences();
void initializeMenuKeyboardShortcut();
#ifdef DEBUG_CRASHHANDLER
void setupCrashTester();
#endif
/**
* \brief Will check if vlmc closed nicely or crashed.
* If so, the emergency backup will be opened.
......
......@@ -45,7 +45,7 @@ void ClipListViewController::addClipsFromMedia( Media* media )
addClip( clip );
}
const int ClipListViewController::getNbDeletion() const
int ClipListViewController::getNbDeletion() const
{
return m_deletion;
}
......
......@@ -35,7 +35,7 @@ class ClipListViewController : public ListViewController
~ClipListViewController();
void addClipsFromMedia( Media* media );
const int getNbDeletion() const;
int getNbDeletion() const;
private:
void addClip( Clip* clip );
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -19,19 +20,16 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QWidget>
#include <QVBoxLayout>
#include <QButtonGroup>
#include <QLabel>
#include <QIcon>
#include <QString>
#include <QToolButton>
#include <QSizePolicy>
#include <QSize>
//DEBUG
#include <QtDebug>
//~DEBUG
#include <QShowEvent>
#include "Panel.h"
......@@ -39,10 +37,7 @@ const int Panel::M_ICON_HEIGHT = 64;
Panel::Panel( QWidget* parent )
: QWidget( parent ),
m_layout( 0 ),
m_buttons( 0 ),
m_firstButton( 0 ),
m_firstButtonNb( 0 )
m_layout( 0 )
{
m_layout = new QVBoxLayout( this );
m_buttons = new QButtonGroup( this );
......@@ -50,25 +45,24 @@ Panel::Panel( QWidget* parent )
m_buttons->setExclusive( true );
m_layout->setMargin( 0 );
m_layout->setSpacing( 1 );
m_layout->insertSpacerItem( 1, new QSpacerItem( 1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
connect( m_buttons, SIGNAL( buttonPressed(int) ),
this, SLOT( switchPanel(int) ) );
QObject::connect( m_buttons,
SIGNAL( buttonClicked( int ) ),
this,
SLOT( switchPanel( int ) ) );
setSizePolicy( QSizePolicy::Expanding,
QSizePolicy::Expanding );
QSizePolicy::Expanding );
setLayout( m_layout );
}
Panel::~Panel()
{
delete m_layout;
delete m_buttons;
}
void Panel::addButton( const QString& label,
const QIcon& icon,
int number)
int index )
{
QToolButton* button = new QToolButton( this );
......@@ -79,32 +73,25 @@ void Panel::addButton( const QString& label,
button->setIconSize( QSize( Panel::M_ICON_HEIGHT,
Panel::M_ICON_HEIGHT) );
button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
button->resize( Panel::M_ICON_HEIGHT + 6,
Panel::M_ICON_HEIGHT + 6 );
button->setSizePolicy( QSizePolicy::Expanding,
QSizePolicy::Expanding );
if ( m_firstButton == 0 )
{
QSizePolicy::Minimum );
if ( m_buttons->buttons().isEmpty() )
button->setChecked( true );
m_firstButton = button;
m_firstButtonNb = number;
}
m_buttons->addButton( button, number );
m_layout->addWidget( button );
m_buttons->addButton( button, index );
m_layout->insertWidget( m_layout->count() - 1, button );
}
void Panel::show()
void Panel::showEvent( QShowEvent *event )
{
if ( !m_firstButton->isChecked() )
{
m_firstButton->setChecked( true );
emit changePanel( m_firstButtonNb );
}
QWidget::show();
// Reset the selection when the dialog is shown.
if ( !event->spontaneous() &&
!m_buttons->buttons().isEmpty() )
m_buttons->buttons().first()->setChecked( true );
}
void Panel::switchPanel( int panel )
void Panel::switchPanel( int index )
{
emit changePanel( panel );
emit changePanel( index );
}
/*****************************************************************************
* Panel.h: a simple panel with button
* Panel.h: a simple panel with buttons
*****************************************************************************
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -19,14 +20,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef PANEL_H
#define PANEL_H
#include <QWidget>
#include <QVBoxLayout>
#include <QButtonGroup>
#include <QString>
#include <QToolButton>
class QButtonGroup;
class Panel : public QWidget
{
......@@ -34,25 +36,23 @@ class Panel : public QWidget
Q_DISABLE_COPY( Panel )
public:
Panel( QWidget* parent = 0 );
~Panel();
virtual ~Panel();
void addButton( const QString& label,
const QIcon& icon,
int number);
void show();
int index );
private:
virtual void showEvent( QShowEvent * );
QVBoxLayout* m_layout;
QButtonGroup* m_buttons;
QToolButton* m_firstButton;
int m_firstButtonNb;
static const int M_ICON_HEIGHT;
private slots:
void switchPanel( int panel );
void switchPanel( int index );
signals:
void changePanel( int panel );
void changePanel( int index );
};
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -20,21 +21,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QPushButton>
#include "Settings.h"
#include <QDialogButtonBox>
#include <QAbstractButton>
#include <QApplication>
#include <QSizePolicy>
#include <QLabel>
#include <QHash>
#include <QIcon>
#include <QLabel>
#include <QtDebug>
#include <QVariant>
#include <QScrollArea>
#include "PreferenceWidget.h"
#include "SettingsManager.h"
#include "Settings.h"
#include "Panel.h"
......@@ -47,49 +43,56 @@ Settings::Settings( bool loadDefaults,
m_defaults( loadDefaults ),
m_name( name )
{
m_panel = new Panel( this );
m_stackedWidgets = new QStackedWidget( this );
setMinimumHeight( 400 );
setMinimumWidth( 600 );
m_buttons = new QDialogButtonBox( Qt::Horizontal, this );
m_buttons->setStandardButtons( QDialogButtonBox::Ok |
QDialogButtonBox::Cancel |
QDialogButtonBox::Apply );
connect( m_buttons, SIGNAL( clicked( QAbstractButton* ) ),
this, SLOT( buttonClicked( QAbstractButton* ) ) );
// Create the layout
setLayout( buildLayout() );
SettingsManager::getInstance()->addNewSettingsPart( m_name );
connect();
connect( m_panel, SIGNAL( changePanel( int ) ),
this, SLOT( switchWidget( int ) ) );
connect( SettingsManager::getInstance(), SIGNAL( settingsLoaded() ),
this, SLOT( load() ) );
}
Settings::~Settings()
{
}
//TODO : see if the widget MUST have a fixed size, or if the window can dynamicaly
//adjust to the size of the biggest Widget.
void Settings::addWidget( const QString& name,
PreferenceWidget* pWidget,
const QIcon& icon,
const QString& label )
{
m_stackedWidgets->addWidget( pWidget );
QObject::connect( this,
SIGNAL( loadSettings( const QString&, bool ) ) ,
pWidget,
SLOT( loadThemAll( const QString&, bool ) ) );
int idx = m_stackedWidgets->indexOf( pWidget );
m_widgets.insert( idx, name );
m_pWidgets.push_back( pWidget );
m_panel->addButton( label, icon, idx );
if ( !m_currentWidget )
m_currentWidget = pWidget;
}
connect( this, SIGNAL( loadSettings( const QString&, bool ) ) ,
pWidget, SLOT( loadThemAll( const QString&, bool ) ) );
void Settings::build()
{
if ( !m_currentWidget )
qFatal( "Can't build the preference panel without having a widget" );
// We don't want the widget to be visible
pWidget->hide();
QHBoxLayout* hLayout = new QHBoxLayout( this );
setLayout( hLayout );
//TODO : change the size of the widgets to make it look cleaner
hLayout->addWidget( m_panel );
hLayout->insertLayout( 1, buildRightHLayout() );
load();
// Save the widget name into a property
pWidget->setProperty( "name", name );
// Add the widget to the list
m_pWidgets.append( pWidget );
// Create a button linked to the widget using its index
m_panel->addButton( label, icon, m_pWidgets.indexOf( pWidget ) );
// If this is the first widget, show it by default.
if ( m_pWidgets.count() == 1 )
switchWidget( 0 );
}
void Settings::show( const QString& part )
......@@ -102,54 +105,40 @@ void Settings::show( const QString& part )
m_defaults = false;
}
load();
switchWidget( 0 );
QWidget::show();
}
void Settings::connect( void )
{
QObject::connect( m_panel,
SIGNAL( changePanel( int ) ),
SLOT( switchWidget( int ) ) );
QObject::connect( this,
SIGNAL( widgetSwitched( int ) ),
m_stackedWidgets,
SLOT( setCurrentIndex( int ) ));
QObject::connect( SettingsManager::getInstance(),
SIGNAL( settingsLoaded() ),
this,
SLOT( load() ) );
}
QVBoxLayout* Settings::buildRightHLayout()
QHBoxLayout* Settings::buildLayout()
{
QVBoxLayout* layout = new QVBoxLayout;
QFrame* titleLine = new QFrame( this );
m_buttons = new QDialogButtonBox( this );
// Create the left panel
m_panel = new Panel( this );
m_panel->setMaximumWidth( 130 );
QObject::connect( m_buttons, SIGNAL( clicked( QAbstractButton* ) ),
this, SLOT( buttonClicked( QAbstractButton* ) ) );
// Create the master layout
QHBoxLayout* hLayout = new QHBoxLayout( this );
hLayout->addWidget( m_panel );
// Right Sub-layout
QVBoxLayout* vLayout = new QVBoxLayout;
m_title = new QLabel( this );
titleLine->setFrameShape( QFrame::HLine );
titleLine->setFrameShadow( QFrame::Sunken );
QFont labelFont = QApplication::font( this );
m_configPanel = new QScrollArea( this );
m_configPanel->setFrameShape( QFrame::NoFrame );
// Set the font and text of the panel title
QFont labelFont = font();
labelFont.setPointSize( labelFont.pointSize() + 6 );
labelFont.setFamily( "Verdana" );
m_title->setFont( labelFont );
m_title->setText( "Empty" );
m_buttons->setStandardButtons( QDialogButtonBox::Ok |
QDialogButtonBox::Cancel |
QDialogButtonBox::Apply );
QString title( m_widgets.value( m_stackedWidgets->indexOf( m_currentWidget ) ) );
m_title->setText( title );
layout->addWidget( m_title );
layout->addWidget( titleLine );
layout->addWidget( m_stackedWidgets );
layout->addWidget( m_buttons );
return ( layout );
vLayout->addWidget( m_title );
vLayout->addWidget( m_configPanel );
vLayout->addWidget( m_buttons );
hLayout->insertLayout( -1, vLayout );
return hLayout;
}
void Settings::save( void )
......@@ -160,6 +149,7 @@ void Settings::buttonClicked( QAbstractButton* button )
{
bool save = false;
bool hide = false ;
switch ( m_buttons->standardButton( button ) )
{
case QDialogButtonBox::Ok :
......@@ -177,26 +167,37 @@ void Settings::buttonClicked( QAbstractButton* button )
}
if ( save == true )
{
//Save Settings
PreferenceWidget* widg;
// Ask each widget to save their state
for ( int i = 0; i < m_pWidgets.count(); ++i )
m_pWidgets.at( i )->save();
foreach( widg, m_pWidgets )
widg->save();
// then commit
SettingsManager::getInstance()->commit();
}
if ( hide == true )
setVisible( false );
if ( hide == true ) setVisible( false );
}
void Settings::switchWidget( int widget )
void Settings::switchWidget( int index )
{
//TODO : Change the title of the preferences shown
//Hide the current widget and show the new one.
PreferenceWidget* pWidget = m_pWidgets.at( index );
// This should never happen
if ( !pWidget ) return;
QString name( pWidget->property( "name" ).toString() );
// Set the panel name
m_title->setText( name );
// Also set the window title accordingly
setWindowTitle( tr( "Preferences: %1" ).arg( name ) );
// If there is already a widget into the QScrollArea take it
// to avoid its deletion.
if ( m_configPanel->widget() )
m_configPanel->takeWidget();
if ( !m_widgets.contains( widget ) )
return ;
m_title->setText( m_widgets.value( widget ) );
emit widgetSwitched( widget );
m_configPanel->setWidget( pWidget );
}
void Settings::load()
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2008-2009 the VLMC team
*
* Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -20,22 +21,21 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef SIMPLEPREFERENCES_H
#define SIMPLEPREFERENCES_H
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QDialog>
#include <QString>
#include <QHash>
#include <QLabel>
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <QButtonGroup>
#include <QStackedWidget>
#include <QAbstractButton>
#include <QVector>
#include <QList>
#include "Panel.h"
#include "PreferenceWidget.h"
class QDialogButtonBox;
class QLabel;
class QHBoxLayout;
class QAbstractButton;
class QScrollArea;