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

Effect: Adding some getters.

parent 00c28276
......@@ -29,7 +29,10 @@
Effect::Effect( const QString &fileName ) :
QLibrary( fileName ),
m_type( Unknown )
m_type( Unknown ),
m_major( -1 ),
m_minor( -1 ),
m_nbParams( -1 )
{
}
......@@ -65,6 +68,9 @@ Effect::load()
m_name = infos.name;
m_desc = infos.explanation;
m_type = static_cast<Type>( infos.plugin_type );
m_major = infos.major_version;
m_minor = infos.minor_version;
m_nbParams = infos.num_params;
return true;
}
......@@ -94,6 +100,22 @@ Effect::type()
return m_type;
}
int
Effect::getMajor()
{
if ( m_major == -1 )
load();
return m_major;
}
int
Effect::getMinor()
{
if ( m_minor == -1 )
load();
return m_minor;
}
EffectInstance*
Effect::createInstance()
{
......
......@@ -55,6 +55,9 @@ class Effect : public QLibrary
const QString& name();
const QString& description();
Type type();
//This breaks coding convention, but it would be safe just to undef major/minor.
int getMajor();
int getMinor();
EffectInstance *createInstance();
private:
......@@ -64,6 +67,9 @@ class Effect : public QLibrary
QString m_name;
QString m_desc;
Type m_type;
int m_major;
int m_minor;
int m_nbParams;
QAtomicInt m_instCount;
//Symbols:
......
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