Commit d12f0578 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Moved TrackType enum to MainWorkflow class.

Some modifications should improve compile time a little bit.
parent 9b85e037
......@@ -34,7 +34,7 @@ void Commands::trigger( QUndoCommand* command )
Commands::MainWorkflow::AddClip::AddClip( ::MainWorkflow* workflow, Clip* clip,
unsigned int trackNumber, qint64 pos,
TrackWorkflow::TrackType trackType ) :
::MainWorkflow::TrackType trackType ) :
m_workflow( workflow ),
m_clip( clip ),
m_trackNumber( trackNumber ),
......@@ -56,7 +56,7 @@ void Commands::MainWorkflow::AddClip::undo()
Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, qint64 oldPos, unsigned int newTrack, qint64 newPos,
TrackWorkflow::TrackType trackType ) :
::MainWorkflow::TrackType trackType ) :
m_workflow( workflow ), m_uuid( uuid ), m_oldTrack( oldTrack ),
m_newTrack( newTrack ), m_pos( newPos ), m_oldPos( oldPos ),
m_trackType( trackType )
......@@ -94,7 +94,7 @@ void Commands::MainWorkflow::RemoveClips::undo()
}
Commands::MainWorkflow::ResizeClip::ResizeClip( ::MainWorkflow* mainWorkflow, const QUuid& uuid, unsigned int trackId,
qint64 newBegin, qint64 newEnd, TrackWorkflow::TrackType trackType ) :
qint64 newBegin, qint64 newEnd, ::MainWorkflow::TrackType trackType ) :
m_mainWorkflow( mainWorkflow ),
m_newBegin( newBegin ),
m_newEnd( newEnd ),
......
......@@ -41,24 +41,24 @@ namespace Commands
{
struct ClipActionInfo
{
Clip* clip;
quint32 trackNumber;
qint64 pos;
TrackWorkflow::TrackType trackType;
Clip* clip;
quint32 trackNumber;
qint64 pos;
::MainWorkflow::TrackType trackType;
};
NEW_COMMAND( AddClip )
{
public:
AddClip( ::MainWorkflow* workflow, Clip* clip, unsigned int trackNumber, qint64 pos, TrackWorkflow::TrackType trackType );
AddClip( ::MainWorkflow* workflow, Clip* clip, unsigned int trackNumber, qint64 pos, ::MainWorkflow::TrackType trackType );
virtual void redo();
virtual void undo();
private:
::MainWorkflow* m_workflow;
Clip* m_clip;
unsigned int m_trackNumber;
qint64 m_pos;
TrackWorkflow::TrackType m_trackType;
::MainWorkflow* m_workflow;
Clip* m_clip;
unsigned int m_trackNumber;
qint64 m_pos;
::MainWorkflow::TrackType m_trackType;
};
NEW_COMMAND( MoveClip )
......@@ -66,19 +66,19 @@ namespace Commands
public:
MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, qint64 oldPos, unsigned int newTrack,
qint64 newPos, TrackWorkflow::TrackType trackType );
qint64 newPos, ::MainWorkflow::TrackType trackType );
virtual void redo();
virtual void undo();
private:
::MainWorkflow* m_workflow;
QUuid m_uuid;
unsigned int m_oldTrack;
unsigned int m_newTrack;
qint64 m_pos;
qint64 m_oldPos;
bool m_undoRedoAction;
TrackWorkflow::TrackType m_trackType;
::MainWorkflow* m_workflow;
QUuid m_uuid;
unsigned int m_oldTrack;
unsigned int m_newTrack;
qint64 m_pos;
qint64 m_oldPos;
bool m_undoRedoAction;
::MainWorkflow::TrackType m_trackType;
};
NEW_COMMAND( RemoveClips )
......@@ -98,7 +98,7 @@ namespace Commands
public:
ResizeClip( ::MainWorkflow* mainWorkflow, const QUuid& uuid, unsigned int trackId,
qint64 newBegin, qint64 newEnd,
TrackWorkflow::TrackType trackType );
::MainWorkflow::TrackType trackType );
virtual void redo();
virtual void undo();
private:
......@@ -108,7 +108,7 @@ namespace Commands
qint64 m_newBegin;
qint64 m_newEnd;
Clip* m_clip;
TrackWorkflow::TrackType m_trackType;
::MainWorkflow::TrackType m_trackType;
};
}
}
......
......@@ -58,9 +58,9 @@ Timeline::Timeline( QWidget *parent ) :
setDuration( 0 );
connect( m_tracksView->horizontalScrollBar(), SIGNAL( valueChanged( int ) ), m_tracksRuler, SLOT( moveRuler( int ) ) );
connect( m_tracksView, SIGNAL( durationChanged(int) ), this, SLOT( setDuration(int) ) );
connect( m_mainWorkflow, SIGNAL( clipAdded(Clip*,uint,qint64,TrackWorkflow::TrackType ) ), this, SLOT( actionAddClip(Clip*,uint,qint64,TrackWorkflow::TrackType ) ) );
connect( m_mainWorkflow, SIGNAL( clipMoved(QUuid, uint, qint64,TrackWorkflow::TrackType ) ), this, SLOT( actionMoveClip(QUuid,uint,qint64,TrackWorkflow::TrackType ) ) );
connect( m_mainWorkflow, SIGNAL( clipRemoved(QUuid,uint,TrackWorkflow::TrackType ) ), this, SLOT( actionRemoveClip(QUuid,uint,TrackWorkflow::TrackType )) );
connect( m_mainWorkflow, SIGNAL( clipAdded(Clip*,uint,qint64,MainWorkflow::TrackType ) ), this, SLOT( actionAddClip(Clip*,uint,qint64,MainWorkflow::TrackType ) ) );
connect( m_mainWorkflow, SIGNAL( clipMoved(QUuid, uint, qint64,MainWorkflow::TrackType ) ), this, SLOT( actionMoveClip(QUuid,uint,qint64,MainWorkflow::TrackType ) ) );
connect( m_mainWorkflow, SIGNAL( clipRemoved(QUuid,uint,MainWorkflow::TrackType ) ), this, SLOT( actionRemoveClip(QUuid,uint,MainWorkflow::TrackType )) );
connect( m_mainWorkflow, SIGNAL( cleared() ), tracksView(), SLOT( clear() ) );
}
......@@ -99,19 +99,19 @@ void Timeline::setTool( ToolButtons button )
tracksView()->setTool( button );
}
void Timeline::actionAddClip( Clip* clip, unsigned int track, qint64 start, TrackWorkflow::TrackType )
void Timeline::actionAddClip( Clip* clip, unsigned int track, qint64 start, MainWorkflow::TrackType )
{
tracksView()->addMediaItem( clip, track, start );
}
void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, TrackWorkflow::TrackType )
void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, MainWorkflow::TrackType )
{
tracksView()->moveMediaItem( uuid, track, time );
tracksView()->updateDuration();
tracksRuler()->update();
}
void Timeline::actionRemoveClip( const QUuid& uuid, unsigned int track, TrackWorkflow::TrackType )
void Timeline::actionRemoveClip( const QUuid& uuid, unsigned int track, MainWorkflow::TrackType )
{
tracksView()->removeMediaItem( uuid, track );
}
......@@ -27,7 +27,6 @@
#include "ui_Timeline.h"
#include "TracksRuler.h"
#include "Workflow/MainWorkflow.h"
#include "Workflow/TrackWorkflow.h"
class TracksScene;
class TracksView;
......@@ -48,9 +47,9 @@ public slots:
void changeZoom( int factor );
void setDuration( int duration );
void setTool( ToolButtons button );
void actionAddClip( Clip* clip, unsigned int track, qint64 start, TrackWorkflow::TrackType );
void actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, TrackWorkflow::TrackType );
void actionRemoveClip( const QUuid& uuid, unsigned int track, TrackWorkflow::TrackType );
void actionAddClip( Clip* clip, unsigned int track, qint64 start, MainWorkflow::TrackType );
void actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, MainWorkflow::TrackType );
void actionRemoveClip( const QUuid& uuid, unsigned int track, MainWorkflow::TrackType );
protected:
virtual void changeEvent( QEvent *e );
......
......@@ -69,7 +69,7 @@ void TracksScene::keyPressEvent( QKeyEvent* keyEvent )
ai.clip = item->clip();
ai.trackNumber = item->trackNumber();
ai.pos = item->pos().x();
ai.trackType = TrackWorkflow::Video;
ai.trackType = MainWorkflow::Video;
clipsinfos.append( ai );
}
......
......@@ -41,7 +41,7 @@ TracksView::TracksView( QGraphicsScene* scene, MainWorkflow* mainWorkflow, QWidg
//TODO should be defined by the settings
m_tracksHeight = 25;
m_tracksCount = mainWorkflow->getTrackCount( TrackWorkflow::Video );
m_tracksCount = mainWorkflow->getTrackCount( MainWorkflow::Video );
m_numAudioTrack = 0;
m_numVideoTrack = 0;
......@@ -425,7 +425,7 @@ void TracksView::dropEvent( QDropEvent* event )
m_dragItem->clip(),
m_dragItem->trackNumber(),
(qint64)mappedXPos,
TrackWorkflow::Video ) );
MainWorkflow::Video ) );
// Commands::trigger( new Commands::MainWorkflow::AddClip( m_mainWorkflow,
// m_dragItem->clip(),
// m_dragItem->trackNumber(),
......@@ -581,7 +581,7 @@ void TracksView::mouseReleaseEvent( QMouseEvent* event )
movieItem->oldPosition,
movieItem->trackNumber(),
(qint64)movieItem->pos().x(),
TrackWorkflow::Video ) );
MainWorkflow::Video ) );
movieItem->oldTrackNumber = movieItem->trackNumber();
movieItem->oldPosition = movieItem->pos().x();
m_actionRelativeX = -1;
......@@ -723,5 +723,5 @@ void TracksView::split( GraphicsMovieItem* item, qint64 frame )
newclip,
item->trackNumber(),
item->pos().x() + frame,
TrackWorkflow::Video ) );
MainWorkflow::Video ) );
}
......@@ -24,6 +24,8 @@
#include <QtDebug>
#include "MainWorkflow.h"
#include "TrackWorkflow.h"
#include "TrackHandler.h"
//JUST FOR THE DEFINES !
//TODO:
......@@ -43,10 +45,10 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_effectEngine = new EffectsEngine;
m_effectEngine->disable();
m_tracks = new TrackHandler*[TrackWorkflow::NbType];
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
m_tracks = new TrackHandler*[MainWorkflow::NbType];
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
{
TrackWorkflow::TrackType trackType = (i == 0 ? TrackWorkflow::Video : TrackWorkflow::Audio );
MainWorkflow::TrackType trackType = (i == 0 ? MainWorkflow::Video : MainWorkflow::Audio );
m_tracks[i] = new TrackHandler( trackCount, trackType, m_effectEngine );
connect( m_tracks[i], SIGNAL( tracksPaused() ), this, SLOT( tracksPaused() ) );
connect( m_tracks[i], SIGNAL( tracksUnpaused() ), this, SLOT( tracksUnpaused() ) );
......@@ -65,7 +67,7 @@ MainWorkflow::~MainWorkflow()
delete m_synchroneRenderWaitCondition;
delete m_renderMutex;
delete m_renderStartedLock;
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
delete m_tracks[i];
delete[] m_tracks;
}
......@@ -76,7 +78,7 @@ EffectsEngine* MainWorkflow::getEffectsEngine()
}
void MainWorkflow::addClip( Clip* clip, unsigned int trackId,
qint64 start, TrackWorkflow::TrackType trackType )
qint64 start, MainWorkflow::TrackType trackType )
{
m_tracks[trackType]->addClip( clip, trackId, start );
computeLength();
......@@ -89,7 +91,7 @@ void MainWorkflow::computeLength()
{
qint64 maxLength = 0;
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
{
if ( m_tracks[i]->getLength() > maxLength )
maxLength = m_tracks[i]->getLength();
......@@ -101,7 +103,7 @@ void MainWorkflow::startRender()
{
m_renderStarted = true;
m_paused = false;
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
m_tracks[i]->startRender();
computeLength();
}
......@@ -113,7 +115,7 @@ void MainWorkflow::getOutput()
if ( m_renderStarted == true )
{
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
m_tracks[i]->getOutput( m_currentFrame );
if ( m_paused == false )
nextFrame();
......@@ -124,7 +126,7 @@ void MainWorkflow::pause()
{
QMutexLocker lock( m_renderMutex );
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
m_tracks[i]->pause();
}
......@@ -132,7 +134,7 @@ void MainWorkflow::unpause()
{
QMutexLocker lock( m_renderMutex );
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
m_tracks[i]->unpause();
}
......@@ -156,7 +158,7 @@ void MainWorkflow::setPosition( float pos )
{
//Since any track can be reactivated, we reactivate all of them, and let them
//unable themself if required.
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i)
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i)
m_tracks[i]->activateAll();
}
qint64 frame = static_cast<qint64>( (float)m_lengthFrame * pos );
......@@ -170,7 +172,7 @@ qint64 MainWorkflow::getLengthFrame() const
return m_lengthFrame;
}
qint64 MainWorkflow::getClipPosition( const QUuid& uuid, unsigned int trackId, TrackWorkflow::TrackType trackType ) const
qint64 MainWorkflow::getClipPosition( const QUuid& uuid, unsigned int trackId, MainWorkflow::TrackType trackType ) const
{
return m_tracks[trackType]->getClipPosition( uuid, trackId );
}
......@@ -180,7 +182,7 @@ void MainWorkflow::stop()
QWriteLocker lock( m_renderStartedLock );
m_renderStarted = false;
for (unsigned int i = 0; i < TrackWorkflow::NbType; ++i)
for (unsigned int i = 0; i < MainWorkflow::NbType; ++i)
m_tracks[i]->stop();
m_currentFrame = 0;
emit frameChanged( 0 );
......@@ -189,7 +191,7 @@ void MainWorkflow::stop()
void MainWorkflow::moveClip( const QUuid& clipUuid, unsigned int oldTrack,
unsigned int newTrack, qint64 startingFrame,
TrackWorkflow::TrackType trackType, bool undoRedoCommand /*= false*/ )
MainWorkflow::TrackType trackType, bool undoRedoCommand /*= false*/ )
{
m_tracks[trackType]->moveClip( clipUuid, oldTrack, newTrack, startingFrame );
computeLength();
......@@ -199,7 +201,7 @@ void MainWorkflow::moveClip( const QUuid& clipUuid, unsigned int oldTr
}
}
Clip* MainWorkflow::removeClip( const QUuid& uuid, unsigned int trackId, TrackWorkflow::TrackType trackType )
Clip* MainWorkflow::removeClip( const QUuid& uuid, unsigned int trackId, MainWorkflow::TrackType trackType )
{
emit clipRemoved( uuid, trackId, trackType );
return m_tracks[trackType]->removeClip( uuid, trackId );
......@@ -228,12 +230,12 @@ void MainWorkflow::cancelSynchronisation()
m_synchroneRenderWaitCondition->wakeAll();
}
void MainWorkflow::muteTrack( unsigned int trackId, TrackWorkflow::TrackType trackType )
void MainWorkflow::muteTrack( unsigned int trackId, MainWorkflow::TrackType trackType )
{
m_tracks[trackType]->muteTrack( trackId );
}
void MainWorkflow::unmuteTrack( unsigned int trackId, TrackWorkflow::TrackType trackType )
void MainWorkflow::unmuteTrack( unsigned int trackId, MainWorkflow::TrackType trackType )
{
m_tracks[trackType]->unmuteTrack( trackId );
}
......@@ -244,7 +246,7 @@ void MainWorkflow::setCurrentFrame( qint64 currentFrame )
emit positionChanged( (float)m_currentFrame / (float)m_lengthFrame );
}
Clip* MainWorkflow::getClip( const QUuid& uuid, unsigned int trackId, TrackWorkflow::TrackType trackType )
Clip* MainWorkflow::getClip( const QUuid& uuid, unsigned int trackId, MainWorkflow::TrackType trackType )
{
return m_tracks[trackType]->getClip( uuid, trackId );
}
......@@ -281,7 +283,7 @@ void MainWorkflow::loadProject( const QDomElement& project )
qint64 begin;
qint64 end;
qint64 startPos;
TrackWorkflow::TrackType trackType = TrackWorkflow::Video;
MainWorkflow::TrackType trackType = MainWorkflow::Video;
while ( clipProperty.isNull() == false )
{
......@@ -319,7 +321,7 @@ void MainWorkflow::loadProject( const QDomElement& project )
}
else if ( tagName == "trackType" )
{
trackType = static_cast<TrackWorkflow::TrackType>( clipProperty.text().toUInt( &ok ) );
trackType = static_cast<MainWorkflow::TrackType>( clipProperty.text().toUInt( &ok ) );
if ( ok == false )
{
qWarning() << "Invalid track type starting frame";
......@@ -344,7 +346,7 @@ void MainWorkflow::loadProject( const QDomElement& project )
void MainWorkflow::saveProject( QDomDocument& doc, QDomElement& rootNode )
{
QDomElement project = doc.createElement( "timeline" );
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
{
m_tracks[i]->save( doc, project );
}
......@@ -353,20 +355,20 @@ void MainWorkflow::saveProject( QDomDocument& doc, QDomElement& rootNode
void MainWorkflow::clear()
{
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
m_tracks[i]->clear();
emit cleared();
}
void MainWorkflow::setFullSpeedRender( bool value )
{
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
m_tracks[i]->setFullSpeedRender( value );
}
void MainWorkflow::tracksPaused()
{
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
if ( m_tracks[i]->isPaused() == false )
return ;
m_paused = true;
......@@ -375,7 +377,7 @@ void MainWorkflow::tracksPaused()
void MainWorkflow::tracksUnpaused()
{
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
if ( m_tracks[i]->isPaused() == true )
return ;
m_paused = false;
......@@ -384,7 +386,7 @@ void MainWorkflow::tracksUnpaused()
void MainWorkflow::tracksRenderCompleted()
{
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
for ( unsigned int i = 0; i < MainWorkflow::NbType; ++i )
if ( m_tracks[i]->allTracksRendered() == false )
return ;
{
......@@ -393,7 +395,7 @@ void MainWorkflow::tracksRenderCompleted()
m_synchroneRenderWaitCondition->wakeAll();
}
int MainWorkflow::getTrackCount( TrackWorkflow::TrackType trackType ) const
int MainWorkflow::getTrackCount( MainWorkflow::TrackType trackType ) const
{
return m_tracks[trackType]->getTrackCount();
}
......
......@@ -31,12 +31,13 @@
#include <QWaitCondition>
#include "Singleton.hpp"
#include "TrackWorkflow.h"
#include "TrackHandler.h"
#include "Clip.h"
#include "LightVideoFrame.h"
#include "EffectsEngine.h"
class TrackWorkflow;
class TrackHandler;
class MainWorkflow : public QObject, public Singleton<MainWorkflow>
{
Q_OBJECT
......@@ -47,7 +48,13 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
const LightVideoFrame* video;
unsigned char* audio;
};
void addClip( Clip* clip, unsigned int trackId, qint64 start, TrackWorkflow::TrackType type );
enum TrackType
{
Video,
NbType,
Audio,
};
void addClip( Clip* clip, unsigned int trackId, qint64 start, TrackType type );
void startRender();
void getOutput();
......@@ -86,11 +93,11 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
void nextFrame();
void previousFrame();
Clip* removeClip( const QUuid& uuid, unsigned int trackId, TrackWorkflow::TrackType trackType );
Clip* removeClip( const QUuid& uuid, unsigned int trackId, MainWorkflow::TrackType trackType );
void moveClip( const QUuid& uuid, unsigned int oldTrack,
unsigned int newTrack, qint64 pos,
TrackWorkflow::TrackType trackType, bool undoRedoCommand = false );
qint64 getClipPosition( const QUuid& uuid, unsigned int trackId, TrackWorkflow::TrackType trackType ) const;
MainWorkflow::TrackType trackType, bool undoRedoCommand = false );
qint64 getClipPosition( const QUuid& uuid, unsigned int trackId, MainWorkflow::TrackType trackType ) const;
/**
* \brief This method will wake every wait condition, so that threads won't
......@@ -98,8 +105,8 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
*/
void cancelSynchronisation();
void muteTrack( unsigned int trackId, TrackWorkflow::TrackType );
void unmuteTrack( unsigned int trackId, TrackWorkflow::TrackType );
void muteTrack( unsigned int trackId, MainWorkflow::TrackType );
void unmuteTrack( unsigned int trackId, MainWorkflow::TrackType );
/**
* \param uuid : The clip's uuid.
......@@ -109,12 +116,12 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
* \param trackType : the track type (audio or video)
* \returns The clip that matches the given UUID.
*/
Clip* getClip( const QUuid& uuid, unsigned int trackId, TrackWorkflow::TrackType trackType );
Clip* getClip( const QUuid& uuid, unsigned int trackId, MainWorkflow::TrackType trackType );
void clear();
void setFullSpeedRender( bool value );
int getTrackCount( TrackWorkflow::TrackType trackType ) const;
int getTrackCount( MainWorkflow::TrackType trackType ) const;
qint64 getCurrentFrame() const;
......@@ -166,9 +173,9 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
void mainWorkflowEndReached();
void mainWorkflowPaused();
void mainWorkflowUnpaused();
void clipAdded( Clip*, unsigned int, qint64, TrackWorkflow::TrackType );
void clipRemoved( QUuid, unsigned int, TrackWorkflow::TrackType );
void clipMoved( QUuid, unsigned int, qint64, TrackWorkflow::TrackType );
void clipAdded( Clip*, unsigned int, qint64, MainWorkflow::TrackType );
void clipRemoved( QUuid, unsigned int, MainWorkflow::TrackType );
void clipMoved( QUuid, unsigned int, qint64, MainWorkflow::TrackType );
void cleared();
};
......
......@@ -21,10 +21,11 @@
*****************************************************************************/
#include "TrackHandler.h"
#include "TrackWorkflow.h"
LightVideoFrame* TrackHandler::nullOutput = NULL;
TrackHandler::TrackHandler( unsigned int nbTracks, TrackWorkflow::TrackType trackType, EffectsEngine* effectsEngine ) :
TrackHandler::TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType, EffectsEngine* effectsEngine ) :
m_trackCount( nbTracks ),
m_trackType( trackType ),
m_length( 0 ),
......@@ -287,7 +288,7 @@ void TrackHandler::tracksRenderCompleted( unsigned int trackId )
--m_nbTracksToRender;
{
if ( m_trackType == TrackWorkflow::Video )
if ( m_trackType == MainWorkflow::Video )
{
LightVideoFrame* buff = reinterpret_cast<LightVideoFrame*>( m_tracks[trackId]->getSynchroneOutput() );
if ( buff == NULL )
......
......@@ -25,14 +25,16 @@
#include <QObject>
#include "Toggleable.hpp"
#include "TrackWorkflow.h"
#include "EffectsEngine.h"
#include "MainWorkflow.h"
class TrackWorkflow;
class TrackHandler : public QObject
{
Q_OBJECT
public:
TrackHandler( unsigned int nbTracks, TrackWorkflow::TrackType trackType, EffectsEngine* effectsEngine );
TrackHandler( unsigned int nbTracks, MainWorkflow::TrackType trackType, EffectsEngine* effectsEngine );
~TrackHandler();
void addClip( Clip* clip, unsigned int trackId, qint64 start );
......@@ -72,7 +74,7 @@ class TrackHandler : public QObject
unsigned int m_trackCount;
QAtomicInt m_nbTracksToPause;
QAtomicInt m_nbTracksToUnpause;
TrackWorkflow::TrackType m_trackType;
MainWorkflow::TrackType m_trackType;
qint64 m_length;
unsigned int m_highestTrackNumber;
unsigned int m_nbTracksToRender;
......
......@@ -27,7 +27,7 @@
#include "VideoClipWorkflow.h"
#include "AudioClipWorkflow.h"
TrackWorkflow::TrackWorkflow( unsigned int trackId, TrackWorkflow::TrackType type ) :
TrackWorkflow::TrackWorkflow( unsigned int trackId, MainWorkflow::TrackType type ) :
m_trackId( trackId ),
m_length( 0 ),
m_forceRepositionning( false ),
......@@ -56,10 +56,10 @@ TrackWorkflow::~TrackWorkflow()
void TrackWorkflow::addClip( Clip* clip, qint64 start )
{
if ( m_trackType == Audio )
if ( m_trackType == MainWorkflow::Audio )
start = 0;
ClipWorkflow* cw;
if ( m_trackType == TrackWorkflow::Video )
if ( m_trackType == MainWorkflow::Video )
cw = new VideoClipWorkflow( clip );
else
cw = new AudioClipWorkflow( clip );
......
......@@ -33,6 +33,7 @@
#include "ClipWorkflow.h"
#include "LightVideoFrame.h"
#include "MainWorkflow.h"
//TODO: REMOVE THIS
#ifndef FPS
......@@ -48,13 +49,7 @@ class TrackWorkflow : public QObject
Q_OBJECT
public:
enum TrackType
{
Video,
NbType,
Audio,
};
TrackWorkflow( unsigned int trackId, TrackType type );
TrackWorkflow( unsigned int trackId, MainWorkflow::TrackType type );
~TrackWorkflow();
bool getOutput( qint64 currentFrame );
......@@ -122,7 +117,7 @@ class TrackWorkflow : public QObject
void* m_synchroneRenderBuffer;
TrackType m_trackType;
MainWorkflow::TrackType m_trackType;
private slots:
void clipWorkflowPaused();
......
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