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 @@ ...@@ -27,7 +27,7 @@
#include <QDir> #include <QDir>
#include "EffectPluginTypeLoader.h" #include "EffectPluginTypeLoader.h"
#define PLUGINS_PATH "./src/EffectsEngine/Plugins/bin/" #define PLUGINS_PATH "./src/EffectsEngine/Plugins/lib/"
class EffectPluginTypeManager 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
###################################################################### include(../../../PluginsAPI/PluginsAPI.pri)
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009 INCLUDEPATH += ../../../PluginsAPI
###################################################################### DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_GreenFilterEffectPlugin TARGET = VLMC_GreenFilterEffectPlugin
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += GreenFilterEffectPlugin.h \ HEADERS += GreenFilterEffectPlugin.h \
GreenFilterEffectPluginCreator.h \ GreenFilterEffectPluginCreator.h
../../../PluginsAPI/IEffectNode.h \ SOURCES += GreenFilterEffectPlugin.cpp \
../../../PluginsAPI/IEffectPlugin.h \ GreenFilterEffectPluginCreator.cpp
../../../PluginsAPI/IEffectPluginCreator.h \ DESTDIR = ../../lib
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += GreenFilterEffectPlugin.cpp GreenFilterEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
###################################################################### include(../../../PluginsAPI/PluginsAPI.pri)
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009 INCLUDEPATH += ../../../PluginsAPI
###################################################################### DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_InvertRNBEffectPlugin TARGET = VLMC_InvertRNBEffectPlugin
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += InvertRNBEffectPlugin.h \ HEADERS += InvertRNBEffectPlugin.h \
InvertRNBEffectPluginCreator.h \ InvertRNBEffectPluginCreator.h
../../../PluginsAPI/IEffectNode.h \ SOURCES += InvertRNBEffectPlugin.cpp \
../../../PluginsAPI/IEffectPlugin.h \ InvertRNBEffectPluginCreator.cpp
../../../PluginsAPI/IEffectPluginCreator.h \ DESTDIR = ../../lib
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += InvertRNBEffectPlugin.cpp InvertRNBEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
###################################################################### include(../../../PluginsAPI/PluginsAPI.pri)
# Automatically generated by qmake (2.01a) Sun Nov 29 13:42:14 2009 INCLUDEPATH += ../../../PluginsAPI
###################################################################### DEPENDPATH += ../../../PluginsAPI
TARGET = VLMC_MixerEffectPlugin TARGET = VLMC_MixerEffectPlugin
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin CONFIG += plugin
INCLUDEPATH += . ../../../PluginsAPI
HEADERS += MixerEffectPlugin.h \ HEADERS += MixerEffectPlugin.h \
MixerEffectPluginCreator.h \ MixerEffectPluginCreator.h
../../../PluginsAPI/IEffectNode.h \ SOURCES += MixerEffectPlugin.cpp \
../../../PluginsAPI/IEffectPlugin.h \ MixerEffectPluginCreator.cpp
../../../PluginsAPI/IEffectPluginCreator.h \ DESTDIR = ../../lib
../../../PluginsAPI/InSlot.hpp \
../../../PluginsAPI/OutSlot.hpp \
../../../PluginsAPI/LightVideoFrame.h
SOURCES += MixerEffectPlugin.cpp MixerEffectPluginCreator.cpp ../../../PluginsAPI/LightVideoFrame.cpp
DESTDIR = ../../bin
TEMPLATE = subdirs
DEPENDPATH += MixerEffect \
BlitInRectangle \
GreenFilterEffect \
InvertRNBEffect
SUBDIRS = MixerEffect \
BlitInRectangle \
GreenFilterEffect \
InvertRNBEffect
...@@ -91,6 +91,9 @@ MainWindow::MainWindow( QWidget *parent ) : ...@@ -91,6 +91,9 @@ MainWindow::MainWindow( QWidget *parent ) :
createGlobalPreferences(); createGlobalPreferences();
createProjectPreferences(); createProjectPreferences();
initializeMenuKeyboardShortcut(); initializeMenuKeyboardShortcut();
#ifdef DEBUG_CRASHHANDLER
setupCrashTester();
#endif
// Translations // Translations
connect( this, SIGNAL( translateDockWidgetTitle() ), connect( this, SIGNAL( translateDockWidgetTitle() ),
...@@ -304,7 +307,6 @@ void MainWindow::createGlobalPreferences() ...@@ -304,7 +307,6 @@ void MainWindow::createGlobalPreferences()
new KeyboardShortcut( m_globalPreferences ), new KeyboardShortcut( m_globalPreferences ),
QIcon( ":/images/keyboard" ), QIcon( ":/images/keyboard" ),
tr( "Keyboard Settings" ) ); tr( "Keyboard Settings" ) );
m_globalPreferences->build();
} }
void MainWindow::createProjectPreferences() void MainWindow::createProjectPreferences()
...@@ -322,7 +324,6 @@ void MainWindow::createProjectPreferences() ...@@ -322,7 +324,6 @@ void MainWindow::createProjectPreferences()
new AudioProjectPreferences, new AudioProjectPreferences,
QIcon( ":/images/images/audio.png" ), QIcon( ":/images/images/audio.png" ),
"Audio settings" ); "Audio settings" );
m_projectPreferences->build();
} }
...@@ -550,3 +551,14 @@ void MainWindow::on_actionImport_triggered() ...@@ -550,3 +551,14 @@ void MainWindow::on_actionImport_triggered()
{ {
m_importController->exec(); 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: ...@@ -64,6 +64,9 @@ private:
void createGlobalPreferences(); void createGlobalPreferences();
void createProjectPreferences(); void createProjectPreferences();
void initializeMenuKeyboardShortcut(); void initializeMenuKeyboardShortcut();
#ifdef DEBUG_CRASHHANDLER
void setupCrashTester();
#endif
/** /**
* \brief Will check if vlmc closed nicely or crashed. * \brief Will check if vlmc closed nicely or crashed.
* If so, the emergency backup will be opened. * If so, the emergency backup will be opened.
......
...@@ -45,7 +45,7 @@ void ClipListViewController::addClipsFromMedia( Media* media ) ...@@ -45,7 +45,7 @@ void ClipListViewController::addClipsFromMedia( Media* media )
addClip( clip ); addClip( clip );
} }
const int ClipListViewController::getNbDeletion() const int ClipListViewController::getNbDeletion() const
{ {
return m_deletion; return m_deletion;
} }
......
...@@ -35,7 +35,7 @@ class ClipListViewController : public ListViewController ...@@ -35,7 +35,7 @@ class ClipListViewController : public ListViewController
~ClipListViewController(); ~ClipListViewController();
void addClipsFromMedia( Media* media ); void addClipsFromMedia( Media* media );
const int getNbDeletion() const; int getNbDeletion() const;
private: private:
void addClip( Clip* clip ); void addClip( Clip* clip );
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 2008-2009 the VLMC team * Copyright (C) 2008-2009 the VLMC team
* *
* Authors: Clement CHAVANCE <kinder@vlmc.org> * Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -19,19 +20,16 @@ ...@@ -19,19 +20,16 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include <QWidget> #include <QWidget>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QButtonGroup> #include <QButtonGroup>
#include <QLabel>
#include <QIcon> #include <QIcon>
#include <QString> #include <QString>
#include <QToolButton> #include <QToolButton>
#include <QSizePolicy> #include <QSizePolicy>
#include <QSize> #include <QSize>
#include <QShowEvent>
//DEBUG
#include <QtDebug>
//~DEBUG
#include "Panel.h" #include "Panel.h"
...@@ -39,10 +37,7 @@ const int Panel::M_ICON_HEIGHT = 64; ...@@ -39,10 +37,7 @@ const int Panel::M_ICON_HEIGHT = 64;
Panel::Panel( QWidget* parent ) Panel::Panel( QWidget* parent )
: QWidget( parent ), : QWidget( parent ),
m_layout( 0 ), m_layout( 0 )
m_buttons( 0 ),
m_firstButton( 0 ),
m_firstButtonNb( 0 )
{ {
m_layout = new QVBoxLayout( this ); m_layout = new QVBoxLayout( this );
m_buttons = new QButtonGroup( this ); m_buttons = new QButtonGroup( this );
...@@ -50,25 +45,24 @@ Panel::Panel( QWidget* parent ) ...@@ -50,25 +45,24 @@ Panel::Panel( QWidget* parent )
m_buttons->setExclusive( true ); m_buttons->setExclusive( true );
m_layout->setMargin( 0 ); m_layout->setMargin( 0 );
m_layout->setSpacing( 1 ); 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, setSizePolicy( QSizePolicy::Expanding,
QSizePolicy::Expanding ); QSizePolicy::Expanding );
setLayout( m_layout ); setLayout( m_layout );
} }
Panel::~Panel() Panel::~Panel()
{ {
delete m_layout;
delete m_buttons;
} }
void Panel::addButton( const QString& label, void Panel::addButton( const QString& label,
const QIcon& icon, const QIcon& icon,
int number) int index )
{ {
QToolButton* button = new QToolButton( this ); QToolButton* button = new QToolButton( this );
...@@ -79,32 +73,25 @@ void Panel::addButton( const QString& label, ...@@ -79,32 +73,25 @@ void Panel::addButton( const QString& label,
button->setIconSize( QSize( Panel::M_ICON_HEIGHT, button->setIconSize( QSize( Panel::M_ICON_HEIGHT,
Panel::M_ICON_HEIGHT) ); Panel::M_ICON_HEIGHT) );
button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon ); button->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
button->resize( Panel::M_ICON_HEIGHT + 6,
Panel::M_ICON_HEIGHT + 6 );
button->setSizePolicy( QSizePolicy::Expanding, button->setSizePolicy( QSizePolicy::Expanding,
QSizePolicy::Expanding ); QSizePolicy::Minimum );
if ( m_firstButton == 0 )
{ if ( m_buttons->buttons().isEmpty() )
button->setChecked( true ); button->setChecked( true );
m_firstButton = button;
m_firstButtonNb = number; m_buttons->addButton( button, index );
} m_layout->insertWidget( m_layout->count() - 1, button );
m_buttons->addButton( button, number );
m_layout->addWidget( button );
} }
void Panel::show() void Panel::showEvent( QShowEvent *event )
{ {
if ( !m_firstButton->isChecked() ) // Reset the selection when the dialog is shown.
{ if ( !event->spontaneous() &&
m_firstButton->setChecked( true ); !m_buttons->buttons().isEmpty() )
emit changePanel( m_firstButtonNb ); m_buttons->buttons().first()->setChecked( true );
}
QWidget::show();
} }
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 * Copyright (C) 2008-2009 the VLMC team
* *
* Authors: Clement CHAVANCE <kinder@vlmc.org> * Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -19,14 +20,15 @@ ...@@ -19,14 +20,15 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifndef PANEL_H #ifndef PANEL_H
#define PANEL_H #define PANEL_H
#include <QWidget> #include <QWidget>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QButtonGroup>
#include <QString> #include <QString>
#include <QToolButton>
class QButtonGroup;
class Panel : public QWidget class Panel : public QWidget
{ {
...@@ -34,25 +36,23 @@ class Panel : public QWidget ...@@ -34,25 +36,23 @@ class Panel : public QWidget
Q_DISABLE_COPY( Panel ) Q_DISABLE_COPY( Panel )
public: public:
Panel( QWidget* parent = 0 ); Panel( QWidget* parent = 0 );
~Panel(); virtual ~Panel();
void addButton( const QString& label, void addButton( const QString& label,
const QIcon& icon, const QIcon& icon,
int number); int index );
void show();
private: private:
virtual void showEvent( QShowEvent * );
QVBoxLayout* m_layout; QVBoxLayout* m_layout;
QButtonGroup* m_buttons; QButtonGroup* m_buttons;
QToolButton* m_firstButton;
int m_firstButtonNb;
static const int M_ICON_HEIGHT; static const int M_ICON_HEIGHT;
private slots: private slots:
void switchPanel( int panel ); void switchPanel( int index );
signals: signals:
void changePanel( int panel ); void changePanel( int index );
}; };
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 2008-2009 the VLMC team * Copyright (C) 2008-2009 the VLMC team
* *
* Authors: Clement CHAVANCE <kinder@vlmc.org> * Authors: Clement CHAVANCE <kinder@vlmc.org>
* Ludovic Fauvet <etix@l0cal.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
...@@ -20,21 +21,16 @@ ...@@ -20,21 +21,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include <QPushButton> #include "Settings.h"
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QAbstractButton> #include <QAbstractButton>
#include <QApplication>
#include <QSizePolicy>
#include <QLabel>
#include <QHash>
#include <QIcon> #include <QIcon>
#include <QLabel> #include <QLabel>
#include <QtDebug> #include <QScrollArea>
#include <QVariant>
#include "PreferenceWidget.h" #include "PreferenceWidget.h"
#include "SettingsManager.h" #include "SettingsManager.h"
#include "Settings.h"
#include "Panel.h" #include "Panel.h"
...@@ -47,49 +43,56 @@ Settings::Settings( bool loadDefaults, ...@@ -47,49 +43,56 @@ Settings::Settings( bool loadDefaults,
m_defaults( loadDefaults ), m_defaults( loadDefaults ),
m_name( name ) m_name( name )
{ {
m_panel = new Panel( this ); setMinimumHeight( 400 );
m_stackedWidgets = new QStackedWidget( this ); 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 ); 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() 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, void Settings::addWidget( const QString& name,
PreferenceWidget* pWidget, PreferenceWidget* pWidget,
const QIcon& icon, const QIcon& icon,
const QString& label ) const QString& label )
{ {
m_stackedWidgets->addWidget( pWidget ); connect( this, SIGNAL( loadSettings( const QString&, bool ) ) ,
pWidget, SLOT( loadThemAll( const QString&, bool ) ) );
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;
}
void Settings::build() // We don't want the widget to be visible
{ pWidget->hide();
if ( !m_currentWidget )
qFatal( "Can't build the preference panel without having a widget" );
QHBoxLayout* hLayout = new QHBoxLayout( this ); // Save the widget name into a property
setLayout( hLayout ); pWidget->setProperty( "name", name );
//TODO : change the size of the widgets to make it look cleaner
hLayout->addWidget( m_panel ); // Add the widget to the list
hLayout->insertLayout( 1, buildRightHLayout() ); m_pWidgets.append( pWidget );
load();
// Create a button linked to the widget using its index