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

Effects: Don't init an effect when it is unused.

parent edd13a2b
......@@ -93,6 +93,9 @@ Effect::type() const
void
Effect::init( quint32 width, quint32 height )
{
//Don't init if the effect is not currently used.
if ( m_used == false )
return ;
if ( width != m_width || height != m_height )
{
if ( m_instance != NULL )
......@@ -112,3 +115,9 @@ Effect::process( double time, const quint32 *input, quint32 *output ) const
{
m_f0r_update( m_instance, time, input, output );
}
void
Effect::setUsed( bool used )
{
m_used = used;
}
......@@ -48,6 +48,7 @@ class Effect : public QLibrary
Effect( const QString& fileName );
virtual ~Effect();
void setUsed( bool used );
bool load();
const QString& name() const;
const QString& description() const;
......@@ -68,6 +69,7 @@ class Effect : public QLibrary
quint32 m_width;
quint32 m_height;
Type m_type;
bool m_used;
};
#endif // EFFECT_H
......@@ -426,7 +426,7 @@ void
MainWindow::initializeDockWidgets( void )
{
//FIXME !!!
EffectsEngine::getInstance()->browseDirectory( "/usr/lib/frei0r-1" );
EffectsEngine::getInstance()->browseDirectory( "/usr/local/frei0r/lib/" );
m_renderer = new WorkflowRenderer();
m_renderer->initializeRenderer();
......
......@@ -429,6 +429,7 @@ WorkflowRenderer::paramsHasChanged( quint32 width, quint32 height, double fps )
void
WorkflowRenderer::appendEffect( Effect *effect, qint64 start, qint64 end )
{
effect->setUsed( true );
m_effects.push_back( new EffectsEngine::EffectHelper( effect, start, end ) );
}
......
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