diff --git a/ChangeLog b/ChangeLog index 3a7d2f21c..9dfb61fda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,13 @@ * src/gui/piano_roll.cpp: (hopefully) fixed bug where shift+drag wasn't copying notes + + * src/core/timeline.cpp: + * include/song_editor.h: + * src/gui/song_editor.cpp: + auto-scroll default to disabled + fixed glitch where it would auto-scroll even if it was off in song-editor + 2008-12-05 Andrew Kelley diff --git a/include/song_editor.h b/include/song_editor.h index 16495cb66..de64420ad 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -90,6 +90,8 @@ private: toolButton * m_recordButton; toolButton * m_recordAccompanyButton; toolButton * m_stopButton; + + timeLine * m_timeLine; toolButton * m_addBBTrackButton; toolButton * m_addSampleTrackButton; diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 55cc23a3f..ac860c3c1 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -52,7 +52,7 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt, song::playPos & _pos, const midiTime & _begin, QWidget * _parent ) : QWidget( _parent ), - m_autoScroll( AutoScrollEnabled ), + m_autoScroll( AutoScrollDisabled ), m_loopPoints( LoopPointsDisabled ), m_behaviourAtStop( BackToZero ), m_changedPosition( TRUE ), @@ -122,6 +122,8 @@ void timeLine::addToolButtons( QWidget * _tool_bar ) autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); connect( autoScroll, SIGNAL( changedState( int ) ), this, SLOT( toggleAutoScroll( int ) ) ); + // default to autoscroll off + autoScroll->changeState( AutoScrollDisabled ); nStateButton * loopPoints = new nStateButton( _tool_bar ); loopPoints->setGeneralToolTip( tr( "Enable/disable loop-points" ) ); diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index 979e40c9a..f76d7d121 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -83,7 +83,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : setFocus(); // create time-line - timeLine * tl = new timeLine( TRACK_OP_WIDTH + + m_timeLine = new timeLine( TRACK_OP_WIDTH + DEFAULT_SETTINGS_WIDGET_WIDTH, 32, pixelsPerTact(), m_s->m_playPos[song::Mode_PlaySong], @@ -91,7 +91,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : connect( this, SIGNAL( positionChanged( const midiTime & ) ), m_s->m_playPos[song::Mode_PlaySong].m_timeLine, SLOT( updatePosition( const midiTime & ) ) ); - connect( tl, SIGNAL( positionChanged( const midiTime & ) ), + connect( m_timeLine, SIGNAL( positionChanged( const midiTime & ) ), this, SLOT( updatePosition( const midiTime & ) ) ); m_positionLine = new positionLine( this ); @@ -107,7 +107,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : m_toolBar->setPalette( pal ); static_cast( layout() )->insertWidget( 0, m_toolBar ); - static_cast( layout() )->insertWidget( 1, tl ); + static_cast( layout() )->insertWidget( 1, m_timeLine ); QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar ); tb_layout->setMargin( 0 ); @@ -232,7 +232,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : tb_layout->addWidget( m_drawModeButton ); tb_layout->addWidget( m_editModeButton ); tb_layout->addSpacing( 10 ); - tl->addToolButtons( m_toolBar ); + m_timeLine->addToolButtons( m_toolBar ); tb_layout->addSpacing( 15 ); tb_layout->addWidget( zoom_lbl ); tb_layout->addSpacing( 5 ); @@ -423,7 +423,8 @@ void songEditor::wheelEvent( QWheelEvent * _we ) void songEditor::updatePosition( const midiTime & _t ) { - if( ( m_s->isPlaying() && m_s->m_playMode == song::Mode_PlaySong ) || + if( ( m_s->isPlaying() && m_s->m_playMode == song::Mode_PlaySong + && m_timeLine->autoScroll() == timeLine::AutoScrollEnabled) || m_scrollBack == TRUE ) { const int w = width() - DEFAULT_SETTINGS_WIDGET_WIDTH