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

WorkflowRenderer: Returning the Filter instance when adding a filter.

parent 116530f8
......@@ -266,7 +266,7 @@ Timeline::dropEvent( QDropEvent *event )
{
Effect* effect = EffectsEngine::getInstance()->effect( event->mimeData()->data( "vlmc/effect_name") );
if ( effect != NULL )
m_renderer->appendEffect( effect );
m_renderer->appendFilter( effect );
else
qWarning() << "Can't find effect name" << event->mimeData()->data( "vlmc/effect_name");
}
......@@ -398,20 +398,22 @@ WorkflowRenderer::paramsHasChanged( quint32 width, quint32 height, double fps )
newOutputFps != fps );
}
void
WorkflowRenderer::appendEffect( Effect *effect, qint64 start, qint64 end )
EffectsEngine::FilterHelper*
WorkflowRenderer::appendFilter( Effect *effect, qint64 start, qint64 end )
{
if ( effect->type() != Effect::Filter )
{
qWarning() << "WorkflowRenderer does not handle non filter effects.";
return ;
return NULL;
}
FilterInstance *filterInstance = static_cast<FilterInstance*>( effect->createInstance() );
if ( isRendering() == true )
filterInstance->init( m_width, m_height );
QWriteLocker lock( m_effectsLock );
m_filters.push_back( new EffectsEngine::FilterHelper( filterInstance, start, end ) );
EffectsEngine::FilterHelper *ret = new EffectsEngine::FilterHelper( filterInstance, start, end );
m_filters.push_back( ret );
return ret;
}
void
......@@ -443,7 +445,7 @@ WorkflowRenderer::loadProject( const QDomElement &project )
{
Effect *e = EffectsEngine::getInstance()->effect( effect.attribute( "name" ) );
if ( e != NULL )
appendEffect( e, effect.attribute( "start" ).toLongLong(),
appendFilter( e, effect.attribute( "start" ).toLongLong(),
effect.attribute( "end" ).toLongLong() );
else
qCritical() << "Renderer: Can't load effect" << effect.attribute( "name" );
......
......@@ -131,7 +131,7 @@ class WorkflowRenderer : public GenericRenderer
*/
void killRenderer();
void appendEffect( Effect* effect, qint64 start = 0, qint64 end = -1 );
EffectsEngine::FilterHelper *appendFilter( Effect* effect, qint64 start = 0, qint64 end = -1 );
void saveProject( QXmlStreamWriter &project ) const;
void loadProject( const QDomElement& project );
......
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