Commit 4eff3c1b authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

Don't create a subclip in AbstractGraphicsMediaItem

Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 79103d94
......@@ -37,9 +37,9 @@
#include <QCoreApplication>
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem( Clip* clip ) :
m_clip( clip ),
m_muted( false )
{
m_clip = new Clip( clip );
// Adjust the width
setWidth( clip->length() );
// Automatically adjust future changes
......
......@@ -383,7 +383,7 @@ TracksView::clipDragEnterEvent( QDragEnterEvent *event )
{
if ( m_dragAudioItem )
delete m_dragAudioItem;
m_dragAudioItem = new GraphicsAudioItem( clip );
m_dragAudioItem = new GraphicsAudioItem( Core::instance()->workflow()->createClip( clip->uuid() ) );
m_dragAudioItem->m_tracksView = this;
m_dragAudioItem->setHeight( m_dragAudioItem->itemHeight() );
m_dragAudioItem->setTrack( getTrack( m_dragAudioItem->trackType(), 0 ) );
......@@ -394,7 +394,7 @@ TracksView::clipDragEnterEvent( QDragEnterEvent *event )
{
if ( m_dragVideoItem )
delete m_dragVideoItem;
m_dragVideoItem = new GraphicsMovieItem( clip );
m_dragVideoItem = new GraphicsMovieItem( Core::instance()->workflow()->createClip( clip->uuid() ) );
m_dragVideoItem->m_tracksView = this;
m_dragVideoItem->setHeight( m_dragVideoItem->itemHeight() );
m_dragVideoItem->setTrack( getTrack( m_dragVideoItem->trackType(), 0 ) );
......@@ -780,6 +780,9 @@ TracksView::dragLeaveEvent( QDragLeaveEvent *event )
if ( m_dragAudioItem || m_dragVideoItem )
updateDurationNeeded = true;
Core::instance()->workflow()->deleteClip( m_dragAudioItem->clip()->uuid() );
Core::instance()->workflow()->deleteClip( m_dragVideoItem->clip()->uuid() );
delete m_dragAudioItem;
delete m_dragVideoItem;
delete m_dragEffectItem;
......
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