Commit d443c2c2 authored by Vincent Carrubba's avatar Vincent Carrubba Committed by Hugo Beauzee-Luyssen

disabling the effects engine thru the effect menu is now possible

parent 3a9af037
......@@ -398,3 +398,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();
return ;
}
......@@ -39,6 +39,8 @@
#include "PreviewWidget.h"
#include "ListViewMediaItem.h"
#include "Settings.h"
#include "EffectsEngine.h"
#include "MainWorkflow.h"
class MainWindow : public QMainWindow
{
......@@ -76,6 +78,7 @@ private:
Settings* m_projectPreferences;
private slots:
void on_actionBypass_effects_engine_toggled(bool );
void on_actionFullscreen_triggered( bool checked );
void on_actionQuit_triggered();
void on_actionAbout_triggered();
......
......@@ -27,7 +27,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
<height>21</height>
<height>26</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
......@@ -54,11 +54,12 @@
</widget>
<widget class="QMenu" name="menuEffets">
<property name="enabled">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="title">
<string>Effects</string>
</property>
<addaction name="actionBypass_effects_engine"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
......@@ -177,6 +178,17 @@
<string>Save</string>
</property>
</action>
<action name="actionBypass_effects_engine">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Enable effects engine</string>
</property>
</action>
</widget>
<resources>
<include location="../../../ressources.qrc"/>
......
......@@ -54,9 +54,6 @@ MainWorkflow::MainWorkflow( int trackCount ) :
}
m_outputBuffers = new OutputBuffers;
m_effectEngine = new EffectsEngine;
m_effectEngine->disable();
m_nbTracksToRenderMutex = new QMutex;
}
......@@ -78,6 +75,11 @@ MainWorkflow::~MainWorkflow()
delete blackOutput;
}
EffectsEngine* MainWorkflow::getEffectsEngine(void)
{
return ( m_effectEngine );
}
void MainWorkflow::addClip( Clip* clip, unsigned int trackId,
qint64 start, TrackWorkflow::TrackType trackType )
{
......@@ -207,48 +209,7 @@ Clip* MainWorkflow::removeClip( const QUuid& uuid, unsigned int trackId, T
return m_tracks[trackType]->removeClip( uuid, trackId );
}
<<<<<<< HEAD:src/Workflow/MainWorkflow.cpp
MainWorkflow::OutputBuffers* MainWorkflow::getSynchroneOutput()
=======
void MainWorkflow::trackUnpaused()
{
m_nbTracksToUnpause.fetchAndAddAcquire( -1 );
if ( m_nbTracksToUnpause <= 0 )
{
m_paused = false;
emit mainWorkflowUnpaused();
}
}
void MainWorkflow::tracksRenderCompleted( unsigned int trackId )
{
// qDebug() << "tracksRenderCompleted";
QMutexLocker lockNbTracks( m_nbTracksToRenderMutex );
--m_nbTracksToRender;
{
LightVideoFrame* buff = m_tracks[trackId]->getSynchroneOutput();
if ( buff == NULL )
m_effectEngine->setInputFrame( *MainWorkflow::nullOutput, trackId );
else
m_effectEngine->setInputFrame( *buff, trackId );
}
//We check for minus or equal, since we can have 0 frame to compute,
//therefore, m_nbTracksToRender will be equal to -1
if ( m_nbTracksToRender <= 0 )
{
// qDebug() << "main workflow render completed";
//Just a synchronisation barriere
{
QMutexLocker lock( m_synchroneRenderWaitConditionMutex );
}
//FIXME: This is uggly.... god probably just killed a kitten :(
m_synchroneRenderWaitCondition->wakeAll();
}
}
const LightVideoFrame* MainWorkflow::getSynchroneOutput()
>>>>>>> Merge new version with Workflow:src/Workflow/MainWorkflow.cpp
{
m_synchroneRenderWaitConditionMutex->lock();
getOutput();
......@@ -258,17 +219,9 @@ const LightVideoFrame* MainWorkflow::getSynchroneOutput()
m_effectEngine->render();
m_synchroneRenderingBuffer = &( m_effectEngine->getOutputFrame( 0 ) );
m_synchroneRenderWaitConditionMutex->unlock();
<<<<<<< HEAD:src/Workflow/MainWorkflow.cpp
m_outputBuffers->video = m_tracks[TrackWorkflow::Video]->getSynchroneOutput();
m_outputBuffers->audio = m_tracks[TrackWorkflow::Audio]->getSynchroneOutput();
return m_outputBuffers;
=======
if ( (*m_synchroneRenderingBuffer)->frame.octets == NULL )
return MainWorkflow::blackOutput;
return m_synchroneRenderingBuffer;
>>>>>>> Merge new version with Workflow:src/Workflow/MainWorkflow.cpp
}
void MainWorkflow::cancelSynchronisation()
......
......@@ -48,6 +48,8 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
unsigned char* audio;
};
void addClip( Clip* clip, unsigned int trackId, qint64 start, TrackWorkflow::TrackType type );
EffectsEngine* getEffectsEngine( void );
void startRender();
void getOutput();
OutputBuffers* getSynchroneOutput();
......
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