Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Got rid of the clang warning of overriding CurrentSelection
Browse files Browse the repository at this point in the history
oleg68 committed Nov 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent dc17d47 commit bc4b72d
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/core/GOChoice.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).
*/
@@ -23,11 +23,11 @@ template <class T> class GOChoice : public wxChoice {
return wxChoice::Append(item, (void *)value);
}

T GetCurrentSelection() {
T GetCurrentValue() {
return (T)(intptr_t)GetClientData(wxChoice::GetCurrentSelection());
}

void SetCurrentSelection(const T value) {
void SetCurrentValue(const T value) {
SetSelection(0);
for (unsigned i = 0; i < GetCount(); i++)
if ((void *)value == GetClientData(i))
6 changes: 3 additions & 3 deletions src/grandorgue/gui/dialogs/midi-event/GOMidiEventRecvTab.cpp
Original file line number Diff line number Diff line change
@@ -328,7 +328,7 @@ bool GOMidiEventRecvTab::TransferDataFromWindow() {
}

void GOMidiEventRecvTab::OnTypeChange(wxCommandEvent &event) {
GOMidiReceiverMessageType type = m_eventtype->GetCurrentSelection();
GOMidiReceiverMessageType type = m_eventtype->GetCurrentValue();
if (m_original->HasChannel(type))
m_channel->Enable();
else
@@ -467,7 +467,7 @@ void GOMidiEventRecvTab::LoadEvent() {

GOMidiReceiverEventPattern &e = m_midi.GetEvent(m_current);

m_eventtype->SetCurrentSelection(e.type);
m_eventtype->SetCurrentValue(e.type);

wxCommandEvent event;
OnTypeChange(event);
@@ -508,7 +508,7 @@ GOMidiReceiverEventPattern GOMidiEventRecvTab::GetCurrentEvent() {
e.deviceId
= m_MidiMap.GetDeviceIdByLogicalName(m_device->GetStringSelection());

e.type = m_eventtype->GetCurrentSelection();
e.type = m_eventtype->GetCurrentValue();
if (m_channel->GetSelection() == 0)
e.channel = -1;
else
6 changes: 3 additions & 3 deletions src/grandorgue/gui/dialogs/midi-event/GOMidiEventSendTab.cpp
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ bool GOMidiEventSendTab::TransferDataFromWindow() {
}

void GOMidiEventSendTab::OnTypeChange(wxCommandEvent &event) {
GOMidiSenderMessageType type = m_eventtype->GetCurrentSelection();
GOMidiSenderMessageType type = m_eventtype->GetCurrentValue();
if (m_original->HasChannel(type))
m_channel->Enable();
else
@@ -409,7 +409,7 @@ void GOMidiEventSendTab::LoadEvent() {

GOMidiSenderEventPattern &e = m_midi.GetEvent(m_current);

m_eventtype->SetCurrentSelection(e.type);
m_eventtype->SetCurrentValue(e.type);

wxCommandEvent event;
OnTypeChange(event);
@@ -437,7 +437,7 @@ void GOMidiEventSendTab::StoreEvent() {
e.deviceId
= m_MidiMap.GetDeviceIdByLogicalName(m_device->GetStringSelection());

e.type = m_eventtype->GetCurrentSelection();
e.type = m_eventtype->GetCurrentValue();
e.channel = m_channel->GetSelection() + 1;
e.key = m_key->GetValue();
e.low_value = m_LowValue->GetValue();
4 changes: 2 additions & 2 deletions src/grandorgue/gui/dialogs/settings/GOSettingsOptions.cpp
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ GOSettingsOptions::GOSettingsOptions(GOConfig &settings, wxWindow *parent)
m_LoadLastFile->Append(
_("Start without any organ"), GOInitialLoadType::LOAD_NONE);
m_Limit->SetValue(m_config.ManagePolyphony());
m_LoadLastFile->SetCurrentSelection(m_config.LoadLastFile());
m_LoadLastFile->SetCurrentValue(m_config.LoadLastFile());
m_Scale->SetValue(m_config.ScaleRelease());
m_Random->SetValue(m_config.RandomizeSpeaking());

@@ -430,7 +430,7 @@ bool GOSettingsOptions::TransferDataFromWindow() {
m_config.ManagePolyphony(m_Limit->IsChecked());
m_config.CompressCache(m_CompressCache->IsChecked());
m_config.ManageCache(m_ManageCache->IsChecked());
m_config.LoadLastFile(m_LoadLastFile->GetCurrentSelection());
m_config.LoadLastFile(m_LoadLastFile->GetCurrentValue());
m_config.ODFCheck(m_ODFCheck->IsChecked());
m_config.ODFHw1Check(m_ODFHw1Check->IsChecked());
m_config.RecordDownmix(m_RecordDownmix->IsChecked());

0 comments on commit bc4b72d

Please sign in to comment.