-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 bug introduced by #5657 #5982
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6371c90
Fix bug introduced by #5657
IanCaio fb896ff
Make some changes to the way #5657 works
IanCaio bad05be
Addresses Dom review
IanCaio 2eaaeff
Fixes the place of the model change request
IanCaio 04f5c63
Removes unnecessary conditional
IanCaio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -405,17 +405,15 @@ void Song::processAutomations(const TrackList &tracklist, TimePos timeStart, fpp | |
} | ||
} | ||
|
||
// Checks if an automated model stopped being automated by automation patterns | ||
// so we can move the control back to any connected controller again | ||
// Moves the control of the models that were processed earlier to their controllers. | ||
// If they get processed again, setAutomatedValue() will move the control back | ||
// to the automation. | ||
if (!m_oldAutomatedValues.isEmpty()) | ||
{ | ||
for (auto it = m_oldAutomatedValues.begin(); it != m_oldAutomatedValues.end(); it++) | ||
{ | ||
AutomatableModel * am = it.key(); | ||
if (am->controllerConnection() && !values.contains(am)) | ||
{ | ||
am->setUseControllerValue(true); | ||
} | ||
am->setUseControllerValue(true); | ||
} | ||
} | ||
m_oldAutomatedValues = values; | ||
|
@@ -427,10 +425,6 @@ void Song::processAutomations(const TrackList &tracklist, TimePos timeStart, fpp | |
{ | ||
it.key()->setAutomatedValue(it.value()); | ||
} | ||
else if (!it.key()->useControllerValue()) | ||
{ | ||
it.key()->setUseControllerValue(true); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -687,6 +681,18 @@ void Song::stop() | |
// remove all note-play-handles that are active | ||
Engine::mixer()->clear(); | ||
|
||
// Moves the control of the models that were processed on the last frame | ||
// back to their controllers. | ||
if (!m_oldAutomatedValues.isEmpty()) | ||
{ | ||
for (auto it = m_oldAutomatedValues.begin(); it != m_oldAutomatedValues.end(); it++) | ||
{ | ||
AutomatableModel * am = it.key(); | ||
am->setUseControllerValue(true); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The if statement here isn't necessary. |
||
m_oldAutomatedValues.clear(); | ||
DomClark marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
m_playMode = Mode_None; | ||
|
||
emit stopped(); | ||
|
@@ -886,6 +892,9 @@ void Song::clearProject() | |
m_masterPitchModel.reset(); | ||
m_timeSigModel.reset(); | ||
|
||
// Clear the m_oldAutomatedValues AutomatedValueMap | ||
m_oldAutomatedValues.clear(); | ||
|
||
AutomationPattern::globalAutomationPattern( &m_tempoModel )->clear(); | ||
AutomationPattern::globalAutomationPattern( &m_masterVolumeModel )-> | ||
clear(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
setUseControllerValue
causes the model to emit itsdataChanged
signal, so this change means that all automated models will emit that signal twice per buffer (plus an additional third time if their value actually changes). I'm not sure what sort of impact this has, but it may be worth looking at.