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

EffectSettingValue: Use the appropriate instance to change the parameter value.

parent bd727134
......@@ -25,6 +25,8 @@
#include "Effect.h"
#include <QtDebug>
EffectInstance::EffectInstance( Effect *effect ) :
m_effect( effect ),
m_width( 0 ),
......@@ -37,7 +39,7 @@ EffectInstance::EffectInstance( Effect *effect ) :
while ( it != ite )
{
f0r_param_info_t *info= *it;
f0r_param_info_t *info = *it;
m_params[info->name] = new EffectSettingValue( EffectSettingValue::frei0rToVlmc( info->type ),
this, i, QVariant(),
info->name, info->explanation );
......
......@@ -47,6 +47,7 @@ class EffectInstance
ParamList m_params;
friend class Effect;
friend class EffectSettingValue;
};
#endif // EFFECTINSTANCE_H
......@@ -32,11 +32,16 @@ EffectSettingValue::EffectSettingValue( Type type, EffectInstance* instance, qui
SettingValue( type, defaultValue, name, desc, flags ),
m_paramBuff( NULL ),
m_buffSize( 0 ),
m_instance( instance ),
m_effectInstance( instance ),
m_index( index )
{
}
EffectSettingValue::~EffectSettingValue()
{
delete[] m_paramBuff;
}
f0r_param_t
EffectSettingValue::getFrei0rParameter() const
{
......@@ -63,7 +68,7 @@ EffectSettingValue::set( const QVariant &val )
qCritical() << "Setting type" << m_type << "is not handled by the effects engine";
break;
}
m_instance->effect()->m_f0r_set_param_value( m_instance, m_paramBuff, m_index );
m_effectInstance->effect()->m_f0r_set_param_value( m_effectInstance->m_instance, m_paramBuff, m_index );
}
quint32
......
......@@ -36,6 +36,7 @@ class EffectSettingValue : public SettingValue
EffectSettingValue( Type type, EffectInstance* instance, quint32 index,
const QVariant& defaultValue, const char* name,
const char* desc, Flags flags = Nothing );
virtual ~EffectSettingValue();
f0r_param_t getFrei0rParameter() const;
virtual void set( const QVariant& val );
......@@ -57,7 +58,7 @@ class EffectSettingValue : public SettingValue
private:
qint8 *m_paramBuff;
quint32 m_buffSize;
EffectInstance *m_instance;
EffectInstance *m_effectInstance;
quint32 m_index;
};
......
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