Skip to content

Commit

Permalink
Renamed the class GODrawstop to GODrawStop
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Jan 14, 2025
1 parent 18e3d86 commit ffb5137
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 71 deletions.
8 changes: 4 additions & 4 deletions src/grandorgue/combinations/model/GOCombinationDefinition.cpp
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-2025 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 @@ -30,17 +30,17 @@ GOCombinationDefinition::GOCombinationDefinition(GOOrganModel &organModel)
GOCombinationDefinition::~GOCombinationDefinition() {}

void GOCombinationDefinition::AddGeneral(
GODrawstop *control, ElementType type, int manual, unsigned index) {
GODrawStop *control, ElementType type, int manual, unsigned index) {
Add(control, type, manual, index, control->IsToStoreInGeneral());
}

void GOCombinationDefinition::AddDivisional(
GODrawstop *control, ElementType type, int manual, unsigned index) {
GODrawStop *control, ElementType type, int manual, unsigned index) {
Add(control, type, manual, index, control->IsToStoreInDivisional());
}

void GOCombinationDefinition::Add(
GODrawstop *control,
GODrawStop *control,
ElementType type,
int manual,
unsigned index,
Expand Down
10 changes: 5 additions & 5 deletions src/grandorgue/combinations/model/GOCombinationDefinition.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-2025 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -13,7 +13,7 @@
#include <vector>

class GOCombinationElement;
class GODrawstop;
class GODrawStop;
class GOManual;
class GOOrganModel;

Expand Down Expand Up @@ -45,11 +45,11 @@ class GOCombinationDefinition {
std::vector<Element> m_elements;

void AddGeneral(
GODrawstop *control, ElementType type, int manual, unsigned index);
GODrawStop *control, ElementType type, int manual, unsigned index);
void AddDivisional(
GODrawstop *control, ElementType type, int manual, unsigned index);
GODrawStop *control, ElementType type, int manual, unsigned index);
void Add(
GODrawstop *control,
GODrawStop *control,
ElementType type,
int manual,
unsigned index,
Expand Down
12 changes: 6 additions & 6 deletions src/grandorgue/model/GOCoupler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -17,7 +17,7 @@

GOCoupler::GOCoupler(
GOOrganModel &organModel, unsigned sourceManual, bool isVirtual)
: GODrawstop(organModel),
: GODrawStop(organModel),
m_IsVirtual(isVirtual),
m_UnisonOff(false),
m_CoupleToSubsequentUnisonIntermanualCouplers(false),
Expand All @@ -41,7 +41,7 @@ GOCoupler::GOCoupler(
m_NumberOfKeys(127) {}

void GOCoupler::PreparePlayback() {
GODrawstop::PreparePlayback();
GODrawStop::PreparePlayback();

GOManual *src = r_OrganModel.GetManual(m_SourceManual);

Expand Down Expand Up @@ -95,7 +95,7 @@ void GOCoupler::Init(
m_DestinationManual = dest_manual;
m_DestinationKeyshift = keyshift;
SetRecursive(recursive);
GODrawstop::Init(cfg, group, name);
GODrawStop::Init(cfg, group, name);

m_CouplerType = coupler_type;
m_FirstMidiNote = 0;
Expand Down Expand Up @@ -240,15 +240,15 @@ void GOCoupler::Load(GOConfigReader &cfg, const wxString &group) {
m_NumberOfKeys = cfg.ReadInteger(
ODFSetting, group, wxT("NumberOfKeys"), 0, 127, false, 127);
}
GODrawstop::Load(cfg, group);
GODrawStop::Load(cfg, group);

if (!m_UnisonOff)
m_CouplerIndexInDest
= r_OrganModel.GetManual(m_DestinationManual)->RegisterCoupler(this);
}

void GOCoupler::SetupIsToStoreInCmb() {
GODrawstop::SetupIsToStoreInCmb();
GODrawStop::SetupIsToStoreInCmb();
m_IsToStoreInDivisional = m_IsToStoreInDivisional
&& (IsIntermanual() ? r_OrganModel.DivisionalsStoreIntermanualCouplers()
: r_OrganModel.DivisionalsStoreIntramanualCouplers());
Expand Down
4 changes: 2 additions & 2 deletions src/grandorgue/model/GOCoupler.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -16,7 +16,7 @@ class GOConfigReader;
class GOConfigWriter;
struct IniFileEnumEntry;

class GOCoupler : public GODrawstop {
class GOCoupler : public GODrawStop {
public:
typedef enum { COUPLER_NORMAL, COUPLER_BASS, COUPLER_MELODY } GOCouplerType;

Expand Down
6 changes: 3 additions & 3 deletions src/grandorgue/model/GODivisionalCoupler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -20,7 +20,7 @@ const wxString GODivisionalCoupler::WX_MIDI_TYPE_CODE
const wxString GODivisionalCoupler::WX_MIDI_TYPE_DESC = _("Divisional Coupler");

GODivisionalCoupler::GODivisionalCoupler(GOOrganModel &organModel)
: GODrawstop(organModel), m_BiDirectionalCoupling(false), m_manuals(0) {}
: GODrawStop(organModel), m_BiDirectionalCoupling(false), m_manuals(0) {}

void GODivisionalCoupler::Load(GOConfigReader &cfg, wxString group) {
wxString buffer;
Expand All @@ -45,7 +45,7 @@ void GODivisionalCoupler::Load(GOConfigReader &cfg, wxString group) {
r_OrganModel.GetFirstManualIndex(),
r_OrganModel.GetManualAndPedalCount()));
}
GODrawstop::Load(cfg, group);
GODrawStop::Load(cfg, group);
}

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

class GOOrganModel;

class GODivisionalCoupler : public GODrawstop {
class GODivisionalCoupler : public GODrawStop {
private:
static const wxString WX_MIDI_TYPE_CODE;
static const wxString WX_MIDI_TYPE_DESC;
Expand Down
42 changes: 21 additions & 21 deletions src/grandorgue/model/GODrawStop.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -15,7 +15,7 @@
#include "GOOrganModel.h"
#include "GOSwitch.h"

const struct IniFileEnumEntry GODrawstop::m_function_types[] = {
const struct IniFileEnumEntry GODrawStop::m_function_types[] = {
{wxT("Input"), FUNCTION_INPUT},
{wxT("And"), FUNCTION_AND},
{wxT("Or"), FUNCTION_OR},
Expand All @@ -25,7 +25,7 @@ const struct IniFileEnumEntry GODrawstop::m_function_types[] = {
{wxT("Xor"), FUNCTION_XOR},
};

GODrawstop::GODrawstop(GOOrganModel &organModel)
GODrawStop::GODrawStop(GOOrganModel &organModel)
: GOButtonControl(organModel, MIDI_RECV_DRAWSTOP, false),
m_Type(FUNCTION_INPUT),
m_GCState(0),
Expand All @@ -34,25 +34,25 @@ GODrawstop::GODrawstop(GOOrganModel &organModel)
m_IsToStoreInDivisional(false),
m_IsToStoreInGeneral(false) {}

void GODrawstop::RegisterControlled(GODrawstop *sw) {
void GODrawStop::RegisterControlled(GODrawStop *sw) {
m_ControlledDrawstops.push_back(sw);
}

void GODrawstop::UnRegisterControlled(GODrawstop *sw) {
void GODrawStop::UnRegisterControlled(GODrawStop *sw) {
auto end = m_ControlledDrawstops.end();
auto pos = std::find(m_ControlledDrawstops.begin(), end, sw);

m_ControlledDrawstops.erase(pos);
}

void GODrawstop::ClearControllingDrawstops() {
void GODrawStop::ClearControllingDrawstops() {
for (auto pControlling : m_ControllingDrawstops)
pControlling->UnRegisterControlled(this);
m_ControllingDrawstops.clear();
}

void GODrawstop::AddControllingDrawstop(
GODrawstop *pDrawStop, unsigned switchN, const wxString &group) {
void GODrawStop::AddControllingDrawstop(
GODrawStop *pDrawStop, unsigned switchN, const wxString &group) {
auto end = m_ControllingDrawstops.end();

if (m_Type == FUNCTION_INPUT)
Expand All @@ -66,7 +66,7 @@ void GODrawstop::AddControllingDrawstop(
m_ControllingDrawstops.push_back(pDrawStop);
}

void GODrawstop::SetFunctionType(GOFunctionType newFunctionType) {
void GODrawStop::SetFunctionType(GOFunctionType newFunctionType) {
if (newFunctionType != m_Type) {
if (m_Type == FUNCTION_INPUT)
ClearControllingDrawstops();
Expand All @@ -77,7 +77,7 @@ void GODrawstop::SetFunctionType(GOFunctionType newFunctionType) {
}
}

void GODrawstop::Init(
void GODrawStop::Init(
GOConfigReader &cfg, const wxString &group, const wxString &name) {
m_Type = FUNCTION_INPUT;
m_Engaged = cfg.ReadBoolean(CMBSetting, group, wxT("DefaultToEngaged"));
Expand All @@ -87,7 +87,7 @@ void GODrawstop::Init(
GOButtonControl::Init(cfg, group, name);
}

void GODrawstop::SetupIsToStoreInCmb() {
void GODrawStop::SetupIsToStoreInCmb() {
const bool isControlledByUser = !IsReadOnly();

m_IsToStoreInDivisional
Expand All @@ -97,7 +97,7 @@ void GODrawstop::SetupIsToStoreInCmb() {
|| isControlledByUser;
}

void GODrawstop::Load(GOConfigReader &cfg, const wxString &group) {
void GODrawStop::Load(GOConfigReader &cfg, const wxString &group) {
m_Type = (GOFunctionType)cfg.ReadEnum(
ODFSetting,
group,
Expand Down Expand Up @@ -157,13 +157,13 @@ void GODrawstop::Load(GOConfigReader &cfg, const wxString &group) {
ODFSetting, group, wxT("StoreInGeneral"), false, m_IsToStoreInGeneral);
}

void GODrawstop::Save(GOConfigWriter &cfg) {
void GODrawStop::Save(GOConfigWriter &cfg) {
if (!IsReadOnly())
cfg.WriteBoolean(m_group, wxT("DefaultToEngaged"), IsEngaged());
GOButtonControl::Save(cfg);
}

void GODrawstop::SetResultState(bool resState) {
void GODrawStop::SetResultState(bool resState) {
if (IsEngaged() != resState) {
Display(resState);
// must be before calling m_ControlledDrawstops[i]->Update();
Expand All @@ -173,7 +173,7 @@ void GODrawstop::SetResultState(bool resState) {
}
}

void GODrawstop::Reset() {
void GODrawStop::Reset() {
if (!IsReadOnly() && m_GCState >= 0) {
if (m_GCState == 0) {
// Clear all internal states
Expand All @@ -185,7 +185,7 @@ void GODrawstop::Reset() {
}
}

bool GODrawstop::CalculateResultState(bool includeDefault) const {
bool GODrawStop::CalculateResultState(bool includeDefault) const {
bool resState = false;

for (const auto &intState : m_InternalStates)
Expand All @@ -194,7 +194,7 @@ bool GODrawstop::CalculateResultState(bool includeDefault) const {
return resState;
}

void GODrawstop::SetInternalState(bool on, const wxString &stateName) {
void GODrawStop::SetInternalState(bool on, const wxString &stateName) {
bool &internalState = m_InternalStates[stateName];

if (internalState != on) {
Expand All @@ -203,23 +203,23 @@ void GODrawstop::SetInternalState(bool on, const wxString &stateName) {
}
}

void GODrawstop::SetButtonState(bool on) {
void GODrawStop::SetButtonState(bool on) {
// we prohibit changing the button state while it is engaged by a crescendo
if (!IsReadOnly() && !CalculateResultState(false))
SetDrawStopState(on);
}

void GODrawstop::SetCombinationState(bool on, const wxString &stateName) {
void GODrawStop::SetCombinationState(bool on, const wxString &stateName) {
if (!IsReadOnly())
SetInternalState(on, stateName);
}

void GODrawstop::StartPlayback() {
void GODrawStop::StartPlayback() {
GOButtonControl::StartPlayback();
Update();
}

void GODrawstop::Update() {
void GODrawStop::Update() {
bool state;
switch (m_Type) {
case FUNCTION_INPUT:
Expand Down
16 changes: 8 additions & 8 deletions src/grandorgue/model/GODrawStop.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2006 Milan Digital Audio LLC
* Copyright 2009-2024 GrandOrgue contributors (see AUTHORS)
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS)
* License GPL-2.0 or later
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html).
*/
Expand All @@ -16,7 +16,7 @@
#include "combinations/model/GOCombinationElement.h"
#include "control/GOButtonControl.h"

class GODrawstop : public GOButtonControl, virtual public GOCombinationElement {
class GODrawStop : public GOButtonControl, virtual public GOCombinationElement {
public:
enum GOFunctionType {
FUNCTION_INPUT,
Expand All @@ -34,8 +34,8 @@ class GODrawstop : public GOButtonControl, virtual public GOCombinationElement {
int m_GCState;
std::unordered_map<wxString, bool, wxStringHash, wxStringEqual>
m_InternalStates;
std::vector<GODrawstop *> m_ControlledDrawstops;
std::vector<GODrawstop *> m_ControllingDrawstops;
std::vector<GODrawStop *> m_ControlledDrawstops;
std::vector<GODrawStop *> m_ControllingDrawstops;

bool IsControlledByUser() const override { return !IsReadOnly(); }

Expand Down Expand Up @@ -68,15 +68,15 @@ class GODrawstop : public GOButtonControl, virtual public GOCombinationElement {
void StartPlayback() override;

public:
GODrawstop(GOOrganModel &organModel);
GODrawStop(GOOrganModel &organModel);

/* + For tests only */
GOFunctionType GetFunctionType() const { return m_Type; }
void SetFunctionType(GOFunctionType newFunctionType);

void ClearControllingDrawstops();
void AddControllingDrawstop(
GODrawstop *pDrawStop, unsigned switchN, const wxString &group);
GODrawStop *pDrawStop, unsigned switchN, const wxString &group);
/* - For tests only */

bool IsToStoreInDivisional() const { return m_IsToStoreInDivisional; }
Expand All @@ -85,8 +85,8 @@ class GODrawstop : public GOButtonControl, virtual public GOCombinationElement {

void Init(GOConfigReader &cfg, const wxString &group, const wxString &name);
void Load(GOConfigReader &cfg, const wxString &group);
void RegisterControlled(GODrawstop *sw);
void UnRegisterControlled(GODrawstop *sw);
void RegisterControlled(GODrawStop *sw);
void UnRegisterControlled(GODrawStop *sw);
virtual void SetButtonState(bool on) override;
virtual void Update();
void Reset();
Expand Down
Loading

0 comments on commit ffb5137

Please sign in to comment.