From acd1b78fa64e6ae6599b05b94e85e4dd7174b885 Mon Sep 17 00:00:00 2001 From: larspalo Date: Tue, 14 May 2024 20:24:19 +0200 Subject: [PATCH] Only allow parent to set tone balance value if child is zero. Removed not needed effective tone balance function. --- src/grandorgue/dialogs/GOOrganSettingsDialog.cpp | 6 ++++-- src/grandorgue/model/GOSoundingPipe.cpp | 2 +- src/grandorgue/model/pipe-config/GOPipeConfigNode.cpp | 4 ---- src/grandorgue/model/pipe-config/GOPipeConfigNode.h | 2 -- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/grandorgue/dialogs/GOOrganSettingsDialog.cpp b/src/grandorgue/dialogs/GOOrganSettingsDialog.cpp index e846ec7c0..0a0c3abee 100644 --- a/src/grandorgue/dialogs/GOOrganSettingsDialog.cpp +++ b/src/grandorgue/dialogs/GOOrganSettingsDialog.cpp @@ -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); + } } } } diff --git a/src/grandorgue/model/GOSoundingPipe.cpp b/src/grandorgue/model/GOSoundingPipe.cpp index e42f5b90d..e76a64c5d 100644 --- a/src/grandorgue/model/GOSoundingPipe.cpp +++ b/src/grandorgue/model/GOSoundingPipe.cpp @@ -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) { diff --git a/src/grandorgue/model/pipe-config/GOPipeConfigNode.cpp b/src/grandorgue/model/pipe-config/GOPipeConfigNode.cpp index ae235f51a..a54cfb370 100644 --- a/src/grandorgue/model/pipe-config/GOPipeConfigNode.cpp +++ b/src/grandorgue/model/pipe-config/GOPipeConfigNode.cpp @@ -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, diff --git a/src/grandorgue/model/pipe-config/GOPipeConfigNode.h b/src/grandorgue/model/pipe-config/GOPipeConfigNode.h index e446b3910..c180c3676 100644 --- a/src/grandorgue/model/pipe-config/GOPipeConfigNode.h +++ b/src/grandorgue/model/pipe-config/GOPipeConfigNode.h @@ -112,8 +112,6 @@ class GOPipeConfigNode : private GOSaveableObject { uint16_t GetEffectiveReleaseTail() const; - int8_t GetEffectiveToneBalanceValue() const; - uint8_t GetEffectiveBitsPerSample() const { return GetEffectiveUint8( &GOPipeConfig::GetBitsPerSample,