Fix for LFO Controller desync on changing play position with the mouse.#8081
Fix for LFO Controller desync on changing play position with the mouse.#8081Jan125 wants to merge 6 commits intoLMMS:masterfrom
Conversation
Fixes LMMS#7528 LFO Controller phase is now updated properly on moving the playhead with the mouse. Unsure whether this fix has far reaching consequences.
Song.h: -Formatting: --Remove spaces (Leftover from copy-paste) TimeLineWidget.cpp: -Formatting: --Remove unnecessary parentheses for inversion (Leftover from copy-paste) --Unpack else --Remove spaces (Leftover from copy-paste) --Remove unused code Thanks to szeli1 for pointing it out.
165f284 to
8e57977
Compare
All instances of setToTime replaced by setPlayPos. Seemingly unused delta time in setPlayPos changed to absolute position. Associated unused code removed. Side effect: Loop-jumping in the editor now also calculates LFO Controller phases correctly. Export is unaffected as of yet. (Intended design for smoother song flow vs. reproducability of song in editor?)
|
As mentioned in that commit, exporting with loops is a case that handle differently. |
| m_elapsedTicks += ticksFromPlayMode - ticks; | ||
| m_elapsedMilliSeconds[static_cast<std::size_t>(playMode)] += TimePos::ticksToMilliseconds( ticks - ticksFromPlayMode, getTempo() ); | ||
| m_elapsedTicks = ticks; | ||
| m_elapsedMilliSeconds[static_cast<std::size_t>(playMode)] = TimePos::ticksToMilliseconds( ticks , getTempo() ); |
There was a problem hiding this comment.
I am not seeing a change in behaviour here.
It has been handled arguably incorrectly before:
-Run song from the beginning: Get total time correctly.
-Run song from after tempo change: Time is calculated on that point as if the current tempo was always the tempo.
There was a problem hiding this comment.
What I am now seeing is a regression in that the timer on top no longer updates when you move the playhead with the mouse when it's not playing, so I will be fixing that.
There was a problem hiding this comment.
Turns out I was looking in the wrong place regarding the previous comment.
We have to explicitly specify both of these cases, otherwise the timer does not get updated.
Fixes #7528
LFO Controller phase is now updated properly on moving the playhead with the mouse.
Unsure whether this fix has far reaching consequences.