Commit 8b6524ed authored by luyikei's avatar luyikei

Workflow: Imeplement addEffect

parent d03853fb
......@@ -30,6 +30,7 @@
#include "Backend/MLT/MLTMultiTrack.h"
#include "Backend/MLT/MLTTrack.h"
#include "Renderer/AbstractRenderer.h"
#include "EffectsEngine/EffectHelper.h"
#ifdef WITH_GUI
#include "Gui/WorkflowFileRendererDialog.h"
#endif
......@@ -304,6 +305,32 @@ MainWorkflow::linkClips( const QString& uuidA, const QString& uuidB )
}
}
QString
MainWorkflow::addEffect( const QString &clipUuid, const QString &effectId )
{
EffectHelper* newEffect = nullptr;
try
{
newEffect = new EffectHelper( effectId );
}
catch( Backend::InvalidServiceException& e )
{
return QStringLiteral( "" );
}
for ( auto clip : m_clips )
if ( clip->uuid().toString() == clipUuid )
{
Commands::trigger( new Commands::Effect::Add(
std::shared_ptr<EffectHelper>( newEffect ), clip->input() )
);
return newEffect->uuid().toString();
}
return QStringLiteral( "" );
}
bool
MainWorkflow::startRenderToFile( const QString &outputFileName, quint32 width, quint32 height,
double fps, const QString &ar, quint32 vbitrate, quint32 abitrate,
......
......@@ -161,6 +161,9 @@ class MainWorkflow : public QObject
Q_INVOKABLE
void linkClips( const QString& uuidA, const QString& uuidB );
Q_INVOKABLE
QString addEffect( const QString& clipUuid, const QString& effectId );
bool startRenderToFile( const QString& outputFileName, quint32 width, quint32 height,
double fps, const QString& ar, quint32 vbitrate, quint32 abitrate,
quint32 nbChannels, quint32 sampleRate );
......
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