Commit 5df4fd43 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Deactivating effect engine.

parent 68d60a4f
......@@ -505,15 +505,15 @@ void MainWindow::toolButtonClicked( int id )
emit toolChanged( (ToolButtons)id );
}
void MainWindow::on_actionBypass_effects_engine_toggled(bool toggled)
{
EffectsEngine* ee;
ee = MainWorkflow::getInstance()->getEffectsEngine();
if (toggled)
ee->enable();
else
ee->disable();
void MainWindow::on_actionBypass_effects_engine_toggled(bool)
{
// EffectsEngine* ee;
//
// ee = MainWorkflow::getInstance()->getEffectsEngine();
// if (toggled)
// ee->enable();
// else
// ee->disable();
return ;
}
......
......@@ -47,16 +47,13 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_currentFrameLock = new QReadWriteLock;
m_renderStartedMutex = new QMutex;
m_effectEngine = new EffectsEngine;
m_effectEngine->disable();
m_tracks = new TrackHandler*[MainWorkflow::NbTrackType];
m_currentFrame = new qint64[MainWorkflow::NbTrackType];
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
{
MainWorkflow::TrackType trackType =
(i == 0 ? MainWorkflow::VideoTrack : MainWorkflow::AudioTrack );
m_tracks[i] = new TrackHandler( trackCount, trackType, m_effectEngine );
m_tracks[i] = new TrackHandler( trackCount, trackType );
connect( m_tracks[i], SIGNAL( tracksEndReached() ),
this, SLOT( tracksEndReached() ) );
m_currentFrame[i] = 0;
......@@ -66,7 +63,6 @@ MainWorkflow::MainWorkflow( int trackCount ) :
MainWorkflow::~MainWorkflow()
{
delete m_effectEngine;
delete m_renderStartedMutex;
delete m_currentFrameLock;
delete m_currentFrame;
......@@ -75,12 +71,6 @@ MainWorkflow::~MainWorkflow()
delete[] m_tracks;
}
EffectsEngine*
MainWorkflow::getEffectsEngine()
{
return m_effectEngine;
}
void
MainWorkflow::addClip( Clip *clip, unsigned int trackId,
qint64 start, MainWorkflow::TrackType trackType )
......@@ -134,21 +124,19 @@ MainWorkflow::getOutput( TrackType trackType, bool paused )
{
QReadLocker lock2( m_currentFrameLock );
m_tracks[trackType]->getOutput( m_currentFrame[VideoTrack],
void* ret = m_tracks[trackType]->getOutput( m_currentFrame[VideoTrack],
m_currentFrame[trackType], paused );
if ( trackType == MainWorkflow::VideoTrack )
{
m_effectEngine->render();
const LightVideoFrame &tmp = m_effectEngine->getVideoOutput( 1 );
if ( tmp->nboctets == 0 )
m_outputBuffers->video = blackOutput;
LightVideoFrame* frame = static_cast<LightVideoFrame*>( ret );
if ( frame == NULL )
m_outputBuffers->video = MainWorkflow::blackOutput;
else
m_outputBuffers->video = &tmp;
m_outputBuffers->video = frame;
}
else
{
m_outputBuffers->audio =
m_tracks[MainWorkflow::AudioTrack]->getTmpAudioBuffer();
m_outputBuffers->audio = static_cast<AudioClipWorkflow::AudioSample*>( ret );
}
}
return m_outputBuffers;
......
......@@ -123,13 +123,6 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
* \param paused The paused state of the renderer
*/
OutputBuffers* getOutput( TrackType trackType, bool paused );
/**
* \brief Returns the effect engine instance used by the workflow
*
* \return The effect engine instance used by the workflow
*/
EffectsEngine* getEffectsEngine();
/**
* \brief Set the workflow position by the desired frame
* \param currentFrame: The desired frame to render from
......@@ -386,8 +379,6 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
/// Pre-allocated buffer, that will contain every computed outputs.
OutputBuffers* m_outputBuffers;
/// Effect engine instance.
EffectsEngine* m_effectEngine;
/// Width used for the render
quint32 m_width;
/// Height used for the render
......
......@@ -31,12 +31,10 @@
LightVideoFrame* TrackHandler::nullOutput = NULL;
TrackHandler::TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType,
EffectsEngine* effectsEngine ) :
TrackHandler::TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType ) :
m_trackCount( nbTracks ),
m_trackType( trackType ),
m_length( 0 ),
m_effectEngine( effectsEngine )
m_length( 0 )
{
TrackHandler::nullOutput = new LightVideoFrame();
......@@ -113,29 +111,23 @@ TrackHandler::getLength() const
return m_length;
}
void
void*
TrackHandler::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
{
m_tmpAudioBuffer = NULL;
for ( unsigned int i = 0; i < m_trackCount; ++i )
for ( int i = m_trackCount - 1; i >= 0; --i )
{
if ( m_trackType == MainWorkflow::VideoTrack )
{
if ( m_tracks[i].activated() == false )
{
m_effectEngine->setVideoInput( i + 1, *TrackHandler::nullOutput );
}
continue ;
else
{
void* ret = m_tracks[i]->getOutput( currentFrame, subFrame, paused );
StackedBuffer<LightVideoFrame*> *buff = reinterpret_cast<StackedBuffer<LightVideoFrame*>*>( ret );
if ( ret == NULL )
m_effectEngine->setVideoInput( i + 1, *TrackHandler::nullOutput );
continue ;
else
{
StackedBuffer<LightVideoFrame*>* stackedBuffer =
reinterpret_cast<StackedBuffer<LightVideoFrame*>*>( ret );
m_effectEngine->setVideoInput( i + 1, *( stackedBuffer->get() ) );
}
return buff->get();
}
}
else
......@@ -150,10 +142,11 @@ TrackHandler::getOutput( qint64 currentFrame, qint64 subFrame, bool paused )
StackedBuffer<AudioClipWorkflow::AudioSample*>* stackedBuffer =
reinterpret_cast<StackedBuffer<AudioClipWorkflow::AudioSample*>*> ( ret );
if ( stackedBuffer != NULL )
m_tmpAudioBuffer = stackedBuffer->get();
return stackedBuffer->get();
}
}
}
return NULL;
}
void
......
......@@ -27,10 +27,6 @@
#include "Toggleable.hpp"
#include "MainWorkflow.h"
//TEMPORARY:
#include "AudioClipWorkflow.h"
class EffectEngine;
class TrackWorkflow;
class QXmlStreamWriter;
......@@ -39,7 +35,7 @@ class TrackHandler : public QObject
{
Q_OBJECT
public:
TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType, EffectsEngine* effectsEngine );
TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType );
~TrackHandler();
void addClip( Clip* clip, unsigned int trackId, qint64 start );
......@@ -56,7 +52,7 @@ class TrackHandler : public QObject
* track, it will be different.
* \param paused The renderer paused state
*/
void getOutput( qint64 currentFrame, qint64 subFrame,
void *getOutput( qint64 currentFrame, qint64 subFrame,
bool paused );
void activateAll();
qint64 getClipPosition( const QUuid& uuid, unsigned int trackId ) const;
......@@ -69,9 +65,6 @@ class TrackHandler : public QObject
Clip* getClip( const QUuid& uuid, unsigned int trackId );
void clear();
//FIXME: remove this. This should go by the effect engine.
AudioClipWorkflow::AudioSample* getTmpAudioBuffer() { return m_tmpAudioBuffer; }
bool endIsReached() const;
void save( QXmlStreamWriter& project ) const;
......@@ -109,8 +102,6 @@ class TrackHandler : public QObject
qint64 m_length;
unsigned int m_highestTrackNumber;
bool m_endReached;
EffectsEngine* m_effectEngine;
AudioClipWorkflow::AudioSample* m_tmpAudioBuffer;
private slots:
......
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