Commit 219da3e0 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Relocating TrackType to Types.h, in the Workflow namespace.

parent ac5e3396
......@@ -45,7 +45,7 @@ void Commands::trigger( Commands::Generic* command )
Commands::MainWorkflow::AddClip::AddClip( ClipHelper* ch,
unsigned int trackNumber, qint64 pos,
::MainWorkflow::TrackType trackType,
Workflow::TrackType trackType,
bool undoRedoAction /*= false*/ ) :
m_trackNumber( trackNumber ),
m_pos( pos ),
......@@ -73,7 +73,7 @@ void Commands::MainWorkflow::AddClip::undo()
Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, unsigned int newTrack, qint64 newPos,
::MainWorkflow::TrackType trackType ) :
Workflow::TrackType trackType ) :
m_workflow( workflow ), m_uuid( uuid ), m_oldTrack( oldTrack ),
m_newTrack( newTrack ), m_pos( newPos ), m_trackType( trackType )
{
......@@ -101,7 +101,7 @@ void Commands::MainWorkflow::MoveClip::undo()
}
Commands::MainWorkflow::RemoveClip::RemoveClip( ClipHelper* ch, quint32 trackNumber,
qint64 pos, ::MainWorkflow::TrackType trackType ) :
qint64 pos, Workflow::TrackType trackType ) :
m_clipHelper( ch ), m_trackNumber( trackNumber ),
m_pos( pos ), m_trackType( trackType )
{
......@@ -122,7 +122,7 @@ Commands::MainWorkflow::ResizeClip::ResizeClip( ClipHelper* clipHelper,
qint64 oldBegin, qint64 oldEnd,
qint64 newPos, qint64 oldPos,
quint32 trackId,
::MainWorkflow::TrackType trackType ) :
Workflow::TrackType trackType ) :
m_newBegin( newBegin ),
m_newEnd( newEnd ),
m_oldBegin( oldBegin ),
......@@ -160,7 +160,7 @@ void Commands::MainWorkflow::ResizeClip::undo()
}
Commands::MainWorkflow::SplitClip::SplitClip( ClipHelper* toSplit, quint32 trackId,
qint64 newClipPos, qint64 newClipBegin, ::MainWorkflow::TrackType trackType ) :
qint64 newClipPos, qint64 newClipBegin, Workflow::TrackType trackType ) :
m_toSplit( toSplit ),
m_newClip( NULL ),
m_trackId( trackId ),
......
......@@ -31,6 +31,7 @@
#include <QObject>
#include <QVector>
#include "MainWorkflow.h"
#include "Types.h"
class Clip;
class ClipHelper;
......@@ -63,14 +64,14 @@ namespace Commands
{
public:
AddClip( ClipHelper* ch, unsigned int trackNumber, qint64 pos,
::MainWorkflow::TrackType trackType, bool undoRedoAction = false );
Workflow::TrackType trackType, bool undoRedoAction = false );
virtual ~AddClip();
virtual void redo();
virtual void undo();
private:
unsigned int m_trackNumber;
qint64 m_pos;
::MainWorkflow::TrackType m_trackType;
Workflow::TrackType m_trackType;
ClipHelper *m_clipHelper;
bool m_undoRedoAction;
};
......@@ -80,7 +81,7 @@ namespace Commands
public:
MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, unsigned int newTrack,
qint64 newPos, ::MainWorkflow::TrackType trackType );
qint64 newPos, Workflow::TrackType trackType );
virtual void redo();
virtual void undo();
......@@ -92,14 +93,14 @@ namespace Commands
qint64 m_pos;
qint64 m_oldPos;
bool m_undoRedoAction;
::MainWorkflow::TrackType m_trackType;
Workflow::TrackType m_trackType;
};
NEW_COMMAND( RemoveClip )
{
public:
RemoveClip( ClipHelper* clip, unsigned int trackNumber,
qint64 pos, ::MainWorkflow::TrackType trackType );
qint64 pos, Workflow::TrackType trackType );
virtual void redo();
virtual void undo();
......@@ -107,7 +108,7 @@ namespace Commands
ClipHelper* m_clipHelper;
unsigned int m_trackNumber;
qint64 m_pos;
::MainWorkflow::TrackType m_trackType;
Workflow::TrackType m_trackType;
};
/**
......@@ -127,7 +128,7 @@ namespace Commands
ResizeClip( ClipHelper* clipHelper,
qint64 newBegin, qint64 newEnd, qint64 oldBegin,
qint64 oldEnd, qint64 newPos, qint64 oldPos,
quint32 trackId, ::MainWorkflow::TrackType trackType );
quint32 trackId, Workflow::TrackType trackType );
virtual void redo();
virtual void undo();
private:
......@@ -139,7 +140,7 @@ namespace Commands
qint64 m_oldPos;
quint32 m_trackId;
ClipHelper* m_clipHelper;
::MainWorkflow::TrackType m_trackType;
Workflow::TrackType m_trackType;
bool m_undoRedoAction;
};
......@@ -147,7 +148,7 @@ namespace Commands
{
public:
SplitClip( ClipHelper* toSplit, quint32 trackId, qint64 newClipPos,
qint64 newClipBegin, ::MainWorkflow::TrackType trackType );
qint64 newClipBegin, Workflow::TrackType trackType );
~SplitClip();
virtual void redo();
virtual void undo();
......@@ -157,7 +158,7 @@ namespace Commands
quint32 m_trackId;
qint64 m_newClipPos;
qint64 m_newClipBegin;
::MainWorkflow::TrackType m_trackType;
Workflow::TrackType m_trackType;
};
}
}
......
......@@ -72,7 +72,7 @@ MainWindow::MainWindow( QWidget *parent ) :
{
m_ui.setupUi( this );
qRegisterMetaType<MainWorkflow::TrackType>( "MainWorkflow::TrackType" );
qRegisterMetaType<Workflow::TrackType>( "Workflow::TrackType" );
qRegisterMetaType<MainWorkflow::FrameChangedReason>( "MainWorkflow::FrameChangedReason" );
qRegisterMetaType<QVariant>( "QVariant" );
......
......@@ -76,7 +76,7 @@ public:
TracksScene* scene();
/// Return the type of the media
virtual MainWorkflow::TrackType mediaType() const = 0;
virtual Workflow::TrackType mediaType() const = 0;
/// Group two items together
void group( AbstractGraphicsMediaItem* item );
......
......@@ -66,9 +66,9 @@ GraphicsAudioItem::~GraphicsAudioItem()
{
}
MainWorkflow::TrackType GraphicsAudioItem::mediaType() const
Workflow::TrackType GraphicsAudioItem::mediaType() const
{
return MainWorkflow::AudioTrack;
return Workflow::AudioTrack;
}
void GraphicsAudioItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* )
......
......@@ -51,7 +51,7 @@ public:
virtual int type() const { return Type; }
virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; }
virtual MainWorkflow::TrackType mediaType() const;
virtual Workflow::TrackType mediaType() const;
virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );
protected:
......
......@@ -66,9 +66,9 @@ GraphicsMovieItem::~GraphicsMovieItem()
{
}
MainWorkflow::TrackType GraphicsMovieItem::mediaType() const
Workflow::TrackType GraphicsMovieItem::mediaType() const
{
return MainWorkflow::VideoTrack;
return Workflow::VideoTrack;
}
void GraphicsMovieItem::paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* )
......
......@@ -52,7 +52,7 @@ public:
virtual int type() const { return Type; }
virtual bool expandable() const { return false; }
virtual bool moveable() const { return true; }
virtual MainWorkflow::TrackType mediaType() const;
virtual Workflow::TrackType mediaType() const;
virtual void paint( QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0 );
protected:
......
......@@ -24,7 +24,7 @@
#include "TracksView.h"
#include "GraphicsTrack.h"
GraphicsTrack::GraphicsTrack( MainWorkflow::TrackType type, quint32 trackNumber,
GraphicsTrack::GraphicsTrack( Workflow::TrackType type, quint32 trackNumber,
QGraphicsItem *parent ) : QGraphicsWidget( parent )
{
m_type = type;
......@@ -75,7 +75,7 @@ GraphicsTrack::trackNumber()
return m_trackNumber;
}
MainWorkflow::TrackType
Workflow::TrackType
GraphicsTrack::mediaType()
{
return m_type;
......
......@@ -36,7 +36,7 @@ class GraphicsTrack : public QGraphicsWidget
public:
enum { Type = UserType + 2 };
GraphicsTrack( MainWorkflow::TrackType type, quint32 trackNumber,
GraphicsTrack( Workflow::TrackType type, quint32 trackNumber,
QGraphicsItem *parent = 0 );
void setHeight( int height );
......@@ -44,13 +44,13 @@ public:
void setTrackEnabled( bool enabled );
bool isEnabled();
quint32 trackNumber();
MainWorkflow::TrackType mediaType();
Workflow::TrackType mediaType();
virtual int type() const { return Type; }
QList<AbstractGraphicsMediaItem*> childs();
private:
MainWorkflow::TrackType m_type;
Workflow::TrackType m_type;
quint32 m_trackNumber;
bool m_enabled;
};
......
......@@ -85,12 +85,12 @@ Timeline::Timeline( WorkflowRenderer* renderer, QWidget *parent ) :
connect( m_tracksView, SIGNAL( durationChanged(int) ), this, SLOT( setDuration(int) ) );
// Clip actions
connect( m_mainWorkflow, SIGNAL( clipAdded(ClipHelper*,uint,qint64,MainWorkflow::TrackType ) ),
this, SLOT( actionAddClip(ClipHelper*,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(const QUuid&,uint,MainWorkflow::TrackType ) ),
this, SLOT( actionRemoveClip(const QUuid&,uint,MainWorkflow::TrackType )) );
connect( m_mainWorkflow, SIGNAL( clipAdded( ClipHelper*, uint, qint64, Workflow::TrackType ) ),
this, SLOT( actionAddClip(ClipHelper*, uint, qint64, Workflow::TrackType ) ) );
connect( m_mainWorkflow, SIGNAL( clipMoved( QUuid, uint, qint64, Workflow::TrackType ) ),
this, SLOT( actionMoveClip(QUuid, uint, qint64, Workflow::TrackType ) ) );
connect( m_mainWorkflow, SIGNAL( clipRemoved( const QUuid&, uint, Workflow::TrackType ) ),
this, SLOT( actionRemoveClip( const QUuid&, uint, Workflow::TrackType )) );
// Clear / reset
connect( m_mainWorkflow, SIGNAL( cleared() ), m_tracksControls, SLOT( clear() ) );
......@@ -163,12 +163,12 @@ void Timeline::setTool( ToolButtons button )
tracksView()->setTool( button );
}
void Timeline::actionAddClip( ClipHelper* clipHelper, unsigned int track, qint64 start, MainWorkflow::TrackType trackType )
void Timeline::actionAddClip( ClipHelper* clipHelper, unsigned int track, qint64 start, Workflow::TrackType trackType )
{
tracksView()->addMediaItem( clipHelper, track, trackType, start );
}
void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, MainWorkflow::TrackType )
void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, Workflow::TrackType )
{
tracksView()->moveMediaItem( uuid, track, time );
Q_ASSERT( tracksView()->setItemOldTrack( uuid, track ) == true );
......@@ -176,7 +176,7 @@ void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 tim
tracksRuler()->update();
}
void Timeline::actionRemoveClip( const QUuid &uuid, unsigned int track, MainWorkflow::TrackType trackType )
void Timeline::actionRemoveClip( const QUuid &uuid, unsigned int track, Workflow::TrackType trackType )
{
tracksView()->removeMediaItem( uuid, track, trackType );
}
......
......@@ -85,20 +85,20 @@ public slots:
* \param start The position in frames.
* \param
*/
void actionAddClip( ClipHelper* clip, unsigned int track, qint64 start, MainWorkflow::TrackType trackType );
void actionAddClip( ClipHelper* clip, unsigned int track, qint64 start, Workflow::TrackType trackType );
/**
* \brief Move an item in the timeline.
* \param uuid The Universally Unique Identifier of the item.
* \param track The new track of the item.
* \param time The new position (in frames) of the item.
*/
void actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, MainWorkflow::TrackType );
void actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, Workflow::TrackType );
/**
* \brief Remove an item from the timeline.
* \param uuid The Universally Unique Identifier of the item.
* \param track The current track of the item.
*/
void actionRemoveClip( const QUuid& uuid, unsigned int track, MainWorkflow::TrackType trackType );
void actionRemoveClip( const QUuid& uuid, unsigned int track, Workflow::TrackType trackType );
void dragEnterEvent( QDragEnterEvent *event );
void dropEvent( QDropEvent *event );
......
......@@ -113,7 +113,7 @@ TracksView::createLayout()
void
TracksView::addVideoTrack()
{
GraphicsTrack *track = new GraphicsTrack( MainWorkflow::VideoTrack, m_numVideoTrack );
GraphicsTrack *track = new GraphicsTrack( Workflow::VideoTrack, m_numVideoTrack );
track->setHeight( m_tracksHeight );
m_layout->insertItem( 0, track );
m_layout->activate();
......@@ -126,7 +126,7 @@ TracksView::addVideoTrack()
void
TracksView::addAudioTrack()
{
GraphicsTrack *track = new GraphicsTrack( MainWorkflow::AudioTrack, m_numAudioTrack );
GraphicsTrack *track = new GraphicsTrack( Workflow::AudioTrack, m_numAudioTrack );
track->setHeight( m_tracksHeight );
m_layout->insertItem( 1000, track );
m_layout->activate();
......@@ -204,7 +204,7 @@ TracksView::removeClip( const QUuid& uuid )
// Saving its values
QUuid itemUuid = item->uuid();
quint32 itemTn = item->trackNumber();
MainWorkflow::TrackType itemTt = item->mediaType();
Workflow::TrackType itemTt = item->mediaType();
// Remove the item from the timeline
removeMediaItem( itemUuid, itemTn, itemTt );
......@@ -218,13 +218,13 @@ TracksView::removeClip( const QUuid& uuid )
}
void
TracksView::addMediaItem( ClipHelper *ch, unsigned int track, MainWorkflow::TrackType trackType, qint64 start )
TracksView::addMediaItem( ClipHelper *ch, unsigned int track, Workflow::TrackType trackType, qint64 start )
{
Q_ASSERT( ch );
// If there is not enough tracks to insert
// the clip do it now.
if ( trackType == MainWorkflow::VideoTrack )
if ( trackType == Workflow::VideoTrack )
{
if ( track + 1 >= m_numVideoTrack )
{
......@@ -233,7 +233,7 @@ TracksView::addMediaItem( ClipHelper *ch, unsigned int track, MainWorkflow::Trac
addVideoTrack();
}
}
else if ( trackType == MainWorkflow::AudioTrack )
else if ( trackType == Workflow::AudioTrack )
{
if ( track + 1 >= m_numAudioTrack )
{
......@@ -244,13 +244,13 @@ TracksView::addMediaItem( ClipHelper *ch, unsigned int track, MainWorkflow::Trac
}
AbstractGraphicsMediaItem *item = 0;
if ( trackType == MainWorkflow::VideoTrack )
if ( trackType == Workflow::VideoTrack )
{
item = new GraphicsMovieItem( ch );
connect( item, SIGNAL( split(AbstractGraphicsMediaItem*,qint64) ),
this, SLOT( split(AbstractGraphicsMediaItem*,qint64) ) );
}
else if ( trackType == MainWorkflow::AudioTrack )
else if ( trackType == Workflow::AudioTrack )
{
item = new GraphicsAudioItem( ch );
connect( item, SIGNAL( split(AbstractGraphicsMediaItem*,qint64) ),
......@@ -360,7 +360,7 @@ TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position )
GraphicsTrack *track = NULL;
if ( !m_lastKnownTrack )
m_lastKnownTrack = getTrack( MainWorkflow::VideoTrack, 0 );
m_lastKnownTrack = getTrack( Workflow::VideoTrack, 0 );
QList<QGraphicsItem*> list = items( 0, position.y() );
for ( int i = 0; i < list.size(); ++i )
......@@ -389,12 +389,12 @@ void
TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, quint32 track, qint64 time )
{
// Add missing tracks
if ( item->mediaType() == MainWorkflow::AudioTrack )
if ( item->mediaType() == Workflow::AudioTrack )
{
while ( track >= m_numAudioTrack )
addAudioTrack();
}
else if ( item->mediaType() == MainWorkflow::VideoTrack )
else if ( item->mediaType() == Workflow::VideoTrack )
{
while ( track >= m_numVideoTrack )
addVideoTrack();
......@@ -407,12 +407,12 @@ TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, quint32 track, qint6
bool validPosFound = false;
// Add missing tracks for the target
if ( item->groupItem()->mediaType() == MainWorkflow::AudioTrack )
if ( item->groupItem()->mediaType() == Workflow::AudioTrack )
{
while ( p.track() >= m_numAudioTrack )
addAudioTrack();
}
else if ( item->groupItem()->mediaType() == MainWorkflow::VideoTrack )
else if ( item->groupItem()->mediaType() == Workflow::VideoTrack )
{
while ( p.track() >= m_numVideoTrack )
addVideoTrack();
......@@ -422,12 +422,12 @@ TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, quint32 track, qint6
ItemPosition p2 = findPosition( item->groupItem(), track, time );
// Add missing tracks for the source
if ( item->mediaType() == MainWorkflow::AudioTrack )
if ( item->mediaType() == Workflow::AudioTrack )
{
while ( p2.track() >= m_numAudioTrack )
addAudioTrack();
}
else if ( item->mediaType() == MainWorkflow::VideoTrack )
else if ( item->mediaType() == Workflow::VideoTrack )
{
while ( p2.track() >= m_numVideoTrack )
addVideoTrack();
......@@ -518,9 +518,9 @@ TracksView::findPosition( AbstractGraphicsMediaItem *item, quint32 track, qint64
else if ( currentItem->trackNumber() <= track )
{
int higherTrack = 0;
if ( item->mediaType() == MainWorkflow::VideoTrack )
if ( item->mediaType() == Workflow::VideoTrack )
higherTrack = m_numVideoTrack;
else if ( item->mediaType() == MainWorkflow::AudioTrack )
else if ( item->mediaType() == Workflow::AudioTrack )
higherTrack = m_numAudioTrack;
if ( track >= higherTrack - 1 )
......@@ -595,7 +595,7 @@ TracksView::findPosition( AbstractGraphicsMediaItem *item, quint32 track, qint64
}
void
TracksView::removeMediaItem( const QUuid &uuid, unsigned int trackId, MainWorkflow::TrackType trackType )
TracksView::removeMediaItem( const QUuid &uuid, unsigned int trackId, Workflow::TrackType trackType )
{
GraphicsTrack *track = getTrack( trackType, trackId );
......@@ -668,7 +668,7 @@ TracksView::dropEvent( QDropEvent *event )
if ( m_dragAudioItem )
{
updateDuration();
if ( getTrack( MainWorkflow::AudioTrack, m_numAudioTrack - 1 )->childItems().count() > 0 )
if ( getTrack( Workflow::AudioTrack, m_numAudioTrack - 1 )->childItems().count() > 0 )
addAudioTrack();
event->acceptProposedAction();
......@@ -678,14 +678,14 @@ TracksView::dropEvent( QDropEvent *event )
Commands::trigger( new Commands::MainWorkflow::AddClip( m_dragAudioItem->clipHelper(),
m_dragAudioItem->trackNumber(),
(qint64)mappedXPos,
MainWorkflow::AudioTrack ) );
Workflow::AudioTrack ) );
m_dragAudioItem = NULL;
}
if ( m_dragVideoItem )
{
updateDuration();
if ( getTrack( MainWorkflow::VideoTrack, m_numVideoTrack - 1 )->childItems().count() > 0 )
if ( getTrack( Workflow::VideoTrack, m_numVideoTrack - 1 )->childItems().count() > 0 )
addVideoTrack();
event->acceptProposedAction();
......@@ -695,7 +695,7 @@ TracksView::dropEvent( QDropEvent *event )
Commands::trigger( new Commands::MainWorkflow::AddClip( m_dragVideoItem->clipHelper(),
m_dragVideoItem->trackNumber(),
(qint64)mappedXPos,
MainWorkflow::VideoTrack ) );
Workflow::VideoTrack ) );
m_dragVideoItem = NULL;
}
......@@ -748,7 +748,7 @@ TracksView::drawBackground( QPainter *painter, const QRectF &rect )
if ( !track ) continue;
QRectF trackRect = track->mapRectToScene( track->boundingRect() );
if ( track->mediaType() == MainWorkflow::VideoTrack )
if ( track->mediaType() == Workflow::VideoTrack )
painter->drawLine( rect.left(), trackRect.top(), rect.right() + 1, trackRect.top() );
else
painter->drawLine( rect.left(), trackRect.bottom(), rect.right() + 1, trackRect.bottom() );
......@@ -923,9 +923,9 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
updateDuration();
if ( getTrack( MainWorkflow::VideoTrack, m_numVideoTrack - 1 )->childItems().count() > 0 )
if ( getTrack( Workflow::VideoTrack, m_numVideoTrack - 1 )->childItems().count() > 0 )
addVideoTrack();
if ( getTrack( MainWorkflow::AudioTrack, m_numAudioTrack - 1 )->childItems().count() > 0 )
if ( getTrack( Workflow::AudioTrack, m_numAudioTrack - 1 )->childItems().count() > 0 )
addAudioTrack();
UndoStack::getInstance()->beginMacro( "Move clip" );
......@@ -1121,12 +1121,12 @@ TracksView::updateDuration()
}
void
TracksView::cleanTracks( MainWorkflow::TrackType type )
TracksView::cleanTracks( Workflow::TrackType type )
{
int tracksToCheck;
int tracksToRemove = 0;
if ( type == MainWorkflow::VideoTrack )
if ( type == Workflow::VideoTrack )
tracksToCheck = m_numVideoTrack;
else
tracksToCheck = m_numAudioTrack;
......@@ -1147,7 +1147,7 @@ TracksView::cleanTracks( MainWorkflow::TrackType type )
while ( tracksToRemove > 1 )
{
if ( type == MainWorkflow::VideoTrack )
if ( type == Workflow::VideoTrack )
removeVideoTrack();
else
removeAudioTrack();
......@@ -1159,13 +1159,13 @@ void
TracksView::cleanUnusedTracks()
{
// Video
cleanTracks( MainWorkflow::VideoTrack );
cleanTracks( Workflow::VideoTrack );
// Audio
cleanTracks( MainWorkflow::AudioTrack );
cleanTracks( Workflow::AudioTrack );
}
GraphicsTrack*
TracksView::getTrack( MainWorkflow::TrackType type, unsigned int number )
TracksView::getTrack( Workflow::TrackType type, unsigned int number )
{
for (int i = 0; i < m_layout->count(); ++i )
{
......
......@@ -201,7 +201,7 @@ public slots:
* \param start The position in frames.
*/
void addMediaItem( ClipHelper *clipHelper, unsigned int track,
MainWorkflow::TrackType trackType, qint64 start );
Workflow::TrackType trackType, qint64 start );
/**
* \brief Move an item in the timeline.
* \param uuid The Universally Unique Identifier of the item.
......@@ -215,7 +215,7 @@ public slots:
* \param track The current track of the item.
* \param trackType The type of the track (Audio or Video)
*/
void removeMediaItem( const QUuid &uuid, unsigned int track, MainWorkflow::TrackType trackType );
void removeMediaItem( const QUuid &uuid, unsigned int track, Workflow::TrackType trackType );
/**
* \brief This is an overloaded method provided for convenience.
* \param item A pointer to AbstractGraphicsMediaItem.
......@@ -289,7 +289,7 @@ private:
/**
* \brief DOCUMENT ME
*/
void cleanTracks( MainWorkflow::TrackType type );
void cleanTracks( Workflow::TrackType type );
/**
* \brief This is an overloaded method provided for convenience.
......@@ -315,7 +315,7 @@ private:
* \param number The track number.
* \return A pointer to the GraphicsTrack.
*/
GraphicsTrack *getTrack( MainWorkflow::TrackType type, unsigned int number );
GraphicsTrack *getTrack( Workflow::TrackType type, unsigned int number );
QGraphicsScene *m_scene;
int m_tracksHeight;
int m_projectDuration;
......
......@@ -42,9 +42,9 @@ TrackControls::~TrackControls()
void TrackControls::updateTextLabels()
{
if ( m_track->mediaType() == MainWorkflow::VideoTrack )
if ( m_track->mediaType() == Workflow::VideoTrack )
m_ui->trackLabel->setText( tr( "Video #%1" ).arg( QString::number( m_track->trackNumber() + 1 ) ) );
else if ( m_track->mediaType() == MainWorkflow::AudioTrack )
else if ( m_track->mediaType() == Workflow::AudioTrack )
m_ui->trackLabel->setText( tr( "Audio #%1" ).arg( QString::number( m_track->trackNumber() + 1 ) ) );
}
......@@ -66,16 +66,16 @@ void TrackControls::setTrackDisabled( bool disable )
m_track->setTrackEnabled( !disable );
if ( !disable )
{
if ( m_track->mediaType() == MainWorkflow::VideoTrack )
if ( m_track->mediaType() == Workflow::VideoTrack )
m_ui->disableButton->setIcon( QIcon( ":/images/trackon" ) );
else if ( m_track->mediaType() == MainWorkflow::AudioTrack )
else if ( m_track->mediaType() == Workflow::AudioTrack )
m_ui->disableButton->setIcon( QIcon( ":/images/hpon" ) );
}
else
{
if ( m_track->mediaType() == MainWorkflow::VideoTrack )
if ( m_track->mediaType() == Workflow::VideoTrack )
m_ui->disableButton->setIcon( QIcon( ":/images/trackoff" ) );
else if ( m_track->mediaType() == MainWorkflow::AudioTrack )
else if ( m_track->mediaType() == Workflow::AudioTrack )
m_ui->disableButton->setIcon( QIcon( ":/images/hpoff" ) );
}
}
......@@ -142,13 +142,13 @@ WorkflowRenderer::lock( void *datas, const char* cookie, qint64 *dts, qint64 *pt
{
ret = handler->self->lockVideo( handler, pts, bufferSize, buffer );
if ( paused == false )
handler->self->m_mainWorkflow->nextFrame( MainWorkflow::VideoTrack );
handler->self->m_mainWorkflow->nextFrame( Workflow::VideoTrack );
}
else if ( cookie[0] == WorkflowRenderer::AudioCookie )
{
ret = handler->self->lockAudio( handler, pts, bufferSize, buffer );
if ( paused == false )
handler->self->m_mainWorkflow->nextFrame( MainWorkflow::AudioTrack );
handler->self->m_mainWorkflow->nextFrame( Workflow::AudioTrack );
}
else
qCritical() << "Invalid imem cookie";
......@@ -164,7 +164,7 @@ WorkflowRenderer::lockVideo( EsHandler *handler, qint64 *pts, size_t *bufferSize
if ( m_stopping == true )
return 1;
ret = m_mainWorkflow->getOutput( MainWorkflow::VideoTrack, m_paused );
ret = m_mainWorkflow->getOutput( Workflow::VideoTrack, m_paused );
ptsDiff = ret->video->ptsDiff;
if ( ptsDiff == 0 )
{
......@@ -194,7 +194,7 @@ WorkflowRenderer::lockAudio( EsHandler *handler, qint64 *pts, size_t *bufferSize
if ( m_stopping == false && m_paused == false )
{
MainWorkflow::OutputBuffers* ret = m_mainWorkflow->getOutput( MainWorkflow::AudioTrack,
MainWorkflow::OutputBuffers* ret = m_mainWorkflow->getOutput( Workflow::AudioTrack,
m_paused );
renderAudioSample = ret->audio;
}
......@@ -264,7 +264,7 @@ void WorkflowRenderer::nextFrame()
void WorkflowRenderer::previousFrame()
{
if ( m_paused == true )
m_mainWorkflow->previousFrame( MainWorkflow::VideoTrack );
m_mainWorkflow->previousFrame( Workflow::VideoTrack );
}
void WorkflowRenderer::togglePlayPause( bool forcePause )
......
......@@ -48,12 +48,12 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_currentFrameLock = new QReadWriteLock;
m_renderStartedMutex = new QMutex;
m_tracks = new TrackHandler*[MainWorkflow::NbTrackType];
m_currentFrame = new qint64[MainWorkflow::NbTrackType];
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
m_tracks = new TrackHandler*[Workflow::NbTrackType];
m_currentFrame = new qint64[Workflow::NbTrackType];
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
{
MainWorkflow::TrackType trackType =
(i == 0 ? MainWorkflow::VideoTrack : MainWorkflow::AudioTrack );
Workflow::TrackType trackType =
(i == 0 ? Workflow::VideoTrack : Workflow::AudioTrack );
m_tracks[i] = new TrackHandler( trackCount, trackType );
connect( m_tracks[i], SIGNAL( tracksEndReached() ),
this, SLOT( tracksEndReached() ) );
......@@ -67,7 +67,7 @@ MainWorkflow::~MainWorkflow()
delete m_renderStartedMutex;
delete m_currentFrameLock;
delete m_currentFrame;
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
delete m_tracks[i];
delete[] m_tracks;
delete MainWorkflow::blackOutput;
......@@ -75,7 +75,7 @@ MainWorkflow::~MainWorkflow()
void
MainWorkflow::addClip( ClipHelper *clipHelper, unsigned int trackId,
qint64 start, MainWorkflow::TrackType trackType,
qint64 start, Workflow::TrackType trackType,
bool informGui )
{
m_tracks[trackType]->addClip( clipHelper, trackId, start );
......@@ -86,7 +86,7 @@ MainWorkflow::addClip( ClipHelper *clipHelper, unsigned int trackId,
}
void
MainWorkflow::addEffect( Effect *effect, quint32 trackId, const QUuid &uuid, TrackType type )
MainWorkflow::addEffect( Effect *effect, quint32 trackId, const QUuid &uuid, Workflow::TrackType type )
{
m_tracks[type]->addEffect( effect, trackId, uuid );
}
......@@ -96,7 +96,7 @@ MainWorkflow::computeLength()
{
qint64 maxLength = 0;
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
{
if ( m_tracks[i]->getLength() > maxLength )
maxLength = m_tracks[i]->getLength();
......@@ -120,13 +120,13 @@ MainWorkflow::startRender( quint32 width, quint32 height, double fps )
delete blackOutput;
blackOutput = new Workflow::Frame( m_width, m_height );
memset( blackOutput->buffer(), 0, blackOutput->size() );
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
for ( unsigned int i = 0; i < Workflow::NbTrackType; ++i )
m_tracks[i]->startRender( width, height, fps );