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

EffectInstance: Store the params by name.

parent 4d37e6b0
......@@ -38,9 +38,9 @@ EffectInstance::EffectInstance( Effect *effect ) :
while ( it != ite )
{
f0r_param_info_t *info= *it;
m_params.push_back( new EffectSettingValue( EffectSettingValue::frei0rToVlmc( info->type ),
m_params[info->name] = new EffectSettingValue( EffectSettingValue::frei0rToVlmc( info->type ),
this, i, QVariant(),
info->name, info->explanation ) );
info->name, info->explanation );
++it;
++i;
}
......@@ -68,3 +68,9 @@ EffectInstance::effect()
{
return m_effect;
}
const EffectInstance::ParamList&
EffectInstance::params() const
{
return m_params;
}
......@@ -24,17 +24,18 @@
#define EFFECTINSTANCE_H
class Effect;
class EffectSettingValue;
#include <QList>
#include <QHash>
#include "frei0r.h"
class EffectSettingValue;
class EffectInstance
{
public:
typedef QHash<QString, EffectSettingValue*> ParamList;
void init( quint32 width, quint32 height );
Effect* effect();
const ParamList &params() const;
protected:
EffectInstance( Effect *effect );
~EffectInstance();
......@@ -43,7 +44,7 @@ class EffectInstance
quint32 m_width;
quint32 m_height;
f0r_instance_t m_instance;
QList<EffectSettingValue*> m_params;
ParamList m_params;
friend class Effect;
};
......
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