[vlmc-devel] commit: EffectsEngine: Store the effect names on a specific list. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Wed Sep 1 00:47:18 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Aug 31 01:58:27 2010 +0200| [52d20b0ed892b36391b58ef5169aaba6aa9d3a81] | committer: Hugo Beauzée-Luyssen 

EffectsEngine: Store the effect names on a specific list.

This will avoid too many copies when dealing with GUI.

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

 src/EffectsEngine/EffectsEngine.cpp |    8 ++++++++
 src/EffectsEngine/EffectsEngine.h   |    9 ++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/EffectsEngine/EffectsEngine.cpp b/src/EffectsEngine/EffectsEngine.cpp
index 83e2dcb..888cfb1 100644
--- a/src/EffectsEngine/EffectsEngine.cpp
+++ b/src/EffectsEngine/EffectsEngine.cpp
@@ -76,6 +76,7 @@ EffectsEngine::loadEffect( const QString &fileName )
                 return false;
             }
             m_effects[name] = e;
+            m_names[type].push_back( name );
             emit effectAdded( e, name, type );
             return true;
         }
@@ -90,6 +91,7 @@ EffectsEngine::loadEffect( const QString &fileName )
     m_cache->setValue( fileName + "/type", e->type() );
     name = e->name();
     type = e->type();
+    m_names[type].push_back( name );
     emit effectAdded( e, name, type );
     return true;
 }
@@ -227,3 +229,9 @@ EffectsEngine::loadEffects()
         }
     }
 }
+
+const QStringList&
+EffectsEngine::effects(Effect::Type type) const
+{
+    return m_names[type];
+}
diff --git a/src/EffectsEngine/EffectsEngine.h b/src/EffectsEngine/EffectsEngine.h
index 3365b8f..6ff9933 100644
--- a/src/EffectsEngine/EffectsEngine.h
+++ b/src/EffectsEngine/EffectsEngine.h
@@ -38,6 +38,7 @@ class   QTime;
 class   QXmlStreamWriter;
 
 #include <QObject>
+#include <QStringList>
 #include <QHash>
 #include <QUuid>
 #include <QMetaType>
@@ -72,9 +73,10 @@ class   EffectsEngine : public QObject, public Singleton<EffectsEngine>
         typedef QList<EffectHelper*>            EffectList;
         static const quint32                    MaxFramesForMixer = 3;
 
-        Effect*     effect( const QString& name );
-        bool        loadEffect( const QString& fileName );
-        void        loadEffects();
+        Effect*             effect( const QString& name );
+        const QStringList&  effects( Effect::Type type ) const;
+        bool                loadEffect( const QString& fileName );
+        void                loadEffects();
 
         static void     initEffects( const EffectList &effects, quint32 width, quint32 height );
         //Filters methods:
@@ -92,6 +94,7 @@ class   EffectsEngine : public QObject, public Singleton<EffectsEngine>
 
     private:
         QHash<QString, Effect*> m_effects;
+        QList<QStringList>      m_names;
         QSettings               *m_cache;
         QTime                   *m_time;
 



More information about the Vlmc-devel mailing list