Commit 44dde9ff authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Timeline: add a getTrack method to find a track using it's number

parent 080917d4
......@@ -580,3 +580,16 @@ void TracksView::updateDuration()
emit durationChanged( m_projectDuration );
}
GraphicsTrack* TracksView::getTrack( unsigned int number )
{
for (int i = 0; i < m_layout->count(); ++i )
{
QGraphicsItem* gi = m_layout->itemAt( i )->graphicsItem();
GraphicsTrack* track = qgraphicsitem_cast<GraphicsTrack*>( gi );
if ( !track ) continue;
if ( track->trackNumber() == number )
return track;
}
return NULL;
}
......@@ -84,6 +84,7 @@ private:
void addAudioTrack();
void moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position );
void moveMediaItem( AbstractGraphicsMediaItem* item, int track, qint64 time );
GraphicsTrack* getTrack( unsigned int number );
QGraphicsScene* m_scene;
int m_tracksHeight;
unsigned int m_tracksCount;
......
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