Skip to content

Commit

Permalink
Small Fixes to Audio Path and Patch Comment (#5382)
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 #5377
2. With audio engine off, make loadByPath mechanism work just
   like loadById does. Closes #5381
3. Add a comment to the reich patch
4. Make the MiniEdit also skip recursion in the new deletion sweep
5. Add SampleRate to the About screen
  • Loading branch information
baconpaul authored Nov 13, 2021
1 parent 797ead6 commit 9f6c679
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 1 deletion.
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
2 changes: 2 additions & 0 deletions src/surge-xt/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6022,6 +6022,8 @@ void SurgeGUIEditor::resetComponentTracking()
recurse = false;
if (dynamic_cast<Surge::Overlays::TypeinParamEditor *>(comp))
recurse = false;
if (dynamic_cast<Surge::Overlays::MiniEdit *>(comp))
recurse = false;
if (dynamic_cast<Surge::Overlays::OverlayWrapper *>(comp))
recurse = false;
if (dynamic_cast<juce::ListBox *>(comp)) // special case of the typeahead
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
12 changes: 11 additions & 1 deletion src/surge-xt/gui/overlays/AboutScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "RuntimeFont.h"
#include "SurgeImage.h"
#include "platform/Paths.h"
#include <fmt/core.h>

namespace Surge
{
Expand Down Expand Up @@ -107,8 +108,17 @@ void AboutScreen::populateData()
lowerLeft.emplace_back("Version", version, "");
lowerLeft.emplace_back("Build", buildinfo, "");
lowerLeft.emplace_back("System", system, "");

auto srString = fmt::format("{:.1f} kHz", samplerate / 1000.0);
if (host != "Unknown")
lowerLeft.emplace_back("Host", host, "");
{
auto hstr = host + " @ " + srString;
lowerLeft.emplace_back("Host", hstr, "");
}
else
{
lowerLeft.emplace_back("Sample Rate", srString, "");
}
lowerLeft.emplace_back("", "", "");
lowerLeft.emplace_back("Factory Data", storage->datapath.u8string(),
storage->datapath.u8string());
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 9f6c679

Please sign in to comment.