Skip to content

Commit

Permalink
Only allow parent to set tone balance value if child is zero. Removed…
Browse files Browse the repository at this point in the history
… not needed effective tone balance function.
  • Loading branch information
larspalo committed May 14, 2024
1 parent 2dbe935 commit acd1b78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/grandorgue/dialogs/GOOrganSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,8 +1246,10 @@ void GOOrganSettingsDialog::ApplyToneBalanceRecursively(
for (unsigned i = 0; i < node->GetChildCount(); i++) {
GOPipeConfigNode *child = node->GetChild(i);
if (child) {
child->GetPipeConfig().SetToneBalanceValue(value);
ApplyToneBalanceRecursively(child, value);
if (!child->GetPipeConfig().GetToneBalanceValue()) {
child->GetPipeConfig().SetToneBalanceValue(value);
ApplyToneBalanceRecursively(child, value);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/grandorgue/model/GOSoundingPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ void GOSoundingPipe::UpdateReleaseTail() {

void GOSoundingPipe::UpdateToneBalance() {
m_SoundProvider.SetToneBalanceValue(
m_PipeConfigNode.GetEffectiveToneBalanceValue());
m_PipeConfigNode.GetPipeConfig().GetToneBalanceValue());
}

void GOSoundingPipe::SetTemperament(const GOTemperament &temperament) {
Expand Down
4 changes: 0 additions & 4 deletions src/grandorgue/model/pipe-config/GOPipeConfigNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ uint16_t GOPipeConfigNode::GetEffectiveReleaseTail() const {
return releaseTail;
}

int8_t GOPipeConfigNode::GetEffectiveToneBalanceValue() const {
return m_PipeConfig.GetToneBalanceValue();
}

uint8_t GOPipeConfigNode::GetEffectiveUint8(
int8_t (GOPipeConfig::*getThisValue)() const,
uint8_t (GOPipeConfigNode::*getParentValue)() const,
Expand Down
2 changes: 0 additions & 2 deletions src/grandorgue/model/pipe-config/GOPipeConfigNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ class GOPipeConfigNode : private GOSaveableObject {

uint16_t GetEffectiveReleaseTail() const;

int8_t GetEffectiveToneBalanceValue() const;

uint8_t GetEffectiveBitsPerSample() const {
return GetEffectiveUint8(
&GOPipeConfig::GetBitsPerSample,
Expand Down

0 comments on commit acd1b78

Please sign in to comment.