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

EffectInstance: Fixing a settings problem when the effect was re-initialized

parent bcd0a338
......@@ -62,6 +62,9 @@ EffectInstance::init( quint32 width, quint32 height )
m_instance = m_effect->m_f0r_construct( width, height );
m_width = width;
m_height = height;
//Re-apply parameters, as they were lost during f0r_destruct();
foreach ( EffectSettingValue* val, m_params.values() )
val->apply();
}
}
......
......@@ -68,7 +68,15 @@ EffectSettingValue::set( const QVariant &val )
qCritical() << "Setting type" << m_type << "is not handled by the effects engine";
break;
}
m_effectInstance->effect()->m_f0r_set_param_value( m_effectInstance->m_instance, m_paramBuff, m_index );
apply();
}
void
EffectSettingValue::apply()
{
if ( m_paramBuff != NULL )
m_effectInstance->effect()->m_f0r_set_param_value( m_effectInstance->m_instance,
m_paramBuff, m_index );
}
quint32
......
......@@ -41,6 +41,14 @@ class EffectSettingValue : public SettingValue
f0r_param_t getFrei0rParameter() const;
virtual void set( const QVariant& val );
quint32 index() const;
/**
* \brief Force the parameter to apply, even if no change is detected
* from VLMC side.
*
* This is usefull when the instance had been destroyed, and the params should
* be applied again.
*/
void apply();
static Type frei0rToVlmc( int type );
private:
......
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