Skip to content

Commit

Permalink
Fixed saving Max release tail to the organ preset #1804
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Apr 11, 2024
1 parent b42b4d8 commit a8be424
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fixed saving Max release tail to the organ preset https://github.com/GrandOrgue/grandorgue/issues/1804
- Added support of macOS on Apple silicon. GrandOrgue for macOS on Apple silicon requires macOS 14 or higher. GrandOrgue for macOS on Intel requires macOS 12.1 or higher. https://github.com/GrandOrgue/grandorgue/discussions/1153
- Added ad-hoc code signing of GrandOrgue for macOS https://github.com/GrandOrgue/grandorgue/issues/1835
- Fixed an error that occurred when trying to install the GrandOrgue RPM package https://github.com/GrandOrgue/grandorgue/issues/1859
Expand Down
13 changes: 2 additions & 11 deletions src/grandorgue/GODocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ bool GODocument::LoadOrgan(
CloseOrgan();
return false;
}
m_sound.GetSettings().AddOrgan(m_OrganController->GetOrganInfo());
cfg.AddOrgan(m_OrganController->GetOrganInfo());
cfg.Flush();
{
wxCommandEvent event(wxEVT_SETVALUE, ID_METER_AUDIO_SPIN);
event.SetInt(m_OrganController->GetVolume());
Expand All @@ -73,16 +74,6 @@ bool GODocument::LoadOrgan(
m_sound.GetEngine().SetVolume(m_OrganController->GetVolume());
}

// synchronize cfg.ReleaseTail with OrganReleaseTail.
unsigned cfgReleaseTail = cfg.ReleaseLength();
unsigned organReleaseTail = m_OrganController->GetReleaseTail();

if (organReleaseTail) // organReleaseTail has the priority
cfg.ReleaseLength(organReleaseTail);
else if (cfgReleaseTail)
m_OrganController->SetReleaseTail(cfgReleaseTail);
cfg.Flush();

wxCommandEvent event(wxEVT_WINTITLE, 0);
event.SetString(m_OrganController->GetChurchName());
wxTheApp->GetTopWindow()->GetEventHandler()->AddPendingEvent(event);
Expand Down
4 changes: 1 addition & 3 deletions src/grandorgue/GOFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ GOFrame::GOFrame(
wxDefaultSize,
choices);
m_ToolBar->AddControl(m_ReleaseLength);
UpdateReleaseLength(m_config.ReleaseLength());
UpdateReleaseLength(0);

m_ToolBar->AddTool(
ID_TRANSPOSE,
Expand Down Expand Up @@ -492,8 +492,6 @@ void GOFrame::UpdateReleaseLength(unsigned releaseLength) {

if (organController && organController->GetReleaseTail() != releaseLength)
organController->SetReleaseTail(releaseLength);
if (m_config.ReleaseLength() != releaseLength)
m_config.ReleaseLength(releaseLength);
if (m_ReleaseLength->GetSelection() != releaseLengthIndex)
m_ReleaseLength->SetSelection(releaseLengthIndex);
}
Expand Down
1 change: 0 additions & 1 deletion src/grandorgue/config/GOConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ GOConfig::GOConfig(wxString instance)
PolyphonyLimit(
this, wxT("General"), wxT("PolyphonyLimit"), 0, MAX_POLYPHONY, 2048),
Preset(this, wxT("General"), wxT("Preset"), 0, MAX_PRESET, 0),
ReleaseLength(this, wxT("General"), wxT("ReleaseLength"), 0, 3000, 0),
LanguageCode(this, wxT("General"), wxT("Language"), wxEmptyString),
BitsPerSample(this, wxT("General"), wxT("BitsPerSample"), 8, 24, 24),
Transpose(this, wxT("General"), wxT("Transpose"), -11, 11, 0),
Expand Down
1 change: 0 additions & 1 deletion src/grandorgue/config/GOConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class GOConfig : public GOSettingStore, public GOOrganList {
GOSettingInteger Volume;
GOSettingUnsigned PolyphonyLimit;
GOSettingUnsigned Preset;
GOSettingUnsigned ReleaseLength;
GOSettingString LanguageCode;

class GOSettingUnsignedBit : public GOSettingUnsigned {
Expand Down

0 comments on commit a8be424

Please sign in to comment.