Commit c7b3ed5e authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

EffectsEngine: Adding an effect list widget.

parent 1880c780
......@@ -103,6 +103,7 @@ INCLUDE_DIRECTORIES(
EffectsEngine
Settings
Gui
Gui/effectsengine
Gui/import
Gui/library
Gui/media
......@@ -141,8 +142,6 @@ IF (NOT WITH_GUI)
ELSE(NOT WITH_GUI)
LIST( APPEND VLMC_SRCS
Commands/KeyboardShortcutHelper.cpp
Main/guimain.cpp
Media/Transcoder.cpp #Won't be needed without the import, so let's put it in GUI list
Gui/About.cpp
Gui/AudioSpectrumDrawer.cpp
Gui/ClickableLabel.cpp
......@@ -150,25 +149,26 @@ ELSE(NOT WITH_GUI)
Gui/DockWidgetManager.cpp
Gui/IntroDialog.cpp
Gui/LanguageHelper.cpp
Gui/preview/LCDTimecode.cpp
Gui/MainWindow.cpp
Gui/import/TagWidget.cpp
Gui/UndoStack.cpp
Gui/WorkflowFileRendererDialog.cpp
Gui/effectsengine/EffectsList.cpp
Gui/export/RendererSettings.cpp
Gui/export/ShareOnYoutube.cpp
Gui/import/ImportController.cpp
Gui/import/TagWidget.cpp
Gui/library/ListViewController.cpp
Gui/library/MediaCellView.cpp
Gui/library/MediaLibrary.cpp
Gui/library/MediaListView.cpp
Gui/library/StackViewController.cpp
Gui/library/StackViewNavController.cpp
Gui/media/GuiMedia.cpp
Gui/media/ClipMetadataDisplayer.cpp
Gui/project/GuiProjectManager.cpp
Gui/media/GuiMedia.cpp
Gui/preview/LCDTimecode.cpp
Gui/preview/PreviewRuler.cpp
Gui/preview/PreviewWidget.cpp
Gui/project/GuiProjectManager.cpp
Gui/settings/BoolWidget.cpp
Gui/settings/DoubleWidget.cpp
Gui/settings/IntWidget.cpp
......@@ -200,20 +200,25 @@ ELSE(NOT WITH_GUI)
Gui/wizard/ProjectWizard.cpp
Gui/wizard/VideoPage.cpp
Gui/wizard/WelcomePage.cpp
Main/guimain.cpp
Media/Transcoder.cpp #Won't be needed without the import, so let's put it in GUI list
)
LIST( APPEND VLMC_HDRS
Commands/KeyboardShortcutHelper.h
Media/Transcoder.h #Won't be needed without the import, so let's put it in GUI list
Gui/About.h
Gui/ClickableLabel.h
Gui/ClipProperty.h
Gui/DockWidgetManager.h
Gui/IntroDialog.h
Gui/LanguageHelper.h
Gui/MainWindow.h
Gui/UndoStack.h
Gui/WorkflowFileRendererDialog.h
Gui/effectsengine/EffectsList.h
Gui/export/RendererSettings.h
Gui/export/ShareOnYoutube.h
Gui/import/ImportController.h
Gui/IntroDialog.h
Gui/LanguageHelper.h
Gui/import/TagWidget.h
Gui/library/ListViewController.h
Gui/library/MediaCellView.h
......@@ -222,26 +227,25 @@ ELSE(NOT WITH_GUI)
Gui/library/StackViewController.h
Gui/library/StackViewNavController.h
Gui/library/ViewController.h
Gui/MainWindow.h
Gui/media/ClipMetadataDisplayer.h
Gui/media/GuiMedia.h
Gui/preview/LCDTimecode.h
Gui/preview/PreviewRuler.h
Gui/preview/PreviewWidget.h
Gui/project/GuiProjectManager.h
Gui/settings/KeyboardShortcut.h
Gui/settings/KeyboardShortcutInput.h
Gui/settings/BoolWidget.h
Gui/settings/DoubleWidget.h
Gui/settings/IntWidget.h
Gui/settings/ISettingsCategoryWidget.h
Gui/settings/IntWidget.h
Gui/settings/KeyboardShortcut.h
Gui/settings/KeyboardShortcutInput.h
Gui/settings/LanguageWidget.h
Gui/settings/Panel.h
Gui/settings/PathWidget.h
Gui/settings/PreferenceWidget.h
Gui/settings/StringWidget.h
Gui/settings/Panel.h
Gui/settings/PreferenceWidget.h
Gui/settings/Settings.h
Gui/settings/StringWidget.h
Gui/timeline/AbstractGraphicsMediaItem.h
Gui/timeline/GraphicsAudioItem.h
Gui/timeline/GraphicsCursorItem.h
......@@ -252,7 +256,6 @@ ELSE(NOT WITH_GUI)
Gui/timeline/TracksRuler.h
Gui/timeline/TracksScene.h
Gui/timeline/TracksView.h
Gui/UndoStack.h
Gui/widgets/ElidableLabel.h
Gui/widgets/FramelessButton.h
Gui/widgets/NotificationZone.h
......@@ -263,24 +266,25 @@ ELSE(NOT WITH_GUI)
Gui/wizard/ProjectWizard.h
Gui/wizard/VideoPage.h
Gui/wizard/WelcomePage.h
Gui/WorkflowFileRendererDialog.h
Media/Transcoder.h #Won't be needed without the import, so let's put it in GUI list
)
SET(VLMC_UIS
Gui/effectsengine/ui/EffectsList.ui
Gui/export/RendererSettings.ui
Gui/export/ShareOnYoutube.ui
Gui/import/ui/ImportController.ui
Gui/import/ui/TagWidget.ui
Gui/library/StackViewNavController.ui
Gui/library/ui/MediaCellView.ui
Gui/library/ui/MediaLibrary.ui
Gui/library/ui/StackViewNavController.ui
Gui/media/ui/ClipMetadataDisplayer.ui
Gui/preview/ui/PreviewWidget.ui
Gui/ui/About.ui
Gui/ui/ClipProperty.ui
Gui/ui/IntroDialog.ui
Gui/ui/MainWindow.ui
Gui/media/ui/ClipMetadataDisplayer.ui
Gui/preview/ui/PreviewWidget.ui
Gui/import/ui/TagWidget.ui
Gui/ui/Timeline.ui
Gui/ui/WorkflowFileRendererDialog.ui
Gui/widgets/TrackControls.ui
......
......@@ -66,6 +66,7 @@ Effect::load()
m_f0r_info( &infos );
m_name = infos.name;
m_desc = infos.explanation;
m_type = static_cast<Type>( infos.plugin_type );
return true;
}
......@@ -83,6 +84,12 @@ Effect::description() const
return m_desc;
}
Effect::Type
Effect::type() const
{
return m_type;
}
void
Effect::init( quint32 width, quint32 height )
{
......
......@@ -51,6 +51,7 @@ class Effect : public QLibrary
bool load();
const QString& name() const;
const QString& description() const;
Type type() const;
void init( quint32 width, quint32 height );
void process( double time, const quint32* input, quint32* output ) const;
private:
......@@ -66,6 +67,7 @@ class Effect : public QLibrary
QString m_desc;
quint32 m_width;
quint32 m_height;
Type m_type;
};
#endif // EFFECT_H
......@@ -47,3 +47,17 @@ EffectsEngine::effect( qint32 idx )
{
return m_effects.at( idx );
}
bool
EffectsEngine::loadEffect( const QString &fileName )
{
Effect* e = new Effect( fileName );
if ( e->load() == false )
{
delete e;
return false;
}
m_effects.push_back( e );
emit effectAdded( e, e->type() );
return true;
}
......@@ -25,21 +25,27 @@
#include "Singleton.hpp"
class Effect;
#include "Effect.h"
#include <QObject>
#include <QList>
class EffectsEngine : public Singleton<EffectsEngine>
class EffectsEngine : public QObject, public Singleton<EffectsEngine>
{
Q_OBJECT
public:
void initAll( quint32 width, quint32 height );
Effect* effect( qint32 idx );
void initAll( quint32 width, quint32 height );
Effect* effect( qint32 idx );
bool loadEffect( const QString& fileName );
private:
EffectsEngine();
~EffectsEngine();
QList<Effect*> m_effects;
signals:
void effectAdded( Effect*, Effect::Type );
friend class Singleton<EffectsEngine>;
};
......
......@@ -47,6 +47,7 @@
/* Widgets */
#include "DockWidgetManager.h"
#include "EffectsList.h"
#include "ImportController.h"
#include "MediaLibrary.h"
#include "NotificationZone.h"
......@@ -452,6 +453,12 @@ MainWindow::initializeDockWidgets( void )
KeyboardShortcutHelper* renderShortcut = new KeyboardShortcutHelper( "keyboard/renderpreview", this );
connect( renderShortcut, SIGNAL( activated() ), m_projectPreview, SLOT( on_pushButtonPlay_clicked() ) );
EffectsList *effectsList = new EffectsList( this );
dockManager->addDockedWidget( effectsList,
QT_TRANSLATE_NOOP( "DockWidgetManager", "Effects List" ),
Qt::AllDockWidgetAreas, QDockWidget::AllDockWidgetFeatures,
Qt::LeftDockWidgetArea );
QDockWidget* dock = dockManager->addDockedWidget( UndoStack::getInstance( this ),
QT_TRANSLATE_NOOP( "DockWidgetManager", "History" ),
Qt::AllDockWidgetAreas,
......
/*****************************************************************************
* EffectsList.cpp: List the available effects plugin
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "EffectsList.h"
#include "ui_EffectsList.h"
#include <QStandardItemModel>
EffectsList::EffectsList(QWidget *parent) :
QWidget(parent),
m_ui( new Ui::EffectsList )
{
m_ui->setupUi( this );
m_filtersModel = new QStandardItemModel( this );
m_effectsModel = new QStandardItemModel( this );
m_ui->filterList->setModel( m_filtersModel );
m_ui->effectsList->setModel( m_effectsModel );
}
EffectsList::~EffectsList()
{
delete m_ui;
}
void
EffectsList::effectAdded( Effect *effect, Effect::Type type )
{
if ( type == Effect::Filter )
m_filtersModel->appendRow( new QStandardItem( effect->name() ) );
else
m_effectsModel->appendRow( new QStandardItem( effect->name() ) );
}
/*****************************************************************************
* EffectsList.h: List the available effects plugin
*****************************************************************************
* Copyright (C) 2008-2010 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <beauze.h@gmail.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef EFFECTSLIST_H
#define EFFECTSLIST_H
#include <QWidget>
#include "EffectsEngine/Effect.h"
class QStandardItemModel;
namespace Ui
{
class EffectsList;
}
class EffectsList : public QWidget
{
Q_OBJECT
public:
explicit EffectsList(QWidget *parent = 0);
~EffectsList();
private:
Ui::EffectsList *m_ui;
QStandardItemModel *m_filtersModel;
QStandardItemModel *m_effectsModel;
public slots:
void effectAdded( Effect *effect, Effect::Type type );
};
#endif // EFFECTSLIST_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EffectsList</class>
<widget class="QWidget" name="EffectsList">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="filterTab">
<attribute name="title">
<string>Filters</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QListView" name="filterList"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="effectsTab">
<attribute name="title">
<string>Effects</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QListView" name="effectsList"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
......@@ -26,6 +26,7 @@
#include "vlmc.h"
#include "Clip.h"
#include "ClipHelper.h"
#include "EffectsEngine/EffectsEngine.h"
#include "Library.h"
#include "MainWorkflow.h"
#include "TrackWorkflow.h"
......@@ -104,6 +105,8 @@ MainWorkflow::computeLength()
void
MainWorkflow::startRender( quint32 width, quint32 height )
{
//Reinit the effects in case the width/height has change
EffectsEngine::getInstance()->initAll( width, height );
m_renderStarted = true;
m_width = width;
m_height = height;
......
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