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

Removed GODrawStop::IsActive #2023

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

oleg68
Copy link
Contributor

@oleg68 oleg68 commented Oct 10, 2024

I mentioned that GODrawStop::IsActive() duplicated GOButtonControl::IsEngaged()

So this PR removes GODrawStop::IsActive() and replaces all it's usages with GOButtonControl::IsEngaged()

It is just refactoring. No GO behavior should be changed.

@rousseldenis
Copy link
Contributor

Mmmh, I would need some clarification as, from my comprehension, both have different meaning.

I saw the introduction of IsEngaged()there: 4937579#diff-da3dd564c78c8f5f60155bc77a2176d5ef7b16df922c9bdca6bd5d28cac1e0b4R50

And the use of IsActive() : ef40b20

It seems Martin did the inverse of you do here.

@larspalo

@oleg68
Copy link
Contributor Author

oleg68 commented Oct 12, 2024

@rousseldenis Yes, Martin introduced different state flags for GOButtonControl (Engaged) and for GODrawStop (Active). Might be earlier they were used separately, but now the only place that changes these flags for GODrawStop is GODrawstop::SetInternalState():

      Display(resState);
      // must be before calling m_ControlledDrawstops[i]->Update();
      m_ActiveState = resState;

Display() changes Engaged::

void GOButtonControl::Display(bool onoff) {
  if (m_Engaged == onoff)
    return;
  m_sender.SetDisplay(onoff);
  m_Engaged = onoff;
  r_OrganModel.SendControlChanged(this);
}

So now for drawstops m_ActiveState always equals to m_Engaged , and there are no more reasons to use them both.

A previous PR introduced another internal states GODrawStop::m_InternalStates rather m_ActiveState #2012. I use the new ones in another PR #2021.

@oleg68 oleg68 merged commit d6dd394 into GrandOrgue:master Oct 14, 2024
1 check passed
@oleg68 oleg68 deleted the refactor/drawstop-active branch October 14, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants