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

Refresh Formula overlay after loading LFO preset or undo/redo, if applicable #7310

Conversation

mkruselj
Copy link
Collaborator

@mkruselj mkruselj commented Nov 18, 2023

Closes #7308

@baconpaul
Copy link
Collaborator

This is clever, and close, but not quite complete.

Rather than doing an || you should do a loop. If formula and mseg are both open this will fail.

So whereas before it was

if (isopen(mseg) )
   blah

and you changed it to

if (isopen(mseg) || isopen (formula))
   which = is mseg ? mseg : formula

you should change it to

for( const auto &cand : { mseg_enum, formula_enum } )
{
   if (isopen(cand))
      then do it
}

so if you have both open and torn out they will simultaneously refresh

Copy link
Collaborator

@baconpaul baconpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comment; we can make it a loop over enum type and work with both open.

@mkruselj mkruselj requested a review from baconpaul November 19, 2023 21:44
@mkruselj mkruselj dismissed baconpaul’s stale review November 19, 2023 21:46

Done according to suggestion

@baconpaul
Copy link
Collaborator

LGTM!

@baconpaul baconpaul merged commit 44975d6 into surge-synthesizer:main Nov 20, 2023
10 checks passed
@mkruselj mkruselj deleted the 7308-refresh-formula-editor-in-some-cases branch November 20, 2023 06:09
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.

Formula editor window doesn't update on patch/preset load
2 participants