Skip to content

Commit

Permalink
Small Fixes to Audio Path and Patch Comment
Browse files Browse the repository at this point in the history
1. Patch Comment dismisses and timer cancels on menu show in
   patch selector. Closes surge-synthesizer#5377
2. With audio engine off, make loadByPath mechanism work just
   like loadById does. Closes surge-synthesizer#5381
3. Add a comment to the reich patch
  • Loading branch information
baconpaul committed Nov 13, 2021
1 parent 797ead6 commit 8cfce74
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
Binary file not shown.
26 changes: 26 additions & 0 deletions src/common/SurgeSynthesizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3361,6 +3361,32 @@ void SurgeSynthesizer::processThreadunsafeOperations(bool dangerMode)
patchid_queue = -1;
}

if (has_patchid_file)
{
auto p(string_to_path(patchid_file));
auto s = path_to_string(p.stem());
has_patchid_file = false;

int ptid = -1, ct = 0;
for (const auto &pti : storage.patch_list)
{
if (path_to_string(pti.path) == patchid_file)
{
ptid = ct;
}
ct++;
}
if (ptid >= 0)
{
loadPatch(ptid);
}
else
{
loadPatchByPath(patchid_file, -1, s.c_str());
}
patchid_file[0] = 0;
}

if (load_fx_needed)
loadFx(false, false);

Expand Down
1 change: 1 addition & 0 deletions src/surge-xt/gui/SurgeGUIEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ class SurgeGUIEditor : public Surge::GUI::IComponentTagValue::Listener,
{
strncpy(synth->patchid_file, file.c_str(), FILENAME_MAX);
synth->has_patchid_file = true;
synth->processThreadunsafeOperations();
}

void openMacroRenameDialog(const int ccid, const juce::Point<int> where,
Expand Down
8 changes: 8 additions & 0 deletions src/surge-xt/gui/widgets/PatchSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ void PatchSelector::mouseDown(const juce::MouseEvent &e)
{
juce::PopupMenu menu;

tooltipCountdown = -1;
toggleCommentTooltip(false);

menu.addSectionHeader("FAVORITES");
auto haveFavs = optionallyAddFavorites(menu, false, false);

Expand All @@ -281,12 +284,17 @@ void PatchSelector::mouseDown(const juce::MouseEvent &e)

if (e.mods.isShiftDown() || searchRect.contains(e.position.toInt()))
{
tooltipCountdown = -1;
toggleCommentTooltip(false);

toggleTypeAheadSearch(!isTypeaheadSearchOn);
return;
}

// if RMB is down, only show the current category
bool single_category = e.mods.isRightButtonDown() || e.mods.isCommandDown();
tooltipCountdown = -1;
toggleCommentTooltip(false);
showClassicMenu(single_category);
}

Expand Down

0 comments on commit 8cfce74

Please sign in to comment.