Commit 525a7814 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Adjust the number of needed tracks when inserting a clip

This should fix ticket #46.
I've identified some bottleneck in the timeline that slow down the GUI
when many items are inserted at the same time. This will be the subject
of an upcoming commit.
parent 901e0b13
......@@ -160,13 +160,17 @@ void TracksView::addMediaItem( Clip* clip, unsigned int track, qint64 start )
{
Q_ASSERT( clip );
//nasty temporary fix:
// If there is not enough tracks to insert
// the clip do it now.
if ( track > (quint32)m_numVideoTrack )
{
unsigned int nbTrackToAdd = track - m_numVideoTrack;
for ( unsigned int i = 0; i < nbTrackToAdd; ++i )
addVideoTrack();
}
// Add the empty upper track
if ( track + 1 == m_numVideoTrack )
addVideoTrack();
// Is the clip already existing in the timeline ?
//TODO: please optimize me!
......@@ -186,6 +190,8 @@ void TracksView::addMediaItem( Clip* clip, unsigned int track, qint64 start )
item->setParentItem( getTrack( track ) );
item->oldTrackNumber = track;
moveMediaItem( item, track, start );
updateDuration();
}
void TracksView::dragEnterEvent( QDragEnterEvent* event )
......
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