MCPcopy Create free account
hub / github.com/LMMS/lmms / TimeLineWidget

Method TimeLineWidget

src/gui/TimeLineWidget.cpp:50–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48QPixmap * TimeLineWidget::s_posMarkerPixmap = NULL;
49
50TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppt,
51 Song::PlayPos & pos, const MidiTime & begin,
52 QWidget * parent ) :
53 QWidget( parent ),
54 m_inactiveLoopColor( 52, 63, 53, 64 ),
55 m_inactiveLoopBrush( QColor( 255, 255, 255, 32 ) ),
56 m_inactiveLoopInnerColor( 255, 255, 255, 32 ),
57 m_activeLoopColor( 52, 63, 53, 255 ),
58 m_activeLoopBrush( QColor( 55, 141, 89 ) ),
59 m_activeLoopInnerColor( 74, 155, 100, 255 ),
60 m_loopRectangleVerticalPadding( 1 ),
61 m_barLineColor( 192, 192, 192 ),
62 m_barNumberColor( m_barLineColor.darker( 120 ) ),
63 m_autoScroll( AutoScrollEnabled ),
64 m_loopPoints( LoopPointsDisabled ),
65 m_behaviourAtStop( BackToZero ),
66 m_changedPosition( true ),
67 m_xOffset( xoff ),
68 m_posMarkerX( 0 ),
69 m_ppt( ppt ),
70 m_pos( pos ),
71 m_begin( begin ),
72 m_savedPos( -1 ),
73 m_hint( NULL ),
74 m_action( NoAction ),
75 m_moveXOff( 0 )
76{
77 m_loopPos[0] = 0;
78 m_loopPos[1] = DefaultTicksPerTact;
79
80 if( s_posMarkerPixmap == NULL )
81 {
82 s_posMarkerPixmap = new QPixmap( embed::getIconPixmap(
83 "playpos_marker" ) );
84 }
85
86 setAttribute( Qt::WA_OpaquePaintEvent, true );
87 move( 0, yoff );
88
89 m_xOffset -= s_posMarkerPixmap->width() / 2;
90
91 setMouseTracking(true);
92 m_pos.m_timeLine = this;
93
94 QTimer * updateTimer = new QTimer( this );
95 connect( updateTimer, SIGNAL( timeout() ),
96 this, SLOT( updatePosition() ) );
97 updateTimer->start( 1000 / 60 ); // 60 fps
98 connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int,int ) ),
99 this, SLOT( update() ) );
100}
101
102
103

Callers

nothing calls this directly

Calls 3

getIconPixmapFunction · 0.85
timeoutFunction · 0.85
startMethod · 0.45

Tested by

no test coverage detected