Skip to content

Commit

Permalink
Beautified code of GOPipe::Load
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Feb 14, 2024
1 parent 4c842a1 commit 5b4baac
Show file tree
Hide file tree
Showing 9 changed files with 7,501 additions and 5,854 deletions.
13,310 changes: 7,484 additions & 5,826 deletions ide-projects/NetBeans12/nbproject/configurations.xml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/grandorgue/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ model/GOCacheObject.cpp
model/GOCoupler.cpp
model/GODivisionalCoupler.cpp
model/GODrawStop.cpp
model/GODummyPipe.cpp
model/GOEnclosure.cpp
model/GOEventHandlerList.cpp
model/GOManual.cpp
Expand Down
16 changes: 0 additions & 16 deletions src/grandorgue/model/GODummyPipe.cpp

This file was deleted.

10 changes: 6 additions & 4 deletions src/grandorgue/model/GODummyPipe.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2023 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -12,13 +12,15 @@

class GODummyPipe : public GOPipe {
private:
void VelocityChanged(unsigned velocity, unsigned old_velocity);
void VelocityChanged(unsigned velocity, unsigned old_velocity) override {}

public:
GODummyPipe(
GOEventHandlerList *handlerList, GORank *rank, unsigned midi_key_number);
GOEventHandlerList *handlerList, GORank *rank, unsigned midi_key_number)
: GOPipe(handlerList, rank, midi_key_number) {}

void Load(GOConfigReader &cfg, wxString group, wxString prefix);
void Load(GOConfigReader &cfg, const wxString &group, const wxString &prefix)
override {}
};

#endif
6 changes: 4 additions & 2 deletions src/grandorgue/model/GOPipe.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2023 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand Down Expand Up @@ -41,7 +41,9 @@ class GOPipe : protected GOSoundStateHandler {
GOPipe(
GOEventHandlerList *handlerList, GORank *rank, unsigned midi_key_number);
virtual ~GOPipe();
virtual void Load(GOConfigReader &cfg, wxString group, wxString prefix) = 0;
virtual void Load(
GOConfigReader &cfg, const wxString &group, const wxString &prefix)
= 0;
/**
* Called from GORank when a user presses the key
* @param velocity the velocity value of the midi event
Expand Down
2 changes: 1 addition & 1 deletion src/grandorgue/model/GOReferencePipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GOReferencePipe::GOReferencePipe(
m_Filename() {}

void GOReferencePipe::Load(
GOConfigReader &cfg, wxString group, wxString prefix) {
GOConfigReader &cfg, const wxString &group, const wxString &prefix) {
SetGroupAndPrefix(group, prefix);
m_model->RegisterCacheObject(this);
m_Filename = cfg.ReadStringTrim(ODFSetting, group, prefix);
Expand Down
3 changes: 2 additions & 1 deletion src/grandorgue/model/GOReferencePipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class GOReferencePipe : public GOPipe, private GOCacheObject {
public:
GOReferencePipe(GOOrganModel *model, GORank *rank, unsigned midi_key_number);

void Load(GOConfigReader &cfg, wxString group, wxString prefix);
void Load(GOConfigReader &cfg, const wxString &group, const wxString &prefix)
override;
};

#endif
2 changes: 1 addition & 1 deletion src/grandorgue/model/GOSoundingPipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void GOSoundingPipe::LoadReleaseFileInfo(
}

void GOSoundingPipe::Load(
GOConfigReader &cfg, wxString group, wxString prefix) {
GOConfigReader &cfg, const wxString &group, const wxString &prefix) {
SetGroupAndPrefix(group, prefix);
p_OrganModel->RegisterCacheObject(this);
m_Filename = cfg.ReadStringTrim(ODFSetting, group, prefix);
Expand Down
5 changes: 3 additions & 2 deletions src/grandorgue/model/GOSoundingPipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class GOSoundingPipe : public GOPipe,

public:
GOSoundingPipe(
GOOrganModel *organController,
GOOrganModel *pOrganModel,
GORank *rank,
bool percussive,
int sampler_group_id,
Expand All @@ -128,7 +128,8 @@ class GOSoundingPipe : public GOPipe,
const wxString &group,
const wxString &prefix,
const wxString &filename);
void Load(GOConfigReader &cfg, wxString group, wxString prefix);
void Load(GOConfigReader &cfg, const wxString &group, const wxString &prefix)
override;
};

#endif

0 comments on commit 5b4baac

Please sign in to comment.