New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrong visual play position when inside loop #11840
Conversation
… inside loop Unified some symbols naming
a2bc887
to
38a9391
Compare
Nice to see it was indeed straightforward and could be done with a few changes! |
The slip position also follows loops. Even though there are no loop markers on the spinners, it would be correct to consider loops as well. |
This seems to be another bug. According to our manual, not to follow loops is explicitly the purpose of the Slip mode:
|
FWIW I noticed the offset with quantized full-track loops aka repeat where the playpos would be before track start for a glimpse, and then jump to the actual engine playpos. |
In general I agree, but this is out of scope of this waveform PR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work with catching loops in font of the play position. In this case the waveform shows already the loop.
src/waveform/visualplayposition.cpp
Outdated
|
||
double interpolatedPlayPos = data.m_playPos + offset * data.m_playRate; | ||
|
||
if (data.m_loopEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this must only applied when the data.m_playPos
is on one side of the loop marker and the interpolatedPlayPos
is on the other side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've commited a fix.
You can use exactly the same code in getPlaySlipAtNextVSync() for the spinnies for both positions slip and normal. |
I don't think it's that easy for the slip position, because it depends on the order of activation of loop and slip mode. I worked already on a follow-up PR for the spinnies, but than found: #11844 |
Based on #11848 I could easily add the code for the slip indicator in the spinnies too. |
985ba70
to
dfbb19e
Compare
dfbb19e
to
1bd9813
Compare
SlipModeState in singular
1bd9813
to
e50eb82
Compare
Ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Two remaining comments.
src/engine/controls/loopingcontrol.h
Outdated
@@ -58,6 +58,12 @@ class LoopingControl : public EngineControl { | |||
void setLoop(mixxx::audio::FramePos startPosition, | |||
mixxx::audio::FramePos endPosition, | |||
bool enabled); | |||
mixxx::audio::FramePos getLoopStartPosition() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loop Start and End should be only read atomically. This avoids that the position can slip out during moving the loop.
In this case LoopInfo should be returned, or both values in a single call.
src/engine/slipmodestate.h
Outdated
|
||
enum class SlipModeState { | ||
Disabled = 0, | ||
Armed = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a brief comment about armed?
Requested changes are done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you
Closes: #11836
The loop is now considered in VisualPlayPosition::getAtNextVSync which determines the visual play position used fo the waveform rendering. The play position indicator is no always inside an active loop. Forward and reverse playing direction is considered.
It wasn't neccessary to change VisualPlayPosition::getPlaySlipAtNextVSync because this is only used for the spinnies, which do not visualize loops. Therefore no special handling for slip position was necesarry.
Furthermore I unified some odd sympol naming in the VisualPlayPosition code.