Fix Automation Editor Playing from Start of Song #7463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request makes the play button in the automation editor teleport the playhead position to where the clip begins before playing the song, instead of playing from the very start. In the case of note detuning, it teleports the playhead to the position of the note being detuned.
Changes
In
AutomationEditor::play()
Engine::getSong()->setToTime(m_clip->startPosition().getTicks(), Song::PlayMode::Song);
for when the automation clip is standalone.Engine::getSong()->setToTime(m_detuningOffset, Song::PlayMode::MidiClip);
in two places for when the automation editor is being used for note detuning.However, since the position of the note which is being detuned is only stored in a temportary variable, a new private member was also added,
m_detuningOffset
, which is assigned when the notes are being looped over to find the detuning note inpaintEvent()
, so that it can be accessed in AutomationEditor::play().Note
I am not sure what the purpose of the
playMidiClip()
on line 1694, as I could never get it to execute during normal usage, playing/stopping in the detuner. I have added asetToTime()
there anyway, but if I am misunderstanding its purpose that may not be necessary.