Skip to content

Commit 4e9549c

Browse files
author
larspalo
committed
Fixed crash when writing odf and rank tried to access NULL windchest. Fixed reading odf with only pedal. Made sure CMake would consider changes to version.txt. [skip ci]
1 parent 6859188 commit 4e9549c

File tree

5 files changed

+43
-25
lines changed

5 files changed

+43
-25
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Option to create new panel from selection on existing panel display.
1313

14+
## [0.11.1] - 2024-04-22
15+
16+
### Changed
17+
18+
- CMake build system now take changes to version.txt file into account.
19+
20+
### Fixed
21+
22+
- Crash when writing .organ file and a rank tried to access non existant windchest.
23+
- Loading of an .organ file with only a pedal as manual.
24+
1425
## [0.11.0] - 2024-03-30
1526

1627
### Added

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
cmake_minimum_required(VERSION 3.10)
1818

19-
# read PROGRAM_VERSION from file
19+
# Make sure that the version file will be considered by CMake
20+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/version.txt")
21+
22+
# Read PROGRAM_VERSION from file
2023
if(EXISTS "${CMAKE_SOURCE_DIR}/version.txt")
2124
file(READ "${CMAKE_SOURCE_DIR}/version.txt" PROGRAM_VERSION)
2225
string(STRIP "${PROGRAM_VERSION}" PROGRAM_VERSION)

src/OrganFileParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ void OrganFileParser::parseOrganSection() {
330330
// needs to be parsed after all manuals have been added to the organ
331331
// and then the divisionals need to be added after the couplers
332332
int nbrManuals = static_cast<int>(m_organFile->ReadLong("NumberOfManuals", 0));
333-
if (nbrManuals > 0 && nbrManuals < 17) {
333+
if ((nbrManuals > 0 && nbrManuals < 17) || (nbrManuals == 0 && m_organ->doesHavePedals())) {
334334
if (m_organ->doesHavePedals())
335335
nbrManuals += 1;
336336
for (int i = 0; i < nbrManuals; i++) {

src/Rank.cpp

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,22 @@ void Rank::write(wxTextFile *outFile) {
8888
outFile->AddLine(wxT("HarmonicNumber=") + wxString::Format(wxT("%i"), harmonicNumber));
8989
if (pitchCorrection != 0)
9090
outFile->AddLine(wxT("PitchCorrection=") + wxString::Format(wxT("%f"), pitchCorrection));
91-
wxString wcRef = GOODF_functions::number_format(::wxGetApp().m_frame->m_organ->getIndexOfOrganWindchest(windchest));
92-
outFile->AddLine(wxT("WindchestGroup=") + wcRef);
93-
if (percussive != windchest->getIsPercussive()) {
94-
if (percussive) {
95-
outFile->AddLine(wxT("Percussive=Y"));
96-
if (hasIndependentRelease != windchest->getHasIndependentRelease()) {
97-
if (hasIndependentRelease) {
98-
outFile->AddLine(wxT("HasIndependentRelease=Y"));
99-
} else {
100-
outFile->AddLine(wxT("HasIndependentRelease=N"));
91+
if (windchest) {
92+
wxString wcRef = GOODF_functions::number_format(::wxGetApp().m_frame->m_organ->getIndexOfOrganWindchest(windchest));
93+
outFile->AddLine(wxT("WindchestGroup=") + wcRef);
94+
if (percussive != windchest->getIsPercussive()) {
95+
if (percussive) {
96+
outFile->AddLine(wxT("Percussive=Y"));
97+
if (hasIndependentRelease != windchest->getHasIndependentRelease()) {
98+
if (hasIndependentRelease) {
99+
outFile->AddLine(wxT("HasIndependentRelease=Y"));
100+
} else {
101+
outFile->AddLine(wxT("HasIndependentRelease=N"));
102+
}
101103
}
104+
} else {
105+
outFile->AddLine(wxT("Percussive=N"));
102106
}
103-
} else {
104-
outFile->AddLine(wxT("Percussive=N"));
105107
}
106108
}
107109
if (minVelocityVolume != 100)
@@ -135,16 +137,18 @@ void Rank::writeFromStop(wxTextFile *outFile) {
135137
outFile->AddLine(wxT("HarmonicNumber=") + wxString::Format(wxT("%i"), harmonicNumber));
136138
if (pitchCorrection != 0)
137139
outFile->AddLine(wxT("PitchCorrection=") + wxString::Format(wxT("%f"), pitchCorrection));
138-
wxString wcRef = GOODF_functions::number_format(::wxGetApp().m_frame->m_organ->getIndexOfOrganWindchest(windchest));
139-
outFile->AddLine(wxT("WindchestGroup=") + wcRef);
140-
if (percussive != windchest->getIsPercussive()) {
141-
if (percussive) {
142-
outFile->AddLine(wxT("Percussive=Y"));
143-
if (hasIndependentRelease) {
144-
outFile->AddLine(wxT("HasIndependentRelease=Y"));
140+
if (windchest) {
141+
wxString wcRef = GOODF_functions::number_format(::wxGetApp().m_frame->m_organ->getIndexOfOrganWindchest(windchest));
142+
outFile->AddLine(wxT("WindchestGroup=") + wcRef);
143+
if (percussive != windchest->getIsPercussive()) {
144+
if (percussive) {
145+
outFile->AddLine(wxT("Percussive=Y"));
146+
if (hasIndependentRelease) {
147+
outFile->AddLine(wxT("HasIndependentRelease=Y"));
148+
}
149+
} else {
150+
outFile->AddLine(wxT("Percussive=N"));
145151
}
146-
} else {
147-
outFile->AddLine(wxT("Percussive=N"));
148152
}
149153
}
150154
if (minVelocityVolume != 100)
@@ -198,7 +202,7 @@ void Rank::read(wxFileConfig *cfg, Organ *readOrgan) {
198202
if (pitchCorr >= -1800 && pitchCorr <= 1800) {
199203
setPitchCorrection(pitchCorr);
200204
}
201-
int windchestRef = static_cast<int>(cfg->ReadLong("WindchestGroup", 1));
205+
int windchestRef = static_cast<int>(cfg->ReadLong("WindchestGroup", 0));
202206
if (windchestRef > 0 && windchestRef <= (int) readOrgan->getNumberOfWindchestgroups()) {
203207
setWindchest(readOrgan->getOrganWindchestgroupAt(windchestRef - 1));
204208
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.0
1+
0.11.1

0 commit comments

Comments
 (0)