[vlmc-devel] commit: WorkflowRenderer: Returning the Filter instance when adding a filter. ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Wed Aug 25 00:40:15 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Wed Aug 25 00:15:01 2010 +0200| [a14425e95510bec8d289c5745b8ab82d245004e3] | committer: Hugo Beauzée-Luyssen
WorkflowRenderer: Returning the Filter instance when adding a filter.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=a14425e95510bec8d289c5745b8ab82d245004e3
---
src/Gui/timeline/Timeline.cpp | 2 +-
src/Renderer/WorkflowRenderer.cpp | 12 +++++++-----
src/Renderer/WorkflowRenderer.h | 2 +-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/Gui/timeline/Timeline.cpp b/src/Gui/timeline/Timeline.cpp
index 2dadc4d..abb2511 100644
--- a/src/Gui/timeline/Timeline.cpp
+++ b/src/Gui/timeline/Timeline.cpp
@@ -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");
}
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index ad1ae7d..3932f1d 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -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" );
diff --git a/src/Renderer/WorkflowRenderer.h b/src/Renderer/WorkflowRenderer.h
index 1d7d917..705f78e 100644
--- a/src/Renderer/WorkflowRenderer.h
+++ b/src/Renderer/WorkflowRenderer.h
@@ -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 );
More information about the Vlmc-devel
mailing list