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

EffectsEngine: Adding types for Mixers, renaming filter methods.

parent 4bf32260
......@@ -100,7 +100,7 @@ EffectsEngine::browseDirectory( const QString &path )
}
void
EffectsEngine::applyEffects( const FilterList &effects, Workflow::Frame* frame,
EffectsEngine::applyFilters( const FilterList &effects, Workflow::Frame* frame,
qint64 currentFrame, double time )
{
if ( effects.size() == 0 )
......@@ -149,7 +149,7 @@ EffectsEngine::applyEffects( const FilterList &effects, Workflow::Frame* frame,
}
void
EffectsEngine::saveEffects( const FilterList &effects, QXmlStreamWriter &project )
EffectsEngine::saveFilters( const FilterList &effects, QXmlStreamWriter &project )
{
if ( effects.size() <= 0 )
return ;
......@@ -169,7 +169,7 @@ EffectsEngine::saveEffects( const FilterList &effects, QXmlStreamWriter &project
}
void
EffectsEngine::initEffects( const FilterList &effects, quint32 width, quint32 height )
EffectsEngine::initFilters( const FilterList &effects, quint32 width, quint32 height )
{
EffectsEngine::FilterList::const_iterator it = effects.begin();
EffectsEngine::FilterList::const_iterator ite = effects.end();
......
......@@ -31,6 +31,7 @@ class QTime;
#include "MainWorkflow.h"
class FilterInstance;
class MixerInstance;
#include <QObject>
#include <QHash>
......@@ -63,16 +64,18 @@ class EffectsEngine : public QObject, public Singleton<EffectsEngine>
QUuid uuid;
};
typedef EffectHelper<FilterInstance> FilterHelper;
typedef QList<FilterHelper*> FilterList;
typedef QList<FilterHelper*> FilterList;
typedef EffectHelper<MixerInstance> MixerHelper;
typedef QList<MixerHelper*> MixerList;
Effect* effect( const QString& name );
bool loadEffect( const QString& fileName );
void browseDirectory( const QString& path );
static void applyEffects( const FilterList &effects,
static void applyFilters( const FilterList &effects,
Workflow::Frame *frame, qint64 currentFrame, double time );
static void saveEffects( const FilterList &effects, QXmlStreamWriter &project );
static void initEffects( const FilterList &effects, quint32 width, quint32 height );
static void saveFilters( const FilterList &effects, QXmlStreamWriter &project );
static void initFilters( const FilterList &effects, quint32 width, quint32 height );
private:
EffectsEngine();
......
......@@ -175,7 +175,7 @@ WorkflowRenderer::lockVideo( EsHandler *handler, qint64 *pts, size_t *bufferSize
}
{
QReadLocker lock( m_effectsLock );
EffectsEngine::applyEffects( m_filters, ret->video,
EffectsEngine::applyFilters( m_filters, ret->video,
m_mainWorkflow->getCurrentFrame(),
m_mainWorkflow->getCurrentFrame() * 1000.0 / handler->fps );
}
......@@ -239,7 +239,7 @@ void WorkflowRenderer::startPreview()
setupRenderer( m_width, m_height, m_outputFps );
}
QReadLocker lock( m_effectsLock );
EffectsEngine::initEffects( m_filters, m_width, m_height );
EffectsEngine::initFilters( m_filters, m_width, m_height );
//Deactivating vlc's keyboard inputs.
m_mediaPlayer->setKeyInput( false );
......@@ -414,7 +414,7 @@ WorkflowRenderer::saveProject( QXmlStreamWriter &project ) const
project.writeStartElement( "renderer" );
{
QReadLocker lock( m_effectsLock );
EffectsEngine::saveEffects( m_filters, project );
EffectsEngine::saveFilters( m_filters, project );
}
project.writeEndElement();
}
......
......@@ -102,7 +102,7 @@ VideoClipWorkflow::initVlcOutput()
m_vlcMedia->addOption( buffer );
QReadLocker lock( m_effectsLock );
EffectsEngine::initEffects( m_filters, m_width, m_height );
EffectsEngine::initFilters( m_filters, m_width, m_height );
}
void*
......@@ -169,7 +169,7 @@ VideoClipWorkflow::unlock( VideoClipWorkflow *cw, void *buffer, int width,
Workflow::Frame *frame = cw->m_computedBuffers.last();
{
QWriteLocker lock( cw->m_effectsLock );
EffectsEngine::applyEffects( cw->m_filters, frame, cw->m_renderedFrame,
EffectsEngine::applyFilters( cw->m_filters, frame, cw->m_renderedFrame,
cw->m_renderedFrame * 1000.0 / cw->clip()->getMedia()->fps() );
}
{
......@@ -229,7 +229,7 @@ void
VideoClipWorkflow::saveEffects( QXmlStreamWriter &project ) const
{
QReadLocker lock( m_effectsLock );
EffectsEngine::saveEffects( m_filters, project );
EffectsEngine::saveFilters( m_filters, project );
}
void
......
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