Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminated usage of GOOrganController from GOLabelControl #2097

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/grandorgue/GOAudioRecorder.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 Down Expand Up @@ -45,7 +45,7 @@ const struct GOElementCreator::ButtonDefinitionEntry *GOAudioRecorder::
GOAudioRecorder::GOAudioRecorder(GOOrganController *organController)
: m_OrganController(organController),
m_recorder(NULL),
m_RecordingTime(organController),
m_RecordingTime(*organController),
m_RecordSeconds(0),
m_Filename(),
m_DoRename(false) {
Expand Down
6 changes: 3 additions & 3 deletions src/grandorgue/GOMetronome.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 Down Expand Up @@ -53,8 +53,8 @@ GOMetronome::GOMetronome(GOOrganController *organController)
m_MeasureLength(4),
m_Pos(0),
m_Running(false),
m_BPMDisplay(organController),
m_MeasureDisplay(organController),
m_BPMDisplay(*organController),
m_MeasureDisplay(*organController),
m_rank(NULL),
m_StopID(0) {
CreateButtons(*m_OrganController);
Expand Down
6 changes: 3 additions & 3 deletions src/grandorgue/GOOrganController.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 Down Expand Up @@ -122,8 +122,8 @@ GOOrganController::GOOrganController(
m_SampleSetId1(0),
m_SampleSetId2(0),
m_bitmaps(nullptr),
m_PitchLabel(this),
m_TemperamentLabel(this),
m_PitchLabel(*this),
m_TemperamentLabel(*this),
m_MainWindowData(this, wxT("MainWindow")) {
if (isAppInitialized) {
// Load here objects that needs App (wx) to be loaded
Expand Down
4 changes: 2 additions & 2 deletions src/grandorgue/combinations/GODivisionalSetter.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 Down Expand Up @@ -119,7 +119,7 @@ GODivisionalSetter::GODivisionalSetter(
organController->RegisterCombinationButtonSet(this);
for (unsigned manualN = 0; manualN < m_NManuals; manualN++) {
m_manualBanks.push_back(0);
m_BankLabels.push_back(new GOLabelControl(organController));
m_BankLabels.push_back(new GOLabelControl(*organController));
m_DivisionalMaps.emplace_back();
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/grandorgue/combinations/GOSetter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,12 @@ GOSetter::GOSetter(GOOrganController *organController)
m_framegeneral(0),
m_general(0),
m_crescendo(0),
m_CurrFileDisplay(organController),
m_PosDisplay(organController),
m_BankDisplay(organController),
m_CrescendoDisplay(organController),
m_TransposeDisplay(organController),
m_NameDisplay(organController),
m_CurrFileDisplay(*organController),
m_PosDisplay(*organController),
m_BankDisplay(*organController),
m_CrescendoDisplay(*organController),
m_TransposeDisplay(*organController),
m_NameDisplay(*organController),
m_CrescendoCtrl(*organController) {
CreateButtons(*m_OrganController);

Expand Down
5 changes: 3 additions & 2 deletions src/grandorgue/combinations/GOSetter.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 Down Expand Up @@ -28,8 +28,9 @@

#define N_CRESCENDOS 4

class GOGeneralCombination;
class GODivisionalCombination;
class GOGeneralCombination;
class GOOrganController;

class GOSetter : private GOSoundStateHandler,
private GOCombinationButtonSet,
Expand Down
28 changes: 14 additions & 14 deletions src/grandorgue/control/GOLabelControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,46 @@

#include <wx/intl.h>

#include "GODocument.h"
#include "GOOrganController.h"
#include "config/GOConfig.h"
#include "model/GOOrganModel.h"

#include "GODocument.h"

GOLabelControl::GOLabelControl(GOOrganController *organController)
: GOMidiObject(*organController),
GOLabelControl::GOLabelControl(GOOrganModel &organModel)
: GOMidiConfigurator(organModel),
m_Name(),
m_Content(),
m_OrganController(organController),
m_sender(*organController, MIDI_SEND_LABEL) {
m_OrganController->RegisterMidiConfigurator(this);
m_OrganController->RegisterSoundStateHandler(this);
m_sender(organModel, MIDI_SEND_LABEL) {
r_OrganModel.RegisterMidiConfigurator(this);
r_OrganModel.RegisterSoundStateHandler(this);
}

GOLabelControl::~GOLabelControl() {}

void GOLabelControl::Init(GOConfigReader &cfg, wxString group, wxString name) {
m_OrganController->RegisterSaveableObject(this);
r_OrganModel.RegisterSaveableObject(this);
m_group = group;
m_Name = name;
m_sender.Load(cfg, m_group, m_OrganController->GetSettings().GetMidiMap());
m_sender.Load(cfg, m_group, r_OrganModel.GetConfig().GetMidiMap());
}

void GOLabelControl::Load(GOConfigReader &cfg, wxString group, wxString name) {
m_OrganController->RegisterSaveableObject(this);
r_OrganModel.RegisterSaveableObject(this);
m_group = group;
m_Name = name;
m_sender.Load(cfg, m_group, m_OrganController->GetSettings().GetMidiMap());
m_sender.Load(cfg, m_group, r_OrganModel.GetConfig().GetMidiMap());
}

void GOLabelControl::Save(GOConfigWriter &cfg) {
m_sender.Save(cfg, m_group, m_OrganController->GetSettings().GetMidiMap());
m_sender.Save(cfg, m_group, r_OrganModel.GetConfig().GetMidiMap());
}

const wxString &GOLabelControl::GetContent() { return m_Content; }

void GOLabelControl::SetContent(wxString name) {
m_Content = name;
m_sender.SetLabel(m_Content);
m_OrganController->SendControlChanged(this);
r_OrganModel.SendControlChanged(this);
}

void GOLabelControl::AbortPlayback() {
Expand Down
6 changes: 3 additions & 3 deletions src/grandorgue/control/GOLabelControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@

class GOConfigReader;
class GOConfigWriter;
class GOOrganController;
class GOOrganModel;

class GOLabelControl : public GOControl,
private GOSaveableObject,
private GOSoundStateHandler,
public GOMidiObject {
protected:
GOOrganModel &r_OrganModel;
wxString m_Name;
wxString m_Content;
wxString m_group;
GOOrganController *m_OrganController;
GOMidiSender m_sender;

void Save(GOConfigWriter &cfg) override;
Expand All @@ -39,7 +39,7 @@ class GOLabelControl : public GOControl,
void PrepareRecording() override;

public:
GOLabelControl(GOOrganController *organController);
GOLabelControl(GOOrganModel &organModel);
virtual ~GOLabelControl();
void Init(GOConfigReader &cfg, wxString group, wxString name);
void Load(GOConfigReader &cfg, wxString group, wxString name);
Expand Down
4 changes: 2 additions & 2 deletions src/grandorgue/midi/GOMidiPlayer.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 Down Expand Up @@ -50,7 +50,7 @@ GOMidiPlayer::GOMidiPlayer(GOOrganController *organController)
r_timer(*organController->GetTimer()),
p_midi(nullptr),
m_content(),
m_PlayingTime(organController),
m_PlayingTime(*organController),
m_Start(0),
m_PlayingSeconds(0),
m_Speed(1),
Expand Down
4 changes: 2 additions & 2 deletions src/grandorgue/midi/GOMidiRecorder.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 Down Expand Up @@ -49,7 +49,7 @@ const struct GOElementCreator::ButtonDefinitionEntry *GOMidiRecorder::
GOMidiRecorder::GOMidiRecorder(GOOrganController *organController)
: m_OrganController(organController),
m_Map(organController->GetSettings().GetMidiMap()),
m_RecordingTime(organController),
m_RecordingTime(*organController),
m_RecordSeconds(0),
m_NextChannel(0),
m_NextNRPN(0),
Expand Down
Loading