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

VideoClipWorkflow: Save the effects to the project file.

parent 97346006
......@@ -55,8 +55,8 @@ EffectInstance::process( double time, const quint32 *input, quint32 *output ) co
m_effect->m_f0r_update( m_instance, time, input, output );
}
const Effect*
EffectInstance::effect() const
Effect*
EffectInstance::effect()
{
return m_effect;
}
......@@ -33,7 +33,7 @@ class EffectInstance
public:
void init( quint32 width, quint32 height );
void process( double time, const quint32* input, quint32* output ) const;
const Effect* effect() const;
Effect* effect();
private:
EffectInstance( Effect *effect );
......
......@@ -198,6 +198,10 @@ class ClipWorkflow : public QObject
void stopRenderer();
void save( QXmlStreamWriter& project ) const;
virtual void saveEffects( QXmlStreamWriter& ) const
{
//Empty implementation, as some clipworkflow does not have effects for now.
}
private:
void setState( State state );
......
......@@ -221,6 +221,27 @@ VideoClipWorkflow::appendEffect( Effect *effect, qint64 start, qint64 end )
return true;
}
void
VideoClipWorkflow::saveEffects( QXmlStreamWriter &project ) const
{
QReadLocker lock( m_effectsLock );
if ( m_effects.size() <= 0 )
return ;
EffectsEngine::EffectList::const_iterator it = m_effects.begin();
EffectsEngine::EffectList::const_iterator ite = m_effects.end();
project.writeStartElement( "effects" );
while ( it != ite )
{
project.writeStartElement( "effect" );
project.writeAttribute( "name", (*it)->effect->effect()->name() );
project.writeAttribute( "start", QString::number( (*it)->start ) );
project.writeAttribute( "end", QString::number( (*it)->end ) );
project.writeEndElement();
++it;
}
project.writeEndElement();
}
void
VideoClipWorkflow::setTime( qint64 time )
{
......
......@@ -54,6 +54,7 @@ class VideoClipWorkflow : public ClipWorkflow
virtual void *getOutput( ClipWorkflow::GetMode mode );
virtual bool appendEffect( Effect *effect, qint64 start = 0, qint64 end = -1 );
virtual void setTime( qint64 time );
virtual void saveEffects( QXmlStreamWriter &project ) const;
static const quint32 nbBuffers = 3 * 30; //3 seconds with an average fps of 30
......
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