Commit 077b7674 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Embedding the track number into the GraphicsTrack objects

parent ce11a343
......@@ -102,7 +102,7 @@ void TracksView::createLayout()
void TracksView::addVideoTrack()
{
GraphicsTrack* track = new GraphicsTrack( GraphicsTrack::Video );
GraphicsTrack* track = new GraphicsTrack( GraphicsTrack::Video, m_videoTracksCounter );
track->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
track->setPreferredHeight( m_tracksHeight );
track->setContentsMargins( 0, 0, 0, 0 );
......@@ -116,7 +116,7 @@ void TracksView::addVideoTrack()
void TracksView::addAudioTrack()
{
GraphicsTrack* track = new GraphicsTrack( GraphicsTrack::Audio );
GraphicsTrack* track = new GraphicsTrack( GraphicsTrack::Audio, 0 );
track->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
track->setPreferredHeight( m_tracksHeight );
track->setContentsMargins( 0, 0, 0, 0 );
......
......@@ -48,9 +48,14 @@ public:
Video,
Audio
};
GraphicsTrack( Type type, QGraphicsItem* parent = 0 ) : QGraphicsWidget( parent )
GraphicsTrack( Type type, int trackNumber, QGraphicsItem* parent = 0 ) : QGraphicsWidget( parent )
{
m_type = type;
m_trackNumber = trackNumber;
}
int trackNumber()
{
return m_trackNumber;
}
protected:
......@@ -66,6 +71,7 @@ protected:
private:
Type m_type;
int m_trackNumber;
};
class TracksView : public QGraphicsView
......
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