Commit f96043e8 authored by Rohit Yadav's avatar Rohit Yadav

EffectUser.cpp: Check type of the effect and only add supported effect types

Supported effect types currently are Effect::Filter and Effect::Mixer2
parent abc02f8d
...@@ -47,11 +47,15 @@ EffectUser::~EffectUser() ...@@ -47,11 +47,15 @@ EffectUser::~EffectUser()
EffectHelper* EffectHelper*
EffectUser::addEffect( Effect *effect, qint64 start /*= 0*/, qint64 end /*= -1*/ ) EffectUser::addEffect( Effect *effect, qint64 start /*= 0*/, qint64 end /*= -1*/ )
{ {
//FIXME: Check it the effect type is supported //Check that effect type is one of the supported ones
EffectInstance *effectInstance = effect->createInstance(); if ( effect->type() == Effect::Filter || effect->type() == Effect::Mixer2 )
EffectHelper *ret = new EffectHelper( effectInstance, start, end ); {
addEffect( ret ); EffectInstance *effectInstance = effect->createInstance();
return ret; EffectHelper *ret = new EffectHelper( effectInstance, start, end );
addEffect( ret );
return ret;
}
return NULL;
} }
void void
......
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