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

EffectUser: Adding an effectType method.

This will avoid using qobject_cast to determine the effect's target
type...
parent 33d2b532
......@@ -37,6 +37,12 @@ class EffectUser : public QObject
Q_OBJECT
public:
enum Type
{
ClipEffectUser,
TrackEffectUser,
GlobalEffectUser,
};
/**
* \brief Add an effect to the TrackWorkflow
*
......@@ -52,6 +58,7 @@ class EffectUser : public QObject
qint32 count( Effect::Type type ) const;
void cleanEffects();
virtual qint64 length() const = 0;
virtual Type effectType() const = 0;
protected:
EffectUser();
......
......@@ -142,6 +142,10 @@ public:
{
return m_isRendering;
}
EffectUser::Type effectType() const
{
return EffectUser::GlobalEffectUser;
}
protected:
/**
......
......@@ -334,3 +334,9 @@ ClipWorkflow::length() const
{
return m_clipHelper->length();
}
EffectUser::Type
ClipWorkflow::effectType() const
{
return EffectUser::ClipEffectUser;
}
......@@ -204,6 +204,7 @@ class ClipWorkflow : public EffectUser
void save( QXmlStreamWriter& project ) const;
virtual qint64 length() const;
virtual Type effectType() const;
private:
void setState( State state );
......
......@@ -650,3 +650,9 @@ TrackWorkflow::length() const
{
return m_length;
}
EffectUser::Type
TrackWorkflow::effectType() const
{
return TrackEffectUser;
}
......@@ -100,7 +100,8 @@ class TrackWorkflow : public EffectUser
//FIXME: this is not thread safe if the list gets modified (but it can't be const, as it is intended to be modified...)
EffectsEngine::EffectList *filters();
EffectsEngine::EffectList *mixers();
qint64 length() const;
virtual qint64 length() const;
virtual Type effectType() const;
private:
void computeLength();
......
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