From 8896860c2baf74987f6ed1d0d88b5a8a7f732fdc Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Tue, 23 Jul 2024 16:44:55 -0400 Subject: [PATCH 01/26] Initial Commit --- include/PianoRoll.h | 1 + include/TimeLineWidget.h | 7 +++++++ src/gui/editors/PianoRoll.cpp | 16 ++++++++++++++++ src/gui/editors/TimeLineWidget.cpp | 14 ++++++++++++++ 4 files changed, 38 insertions(+) diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 35550a5b32f..fd73339daa2 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -305,6 +305,7 @@ protected slots: ~PianoRoll() override = default; void autoScroll(const TimePos & t ); + void continuousAutoScroll(const TimePos & t ); TimePos newNoteLen() const; diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 5c683cfd9f9..3a08ad3a2c6 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -140,6 +140,11 @@ class TimeLineWidget : public QWidget return m_autoScroll; } + AutoScrollState continuousAutoScroll() const + { + return m_continuousAutoScroll; + } + inline void setPixelsPerBar( float ppb ) { m_ppb = ppb; @@ -168,6 +173,7 @@ public slots: m_snapSize = snapSize; } void toggleAutoScroll( int _n ); + void toggleContinuousAutoScroll( int _n ); protected: void paintEvent( QPaintEvent * _pe ) override; @@ -213,6 +219,7 @@ public slots: QCursor m_cursorSelectRight = QCursor{embed::getIconPixmap("cursor_select_right"), 32, 16}; AutoScrollState m_autoScroll = AutoScrollState::Enabled; + AutoScrollState m_continuousAutoScroll = AutoScrollState::Disabled; // Width of the unused region on the widget's left (above track labels or piano) int m_xOffset; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 5811f956cc1..7dbfe3fe361 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -41,6 +41,8 @@ #include #include +#include + #ifndef __USE_XOPEN #define __USE_XOPEN #endif @@ -4476,6 +4478,13 @@ void PianoRoll::autoScroll( const TimePos & t ) m_scrollBack = false; } +void PianoRoll::continuousAutoScroll( const TimePos & t ) +{ + const int w = width() - m_whiteKeyWidth; + //m_leftRightScroll->setValue( t.getTicks() ); + m_leftRightScroll->setValue( std::max(t.getTicks() - w * TimePos::ticksPerBar() / m_ppb / 2, 0 ) ); + m_scrollBack = false; +} @@ -4488,6 +4497,13 @@ void PianoRoll::updatePosition( const TimePos & t ) { autoScroll( t ); } + if( ( Engine::getSong()->isPlaying() + && Engine::getSong()->playMode() == Song::PlayMode::MidiClip + && m_timeLine->continuousAutoScroll() == TimeLineWidget::AutoScrollState::Enabled + ) || m_scrollBack ) + { + continuousAutoScroll( t ); + } // ticks relative to m_currentPosition // < 0 = outside viewport left // > width = outside viewport right diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index 7657e2916cd..3fa0427d1cd 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -93,6 +93,14 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); + // Better Auto Scroll + + auto continuousAutoScroll = new NStateButton(_tool_bar); + continuousAutoScroll->setGeneralToolTip( tr( "Continuous auto scrolling" ) ); + continuousAutoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) ); + continuousAutoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); + connect( continuousAutoScroll, SIGNAL(changedState(int)), this, + SLOT(toggleContinuousAutoScroll(int))); auto loopPoints = new NStateButton(_tool_bar); loopPoints->setGeneralToolTip( tr( "Loop points" ) ); @@ -126,6 +134,7 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) behaviourAtStop->changeState(static_cast(m_timeline->stopBehaviour())); _tool_bar->addWidget( autoScroll ); + _tool_bar->addWidget( continuousAutoScroll ); _tool_bar->addWidget( loopPoints ); _tool_bar->addWidget( behaviourAtStop ); } @@ -141,6 +150,11 @@ void TimeLineWidget::toggleAutoScroll( int _n ) m_autoScroll = static_cast( _n ); } +void TimeLineWidget::toggleContinuousAutoScroll( int _n ) +{ + m_continuousAutoScroll = static_cast( _n ); +} + void TimeLineWidget::paintEvent( QPaintEvent * ) { QPainter p( this ); From 5227bc3a8283da1cc9f3d17e07b04bd0687f8658 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Wed, 24 Jul 2024 17:51:22 -0400 Subject: [PATCH 02/26] Refactor code and add new icons --- .../default/autoscroll_continuous_on.png | Bin 0 -> 7966 bytes data/themes/default/autoscroll_stepped_on.png | Bin 0 -> 8791 bytes include/PianoRoll.h | 1 - include/TimeLineWidget.h | 11 ++--- src/gui/editors/PianoRoll.cpp | 38 +++++++----------- src/gui/editors/SongEditor.cpp | 23 +++++++---- src/gui/editors/TimeLineWidget.cpp | 19 ++------- 7 files changed, 38 insertions(+), 54 deletions(-) create mode 100644 data/themes/default/autoscroll_continuous_on.png create mode 100644 data/themes/default/autoscroll_stepped_on.png diff --git a/data/themes/default/autoscroll_continuous_on.png b/data/themes/default/autoscroll_continuous_on.png new file mode 100644 index 0000000000000000000000000000000000000000..7f27a7f7dba81a47bac06508abcf65ee95cc6a6e GIT binary patch literal 7966 zcmeHL2~<eZ1d;&3q7iU_s6|wq zYZV+2YAK3C>wut$;y`^?uv$f&z!8FqQ6Tr78wR28y;XhdfA9bQwY;p8d+s@Ve`kOD z?7g}7Z+6Ed8^idm1K@+d& zTk9m~{|cI^{!a^fSkMOUA)K&qJk5hj@$h5-eF}}vr1&stbUf9EN%v$@XkdNJj&~LT zRmcp|L4DY$jRTxeLkBpa{Q*u>LEo_7Ueq%tL;9nK@W2@KVTPi*{rxtS7`XauN3J7x zppnz3ai)QVPzQk@E7 zJtp7@lUy7eh(2zUC{#L~?li%d#i03lc+zPo2*%9J%+kW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/default/autoscroll_stepped_on.png b/data/themes/default/autoscroll_stepped_on.png new file mode 100644 index 0000000000000000000000000000000000000000..c58fa97b2cfe6eb6a0b582b80b7c1d04f45f80c8 GIT binary patch literal 8791 zcmeHNc~}$4w(qbQHbpQfg90I-AR4j|NQi{61wlnY13{fDHzXa1LV_VcL^KF45JUzQ zeJ!9juk)4?5w7K1_HcTSe|U6a(##8q~0$^xh{11&83NE)=qhD+7!tQ)x^xok^wPDRd@{%A~k~`7zr*uLul< z3?U8Fts7lquTAJedu>ANy*BxRx^B;UQDg@7say211EbTeGY}oyQ@1ihC+J-}QinW- zhE56y3IG$K0D)h~eaH_o7&HhwNZ$a9#TptK7@6P(n;09L{9r!J6lZN^Yh!ISY82kV z#Su>!Z$E036MgJ>GKEH?**bc#7*tOeR~i*nf-y8SG%+@@96Z>PYB$P``pp+|1~M~1 z*QARfKssg^T{8@F0kQ?_)W>MAZd1Usj;@~mAgqC*kueY`8;T;OtD~o@udk;EdKZCy zNY6~)+>YWiXjmv8OPG(NF3H<&VDEe2ti|-|MhDj@S-PRo@DY|jSdAXz=rq=u=H^ak zcrg9^IRO&`gC@=3hK2JYX3i1_VNrC9cy59`F)3NGASGkzvgIo>vsA0stj%Ay{(m-X zEGXQub63&sJ;nbzc&O~~k)y|spF4ly;-!kqS1NDbx_zgnw(jn|Cr_U}fAR9w>)+or zHNS89(AuVM??CNB?d-j}EgN8$8L&%7Pfu45i`s?JNk$Df)6=)33^Ml##q#G5BT$zZ z;C%D8A2@4h?>fEFB1%?mG~9vqWONg1n%1(fGc5i8W!WdgKHGHZY>0EQl%l7Vs(>+Rer*-#XfARO>cAn9^RUaw>6fDo{b+S~}>DO*=E! zKWZJe27x%7IVE$#8nGJx$qgS3uOLuCL220Th3nE!mON|g%v{HA9hM8ECZkeKAAywZ zN5cvrwR5{fRL)n7oC?yuwRq(WoU=AR6@x%|<{vfZWXjjOOYY3Id9iKa zoVCS3Y%wZUp*c4nfnM*4nVq%OBa~wyT!stv*8fsT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uWkeC_6d{#J zqY7w5zR-ngABKQ}|j{LIE>CDvRR-cZ%cq(J(1q60Pk(0cZMz1hEKI7xL$pkXXK41O~7O zQ^b-)#pe#LI1Zj6=c8y+=u`^Bjqd77r?`_DZmyq&!eLngh(uJU_BdPHgSv$Yi~+#% z(KrPPwC%tark@Pv%cU}|R2s`7d^!mK)Ex|7Cm~lSW@2yeE(cE)NtZfcY0_o4Vhq8Swn>r|!pCvG!HMlh4A`S5TzlKaUkHULS2uwNg~lh61+XiTMyB(Ld@7#-f{V&`bA{bR zG@7Wt_5`U&p3IlQKG6V2fE5T&?H>*BPFhEe?Ju1i1EXF5fDy@bB9+z)7`+EDQjftT zlrwrQ_9XoqCZ1Y>J|qLib+-ZX0$fP?M20<>p|tZKyn1}`ADjWG{yxb!;rkt~?{Iw+ z0^cP3J-WWb^-TzTlkoTG`pe)l`usTsOF$Ns3_h0pt&E7^Q_CP>Xuro zEpV#_zYVA{(Mvy)X8iu;uMUAe-c!$ZZWuc3_$~Zw-wNYJcM^RJTy64vBO3P_HPu{K zZ6EXCM?pn|bJCCr>wUc*<&HYNHnL{Sp*q`Xr85=Cc>-2ZvXC-%Ob7b!8Bh>ss{b#( H|4jd1D+9KA literal 0 HcmV?d00001 diff --git a/include/PianoRoll.h b/include/PianoRoll.h index fd73339daa2..35550a5b32f 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -305,7 +305,6 @@ protected slots: ~PianoRoll() override = default; void autoScroll(const TimePos & t ); - void continuousAutoScroll(const TimePos & t ); TimePos newNoteLen() const; diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 3a08ad3a2c6..3f399e174b8 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -73,7 +73,8 @@ class TimeLineWidget : public QWidget enum class AutoScrollState { - Enabled, + Stepped, + Continuous, Disabled }; @@ -140,11 +141,6 @@ class TimeLineWidget : public QWidget return m_autoScroll; } - AutoScrollState continuousAutoScroll() const - { - return m_continuousAutoScroll; - } - inline void setPixelsPerBar( float ppb ) { m_ppb = ppb; @@ -173,7 +169,6 @@ public slots: m_snapSize = snapSize; } void toggleAutoScroll( int _n ); - void toggleContinuousAutoScroll( int _n ); protected: void paintEvent( QPaintEvent * _pe ) override; @@ -218,7 +213,7 @@ public slots: QCursor m_cursorSelectLeft = QCursor{embed::getIconPixmap("cursor_select_left"), 0, 16}; QCursor m_cursorSelectRight = QCursor{embed::getIconPixmap("cursor_select_right"), 32, 16}; - AutoScrollState m_autoScroll = AutoScrollState::Enabled; + AutoScrollState m_autoScroll = AutoScrollState::Stepped; AutoScrollState m_continuousAutoScroll = AutoScrollState::Disabled; // Width of the unused region on the widget's left (above track labels or piano) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 7dbfe3fe361..0e84e98bd22 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4064,7 +4064,7 @@ void PianoRoll::stop() { Engine::getSong()->stop(); m_recording = false; - m_scrollBack = ( m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Enabled ); + m_scrollBack = ( m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled ); } @@ -4465,45 +4465,37 @@ bool PianoRoll::deleteSelectedNotes() void PianoRoll::autoScroll( const TimePos & t ) { const int w = width() - m_whiteKeyWidth; - if( t > m_currentPosition + w * TimePos::ticksPerBar() / m_ppb ) + if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { - m_leftRightScroll->setValue( t.getBar() * TimePos::ticksPerBar() ); + if( t > m_currentPosition + w * TimePos::ticksPerBar() / m_ppb ) + { + m_leftRightScroll->setValue( t.getBar() * TimePos::ticksPerBar() ); + } + else if( t < m_currentPosition ) + { + TimePos t2 = qMax( t - w * TimePos::ticksPerBar() * + TimePos::ticksPerBar() / m_ppb, (tick_t) 0 ); + m_leftRightScroll->setValue( t2.getBar() * TimePos::ticksPerBar() ); + } } - else if( t < m_currentPosition ) + else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { - TimePos t2 = qMax( t - w * TimePos::ticksPerBar() * - TimePos::ticksPerBar() / m_ppb, (tick_t) 0 ); - m_leftRightScroll->setValue( t2.getBar() * TimePos::ticksPerBar() ); + m_leftRightScroll->setValue( std::max(t.getTicks() - w * TimePos::ticksPerBar() / m_ppb / 2, 0 ) ); } m_scrollBack = false; } -void PianoRoll::continuousAutoScroll( const TimePos & t ) -{ - const int w = width() - m_whiteKeyWidth; - //m_leftRightScroll->setValue( t.getTicks() ); - m_leftRightScroll->setValue( std::max(t.getTicks() - w * TimePos::ticksPerBar() / m_ppb / 2, 0 ) ); - m_scrollBack = false; -} - void PianoRoll::updatePosition( const TimePos & t ) { if( ( Engine::getSong()->isPlaying() && Engine::getSong()->playMode() == Song::PlayMode::MidiClip - && m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Enabled + && m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled ) || m_scrollBack ) { autoScroll( t ); } - if( ( Engine::getSong()->isPlaying() - && Engine::getSong()->playMode() == Song::PlayMode::MidiClip - && m_timeLine->continuousAutoScroll() == TimeLineWidget::AutoScrollState::Enabled - ) || m_scrollBack ) - { - continuousAutoScroll( t ); - } // ticks relative to m_currentPosition // < 0 = outside viewport left // > width = outside viewport right diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 9ba9ac083d4..a319349ad5b 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -34,6 +34,8 @@ #include #include +#include + #include "ActionGroup.h" #include "AudioDevice.h" #include "AudioEngine.h" @@ -756,22 +758,29 @@ void SongEditor::updatePosition( const TimePos & t ) const auto widgetWidth = compactTrackButtons ? DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT : DEFAULT_SETTINGS_WIDGET_WIDTH; const auto trackOpWidth = compactTrackButtons ? TRACK_OP_WIDTH_COMPACT : TRACK_OP_WIDTH; - if( ( m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song - && m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Enabled) || + if( ( m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song ) || m_scrollBack == true ) { m_smoothScroll = ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt(); const int w = width() - widgetWidth - trackOpWidth - contentWidget()->verticalScrollBar()->width(); // width of right scrollbar - if( t > m_currentPosition + w * TimePos::ticksPerBar() / - pixelsPerBar() ) + + if (m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Stepped) { - animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); + if( t > m_currentPosition + w * TimePos::ticksPerBar() / + pixelsPerBar() ) + { + animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); + } + else if( t < m_currentPosition ) + { + animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); + } } - else if( t < m_currentPosition ) + else if (m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Continuous) { - animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); + animateScroll( m_leftRightScroll, std::max(t.getBar() - w / pixelsPerBar() / 2, 0.0f), m_smoothScroll ); } m_scrollBack = false; } diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index 3fa0427d1cd..c5f39dd933b 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -87,20 +87,15 @@ void TimeLineWidget::setXOffset(const int x) void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { + auto autoScroll = new NStateButton(_tool_bar); autoScroll->setGeneralToolTip( tr( "Auto scrolling" ) ); - autoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) ); + autoScroll->addState( embed::getIconPixmap( "autoscroll_stepped_on" ) ); + autoScroll->addState( embed::getIconPixmap( "autoscroll_continuous_on" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); - // Better Auto Scroll - - auto continuousAutoScroll = new NStateButton(_tool_bar); - continuousAutoScroll->setGeneralToolTip( tr( "Continuous auto scrolling" ) ); - continuousAutoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) ); - continuousAutoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); - connect( continuousAutoScroll, SIGNAL(changedState(int)), this, - SLOT(toggleContinuousAutoScroll(int))); + auto loopPoints = new NStateButton(_tool_bar); loopPoints->setGeneralToolTip( tr( "Loop points" ) ); @@ -134,7 +129,6 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) behaviourAtStop->changeState(static_cast(m_timeline->stopBehaviour())); _tool_bar->addWidget( autoScroll ); - _tool_bar->addWidget( continuousAutoScroll ); _tool_bar->addWidget( loopPoints ); _tool_bar->addWidget( behaviourAtStop ); } @@ -150,11 +144,6 @@ void TimeLineWidget::toggleAutoScroll( int _n ) m_autoScroll = static_cast( _n ); } -void TimeLineWidget::toggleContinuousAutoScroll( int _n ) -{ - m_continuousAutoScroll = static_cast( _n ); -} - void TimeLineWidget::paintEvent( QPaintEvent * ) { QPainter p( this ); From 82f637034840381bd9bd9ae437546a11e371e6db Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:04:45 -0400 Subject: [PATCH 03/26] Fix logical error --- src/gui/editors/SongEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index a319349ad5b..1687dc1167f 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -766,7 +766,7 @@ void SongEditor::updatePosition( const TimePos & t ) - trackOpWidth - contentWidget()->verticalScrollBar()->width(); // width of right scrollbar - if (m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Stepped) + if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { if( t > m_currentPosition + w * TimePos::ticksPerBar() / pixelsPerBar() ) @@ -778,7 +778,7 @@ void SongEditor::updatePosition( const TimePos & t ) animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); } } - else if (m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Continuous) + else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { animateScroll( m_leftRightScroll, std::max(t.getBar() - w / pixelsPerBar() / 2, 0.0f), m_smoothScroll ); } From 595c212d59cdba154d99916eb6c6a6e6fc87494f Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:34:46 -0400 Subject: [PATCH 04/26] Add smooth scrolling to Song Editor --- include/TrackContentWidget.h | 2 ++ src/gui/editors/SongEditor.cpp | 10 +++++----- src/gui/tracks/TrackContentWidget.cpp | 7 ++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index f93b0a58d6f..0bad6dbf706 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -176,6 +176,8 @@ public slots: int m_horizontalWidth; int m_embossWidth; + TimePos m_song_editor_currentPosition; + int m_embossOffset; } ; diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 1687dc1167f..3788fdbe717 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -327,7 +327,7 @@ QString SongEditor::getSnapSizeString() const void SongEditor::scrolled( int new_pos ) { update(); - emit positionChanged( m_currentPosition = TimePos( new_pos, 0 ) ); + emit positionChanged( m_currentPosition = TimePos( new_pos ) ); } @@ -715,7 +715,7 @@ void SongEditor::hideMasterPitchFloat( void ) void SongEditor::updateScrollBar( int len ) { - m_leftRightScroll->setMaximum( len ); + m_leftRightScroll->setMaximum( len * TimePos::ticksPerBar() ); } @@ -771,16 +771,16 @@ void SongEditor::updatePosition( const TimePos & t ) if( t > m_currentPosition + w * TimePos::ticksPerBar() / pixelsPerBar() ) { - animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); + animateScroll( m_leftRightScroll, t.getTicks(), m_smoothScroll ); } else if( t < m_currentPosition ) { - animateScroll( m_leftRightScroll, t.getBar(), m_smoothScroll ); + animateScroll( m_leftRightScroll, t.getTicks(), m_smoothScroll ); } } else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { - animateScroll( m_leftRightScroll, std::max(t.getBar() - w / pixelsPerBar() / 2, 0.0f), m_smoothScroll ); + animateScroll( m_leftRightScroll, std::max(t.getTicks() - w * TimePos::ticksPerBar() / pixelsPerBar() / 2, 0.0f), m_smoothScroll ); } m_scrollBack = false; } diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index e205a0c00ea..f0028f6a68e 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -29,6 +29,8 @@ #include #include +#include + #include "AutomationClip.h" #include "Clipboard.h" #include "DataFile.h" @@ -291,7 +293,10 @@ void TrackContentWidget::changePosition( const TimePos & newPos ) } setUpdatesEnabled( true ); + m_song_editor_currentPosition = pos; + // redraw background + updateBackground(); // update(); } @@ -629,7 +634,7 @@ void TrackContentWidget::paintEvent( QPaintEvent * pe ) if (m_trackView->trackContainerView() != getGUI()->patternEditor()->m_editor) { p.drawTiledPixmap( rect(), m_background, QPoint( - tcv->currentPosition().getBar() * ppb, 0 ) ); + tcv->currentPosition().getTicks() * ppb / TimePos::ticksPerBar(), 0 ) ); } } From be96a8b779bdee0ce1f21f15976e2b0044b99fef Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:36:39 -0400 Subject: [PATCH 05/26] Remove unused variable --- include/TrackContentWidget.h | 3 --- src/gui/tracks/TrackContentWidget.cpp | 2 -- 2 files changed, 5 deletions(-) diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index 0bad6dbf706..77152f2448c 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -175,9 +175,6 @@ public slots: int m_fineGridWidth; int m_horizontalWidth; int m_embossWidth; - - TimePos m_song_editor_currentPosition; - int m_embossOffset; } ; diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index f0028f6a68e..66126e29841 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -293,8 +293,6 @@ void TrackContentWidget::changePosition( const TimePos & newPos ) } setUpdatesEnabled( true ); - m_song_editor_currentPosition = pos; - // redraw background updateBackground(); // update(); From 58af412b0353a55d28e09597c714bcf9c877f6a3 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:44:59 -0400 Subject: [PATCH 06/26] Fix scrolling speed and scrollbar width --- src/gui/editors/SongEditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 3788fdbe717..c747b49747b 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -236,7 +236,7 @@ SongEditor::SongEditor( Song * song ) : m_leftRightScroll->setMinimum( 0 ); m_leftRightScroll->setMaximum( 0 ); m_leftRightScroll->setSingleStep( 1 ); - m_leftRightScroll->setPageStep( 20 ); + m_leftRightScroll->setPageStep( 20 * TimePos::ticksPerBar() ); static_cast( layout() )->addWidget( m_leftRightScroll ); connect( m_leftRightScroll, SIGNAL(valueChanged(int)), this, SLOT(scrolled(int))); @@ -547,12 +547,12 @@ void SongEditor::wheelEvent( QWheelEvent * we ) else if(abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal { m_leftRightScroll->setValue(m_leftRightScroll->value() - - we->angleDelta().x() /30); + we->angleDelta().x()); } else if(we->modifiers() & Qt::ShiftModifier) { m_leftRightScroll->setValue(m_leftRightScroll->value() - - we->angleDelta().y() / 30); + we->angleDelta().y()); } else { From ca6aea34f3dbd37796506518c17f7f87ac5eed71 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:49:40 -0400 Subject: [PATCH 07/26] Remove QDebug and re-add a newline I deleted in an unrelated file --- include/TrackContentWidget.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index 77152f2448c..f93b0a58d6f 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -175,6 +175,7 @@ public slots: int m_fineGridWidth; int m_horizontalWidth; int m_embossWidth; + int m_embossOffset; } ; From 518ffb2461104fc4a9956bf10428138217022be4 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 19:56:43 -0400 Subject: [PATCH 08/26] Forgot to add files to commit --- src/gui/editors/PianoRoll.cpp | 2 -- src/gui/editors/SongEditor.cpp | 2 -- src/gui/tracks/TrackContentWidget.cpp | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 0e84e98bd22..2be8a5b0695 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -41,8 +41,6 @@ #include #include -#include - #ifndef __USE_XOPEN #define __USE_XOPEN #endif diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index c747b49747b..361b839e507 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -34,8 +34,6 @@ #include #include -#include - #include "ActionGroup.h" #include "AudioDevice.h" #include "AudioEngine.h" diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 66126e29841..0465b2f78ee 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -29,8 +29,6 @@ #include #include -#include - #include "AutomationClip.h" #include "Clipboard.h" #include "DataFile.h" From 0ae5a3680b83b2632fbc3554c366240111cc9752 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 21:37:51 -0400 Subject: [PATCH 09/26] Remove unused variable --- include/TimeLineWidget.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 3f399e174b8..0eb33bad935 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -214,7 +214,6 @@ public slots: QCursor m_cursorSelectRight = QCursor{embed::getIconPixmap("cursor_select_right"), 32, 16}; AutoScrollState m_autoScroll = AutoScrollState::Stepped; - AutoScrollState m_continuousAutoScroll = AutoScrollState::Disabled; // Width of the unused region on the widget's left (above track labels or piano) int m_xOffset; From b841fe9223a9f7d74f13d53198b1cf62ab44d88c Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 22:48:28 -0400 Subject: [PATCH 10/26] Fix Styling --- src/gui/editors/PianoRoll.cpp | 22 ++++++++-------- src/gui/editors/SongEditor.cpp | 36 +++++++++++++-------------- src/gui/editors/TimeLineWidget.cpp | 10 +++----- src/gui/tracks/TrackContentWidget.cpp | 4 +-- 4 files changed, 35 insertions(+), 37 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 2be8a5b0695..07c718ec9f8 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4062,7 +4062,7 @@ void PianoRoll::stop() { Engine::getSong()->stop(); m_recording = false; - m_scrollBack = ( m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled ); + m_scrollBack = (m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled); } @@ -4465,20 +4465,20 @@ void PianoRoll::autoScroll( const TimePos & t ) const int w = width() - m_whiteKeyWidth; if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { - if( t > m_currentPosition + w * TimePos::ticksPerBar() / m_ppb ) + if(t > m_currentPosition + w * TimePos::ticksPerBar() / m_ppb) { - m_leftRightScroll->setValue( t.getBar() * TimePos::ticksPerBar() ); + m_leftRightScroll->setValue(t.getBar() * TimePos::ticksPerBar()); } - else if( t < m_currentPosition ) + else if(t < m_currentPosition) { - TimePos t2 = qMax( t - w * TimePos::ticksPerBar() * - TimePos::ticksPerBar() / m_ppb, (tick_t) 0 ); - m_leftRightScroll->setValue( t2.getBar() * TimePos::ticksPerBar() ); + TimePos t2 = qMax(t - w * TimePos::ticksPerBar() * + TimePos::ticksPerBar() / m_ppb, (tick_t) 0); + m_leftRightScroll->setValue(t2.getBar() * TimePos::ticksPerBar()); } } else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { - m_leftRightScroll->setValue( std::max(t.getTicks() - w * TimePos::ticksPerBar() / m_ppb / 2, 0 ) ); + m_leftRightScroll->setValue(std::max(t.getTicks() - w * TimePos::ticksPerBar() / m_ppb / 2, 0)); } m_scrollBack = false; } @@ -4487,12 +4487,12 @@ void PianoRoll::autoScroll( const TimePos & t ) void PianoRoll::updatePosition( const TimePos & t ) { - if( ( Engine::getSong()->isPlaying() + if((Engine::getSong()->isPlaying() && Engine::getSong()->playMode() == Song::PlayMode::MidiClip && m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled - ) || m_scrollBack ) + ) || m_scrollBack) { - autoScroll( t ); + autoScroll(t); } // ticks relative to m_currentPosition // < 0 = outside viewport left diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 361b839e507..53c33666e4e 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -231,10 +231,10 @@ SongEditor::SongEditor( Song * song ) : static_cast( layout() )->insertWidget( 0, m_timeLine ); m_leftRightScroll = new QScrollBar( Qt::Horizontal, this ); - m_leftRightScroll->setMinimum( 0 ); - m_leftRightScroll->setMaximum( 0 ); - m_leftRightScroll->setSingleStep( 1 ); - m_leftRightScroll->setPageStep( 20 * TimePos::ticksPerBar() ); + m_leftRightScroll->setMinimum(0); + m_leftRightScroll->setMaximum(0); + m_leftRightScroll->setSingleStep(1); + m_leftRightScroll->setPageStep(20 * TimePos::ticksPerBar()); static_cast( layout() )->addWidget( m_leftRightScroll ); connect( m_leftRightScroll, SIGNAL(valueChanged(int)), this, SLOT(scrolled(int))); @@ -325,7 +325,7 @@ QString SongEditor::getSnapSizeString() const void SongEditor::scrolled( int new_pos ) { update(); - emit positionChanged( m_currentPosition = TimePos( new_pos ) ); + emit positionChanged(m_currentPosition = TimePos(new_pos)); } @@ -544,13 +544,13 @@ void SongEditor::wheelEvent( QWheelEvent * we ) // FIXME: Reconsider if determining orientation is necessary in Qt6. else if(abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal { - m_leftRightScroll->setValue(m_leftRightScroll->value() - - we->angleDelta().x()); + m_leftRightScroll->setValue(m_leftRightScroll->value() + - we->angleDelta().x() / pixelsPerBar()); } else if(we->modifiers() & Qt::ShiftModifier) { - m_leftRightScroll->setValue(m_leftRightScroll->value() - - we->angleDelta().y()); + m_leftRightScroll->setValue(m_leftRightScroll->value() + - we->angleDelta().y() / pixelsPerBar()); } else { @@ -713,7 +713,7 @@ void SongEditor::hideMasterPitchFloat( void ) void SongEditor::updateScrollBar( int len ) { - m_leftRightScroll->setMaximum( len * TimePos::ticksPerBar() ); + m_leftRightScroll->setMaximum(len * TimePos::ticksPerBar()); } @@ -756,8 +756,8 @@ void SongEditor::updatePosition( const TimePos & t ) const auto widgetWidth = compactTrackButtons ? DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT : DEFAULT_SETTINGS_WIDGET_WIDTH; const auto trackOpWidth = compactTrackButtons ? TRACK_OP_WIDTH_COMPACT : TRACK_OP_WIDTH; - if( ( m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song ) || - m_scrollBack == true ) + if((m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song) + || m_scrollBack == true) { m_smoothScroll = ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt(); const int w = width() - widgetWidth @@ -766,19 +766,19 @@ void SongEditor::updatePosition( const TimePos & t ) if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { - if( t > m_currentPosition + w * TimePos::ticksPerBar() / - pixelsPerBar() ) + if(t > m_currentPosition + w * TimePos::ticksPerBar() + / pixelsPerBar()) { - animateScroll( m_leftRightScroll, t.getTicks(), m_smoothScroll ); + animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); } - else if( t < m_currentPosition ) + else if(t < m_currentPosition) { - animateScroll( m_leftRightScroll, t.getTicks(), m_smoothScroll ); + animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); } } else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { - animateScroll( m_leftRightScroll, std::max(t.getTicks() - w * TimePos::ticksPerBar() / pixelsPerBar() / 2, 0.0f), m_smoothScroll ); + animateScroll(m_leftRightScroll, std::max(t.getTicks() - w * TimePos::ticksPerBar() / pixelsPerBar() / 2, 0.0f), m_smoothScroll); } m_scrollBack = false; } diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index c5f39dd933b..cb81b0faad3 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -87,15 +87,13 @@ void TimeLineWidget::setXOffset(const int x) void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { - auto autoScroll = new NStateButton(_tool_bar); - autoScroll->setGeneralToolTip( tr( "Auto scrolling" ) ); - autoScroll->addState( embed::getIconPixmap( "autoscroll_stepped_on" ) ); - autoScroll->addState( embed::getIconPixmap( "autoscroll_continuous_on" ) ); - autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); + autoScroll->setGeneralToolTip(tr("Auto scrolling")); + autoScroll->addState(embed::getIconPixmap( "autoscroll_stepped_on")); + autoScroll->addState(embed::getIconPixmap( "autoscroll_continuous_on")); + autoScroll->addState(embed::getIconPixmap( "autoscroll_off")); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); - auto loopPoints = new NStateButton(_tool_bar); loopPoints->setGeneralToolTip( tr( "Loop points" ) ); diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 0465b2f78ee..17aaa581b83 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -629,8 +629,8 @@ void TrackContentWidget::paintEvent( QPaintEvent * pe ) // Don't draw background on Pattern Editor if (m_trackView->trackContainerView() != getGUI()->patternEditor()->m_editor) { - p.drawTiledPixmap( rect(), m_background, QPoint( - tcv->currentPosition().getTicks() * ppb / TimePos::ticksPerBar(), 0 ) ); + p.drawTiledPixmap(rect(), m_background, QPoint( + tcv->currentPosition().getTicks() * ppb / TimePos::ticksPerBar(), 0)); } } From 426013110e9d750fc2935c878d725cf791d18340 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 22:51:22 -0400 Subject: [PATCH 11/26] Fix Styling Again --- src/gui/editors/TimeLineWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index cb81b0faad3..bdde3a66ba4 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -89,9 +89,9 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { auto autoScroll = new NStateButton(_tool_bar); autoScroll->setGeneralToolTip(tr("Auto scrolling")); - autoScroll->addState(embed::getIconPixmap( "autoscroll_stepped_on")); - autoScroll->addState(embed::getIconPixmap( "autoscroll_continuous_on")); - autoScroll->addState(embed::getIconPixmap( "autoscroll_off")); + autoScroll->addState(embed::getIconPixmap("autoscroll_stepped_on")); + autoScroll->addState(embed::getIconPixmap("autoscroll_continuous_on")); + autoScroll->addState(embed::getIconPixmap("autoscroll_off")); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); From ff9ffbf17104d6e450f77443639a3a51b44c0107 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 23:03:33 -0400 Subject: [PATCH 12/26] Fix Styling Again --- src/gui/editors/PianoRoll.cpp | 8 ++++---- src/gui/editors/SongEditor.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 07c718ec9f8..86441ab0192 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4465,11 +4465,11 @@ void PianoRoll::autoScroll( const TimePos & t ) const int w = width() - m_whiteKeyWidth; if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { - if(t > m_currentPosition + w * TimePos::ticksPerBar() / m_ppb) + if (t > m_currentPosition + w * TimePos::ticksPerBar() / m_ppb) { m_leftRightScroll->setValue(t.getBar() * TimePos::ticksPerBar()); } - else if(t < m_currentPosition) + else if (t < m_currentPosition) { TimePos t2 = qMax(t - w * TimePos::ticksPerBar() * TimePos::ticksPerBar() / m_ppb, (tick_t) 0); @@ -4485,9 +4485,9 @@ void PianoRoll::autoScroll( const TimePos & t ) -void PianoRoll::updatePosition( const TimePos & t ) +void PianoRoll::updatePosition(const TimePos & t) { - if((Engine::getSong()->isPlaying() + if ((Engine::getSong()->isPlaying() && Engine::getSong()->playMode() == Song::PlayMode::MidiClip && m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled ) || m_scrollBack) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 53c33666e4e..7b8b97b069c 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -542,12 +542,12 @@ void SongEditor::wheelEvent( QWheelEvent * we ) } // FIXME: Reconsider if determining orientation is necessary in Qt6. - else if(abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal + else if (abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal { m_leftRightScroll->setValue(m_leftRightScroll->value() - we->angleDelta().x() / pixelsPerBar()); } - else if(we->modifiers() & Qt::ShiftModifier) + else if (we->modifiers() & Qt::ShiftModifier) { m_leftRightScroll->setValue(m_leftRightScroll->value() - we->angleDelta().y() / pixelsPerBar()); @@ -711,7 +711,7 @@ void SongEditor::hideMasterPitchFloat( void ) -void SongEditor::updateScrollBar( int len ) +void SongEditor::updateScrollBar(int len) { m_leftRightScroll->setMaximum(len * TimePos::ticksPerBar()); } @@ -766,12 +766,12 @@ void SongEditor::updatePosition( const TimePos & t ) if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { - if(t > m_currentPosition + w * TimePos::ticksPerBar() + if (t > m_currentPosition + w * TimePos::ticksPerBar() / pixelsPerBar()) { animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); } - else if(t < m_currentPosition) + else if (t < m_currentPosition) { animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); } From a73c1b615fd8d13efad14395bfd3cfa5e2e40e1a Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 23:04:51 -0400 Subject: [PATCH 13/26] Fix Styling Again --- src/gui/editors/SongEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 7b8b97b069c..808c36724fe 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -756,7 +756,7 @@ void SongEditor::updatePosition( const TimePos & t ) const auto widgetWidth = compactTrackButtons ? DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT : DEFAULT_SETTINGS_WIDGET_WIDTH; const auto trackOpWidth = compactTrackButtons ? TRACK_OP_WIDTH_COMPACT : TRACK_OP_WIDTH; - if((m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song) + if ((m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song) || m_scrollBack == true) { m_smoothScroll = ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt(); From aa6d4bcb9f5a442d06492eec830a2e372394d199 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Thu, 25 Jul 2024 23:15:56 -0400 Subject: [PATCH 14/26] Add icons for classic theme --- .../themes/classic/autoscroll_continuous_on.png | Bin 0 -> 9733 bytes data/themes/classic/autoscroll_stepped_on.png | Bin 0 -> 11905 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 data/themes/classic/autoscroll_continuous_on.png create mode 100644 data/themes/classic/autoscroll_stepped_on.png diff --git a/data/themes/classic/autoscroll_continuous_on.png b/data/themes/classic/autoscroll_continuous_on.png new file mode 100644 index 0000000000000000000000000000000000000000..0140d5cc51733dd1475c2b9d3cb7b8f4b32ba4db GIT binary patch literal 9733 zcmeHMdpwle*MHn{DLHNxxrI(r3}Xi4ham=2xnEP#m>CQ)m~l&*N+n7NIo&8yr|LMy=kggALoP=7&m!+K+}>W~oV1C%`c5YG}F&$2o%4q!L`mKnrD{tqbPox$;dTzzPXNY-mw7 zSH~|laTWby6Sw}wrfs0kx1=u@nH9_G(#!1N;a!wz#pPY9AD84#@I`mdYtDPZu9H8&|K zZ&i_#Q`6hLRZAOzKqziP8R^3fHFXeht`Ht!Vc}IPSFIBjT?gMFw*mgcKh8r)T!^a^ zACEG`E6&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;ZAy@#l56}fD*$H)}y`8 zBih=|(k*Qt55={)9C6Z9(Xo~~~4*P+pKso&B&V^{8%?7kAP;{@LSoJYq< zET_{1+UgbksUv20wv+oq<30=XTcpNWSQ U&Y);L+HjjuHgC)}+ Date: Thu, 25 Jul 2024 23:34:36 -0400 Subject: [PATCH 15/26] Accidentally committed varying scroll speed with zoom -- removing --- src/gui/editors/SongEditor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 808c36724fe..ef402717dae 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -545,12 +545,12 @@ void SongEditor::wheelEvent( QWheelEvent * we ) else if (abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal { m_leftRightScroll->setValue(m_leftRightScroll->value() - - we->angleDelta().x() / pixelsPerBar()); + - we->angleDelta().x()); } else if (we->modifiers() & Qt::ShiftModifier) { m_leftRightScroll->setValue(m_leftRightScroll->value() - - we->angleDelta().y() / pixelsPerBar()); + - we->angleDelta().y()); } else { @@ -764,7 +764,7 @@ void SongEditor::updatePosition( const TimePos & t ) - trackOpWidth - contentWidget()->verticalScrollBar()->width(); // width of right scrollbar - if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) + if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { if (t > m_currentPosition + w * TimePos::ticksPerBar() / pixelsPerBar()) From 87ab27634f47921236de6dfa6c1cbda22c985d3b Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:43:07 -0400 Subject: [PATCH 16/26] Change abs to std::abs Co-authored-by: saker --- src/gui/editors/SongEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index ef402717dae..8b6f61e1c1e 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -542,7 +542,7 @@ void SongEditor::wheelEvent( QWheelEvent * we ) } // FIXME: Reconsider if determining orientation is necessary in Qt6. - else if (abs(we->angleDelta().x()) > abs(we->angleDelta().y())) // scrolling is horizontal + else if (std::abs(we->angleDelta().x()) > std::abs(we->angleDelta().y())) // scrolling is horizontal { m_leftRightScroll->setValue(m_leftRightScroll->value() - we->angleDelta().x()); From e0fd0665898028c431685ef439148affcf961b3e Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:44:04 -0400 Subject: [PATCH 17/26] Change qMax to std::max and use static_cast Co-authored-by: saker --- src/gui/editors/PianoRoll.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 86441ab0192..067f370b084 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4471,8 +4471,8 @@ void PianoRoll::autoScroll( const TimePos & t ) } else if (t < m_currentPosition) { - TimePos t2 = qMax(t - w * TimePos::ticksPerBar() * - TimePos::ticksPerBar() / m_ppb, (tick_t) 0); + TimePos t2 = std::max(t - w * TimePos::ticksPerBar() * + TimePos::ticksPerBar() / m_ppb, static_cast(0)); m_leftRightScroll->setValue(t2.getBar() * TimePos::ticksPerBar()); } } From d75598784900abcdb9baa2a367347445a0713d6f Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:45:01 -0400 Subject: [PATCH 18/26] Simplify stepped auto scrolling Co-authored-by: saker --- src/gui/editors/SongEditor.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 8b6f61e1c1e..971c4fa51d0 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -766,15 +766,9 @@ void SongEditor::updatePosition( const TimePos & t ) if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { - if (t > m_currentPosition + w * TimePos::ticksPerBar() - / pixelsPerBar()) - { - animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); - } - else if (t < m_currentPosition) - { - animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); - } + const auto nextPosition = m_currentPosition + w * TimePos::ticksPerBar() / pixelsPerBar(); + if (t <= nextPosition && t >= m_currentPosition) { return; } + animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); } else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { From cd80974a0f832d7ac6c07926d5af55cafab35f37 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:05:47 -0400 Subject: [PATCH 19/26] Remove unnecessary parentheses --- src/gui/editors/PianoRoll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 067f370b084..22400edce49 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -4062,7 +4062,7 @@ void PianoRoll::stop() { Engine::getSong()->stop(); m_recording = false; - m_scrollBack = (m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled); + m_scrollBack = m_timeLine->autoScroll() != TimeLineWidget::AutoScrollState::Disabled; } From 4151b2f70a2e3a5c3c1bc1132d6894c37b5ccec3 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:48:15 -0400 Subject: [PATCH 20/26] Remove return statement causing the play head line to stop --- src/gui/editors/SongEditor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 971c4fa51d0..3fb395548e4 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -767,8 +767,10 @@ void SongEditor::updatePosition( const TimePos & t ) if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Stepped) { const auto nextPosition = m_currentPosition + w * TimePos::ticksPerBar() / pixelsPerBar(); - if (t <= nextPosition && t >= m_currentPosition) { return; } - animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); + if (t > nextPosition || t < m_currentPosition) + { + animateScroll(m_leftRightScroll, t.getTicks(), m_smoothScroll); + } } else if (m_timeLine->autoScroll() == TimeLineWidget::AutoScrollState::Continuous) { From 84cfbda219b460e0c3a3a3dab359904182707498 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:24:07 -0400 Subject: [PATCH 21/26] Add specific tooltips to auto scrolling button states --- src/gui/editors/TimeLineWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index bdde3a66ba4..bc0f6c8842c 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -89,9 +89,9 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { auto autoScroll = new NStateButton(_tool_bar); autoScroll->setGeneralToolTip(tr("Auto scrolling")); - autoScroll->addState(embed::getIconPixmap("autoscroll_stepped_on")); - autoScroll->addState(embed::getIconPixmap("autoscroll_continuous_on")); - autoScroll->addState(embed::getIconPixmap("autoscroll_off")); + autoScroll->addState(embed::getIconPixmap("autoscroll_stepped_on"), "Stepped auto scrolling"); + autoScroll->addState(embed::getIconPixmap("autoscroll_continuous_on"), "Continuous auto scrolling"); + autoScroll->addState(embed::getIconPixmap("autoscroll_off"), "Auto scrolling disabled"); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); From 0017d2717761d5b3329f0003ccfabd4f5ebe85ca Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:31:35 -0400 Subject: [PATCH 22/26] Remove `== true` from SongEditor.cpp Co-authored-by: saker --- src/gui/editors/SongEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 3fb395548e4..5e90ef1ad2b 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -757,7 +757,7 @@ void SongEditor::updatePosition( const TimePos & t ) const auto trackOpWidth = compactTrackButtons ? TRACK_OP_WIDTH_COMPACT : TRACK_OP_WIDTH; if ((m_song->isPlaying() && m_song->m_playMode == Song::PlayMode::Song) - || m_scrollBack == true) + || m_scrollBack) { m_smoothScroll = ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt(); const int w = width() - widgetWidth From 1a4c7918e19bed1e9eccba9ac0d332aaa6232c61 Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Fri, 26 Jul 2024 12:34:28 -0400 Subject: [PATCH 23/26] Make tooltips translatable Co-authored-by: Dominic Clark --- src/gui/editors/TimeLineWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index bc0f6c8842c..f75b1cabfac 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -89,9 +89,9 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { auto autoScroll = new NStateButton(_tool_bar); autoScroll->setGeneralToolTip(tr("Auto scrolling")); - autoScroll->addState(embed::getIconPixmap("autoscroll_stepped_on"), "Stepped auto scrolling"); - autoScroll->addState(embed::getIconPixmap("autoscroll_continuous_on"), "Continuous auto scrolling"); - autoScroll->addState(embed::getIconPixmap("autoscroll_off"), "Auto scrolling disabled"); + autoScroll->addState(embed::getIconPixmap("autoscroll_stepped_on"), tr("Stepped auto scrolling")); + autoScroll->addState(embed::getIconPixmap("autoscroll_continuous_on"), tr("Continuous auto scrolling")); + autoScroll->addState(embed::getIconPixmap("autoscroll_off"), tr("Auto scrolling disabled")); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); From def4fa6dd49ecf42d109473e45111147e49327dc Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:46:10 -0400 Subject: [PATCH 24/26] Fix zooming position calculation --- src/gui/editors/SongEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 5e90ef1ad2b..955245d73df 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -523,7 +523,7 @@ void SongEditor::wheelEvent( QWheelEvent * we ) { int x = position(we).x() - m_trackHeadWidth; // bar based on the mouse x-position where the scroll wheel was used - int bar = x / pixelsPerBar(); + int bar = x / pixelsPerBar() * TimePos::ticksPerBar(); // move zoom slider (pixelsPerBar will change automatically) int step = we->modifiers() & Qt::ShiftModifier ? 1 : 5; @@ -532,7 +532,7 @@ void SongEditor::wheelEvent( QWheelEvent * we ) m_zoomingModel->incValue(step * direction); // scroll to zooming around cursor's bar - int newBar = static_cast(x / pixelsPerBar()); + int newBar = static_cast(x / pixelsPerBar() * TimePos::ticksPerBar()); m_leftRightScroll->setValue(m_leftRightScroll->value() + bar - newBar); // update timeline From 80643b0da9749584d468646afce7dd27daf00f6b Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Mon, 29 Jul 2024 22:52:14 -0400 Subject: [PATCH 25/26] Rename bars to ticks --- src/gui/editors/SongEditor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 955245d73df..2befc742f1f 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -522,8 +522,8 @@ void SongEditor::wheelEvent( QWheelEvent * we ) if ((we->modifiers() & Qt::ControlModifier) && (position(we).x() > m_trackHeadWidth)) { int x = position(we).x() - m_trackHeadWidth; - // bar based on the mouse x-position where the scroll wheel was used - int bar = x / pixelsPerBar() * TimePos::ticksPerBar(); + // tick based on the mouse x-position where the scroll wheel was used + int tick = x / pixelsPerBar() * TimePos::ticksPerBar(); // move zoom slider (pixelsPerBar will change automatically) int step = we->modifiers() & Qt::ShiftModifier ? 1 : 5; @@ -531,9 +531,9 @@ void SongEditor::wheelEvent( QWheelEvent * we ) int direction = (we->angleDelta().y() + we->angleDelta().x()) > 0 ? 1 : -1; m_zoomingModel->incValue(step * direction); - // scroll to zooming around cursor's bar - int newBar = static_cast(x / pixelsPerBar() * TimePos::ticksPerBar()); - m_leftRightScroll->setValue(m_leftRightScroll->value() + bar - newBar); + // scroll to zooming around cursor's tick + int newTick = static_cast(x / pixelsPerBar() * TimePos::ticksPerBar()); + m_leftRightScroll->setValue(m_leftRightScroll->value() + tick - newTick); // update timeline m_timeLine->setPixelsPerBar(pixelsPerBar()); From 9bfcea7e7c15eb3e11a2b275a6a6da42b2a5c77b Mon Sep 17 00:00:00 2001 From: regulus79 <117475203+regulus79@users.noreply.github.com> Date: Tue, 30 Jul 2024 13:24:36 -0400 Subject: [PATCH 26/26] Fix rubberband rect size --- src/gui/editors/SongEditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 2befc742f1f..f043e715acc 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -384,7 +384,7 @@ void SongEditor::updateRubberband() } //take care of the scrollbar position - int hs = (m_leftRightScroll->value() - m_scrollPos.x()) * pixelsPerBar(); + int hs = (m_leftRightScroll->value() - m_scrollPos.x()) * pixelsPerBar() / TimePos::ticksPerBar(); int vs = contentWidget()->verticalScrollBar()->value() - m_scrollPos.y(); //the adjusted origin point