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

Formula/MSEG follows mod button #4716

Merged
merged 1 commit into from
Jul 5, 2021
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
38 changes: 24 additions & 14 deletions src/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,11 @@ void SurgeGUIEditor::openOrRecreateEditor()

#endif

for (const auto &el : juceOverlays)
{
frame->addAndMakeVisible(*(el.second));
}

if (showMSEGEditorOnNextIdleOrOpen)
{
showMSEGEditor();
Expand Down Expand Up @@ -4389,6 +4394,8 @@ void SurgeGUIEditor::swapFX(int source, int target, SurgeSynthesizer::FXReorderM

void SurgeGUIEditor::lfoShapeChanged(int prior, int curr)
{
std::cout << "lfoShapeChanged" << prior << " " << curr << std::endl;

if (prior != curr || prior == lt_mseg || curr == lt_mseg || prior == lt_formula ||
curr == lt_formula)
{
Expand All @@ -4399,26 +4406,29 @@ void SurgeGUIEditor::lfoShapeChanged(int prior, int curr)
}
}

if (curr == lt_mseg && isAnyOverlayPresent(MSEG_EDITOR))
{
// We have the MSEGEditor open and have swapped to the MSEG here
showMSEGEditor();
}
else if (prior == lt_mseg && curr != lt_mseg && isAnyOverlayPresent(MSEG_EDITOR))
bool hadExtendedEditor = false;
if (isAnyOverlayPresent(MSEG_EDITOR))
{
// We can choose to not do this too; if we do we are editing an MSEG which isn't used though
closeMSEGEditor();
hadExtendedEditor = true;
}

if (curr == lt_formula && isAnyOverlayPresent(FORMULA_EDITOR))
if (isAnyOverlayPresent(FORMULA_EDITOR))
{
// We have the MSEGEditor open and have swapped to the MSEG here
showFormulaEditorDialog();
closeFormulaEditorDialog();
hadExtendedEditor = true;
}
else if (prior == lt_formula && curr != lt_formula && isAnyOverlayPresent(FORMULA_EDITOR))
std::cout << _D(prior) << _D(curr) << _D(hadExtendedEditor) << std::endl;

if (hadExtendedEditor)
{
// We can choose to not do this too; if we do we are editing an MSEG which isn't used though
closeFormulaEditorDialog();
if (curr == lt_mseg)
{
showMSEGEditor();
}
if (curr == lt_formula)
{
showFormulaEditorDialog();
}
}

// update the LFO title label
Expand Down
15 changes: 13 additions & 2 deletions src/gui/SurgeGUIEditorValueCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2220,17 +2220,28 @@ void SurgeGUIEditor::valueChanged(Surge::GUI::IComponentTagValue *control)
}
}

bool hadExtendedOverlay = false;
if (isAnyOverlayPresent(MSEG_EDITOR))
{
closeMSEGEditor();
hadExtendedOverlay = true;
}
if (isAnyOverlayPresent(FORMULA_EDITOR))
{
closeFormulaEditorDialog();
hadExtendedOverlay = true;
}
if (hadExtendedOverlay)
{
auto ld = &(synth->storage.getPatch().scene[current_scene].lfo[newsource -
ms_lfo1]);
if (ld->shape.val.i == lt_mseg)
{
showMSEGEditor();
}
else
if (ld->shape.val.i == lt_formula)
{
closeMSEGEditor();
showFormulaEditorDialog();
}
}

Expand Down