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

Store the ClipWorkflow inside the ClipHelper

This will ease effect related stuff.
parent 2d82cc20
......@@ -26,9 +26,10 @@
ClipHelper::ClipHelper( Clip* clip, qint64 begin /*= -1*/, qint64 end /*= -1*/,
const QString& uuid /*= QString()*/ ) :
m_clip( clip ),
m_begin( begin ),
m_end( end )
m_clip( clip ),
m_begin( begin ),
m_end( end ),
m_clipWorkflow( NULL )
{
if ( begin == -1 )
m_begin = clip->begin();
......@@ -73,3 +74,15 @@ ClipHelper::length() const
{
return m_end - m_begin;
}
ClipWorkflow*
ClipHelper::clipWorkflow()
{
return m_clipWorkflow;
}
void
ClipHelper::setClipWorkflow( ClipWorkflow* cw )
{
m_clipWorkflow = cw;
}
......@@ -24,6 +24,7 @@
#define CLIPHELPER_H
class Clip;
class ClipWorkflow;
#include <QObject>
#include <QUuid>
......@@ -60,12 +61,15 @@ class ClipHelper : public QObject
{
return m_uuid;
}
ClipWorkflow *clipWorkflow();
void setClipWorkflow( ClipWorkflow* cw );
private:
Clip* m_clip;
qint64 m_begin;
qint64 m_end;
QUuid m_uuid;
Clip* m_clip;
qint64 m_begin;
qint64 m_end;
QUuid m_uuid;
ClipWorkflow* m_clipWorkflow;
signals:
void lengthUpdated();
......
......@@ -26,6 +26,7 @@
#include "vlmc.h"
#include "Clip.h"
#include "ClipHelper.h"
#include "ClipWorkflow.h"
#include "Library.h"
#include "MainWorkflow.h"
#include "TrackWorkflow.h"
......@@ -329,28 +330,29 @@ MainWorkflow::loadProject( const QDomElement &root )
ClipHelper *ch = new ClipHelper( c, begin.toLongLong(),
end.toLongLong(), chUuid );
addClip( ch, trackId, startFrame.toLongLong(), type, true );
}
QDomElement effects = clip.firstChildElement( "effects" );
if ( effects.isNull() == false )
{
QDomElement effect = effects.firstChildElement( "effect" );
while ( effect.isNull() == false )
QDomElement effects = clip.firstChildElement( "effects" );
if ( effects.isNull() == false )
{
if ( effect.hasAttribute( "name" ) == true &&
effect.hasAttribute( "start" ) == true &&
effect.hasAttribute( "end" ) == true )
QDomElement effect = effects.firstChildElement( "effect" );
while ( effect.isNull() == false )
{
Effect *e = EffectsEngine::getInstance()->effect( effect.attribute( "name" ) );
if ( e != NULL )
addEffect( e, trackId, uuid, type );
else
qCritical() << "Workflow: Can't load effect" << effect.attribute( "name" );
if ( effect.hasAttribute( "name" ) == true &&
effect.hasAttribute( "start" ) == true &&
effect.hasAttribute( "end" ) == true )
{
Effect *e = EffectsEngine::getInstance()->effect( effect.attribute( "name" ) );
qint64 start = effect.attribute( "start" ).toLongLong();
qint64 end = effect.attribute( "end" ).toLongLong();
if ( e != NULL )
ch->clipWorkflow()->appendEffect( e, start, end );
else
qCritical() << "Workflow: Can't load effect" << effect.attribute( "name" );
}
effect = effect.nextSiblingElement();
}
effect = effect.nextSiblingElement();
}
}
clip = clip.nextSiblingElement();
}
elem = elem.nextSiblingElement();
......
......@@ -79,6 +79,7 @@ TrackWorkflow::addClip( ClipHelper* ch, qint64 start )
}
else
cw = new AudioClipWorkflow( ch );
ch->setClipWorkflow( cw );
addClip( cw, start );
}
......
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