Commit 9105f792 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Revert "Using ClipWorkflow's uuid to handle clip addition to the timeline."

This reverts commit bd9b98fa.

Conflicts:

	src/Commands/Commands.hpp
parent 056ec721
......@@ -29,7 +29,6 @@
#include "UndoStack.h"
#include "MainWorkflow.h"
#include "Clip.h"
#include "ClipWorkflow.h"
#define NEW_COMMAND(x) class x : public QUndoCommand
......@@ -59,16 +58,15 @@ namespace Commands
}
virtual void redo()
{
m_clipWorkflow = m_workflow->addClip( m_clip, m_trackNumber, m_pos );
m_workflow->addClip( m_clip, m_trackNumber, m_pos );
}
virtual void undo()
{
m_workflow->removeClip( m_clipWorkflow->getUuid(), m_trackNumber );
m_workflow->removeClip( m_clip->getUuid(), m_trackNumber );
}
private:
::MainWorkflow* m_workflow;
Clip* m_clip;
ClipWorkflow* m_clipWorkflow;
unsigned int m_trackNumber;
qint64 m_pos;
};
......
......@@ -342,7 +342,6 @@ void TracksView::dropEvent( QDropEvent* event )
event->acceptProposedAction();
qreal mappedXPos = ( mapToScene( event->pos() ).x() + 0.5 );
//FIXME: this line seems useless ?
m_dragItem->oldTrackNumber = m_dragItem->trackNumber();
Commands::trigger( new Commands::MainWorkflow::AddClip( m_mainWorkflow,
m_dragItem->clip(),
......
......@@ -51,7 +51,6 @@ Clip::~Clip()
void Clip::init()
{
m_uuid = QUuid::createUuid();
qDebug() << "Creating QUuid for clip:" << m_uuid;
computeLength();
m_metaTags << "Toto" << "titi" << "tutu";
}
......
......@@ -44,7 +44,6 @@ Media::Media( const QString& filePath )
m_height( 0 )
{
m_uuid = QUuid::createUuid();
qDebug() << "Creating QUuid for media:" << m_uuid;
if ( filePath.startsWith( Media::streamPrefix ) == false )
{
......
......@@ -34,7 +34,6 @@ ClipWorkflow::ClipWorkflow( Clip::Clip* clip ) :
m_rendering( false ),
m_initFlag( false )
{
m_uuid = QUuid::createUuid();
m_stateLock = new QReadWriteLock;
m_requiredStateLock = new QMutex;
m_waitCond = new QWaitCondition;
......@@ -355,8 +354,3 @@ void ClipWorkflow::unpausedMediaPlayer()
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( unpausedMediaPlayer() ) );
emit unpaused();
}
const QUuid& ClipWorkflow::getUuid() const
{
return m_uuid;
}
......@@ -156,8 +156,6 @@ class ClipWorkflow : public QObject
LibVLCpp::MediaPlayer* getMediaPlayer();
const QUuid& getUuid() const;
private:
static void lock( ClipWorkflow* clipWorkflow, void** pp_ret );
static void unlock( ClipWorkflow* clipWorkflow );
......@@ -194,8 +192,6 @@ class ClipWorkflow : public QObject
WaitCondition* m_renderWaitCond;
WaitCondition* m_pausingStateWaitCond;
QUuid m_uuid;
/**
* While this flag is set to false, we will use the same buffer, to prevent
* having X buffers with the same picture (when media player is paused mainly)
......
......@@ -71,7 +71,7 @@ MainWorkflow::~MainWorkflow()
delete[] blackOutput;
}
ClipWorkflow* MainWorkflow::addClip( Clip* clip, unsigned int trackId, qint64 start )
void MainWorkflow::addClip( Clip* clip, unsigned int trackId, qint64 start )
{
Q_ASSERT_X( trackId < m_trackCount, "MainWorkflow::addClip",
"The specified trackId isn't valid, for it's higher than the number of tracks");
......@@ -79,10 +79,9 @@ ClipWorkflow* MainWorkflow::addClip( Clip* clip, unsigned int trackId, qin
//if the track is deactivated, we need to reactivate it :
if ( m_tracks[trackId].deactivated() == true )
activateTrack( trackId );
ClipWorkflow* cw = m_tracks[trackId]->addClip( clip, start );
m_tracks[trackId]->addClip( clip, start );
if ( m_tracks[trackId]->getLength() > m_length )
m_length = m_tracks[trackId]->getLength();
return cw;
}
void MainWorkflow::computeLength()
......
......@@ -40,7 +40,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
MainWorkflow( int trackCount );
~MainWorkflow();
ClipWorkflow* addClip( Clip* clip, unsigned int trackId, qint64 start );
void addClip( Clip* clip, unsigned int trackId, qint64 start );
void startRender();
void getOutput();
unsigned char* getSynchroneOutput();
......
......@@ -51,11 +51,10 @@ TrackWorkflow::~TrackWorkflow()
delete m_forceRepositionningMutex;
}
ClipWorkflow* TrackWorkflow::addClip( Clip* clip, qint64 start )
void TrackWorkflow::addClip( Clip* clip, qint64 start )
{
ClipWorkflow* cw = new ClipWorkflow( clip );
addClip( cw, start );
return cw;
}
void TrackWorkflow::addClip( ClipWorkflow* cw, qint64 start )
......@@ -405,7 +404,6 @@ Clip* TrackWorkflow::removeClip( const QUuid& id )
ClipWorkflow* cw = it.value();
Clip* clip = cw->getClip();
m_clips.erase( it );
delete cw;
computeLength();
return clip;
}
......
......@@ -56,7 +56,7 @@ class TrackWorkflow : public QObject
void unpause();
void moveClip( const QUuid& id, qint64 startingFrame );
Clip* removeClip( const QUuid& id );
ClipWorkflow* addClip( Clip*, qint64 start );
void addClip( Clip*, qint64 start );
void addClip( ClipWorkflow*, qint64 start );
qint64 getClipPosition( const QUuid& uuid ) const;
......
Supports Markdown
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