Commit 79103d94 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

MainWorkflow: Add createClip and deleteClip functions

This is used to create/delete subclips which are only used in a timeline.
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 4e21dcf9
......@@ -342,6 +342,26 @@ MainWorkflow::trackCount() const
return m_trackCount;
}
Clip*
MainWorkflow::createClip( const QUuid& uuid )
{
Clip* clip = Core::instance()->library()->clip( uuid );
if ( clip == nullptr )
{
vlmcCritical() << "Couldn't find an acceptable parent to be added.";
return nullptr;
}
auto newClip = new Clip( clip );
m_mediaContainer->addClip( newClip );
return newClip;
}
void
MainWorkflow::deleteClip( const QUuid& uuid )
{
m_mediaContainer->deleteClip( uuid );
}
void
MainWorkflow::preSave()
{
......
......@@ -257,6 +257,19 @@ class MainWorkflow : public QObject
*/
quint32 trackCount() const;
/**
* \brief Create a clip from a parent clip's uuid.
*
* The clip will be added to this MediaContainer, not to the Library.
* The parent clip should be in the Library.
*/
Clip* createClip( const QUuid& uuid );
/**
* \brief Delete a clip.
*/
void deleteClip( const QUuid& uuid );
private:
/**
* \brief Compute the length of the workflow.
......
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