From 8cfce744c57021ff6d845b34ea4ad9ddce81e00d Mon Sep 17 00:00:00 2001 From: Paul Walker Date: Sat, 13 Nov 2021 09:15:39 -0500 Subject: [PATCH] Small Fixes to Audio Path and Patch Comment 1. Patch Comment dismisses and timer cancels on menu show in patch selector. Closes #5377 2. With audio engine off, make loadByPath mechanism work just like loadById does. Closes #5381 3. Add a comment to the reich patch --- .../11 Example - Reich - Piano Phase.fxp | Bin 31003 -> 31149 bytes src/common/SurgeSynthesizer.cpp | 26 ++++++++++++++++++ src/surge-xt/gui/SurgeGUIEditor.h | 1 + src/surge-xt/gui/widgets/PatchSelector.cpp | 8 ++++++ 4 files changed, 35 insertions(+) diff --git a/resources/data/patches_factory/Tutorials/Formula Modulator/11 Example - Reich - Piano Phase.fxp b/resources/data/patches_factory/Tutorials/Formula Modulator/11 Example - Reich - Piano Phase.fxp index 4839a8b3b672f4abd1b891987d8c7f6f2c8af277..a5256cef7ad72d3f39d23c3ee89437138a0c1ed6 100644 GIT binary patch delta 173 zcmXxdu@M156o>J-h@1lc5|I&*k(p5du7T(5*>`hx*S>eSNDIVj5UD{!G~kR;!1w!Z zujKwtE|Ye>mufv;)YsYboLYmNqbLHYn&^;6zr#w+!C+}PvwaF)rh=>_5zdhNh!Fyl z^D;#0VGTvF4p3BICK?g^qLTFAgWLv3VnyYYOK9^AmO8?23sH*NU~^aay7y=$-O~ph Coj$Sv delta 25 hcmZ4cnQ`_f#tBv&759rvlZ^LQOmsTBc_yPs1pu8U3w{6q diff --git a/src/common/SurgeSynthesizer.cpp b/src/common/SurgeSynthesizer.cpp index a89d89cd69c..6807e26b3fc 100644 --- a/src/common/SurgeSynthesizer.cpp +++ b/src/common/SurgeSynthesizer.cpp @@ -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); diff --git a/src/surge-xt/gui/SurgeGUIEditor.h b/src/surge-xt/gui/SurgeGUIEditor.h index 486bd3e6017..ab9b4b5a3eb 100644 --- a/src/surge-xt/gui/SurgeGUIEditor.h +++ b/src/surge-xt/gui/SurgeGUIEditor.h @@ -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 where, diff --git a/src/surge-xt/gui/widgets/PatchSelector.cpp b/src/surge-xt/gui/widgets/PatchSelector.cpp index 1c0a610212f..93b95e44f20 100644 --- a/src/surge-xt/gui/widgets/PatchSelector.cpp +++ b/src/surge-xt/gui/widgets/PatchSelector.cpp @@ -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); @@ -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); }