Skip to content

Commit

Permalink
Optimised refreshing a coupler
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Feb 29, 2024
1 parent b25656e commit 41a7a8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/grandorgue/model/GOCoupler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,9 @@ void GOCoupler::RefreshState() {
GOManual *dest = r_OrganModel.GetManual(m_DestinationManual);

for (unsigned l = m_OutVelocity.size(), i = 0; i < l; i++)
dest->PropagateKeyToCouplers(i);
// check if the key is set. Otherwise propagating is not necessary
if (m_OutVelocity[i])
dest->PropagateKeyToCouplers(i);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/grandorgue/model/GOCoupler.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class GOCoupler : public GODrawstop {
GOCouplerType coupler_type);
void Load(GOConfigReader &cfg, wxString group);

// send key states for all chaned couplers
void RefreshState();

void SetKey(
Expand Down

0 comments on commit 41a7a8e

Please sign in to comment.