[vlmc-devel] commit: EffectInstance: Store the params by name. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Aug 20 00:55:06 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Thu Aug 19 20:16:18 2010 +0200| [328c6bd4cea760700b88291d26dc0989b31de633] | committer: Hugo Beauzée-Luyssen 

EffectInstance: Store the params by name.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=328c6bd4cea760700b88291d26dc0989b31de633
---

 src/EffectsEngine/EffectInstance.cpp |   10 ++++++++--
 src/EffectsEngine/EffectInstance.h   |    9 +++++----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/EffectsEngine/EffectInstance.cpp b/src/EffectsEngine/EffectInstance.cpp
index 55bc5a6..f29cb4c 100644
--- a/src/EffectsEngine/EffectInstance.cpp
+++ b/src/EffectsEngine/EffectInstance.cpp
@@ -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;
+}
diff --git a/src/EffectsEngine/EffectInstance.h b/src/EffectsEngine/EffectInstance.h
index fe1539e..e9e7cc2 100644
--- a/src/EffectsEngine/EffectInstance.h
+++ b/src/EffectsEngine/EffectInstance.h
@@ -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;
 };



More information about the Vlmc-devel mailing list