Skip to content
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 Automation Editor Playing from Start of Song #7463

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

regulus79
Copy link
Contributor

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()

  • Added Engine::getSong()->setToTime(m_clip->startPosition().getTicks(), Song::PlayMode::Song); for when the automation clip is standalone.
  • Added 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 in paintEvent(), 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 a setToTime() there anyway, but if I am misunderstanding its purpose that may not be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant