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

EffectsEngine: Store the effect names on a specific list.

This will avoid too many copies when dealing with GUI.
parent fd026a12
......@@ -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];
}
......@@ -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;
......
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