Commit 24744cda authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding a TrackType enum to trackworkflow, so that we can have video and audio tracks

parent 05c24916
......@@ -44,7 +44,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_tracks = new Toggleable<TrackWorkflow*>[trackCount];
for ( int i = 0; i < trackCount; ++i )
{
m_tracks[i].setPtr( new TrackWorkflow( i ) );
m_tracks[i].setPtr( new TrackWorkflow( i, TrackWorkflow::Video ) );
connect( m_tracks[i], SIGNAL( trackEndReached( unsigned int ) ), this, SLOT( trackEndReached(unsigned int) ) );
connect( m_tracks[i], SIGNAL( trackPaused() ), this, SLOT( trackPaused() ) );
connect( m_tracks[i], SIGNAL( trackUnpaused() ), this, SLOT( trackUnpaused() ) );
......
......@@ -26,12 +26,13 @@
#include "TrackWorkflow.h"
#include "VideoClipWorkflow.h"
TrackWorkflow::TrackWorkflow( unsigned int trackId ) :
TrackWorkflow::TrackWorkflow( unsigned int trackId, TrackWorkflow::TrackType type ) :
m_trackId( trackId ),
m_length( 0 ),
m_forceRepositionning( false ),
m_paused( false ),
m_synchroneRenderBuffer( NULL )
m_synchroneRenderBuffer( NULL ),
m_trackType( type )
{
m_forceRepositionningMutex = new QMutex;
m_clipsLock = new QReadWriteLock;
......@@ -54,7 +55,9 @@ TrackWorkflow::~TrackWorkflow()
void TrackWorkflow::addClip( Clip* clip, qint64 start )
{
ClipWorkflow* cw = new VideoClipWorkflow( clip );
ClipWorkflow* cw;
if ( m_trackType == TrackWorkflow::Video )
cw = new VideoClipWorkflow( clip );
addClip( cw, start );
}
......
......@@ -47,7 +47,12 @@ class TrackWorkflow : public QObject
Q_OBJECT
public:
TrackWorkflow( unsigned int trackId );
enum TrackType
{
Video,
Audio,
};
TrackWorkflow( unsigned int trackId, TrackType type );
~TrackWorkflow();
bool getOutput( qint64 currentFrame );
......@@ -115,6 +120,8 @@ class TrackWorkflow : public QObject
unsigned char* m_synchroneRenderBuffer;
TrackType m_trackType;
private slots:
void clipWorkflowPaused();
void clipWorkflowUnpaused();
......
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