[vlmc-devel] commit: EffectSettingValue: Use the appropriate instance to change the parameter value. ( Hugo Beauzée-Luyssen )
git at videolan.org
git at videolan.org
Fri Aug 20 00:55:07 CEST 2010
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Aug 19 22:28:28 2010 +0200| [ce08eb4f8665c22d614e47c19f3c270a3d947b70] | committer: Hugo Beauzée-Luyssen
EffectSettingValue: Use the appropriate instance to change the parameter value.
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=ce08eb4f8665c22d614e47c19f3c270a3d947b70
---
src/EffectsEngine/EffectInstance.cpp | 4 +++-
src/EffectsEngine/EffectInstance.h | 1 +
src/EffectsEngine/EffectSettingValue.cpp | 9 +++++++--
src/EffectsEngine/EffectSettingValue.h | 3 ++-
4 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/EffectsEngine/EffectInstance.cpp b/src/EffectsEngine/EffectInstance.cpp
index f29cb4c..e5b1250 100644
--- a/src/EffectsEngine/EffectInstance.cpp
+++ b/src/EffectsEngine/EffectInstance.cpp
@@ -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 );
diff --git a/src/EffectsEngine/EffectInstance.h b/src/EffectsEngine/EffectInstance.h
index 0e31ee0..e2227f8 100644
--- a/src/EffectsEngine/EffectInstance.h
+++ b/src/EffectsEngine/EffectInstance.h
@@ -47,6 +47,7 @@ class EffectInstance
ParamList m_params;
friend class Effect;
+ friend class EffectSettingValue;
};
#endif // EFFECTINSTANCE_H
diff --git a/src/EffectsEngine/EffectSettingValue.cpp b/src/EffectsEngine/EffectSettingValue.cpp
index 83fbbcd..edb8be5 100644
--- a/src/EffectsEngine/EffectSettingValue.cpp
+++ b/src/EffectsEngine/EffectSettingValue.cpp
@@ -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
diff --git a/src/EffectsEngine/EffectSettingValue.h b/src/EffectsEngine/EffectSettingValue.h
index 042970d..02e6df4 100644
--- a/src/EffectsEngine/EffectSettingValue.h
+++ b/src/EffectsEngine/EffectSettingValue.h
@@ -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;
};
More information about the Vlmc-devel
mailing list