From cbd1f6027106e1c726a205fba2eb8dc32f36c646 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Fri, 5 Feb 2021 17:33:16 +0100 Subject: [PATCH 1/2] Notify VST when SFZ is changed by reload --- vst/SfizzVstProcessor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vst/SfizzVstProcessor.cpp b/vst/SfizzVstProcessor.cpp index f318b269..972b34dc 100644 --- a/vst/SfizzVstProcessor.cpp +++ b/vst/SfizzVstProcessor.cpp @@ -625,6 +625,11 @@ void SfizzVstProcessor::doBackgroundWork() fprintf(stderr, "[Sfizz] sfz file has changed, reloading\n"); std::lock_guard lock(_processMutex); loadSfzFileOrDefault(*_synth, _state.sfzFile); + + Steinberg::OPtr reply { allocateMessage() }; + reply->setMessageID("LoadedSfz"); + reply->getAttributes()->setBinary("File", _state.sfzFile.data(), _state.sfzFile.size()); + sendMessage(reply); } else if (_synth->shouldReloadScala()) { fprintf(stderr, "[Sfizz] scala file has changed, reloading\n"); From 595301ab3491f7976aeca8c7c6e2e89e319450af Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Fri, 5 Feb 2021 17:42:24 +0100 Subject: [PATCH 2/2] Text truncation for CC labels --- editor/src/editor/GUIComponents.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/editor/src/editor/GUIComponents.cpp b/editor/src/editor/GUIComponents.cpp index 5051e952..e188dbf5 100644 --- a/editor/src/editor/GUIComponents.cpp +++ b/editor/src/editor/GUIComponents.cpp @@ -570,6 +570,8 @@ void SControlsPanel::setControlUsed(uint32_t index, bool used) label->setStyle(CTextLabel::kRoundRectStyle); label->setRoundRectRadius(5.0); label->setBackColor(CColor(0x2e, 0x34, 0x36)); + label->setTextTruncateMode(CTextLabel::kTruncateTail); + label->setTextInset({4.0, 0.0}); label->setText(getDefaultLabelText(index)); knob->setActiveTrackColor(CColor(0x00, 0xb6, 0x2a)); knob->setInactiveTrackColor(CColor(0x30, 0x30, 0x30)); @@ -630,11 +632,12 @@ void SControlsPanel::setControlLabelText(uint32_t index, UTF8StringPtr text) if (!slot) return; + CTextLabel* label = slot->label; if (text && text[0] != '\0') - slot->label->setText(text); + label->setText(text); else - slot->label->setText(getDefaultLabelText(index).c_str()); - slot->label->invalid(); + label->setText(getDefaultLabelText(index).c_str()); + label->invalid(); } void SControlsPanel::recalculateSubViews()