Commit 5d6b048a authored by Vincent Carrubba's avatar Vincent Carrubba

Add the possibility to enable/disable the EffectEngine (but very Huglyly (is't...

Add the possibility to enable/disable the EffectEngine (but very Huglyly (is't a valid english word?), because it's temporary, just for demo and merge into master branch)
parent 85e3a72c
......@@ -8,11 +8,11 @@ EffectsEngine::EffectsEngine( void )
quint32 i;
m_inputLock = new QReadWriteLock;
for (i = 0; i < 64; ++i)
m_videoInputs[i];
for (i = 0; i < 1; ++i)
m_videoOutputs[i];
start();
for (i = 0; i < 64; ++i)
m_videoInputs[i];
for (i = 0; i < 1; ++i)
m_videoOutputs[i];
start();
}
EffectsEngine::~EffectsEngine()
......@@ -25,11 +25,25 @@ EffectsEngine::~EffectsEngine()
void EffectsEngine::render( void )
{
( m_effects[0] )->render();
( m_effects[1] )->render();
return ;
QWriteLocker lock( m_inputLock );
( m_effects[0] )->render();
( m_effects[1] )->render();
return ;
}
// BYPASSING
void EffectsEngine::enable( void )
{
QWriteLocker lock( m_inputLock );
reinterpret_cast<PouetEffect*>(m_effects[1])->enable(); // YES, I KNOW, IT'S HUGLY, BUT IT'S TEMPORARY
}
void EffectsEngine::disable( void )
{
QWriteLocker lock( m_inputLock );
reinterpret_cast<PouetEffect*>(m_effects[1])->disable(); // YES, I KNOW, IT'S HUGLY, BUT IT'S TEMPORARY (second time)
}
// INPUTS & OUTPUTS METHODS
......@@ -106,4 +120,3 @@ void EffectsEngine::patchEffects( void )
m_effects[1]->connect( QString( "out" ), m_videoOutputs[0] );
return ;
}
......@@ -29,6 +29,11 @@ class EffectsEngine
void render( void );
// BYPASSING
void enable( void );
void disable( void );
// INPUTS & OUTPUTS METHODS
/* void setClock( Parameter currentframenumber ); */
......@@ -52,6 +57,7 @@ class EffectsEngine
void patchEffects( void );
private:
QHash< quint32, GenericEffect* > m_effects;
......
......@@ -7,7 +7,8 @@ char const * PouetEffect::m_videoOutputsNames[] = {"out"};
PouetEffect::PouetEffect() : GenericEffect(
PouetEffect::m_videoInputsNames, PouetEffect::m_nbVideoInputs,
PouetEffect::m_videoOutputsNames, PouetEffect::m_nbVideoOutputs
)
),
m_enabled( true )
{
};
......@@ -17,19 +18,31 @@ PouetEffect::~PouetEffect()
void PouetEffect::render( void )
{
static qint32 nbp = -1;
quint32 i;
LightVideoFrame tmp;
( m_videoInputs["in"] ) >> tmp;
if (tmp->frame.octets != NULL)
{
for ( i = 0; i < tmp->nbpixels; ++i )
{
tmp->frame.pixels[i].Red = 0;
tmp->frame.pixels[i].Blue = 0;
}
if (m_enabled)
for ( i = 0; i < tmp->nbpixels; ++i )
{
tmp->frame.pixels[i].Red = 0;
tmp->frame.pixels[i].Blue = 0;
}
(m_videoOutputs["out"]) << tmp;
}
return ;
}
void PouetEffect::enable( void )
{
m_enabled = true;
return ;
}
void PouetEffect::disable( void )
{
m_enabled = false;
return ;
}
......@@ -15,9 +15,12 @@ class PouetEffect : public GenericEffect
// RENDER METHOD
void render( void );
void enable( void );
void disable( void );
private:
bool m_enabled;
static quint32 const m_nbVideoInputs = 1;
static quint32 const m_nbVideoOutputs = 1;
static char const * m_videoInputsNames[m_nbVideoInputs];
......
......@@ -57,6 +57,9 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_synchroneRenderWaitCondition = new QWaitCondition;
m_synchroneRenderWaitConditionMutex = new QMutex;
m_effectEngine = new EffectsEngine;
m_effectEngine->disable();
m_nbTracksToRenderMutex = new QMutex;
}
......
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