From c222446400eb146ca92ed28e7419178af177df67 Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Thu, 20 Nov 2025 23:48:50 -0500 Subject: [PATCH 01/10] Remove scaling detection, fix #501 --- README.md | 5 +++++ Source/OperatorEditor.cpp | 12 ++++++++++++ Source/PluginParam.cpp | 21 +++++++++++++++++++-- Source/PluginProcessor.cpp | 18 ++++++++++++++---- Source/PluginProcessor.h | 4 +++- 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a8682b19..4edb64e3 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,11 @@ Dexed Forks Changelog --------- +#### Version 0.9.10 +* Remove automatic UI scaling, dexed will always use user settings and if UI + window is to big, it can be reset with the contextual menu (right click on the UI) + by selecting the "Reset plugin UI scaling factor" + #### Version 0.9.9 * Partial portamento implementation. Thanks @jpcima * More accurate LFO implementation. Thanks @mtarenskeen diff --git a/Source/OperatorEditor.cpp b/Source/OperatorEditor.cpp index 3eef23ee..ddf62ead 100644 --- a/Source/OperatorEditor.cpp +++ b/Source/OperatorEditor.cpp @@ -22,6 +22,8 @@ #include "OperatorEditor.h" +#include "PluginEditor.h" + //[MiscUserDefs] You can add your own user definitions and misc code here... #ifndef M_LN10 @@ -607,6 +609,11 @@ void OperatorEditor::mouseDown(const MouseEvent &event) { popup.addSeparator(); popup.addItem(4, "Send current program to DX7"); + if ( processor->getDpiScaleFactor() > 1.0f ) { + popup.addSeparator(); + popup.addItem(5, "Reset plugin UI scaling factor"); + } + switch(popup.show()) { case 1: processor->copyToClipboard(internalOp); @@ -623,6 +630,11 @@ void OperatorEditor::mouseDown(const MouseEvent &event) { case 4: processor->sendCurrentSysexProgram(); break; + + case 5: + processor->resetScalingFactor(); + getParentComponent()->setSize(DexedAudioProcessorEditor::WINDOW_SIZE_X, (processor->showKeyboard ? DexedAudioProcessorEditor::WINDOW_SIZE_Y : DexedAudioProcessorEditor::WINDOW_SIZE_Y - 94)); + break; } } diff --git a/Source/PluginParam.cpp b/Source/PluginParam.cpp index e4f7f83b..8706af30 100644 --- a/Source/PluginParam.cpp +++ b/Source/PluginParam.cpp @@ -137,6 +137,11 @@ void Ctrl::mouseDown(const juce::MouseEvent &event) { } popup.addItem(2, "Clear midi CC mapping"); + if ( parent->getDpiScaleFactor() > 1.0f ) { + popup.addSeparator(); + popup.addItem(5, "Reset plugin UI scaling factor"); + } + switch(popup.show()) { case 1: parent->mappedMidiCC.removeValue(this); @@ -148,14 +153,26 @@ void Ctrl::mouseDown(const juce::MouseEvent &event) { parent->savePreference(); } break; - case 3: + case 3: { AudioProcessorEditor *editor = parent->getActiveEditor(); if ( editor == NULL ) { return; } DexedAudioProcessorEditor *dexedEditor = (DexedAudioProcessorEditor *) editor; dexedEditor->discoverMidiCC(this); - break; + } + break; + + case 5: { + parent->resetScalingFactor(); + AudioProcessorEditor *editor = parent->getActiveEditor(); + if ( editor == NULL ) { + return; + } + DexedAudioProcessorEditor *dexedEditor = (DexedAudioProcessorEditor *) editor; + dexedEditor->setSize(DexedAudioProcessorEditor::WINDOW_SIZE_X, (parent->showKeyboard ? DexedAudioProcessorEditor::WINDOW_SIZE_Y : DexedAudioProcessorEditor::WINDOW_SIZE_Y - 94)); + } + break; } } } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 9d319651..7c63c7d9 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -871,11 +871,15 @@ void DexedAudioProcessor::updateUI() { AudioProcessorEditor* DexedAudioProcessor::createEditor() { AudioProcessorEditor* editor = new DexedAudioProcessorEditor (this); float scaleFactor = getDpiScaleFactor(); - float maxFactor = DexedAudioProcessorEditor::getLargestScaleFactor(); - if ( scaleFactor == -1 || scaleFactor > maxFactor ) { - scaleFactor = maxFactor; - } + // We still have issues on some DAW reporting the scale factor... + // float maxFactor = DexedAudioProcessorEditor::getLargestScaleFactor(); + // + // if ( scaleFactor == -1 || scaleFactor > maxFactor ) { + // scaleFactor = maxFactor; + // } + if ( scaleFactor < 1.0f || scaleFactor > 4.0f ) + scaleFactor = 1.0f; setDpiScaleFactor(scaleFactor); return editor; @@ -894,6 +898,12 @@ void DexedAudioProcessor::setDpiScaleFactor(float factor) { Desktop::getInstance().setGlobalScaleFactor(dpiScaleFactor); } +void DexedAudioProcessor::resetScalingFactor() { + dpiScaleFactor = 1.0f; + savePreference(); + Desktop::getInstance().setGlobalScaleFactor(dpiScaleFactor); +} + void DexedAudioProcessor::handleAsyncUpdate() { updateUI(); } diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 2a401674..35adf366 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -131,7 +131,7 @@ class DexedAudioProcessor : public AudioProcessor, public AsyncUpdater, public void unpackOpSwitch(char packOpValue); void packOpSwitch(); - float dpiScaleFactor = -1; + float dpiScaleFactor = 1; public : // in MIDI units (0x4000 is neutral) @@ -281,6 +281,8 @@ public : std::string currentSCLData = ""; std::string currentKBMData = ""; void setDpiScaleFactor(float factor); + void resetScalingFactor(); + float getDpiScaleFactor() { return dpiScaleFactor; } From 1d3dde49067eac9d9ce12532d89a476293cfad6c Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Sat, 22 Nov 2025 10:29:43 -0500 Subject: [PATCH 02/10] Enable nightly --- .github/workflows/project-pipeline.yml | 2 +- Source/PluginProcessor.cpp | 8 ++++---- libs/clap-juce-extensions | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/project-pipeline.yml b/.github/workflows/project-pipeline.yml index b8816857..f837ea36 100644 --- a/.github/workflows/project-pipeline.yml +++ b/.github/workflows/project-pipeline.yml @@ -136,7 +136,7 @@ jobs: publish-nightly: name: "Publish Nightly" runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/heads/') + if: github.ref_type == 'branch' needs: [ build-linux, build-windows, build-macos ] steps: - name: "Upload to nightly" diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 7c63c7d9..03c1a03a 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -887,10 +887,10 @@ AudioProcessorEditor* DexedAudioProcessor::createEditor() { void DexedAudioProcessor::setDpiScaleFactor(float factor) { // Currently the clap juce wrapper doesn't work with this deprecated scale factor direct set so - if ( is_clap ) { - dpiScaleFactor = 1.0; - return; - } + // if ( is_clap ) { + // dpiScaleFactor = 1.0; + // return; + // } dpiScaleFactor = factor; // The scale factor needs to be done after object creation otherwise Bitwig, Live and REAPER can't render the diff --git a/libs/clap-juce-extensions b/libs/clap-juce-extensions index 2c23b918..4d454e51 160000 --- a/libs/clap-juce-extensions +++ b/libs/clap-juce-extensions @@ -1 +1 @@ -Subproject commit 2c23b918828ba5fbc5fcb4c95d3a046fbf7e9285 +Subproject commit 4d454e5125da75a0e75d95615cbec26d2a09e2bf From e27096b7f7fdede94c3342658331428c2030d423 Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Sun, 23 Nov 2025 09:36:09 -0500 Subject: [PATCH 03/10] Set scaling from main plugin component --- Source/OperatorEditor.cpp | 8 ++++---- Source/PluginEditor.cpp | 19 ++++++++++++++++--- Source/PluginEditor.h | 1 + Source/PluginParam.cpp | 9 +++------ Source/PluginProcessor.cpp | 27 --------------------------- Source/PluginProcessor.h | 1 - 6 files changed, 24 insertions(+), 41 deletions(-) diff --git a/Source/OperatorEditor.cpp b/Source/OperatorEditor.cpp index ddf62ead..843f022a 100644 --- a/Source/OperatorEditor.cpp +++ b/Source/OperatorEditor.cpp @@ -523,8 +523,6 @@ void OperatorEditor::buttonClicked (juce::Button* buttonThatWasClicked) //[/UserbuttonClicked_Post] } - - //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... void OperatorEditor::bind(DexedAudioProcessor *parent, int op) { parent->opCtrl[op].egLevel[0]->bind(s_egl1.get()); @@ -632,8 +630,10 @@ void OperatorEditor::mouseDown(const MouseEvent &event) { break; case 5: - processor->resetScalingFactor(); - getParentComponent()->setSize(DexedAudioProcessorEditor::WINDOW_SIZE_X, (processor->showKeyboard ? DexedAudioProcessorEditor::WINDOW_SIZE_Y : DexedAudioProcessorEditor::WINDOW_SIZE_Y - 94)); + auto *editor = dynamic_cast(getParentComponent()); + if ( editor != nullptr ) { + editor->resetScaleFactor(); + } break; } diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index fd97fbf8..52fb85d7 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -36,7 +36,6 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner midiKeyboard (ownerFilter->keyboardState, MidiKeyboardComponent::horizontalKeyboard), cartManager(this) { - setSize(WINDOW_SIZE_X, (ownerFilter->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); setExplicitFocusOrder(1); processor = ownerFilter; @@ -89,6 +88,9 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner cartManagerCover.addChildComponent(&cartManager); cartManager.setVisible(true); + AudioProcessorEditor::setScaleFactor(processor->getDpiScaleFactor()); + setSize(WINDOW_SIZE_X, (ownerFilter->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + addKeyListener(this); updateUI(); startTimer(100); @@ -217,12 +219,15 @@ void DexedAudioProcessorEditor::parmShow() { int tpo; float scale = this->processor->getDpiScaleFactor(); bool ret = param->getDialogValues(this->processor->controllers, this->processor->sysexComm, &tpo, &this->processor->showKeyboard, &scale); - this->processor->setEngineType(tpo); this->processor->setDpiScaleFactor(scale); + this->processor->setEngineType(tpo); this->processor->savePreference(); + + auto previousSize = this->getBounds(); + this->setScaleFactor(scale); + this->setSize(previousSize.getWidth(), previousSize.getHeight()); param->setSize(710, 355); - this->setSize(WINDOW_SIZE_X, (processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); this->midiKeyboard.repaint(); if ( ret == false ) { @@ -461,6 +466,14 @@ float DexedAudioProcessorEditor::getLargestScaleFactor() { return 1.0f; } +void DexedAudioProcessorEditor::resetScaleFactor() { + processor->setDpiScaleFactor(1.0); + processor->savePreference(); + auto previousSize = this->getBounds(); + setScaleFactor(1.0); + this->setSize(previousSize.getWidth(), previousSize.getHeight()); +} + bool DexedAudioProcessorEditor::isInterestedInFileDrag (const StringArray &files) { if( files.size() != 1 ) return false; diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 4d2d2954..affeb827 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -66,6 +66,7 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: void discoverMidiCC(Ctrl *ctrl); static float getLargestScaleFactor(); + void resetScaleFactor(); virtual bool isInterestedInFileDrag (const StringArray &files) override; virtual void filesDropped (const StringArray &files, int x, int y ) override; diff --git a/Source/PluginParam.cpp b/Source/PluginParam.cpp index 8706af30..b653ca63 100644 --- a/Source/PluginParam.cpp +++ b/Source/PluginParam.cpp @@ -164,13 +164,10 @@ void Ctrl::mouseDown(const juce::MouseEvent &event) { break; case 5: { - parent->resetScalingFactor(); - AudioProcessorEditor *editor = parent->getActiveEditor(); - if ( editor == NULL ) { - return; + auto *editor = dynamic_cast(parent->getActiveEditor()); + if ( editor != nullptr ) { + editor->resetScaleFactor(); } - DexedAudioProcessorEditor *dexedEditor = (DexedAudioProcessorEditor *) editor; - dexedEditor->setSize(DexedAudioProcessorEditor::WINDOW_SIZE_X, (parent->showKeyboard ? DexedAudioProcessorEditor::WINDOW_SIZE_Y : DexedAudioProcessorEditor::WINDOW_SIZE_Y - 94)); } break; } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 03c1a03a..995de64c 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -870,38 +870,11 @@ void DexedAudioProcessor::updateUI() { AudioProcessorEditor* DexedAudioProcessor::createEditor() { AudioProcessorEditor* editor = new DexedAudioProcessorEditor (this); - float scaleFactor = getDpiScaleFactor(); - - // We still have issues on some DAW reporting the scale factor... - // float maxFactor = DexedAudioProcessorEditor::getLargestScaleFactor(); - // - // if ( scaleFactor == -1 || scaleFactor > maxFactor ) { - // scaleFactor = maxFactor; - // } - if ( scaleFactor < 1.0f || scaleFactor > 4.0f ) - scaleFactor = 1.0f; - - setDpiScaleFactor(scaleFactor); return editor; } void DexedAudioProcessor::setDpiScaleFactor(float factor) { - // Currently the clap juce wrapper doesn't work with this deprecated scale factor direct set so - // if ( is_clap ) { - // dpiScaleFactor = 1.0; - // return; - // } dpiScaleFactor = factor; - - // The scale factor needs to be done after object creation otherwise Bitwig, Live and REAPER can't render the - // plugin window. - Desktop::getInstance().setGlobalScaleFactor(dpiScaleFactor); -} - -void DexedAudioProcessor::resetScalingFactor() { - dpiScaleFactor = 1.0f; - savePreference(); - Desktop::getInstance().setGlobalScaleFactor(dpiScaleFactor); } void DexedAudioProcessor::handleAsyncUpdate() { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 35adf366..3c6f673e 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -281,7 +281,6 @@ public : std::string currentSCLData = ""; std::string currentKBMData = ""; void setDpiScaleFactor(float factor); - void resetScalingFactor(); float getDpiScaleFactor() { return dpiScaleFactor; From 191664e2aaf5c955bccc76baf12aba05c16bdd52 Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Sun, 23 Nov 2025 11:14:43 -0500 Subject: [PATCH 04/10] Attach dialogs plugin component --- Source/GlobalEditor.cpp | 10 ++++++---- Source/GlobalEditor.h | 2 ++ Source/PluginEditor.cpp | 37 +++++++++++++++++++++---------------- Source/PluginEditor.h | 1 + 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Source/GlobalEditor.cpp b/Source/GlobalEditor.cpp index da3b86bc..50aa618e 100644 --- a/Source/GlobalEditor.cpp +++ b/Source/GlobalEditor.cpp @@ -78,7 +78,7 @@ class AboutBox : public DialogWindow { std::unique_ptr dexed; // changed to std::unique_ptr from juce::ScopedPointer std::unique_ptr surge; // changed to std::unique_ptr from juce::ScopedPointer - AboutBox(Component *parent) : DialogWindow("About", Colour(0xFF000000), true), + AboutBox() : DialogWindow("About", Colour(0xFF000000), true), dexed(std::make_unique("https://asb2m10.github.io/dexed/", URL("https://asb2m10.github.io/dexed/"))), surge(std::make_unique("https://surge-synthesizer.github.io/", URL("https://surge-synthesizer.github.io/"))) { @@ -86,7 +86,7 @@ class AboutBox : public DialogWindow { setAlwaysOnTop(true); logo_png = ImageCache::getFromMemory(BinaryData::dexedlogo_png, BinaryData::dexedlogo_pngSize); setSize(logo_png.getWidth() + 8, 500); - centreAroundComponent(parent, getWidth(), getHeight()); + //centreAroundComponent(parent, getWidth(), getHeight()); dexed->setColour(HyperlinkButton::ColourIds::textColourId, Colour(0xFF4ea097)); dexed->setJustificationType(Justification::left); @@ -701,8 +701,10 @@ void GlobalEditor::buttonClicked (juce::Button* buttonThatWasClicked) else if (buttonThatWasClicked == aboutButton.get()) { //[UserButtonCode_aboutButton] -- add your button handler code here.. - AboutBox about(this->getParentComponent()); - about.runModalLoop(); + aboutBox = std::make_unique(); + getParentComponent()->addAndMakeVisible(aboutBox.get()); + aboutBox->centreWithSize(aboutBox->getWidth(), aboutBox->getHeight()); + aboutBox->enterModalState(true,{}); //[/UserButtonCode_aboutButton] } diff --git a/Source/GlobalEditor.h b/Source/GlobalEditor.h index 8bfb4bf1..7a885cdc 100644 --- a/Source/GlobalEditor.h +++ b/Source/GlobalEditor.h @@ -84,6 +84,8 @@ class GlobalEditor : public Component, Image background; Image imageLight; + + std::unique_ptr aboutBox; //[/UserVariables] //============================================================================== diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 52fb85d7..d9ef6582 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -27,6 +27,7 @@ #include "Dexed.h" #include "math.h" #include +#include #include "msfa/fm_op_kernel.h" @@ -36,6 +37,8 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner midiKeyboard (ownerFilter->keyboardState, MidiKeyboardComponent::horizontalKeyboard), cartManager(this) { + // We have to set size at startup because the keyboard doesnt show up before being added + setSize(WINDOW_SIZE_X, (ownerFilter->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); setExplicitFocusOrder(1); processor = ownerFilter; @@ -179,10 +182,20 @@ void DexedAudioProcessorEditor::tuningShow() { auto dialogwindow = options.launchAsync(); } +// I don't know why closeButtonPressed is not implemented in the standard DialogWindow version. +class DexedDialogWindow : public juce::DialogWindow { +public: + DexedDialogWindow(const juce::String& title, juce::Colour backgroundColour) + : juce::DialogWindow(title, backgroundColour, true, false) { + + } + void closeButtonPressed() override { + setVisible(false); + } +}; + void DexedAudioProcessorEditor::parmShow() { int tp = processor->getEngineType(); - DialogWindow::LaunchOptions options; - auto param = new ParamDialog(); param->setColour(AlertWindow::backgroundColourId, Colour(0xFF323E44)); param->setDialogValues(processor->controllers, processor->sysexComm, tp, processor->showKeyboard, processor->getDpiScaleFactor()); @@ -207,13 +220,6 @@ void DexedAudioProcessorEditor::parmShow() { p->setIsStandardTuning(this->processor->synthTuningState->is_standard_tuning() ); } ); - options.content.setOwned(param); - options.dialogTitle = "dexed Parameters"; - options.dialogBackgroundColour = Colour(0xFF323E44); - options.escapeKeyTriggersCloseButton = true; - options.useNativeTitleBar = false; - options.resizable = false; - auto generalCallback = [this](ParamDialog *param) { int tpo; @@ -222,13 +228,8 @@ void DexedAudioProcessorEditor::parmShow() { this->processor->setDpiScaleFactor(scale); this->processor->setEngineType(tpo); this->processor->savePreference(); - - - auto previousSize = this->getBounds(); this->setScaleFactor(scale); - this->setSize(previousSize.getWidth(), previousSize.getHeight()); - param->setSize(710, 355); - this->midiKeyboard.repaint(); + setSize(WINDOW_SIZE_X, (this->processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); if ( ret == false ) { AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Midi Interface", "Error opening midi ports"); @@ -236,7 +237,11 @@ void DexedAudioProcessorEditor::parmShow() { }; param->setGeneralCallback(generalCallback); - auto dialogWindow = options.launchAsync(); + dexedParameterDialog = std::make_unique("dexed Parameters", Colour(0xFF323E44)); + dexedParameterDialog->setContentOwned(param, true); + addAndMakeVisible(dexedParameterDialog.get()); + dexedParameterDialog->centreAroundComponent(this, param->getWidth(), param->getHeight() + dexedParameterDialog->getTitleBarHeight()); + dexedParameterDialog->enterModalState(true,{}); } void DexedAudioProcessorEditor::initProgram() { diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index affeb827..f2ee845a 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -41,6 +41,7 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: Component cartManagerCover; SharedResourcePointer lookAndFeel; + std::unique_ptr dexedParameterDialog; #ifdef DEXED_EVENT_DEBUG FocusLogger focusLogger; #endif From 4968e0dbf3ea8375da25cefc8c9f3d12c23bce87 Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Thu, 27 Nov 2025 08:25:20 -0500 Subject: [PATCH 05/10] Fix Windows scaling issue with VST and CLAP --- README.md | 1 + Source/PluginEditor.cpp | 17 ++++++++++++----- Source/PluginEditor.h | 4 ++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4edb64e3..788934ce 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Changelog * Remove automatic UI scaling, dexed will always use user settings and if UI window is to big, it can be reset with the contextual menu (right click on the UI) by selecting the "Reset plugin UI scaling factor" +* Fixed scaling issue with CLAP format #### Version 0.9.9 * Partial portamento implementation. Thanks @jpcima diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index d9ef6582..bb6c121b 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -91,9 +91,9 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner cartManagerCover.addChildComponent(&cartManager); cartManager.setVisible(true); - AudioProcessorEditor::setScaleFactor(processor->getDpiScaleFactor()); - setSize(WINDOW_SIZE_X, (ownerFilter->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); - + AffineTransform scale = AffineTransform::scale(processor->getDpiScaleFactor()); + setTransform(scale); + setSize(WINDOW_SIZE_X, (this->processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); addKeyListener(this); updateUI(); startTimer(100); @@ -228,8 +228,10 @@ void DexedAudioProcessorEditor::parmShow() { this->processor->setDpiScaleFactor(scale); this->processor->setEngineType(tpo); this->processor->savePreference(); - this->setScaleFactor(scale); - setSize(WINDOW_SIZE_X, (this->processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + + AffineTransform scaleAffine = AffineTransform::scale(dawScalingFactor * this->processor->getDpiScaleFactor()); + setTransform(scaleAffine); + setSize(WINDOW_SIZE_X, (this->processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); if ( ret == false ) { AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Midi Interface", "Error opening midi ports"); @@ -601,4 +603,9 @@ bool DexedAudioProcessorEditor::keyPressed(const KeyPress& key, Component* origi } return false; +} + +void DexedAudioProcessorEditor::setScaleFactor(float newScaleFactor) { + dawScalingFactor = newScaleFactor; + AudioProcessorEditor::setScaleFactor(newScaleFactor * processor->getDpiScaleFactor()); } \ No newline at end of file diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index f2ee845a..3d80c50b 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -45,6 +45,8 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: #ifdef DEXED_EVENT_DEBUG FocusLogger focusLogger; #endif + + float dawScalingFactor = 1.0f; public: DexedAudioProcessor *processor; GlobalEditor global; @@ -73,6 +75,8 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: virtual void filesDropped (const StringArray &files, int x, int y ) override; std::unique_ptr createFocusTraverser() override; + virtual void setScaleFactor(float newScaleFactor) override; + bool keyPressed(const KeyPress& key, Component* originatingComponent) override; static const int WINDOW_SIZE_X = 866; From 739476f3bd63349b8983ed1974c557d5148a9f29 Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Thu, 27 Nov 2025 21:19:05 -0500 Subject: [PATCH 06/10] Scale by overriding setScaleFactor --- Source/OperatorEditor.cpp | 4 ++-- Source/PluginEditor.cpp | 40 +++++++++++++++++++++----------------- Source/PluginEditor.h | 4 +++- Source/PluginParam.cpp | 8 ++++---- Source/PluginProcessor.cpp | 4 ++-- Source/PluginProcessor.h | 9 ++++----- Source/VUMeter.cpp | 12 ++++++------ 7 files changed, 43 insertions(+), 38 deletions(-) diff --git a/Source/OperatorEditor.cpp b/Source/OperatorEditor.cpp index 843f022a..914cb406 100644 --- a/Source/OperatorEditor.cpp +++ b/Source/OperatorEditor.cpp @@ -607,7 +607,7 @@ void OperatorEditor::mouseDown(const MouseEvent &event) { popup.addSeparator(); popup.addItem(4, "Send current program to DX7"); - if ( processor->getDpiScaleFactor() > 1.0f ) { + if ( processor->getZoomFactor() > 1.0f ) { popup.addSeparator(); popup.addItem(5, "Reset plugin UI scaling factor"); } @@ -632,7 +632,7 @@ void OperatorEditor::mouseDown(const MouseEvent &event) { case 5: auto *editor = dynamic_cast(getParentComponent()); if ( editor != nullptr ) { - editor->resetScaleFactor(); + editor->resetZoomFactor(); } break; } diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index bb6c121b..04c752fd 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -37,10 +37,11 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner midiKeyboard (ownerFilter->keyboardState, MidiKeyboardComponent::horizontalKeyboard), cartManager(this) { + processor = ownerFilter; + // We have to set size at startup because the keyboard doesnt show up before being added - setSize(WINDOW_SIZE_X, (ownerFilter->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + resetSize(); setExplicitFocusOrder(1); - processor = ownerFilter; lookAndFeel->setDefaultLookAndFeel(lookAndFeel); background = lookAndFeel->background; @@ -91,9 +92,9 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner cartManagerCover.addChildComponent(&cartManager); cartManager.setVisible(true); - AffineTransform scale = AffineTransform::scale(processor->getDpiScaleFactor()); + AffineTransform scale = AffineTransform::scale(processor->getZoomFactor()); setTransform(scale); - setSize(WINDOW_SIZE_X, (this->processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + resetSize(); addKeyListener(this); updateUI(); startTimer(100); @@ -198,7 +199,7 @@ void DexedAudioProcessorEditor::parmShow() { int tp = processor->getEngineType(); auto param = new ParamDialog(); param->setColour(AlertWindow::backgroundColourId, Colour(0xFF323E44)); - param->setDialogValues(processor->controllers, processor->sysexComm, tp, processor->showKeyboard, processor->getDpiScaleFactor()); + param->setDialogValues(processor->controllers, processor->sysexComm, tp, processor->showKeyboard, processor->getZoomFactor()); param->setIsStandardTuning(processor->synthTuningState->is_standard_tuning() ); param->setTuningCallback([this](ParamDialog *p, ParamDialog::TuningAction which) { switch(which) @@ -223,15 +224,15 @@ void DexedAudioProcessorEditor::parmShow() { auto generalCallback = [this](ParamDialog *param) { int tpo; - float scale = this->processor->getDpiScaleFactor(); + float scale = this->processor->getZoomFactor(); bool ret = param->getDialogValues(this->processor->controllers, this->processor->sysexComm, &tpo, &this->processor->showKeyboard, &scale); - this->processor->setDpiScaleFactor(scale); + this->processor->setZoomFactor(scale); this->processor->setEngineType(tpo); this->processor->savePreference(); - AffineTransform scaleAffine = AffineTransform::scale(dawScalingFactor * this->processor->getDpiScaleFactor()); + AffineTransform scaleAffine = AffineTransform::scale(dawScalingFactor * this->processor->getZoomFactor()); setTransform(scaleAffine); - setSize(WINDOW_SIZE_X, (this->processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + resetSize(); if ( ret == false ) { AlertWindow::showMessageBoxAsync(AlertWindow::WarningIcon, "Midi Interface", "Error opening midi ports"); @@ -457,9 +458,8 @@ float DexedAudioProcessorEditor::getLargestScaleFactor() { // validate if there is really a display that can show the complete plugin size for (auto& display : Desktop::getInstance().getDisplays().displays) { - float ratio = display.scale; - int height = ratio * display.userArea.getHeight(); - int width = ratio * display.userArea.getWidth(); + int height = display.userArea.getHeight(); + int width = display.userArea.getWidth(); TRACE("Testing size %d x %d < Dexed Window %d x %d", height, width, rect.getWidth(), rect.getHeight() ); if ( height > rect.getHeight() && width > rect.getWidth() ) { @@ -473,12 +473,11 @@ float DexedAudioProcessorEditor::getLargestScaleFactor() { return 1.0f; } -void DexedAudioProcessorEditor::resetScaleFactor() { - processor->setDpiScaleFactor(1.0); +void DexedAudioProcessorEditor::resetZoomFactor() { + processor->setZoomFactor(1.0); processor->savePreference(); - auto previousSize = this->getBounds(); - setScaleFactor(1.0); - this->setSize(previousSize.getWidth(), previousSize.getHeight()); + setScaleFactor(dawScalingFactor); + resetSize(); } bool DexedAudioProcessorEditor::isInterestedInFileDrag (const StringArray &files) @@ -606,6 +605,11 @@ bool DexedAudioProcessorEditor::keyPressed(const KeyPress& key, Component* origi } void DexedAudioProcessorEditor::setScaleFactor(float newScaleFactor) { + TRACE("scaling factor to %f", newScaleFactor); dawScalingFactor = newScaleFactor; - AudioProcessorEditor::setScaleFactor(newScaleFactor * processor->getDpiScaleFactor()); + AudioProcessorEditor::setScaleFactor(newScaleFactor * processor->getZoomFactor()); +} + +void DexedAudioProcessorEditor::resetSize() { + setSize(WINDOW_SIZE_X, (processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); } \ No newline at end of file diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 3d80c50b..d1c9a4e3 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -47,6 +47,8 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: #endif float dawScalingFactor = 1.0f; + + void resetSize(); public: DexedAudioProcessor *processor; GlobalEditor global; @@ -69,7 +71,7 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: void discoverMidiCC(Ctrl *ctrl); static float getLargestScaleFactor(); - void resetScaleFactor(); + void resetZoomFactor(); virtual bool isInterestedInFileDrag (const StringArray &files) override; virtual void filesDropped (const StringArray &files, int x, int y ) override; diff --git a/Source/PluginParam.cpp b/Source/PluginParam.cpp index b653ca63..2edcb408 100644 --- a/Source/PluginParam.cpp +++ b/Source/PluginParam.cpp @@ -137,7 +137,7 @@ void Ctrl::mouseDown(const juce::MouseEvent &event) { } popup.addItem(2, "Clear midi CC mapping"); - if ( parent->getDpiScaleFactor() > 1.0f ) { + if ( parent->getZoomFactor() > 1.0f ) { popup.addSeparator(); popup.addItem(5, "Reset plugin UI scaling factor"); } @@ -166,7 +166,7 @@ void Ctrl::mouseDown(const juce::MouseEvent &event) { case 5: { auto *editor = dynamic_cast(parent->getActiveEditor()); if ( editor != nullptr ) { - editor->resetScaleFactor(); + editor->resetZoomFactor(); } } break; @@ -844,7 +844,7 @@ void DexedAudioProcessor::loadPreference() { } if ( prop.containsKey( String("dpiScaleFactor") ) ) { - dpiScaleFactor = prop.getDoubleValue(String("dpiScaleFactor")); + zoomFactor = prop.getDoubleValue(String("dpiScaleFactor")); } controllers.refresh(); @@ -878,7 +878,7 @@ void DexedAudioProcessor::savePreference() { prop.setValue(String("aftertouchMod"), mod_cfg); prop.setValue(String("engineType"), (int) engineType); - prop.setValue(String("dpiScaleFactor"), dpiScaleFactor); + prop.setValue(String("dpiScaleFactor"), zoomFactor); prop.save(); } diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 995de64c..369bfd87 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -873,8 +873,8 @@ AudioProcessorEditor* DexedAudioProcessor::createEditor() { return editor; } -void DexedAudioProcessor::setDpiScaleFactor(float factor) { - dpiScaleFactor = factor; +void DexedAudioProcessor::setZoomFactor(float factor) { + zoomFactor = factor; } void DexedAudioProcessor::handleAsyncUpdate() { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 3c6f673e..161819e0 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -131,7 +131,7 @@ class DexedAudioProcessor : public AudioProcessor, public AsyncUpdater, public void unpackOpSwitch(char packOpValue); void packOpSwitch(); - float dpiScaleFactor = 1; + float zoomFactor = 1; public : // in MIDI units (0x4000 is neutral) @@ -280,10 +280,9 @@ public : std::string currentSCLData = ""; std::string currentKBMData = ""; - void setDpiScaleFactor(float factor); - - float getDpiScaleFactor() { - return dpiScaleFactor; + void setZoomFactor(float factor); + float getZoomFactor() { + return zoomFactor; } private: int chooseNote(uint8_t pitch); diff --git a/Source/VUMeter.cpp b/Source/VUMeter.cpp index af774c6e..a5407441 100644 --- a/Source/VUMeter.cpp +++ b/Source/VUMeter.cpp @@ -29,14 +29,14 @@ VuMeterBase::VuMeterBase(int maxdB) { // set log-free faster index calculationg function ampToStripeIndex = &VuMeterBase::ampToStripeIndex_le; indexBiasMindB2 = ampTodB21_le(dB2ToAmp((float)mindB)); -DBG("VuMeterBase::VuMeterBase(): Little Endian Float System identified"); +//DBG("VuMeterBase::VuMeterBase(): Little Endian Float System identified"); } else if (u.b4[0] == 0x40 && u.b4[1] == 0x08) { // a Big Endian system identified // set log-free faster index calculationg function ampToStripeIndex = &VuMeterBase::ampToStripeIndex_be; indexBiasMindB2 = ampTodB21_be(dB2ToAmp((float)mindB)); -DBG("VuMeterBase::VuMeterBase(): Big Endian Float System identified"); +//DBG("VuMeterBase::VuMeterBase(): Big Endian Float System identified"); } else { // the endianess of floats is not identified; @@ -44,7 +44,7 @@ DBG("VuMeterBase::VuMeterBase(): Big Endian Float System identified"); ampToStripeIndex = &VuMeterBase::ampToStripeIndex_log; minamp = dB10ToAmp((float)mindB); maxamp = dB10ToAmp((float)maxdB); -DBG("VuMeterBase::VuMeterBase(): Unidentified Endian Float System"); +//DBG("VuMeterBase::VuMeterBase(): Unidentified Endian Float System"); } } @@ -207,7 +207,7 @@ VuStripesSingleton::~VuStripesSingleton() { destroyStripes(tricolorVuMeterStripes); // release memblks reserved for images of tricolor stripes destroyStripes(solidVuMeterStripes); -DBG("VuStripesSingleton::~VuStripesSingleton() called"); +//DBG("VuStripesSingleton::~VuStripesSingleton() called"); } VuStripesSingleton::VuStripesSingleton() { @@ -215,7 +215,7 @@ VuStripesSingleton::VuStripesSingleton() { createStripes(solidVuMeterStripes, false); // create tricolor single stripes createStripes(tricolorVuMeterStripes, true); -DBG("VuStripesSingleton::VuStripesSingleton() called"); +//DBG("VuStripesSingleton::VuStripesSingleton() called"); } @@ -334,7 +334,7 @@ void VuStripesSingleton::createStripes(juce::Image** array, bool tricolor) { juce::Graphics gimgCurrent(*imgCurrent); gimgCurrent.drawImageAt(brightLED, xStart, 0, false); - // store this stripe having number of ÿÿiStripe`` bright LEDs + // store this stripe having number of ��iStripe`` bright LEDs array[iStripe] = imgCurrent; // use this image as source in the next loop From 50e78655792bb627e114c361d7a8282b9d565baf Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Thu, 27 Nov 2025 22:33:43 -0500 Subject: [PATCH 07/10] Dont override DAW scaling WIP --- README.md | 7 +++---- Source/PluginEditor.cpp | 43 ++++++++++++++++++++--------------------- Source/PluginEditor.h | 8 +++----- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 788934ce..586b6fe4 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,10 @@ Dexed Forks Changelog --------- -#### Version 0.9.10 -* Remove automatic UI scaling, dexed will always use user settings and if UI - window is to big, it can be reset with the contextual menu (right click on the UI) - by selecting the "Reset plugin UI scaling factor" +#### Version 1.0.1 +* Let DAW scale the UI and then let the user can zoom it further if needed * Fixed scaling issue with CLAP format +* Plugin parameters dialogs are now part of the main plugin window (no more separate windows) #### Version 0.9.9 * Partial portamento implementation. Thanks @jpcima diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 04c752fd..19894bab 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -43,43 +43,46 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner resetSize(); setExplicitFocusOrder(1); + + frameComponent.setBounds(0,0, WINDOW_SIZE_X, (processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + addAndMakeVisible(&frameComponent); lookAndFeel->setDefaultLookAndFeel(lookAndFeel); background = lookAndFeel->background; // OPERATORS - addAndMakeVisible(&(operators[0])); + frameComponent.addAndMakeVisible(&(operators[0])); operators[0].setBounds(2, 1, 287, 218); operators[0].bind(processor, 0); - addAndMakeVisible(&(operators[1])); + frameComponent.addAndMakeVisible(&(operators[1])); operators[1].setBounds(290, 1, 287, 218); operators[1].bind(processor, 1); - addAndMakeVisible(&(operators[2])); + frameComponent.addAndMakeVisible(&(operators[2])); operators[2].setBounds(578, 1, 287, 218); operators[2].bind(processor, 2); - addAndMakeVisible(&(operators[3])); + frameComponent.addAndMakeVisible(&(operators[3])); operators[3].setBounds(2, 219, 287, 218); operators[3].bind(processor, 3); - addAndMakeVisible(&(operators[4])); + frameComponent.addAndMakeVisible(&(operators[4])); operators[4].setBounds(290, 219, 287, 218); operators[4].bind(processor, 4); - addAndMakeVisible(&(operators[5])); + frameComponent.addAndMakeVisible(&(operators[5])); operators[5].setBounds(578, 219, 287, 218); operators[5].bind(processor, 5); // add the midi keyboard component.. - addAndMakeVisible (&midiKeyboard); + frameComponent.addAndMakeVisible (&midiKeyboard); // The DX7 is a badass on the bass, keep it that way midiKeyboard.setLowestVisibleKey(24); midiKeyboard.setBounds(4, 581, getWidth() - 8, 90); midiKeyboard.setTitle("Keyboard keys"); - addAndMakeVisible(&global); + frameComponent.addAndMakeVisible(&global); global.setBounds(2,436,864,144); global.bind(this); @@ -88,12 +91,12 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner rebuildProgramCombobox(); global.programs->addListener(this); - addChildComponent(&cartManagerCover); + frameComponent.addChildComponent(&cartManagerCover); cartManagerCover.addChildComponent(&cartManager); cartManager.setVisible(true); AffineTransform scale = AffineTransform::scale(processor->getZoomFactor()); - setTransform(scale); + frameComponent.setTransform(scale); resetSize(); addKeyListener(this); updateUI(); @@ -230,8 +233,8 @@ void DexedAudioProcessorEditor::parmShow() { this->processor->setEngineType(tpo); this->processor->savePreference(); - AffineTransform scaleAffine = AffineTransform::scale(dawScalingFactor * this->processor->getZoomFactor()); - setTransform(scaleAffine); + AffineTransform scaleAffine = AffineTransform::scale(this->processor->getZoomFactor()); + frameComponent.setTransform(scaleAffine); resetSize(); if ( ret == false ) { @@ -242,8 +245,8 @@ void DexedAudioProcessorEditor::parmShow() { dexedParameterDialog = std::make_unique("dexed Parameters", Colour(0xFF323E44)); dexedParameterDialog->setContentOwned(param, true); - addAndMakeVisible(dexedParameterDialog.get()); - dexedParameterDialog->centreAroundComponent(this, param->getWidth(), param->getHeight() + dexedParameterDialog->getTitleBarHeight()); + frameComponent.addAndMakeVisible(dexedParameterDialog.get()); + dexedParameterDialog->centreAroundComponent(&frameComponent, param->getWidth(), param->getHeight() + dexedParameterDialog->getTitleBarHeight()); dexedParameterDialog->enterModalState(true,{}); } @@ -476,7 +479,8 @@ float DexedAudioProcessorEditor::getLargestScaleFactor() { void DexedAudioProcessorEditor::resetZoomFactor() { processor->setZoomFactor(1.0); processor->savePreference(); - setScaleFactor(dawScalingFactor); + AffineTransform scale = AffineTransform::scale(processor->getZoomFactor()); + frameComponent.setTransform(scale); resetSize(); } @@ -604,12 +608,7 @@ bool DexedAudioProcessorEditor::keyPressed(const KeyPress& key, Component* origi return false; } -void DexedAudioProcessorEditor::setScaleFactor(float newScaleFactor) { - TRACE("scaling factor to %f", newScaleFactor); - dawScalingFactor = newScaleFactor; - AudioProcessorEditor::setScaleFactor(newScaleFactor * processor->getZoomFactor()); -} - void DexedAudioProcessorEditor::resetSize() { - setSize(WINDOW_SIZE_X, (processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94)); + float factor = processor->getZoomFactor(); + setSize(WINDOW_SIZE_X * factor, (processor->showKeyboard ? WINDOW_SIZE_Y : WINDOW_SIZE_Y - 94) * factor); } \ No newline at end of file diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index d1c9a4e3..b3c0e90a 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -46,9 +46,9 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: FocusLogger focusLogger; #endif - float dawScalingFactor = 1.0f; - void resetSize(); + + Component frameComponent; public: DexedAudioProcessor *processor; GlobalEditor global; @@ -76,9 +76,7 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: virtual bool isInterestedInFileDrag (const StringArray &files) override; virtual void filesDropped (const StringArray &files, int x, int y ) override; std::unique_ptr createFocusTraverser() override; - - virtual void setScaleFactor(float newScaleFactor) override; - + bool keyPressed(const KeyPress& key, Component* originatingComponent) override; static const int WINDOW_SIZE_X = 866; From fda510ec05abc78dd39d1205c91fb78e9da04fb2 Mon Sep 17 00:00:00 2001 From: asb2m10 Date: Thu, 27 Nov 2025 23:08:31 -0500 Subject: [PATCH 08/10] Remove maximum zoom detection --- README.md | 2 +- Source/OperatorEditor.cpp | 2 +- Source/PluginEditor.cpp | 43 +++++++++++++++++++++------------------ Source/PluginEditor.h | 2 +- Source/PluginParam.cpp | 6 +++--- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 586b6fe4..bc2fc4f9 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Dexed Forks Changelog --------- #### Version 1.0.1 -* Let DAW scale the UI and then let the user can zoom it further if needed +* Let DAW scale the UI and then let the user zoom it further if needed * Fixed scaling issue with CLAP format * Plugin parameters dialogs are now part of the main plugin window (no more separate windows) diff --git a/Source/OperatorEditor.cpp b/Source/OperatorEditor.cpp index 914cb406..426c016f 100644 --- a/Source/OperatorEditor.cpp +++ b/Source/OperatorEditor.cpp @@ -630,7 +630,7 @@ void OperatorEditor::mouseDown(const MouseEvent &event) { break; case 5: - auto *editor = dynamic_cast(getParentComponent()); + auto *editor = dynamic_cast(getParentComponent()->getParentComponent()); if ( editor != nullptr ) { editor->resetZoomFactor(); } diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 19894bab..44ce786e 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -454,29 +454,32 @@ void DexedAudioProcessorEditor::discoverMidiCC(Ctrl *ctrl) { } float DexedAudioProcessorEditor::getLargestScaleFactor() { - constexpr float TESTING_SCALE_FACTOR[] = { 4.0f, 3.0f, 2.0f, 1.5f, 1.0f }; - - for (float factor: TESTING_SCALE_FACTOR) { - const juce::Rectangle rect(WINDOW_SIZE_X * factor, WINDOW_SIZE_Y * factor); - - // validate if there is really a display that can show the complete plugin size - for (auto& display : Desktop::getInstance().getDisplays().displays) { - int height = display.userArea.getHeight(); - int width = display.userArea.getWidth(); - - TRACE("Testing size %d x %d < Dexed Window %d x %d", height, width, rect.getWidth(), rect.getHeight() ); - if ( height > rect.getHeight() && width > rect.getWidth() ) { - TRACE("Found factor %f for display %s with size %d x %d", factor, display.userArea.toString().toRawUTF8(), height, width ); - return factor; - } - } - } - - TRACE("No suitable display found, returning default scale factor 1.0"); - return 1.0f; + // constexpr float TESTING_SCALE_FACTOR[] = { 4.0f, 3.0f, 2.0f, 1.5f, 1.0f }; + // + // for (float factor: TESTING_SCALE_FACTOR) { + // const juce::Rectangle rect(WINDOW_SIZE_X * factor, WINDOW_SIZE_Y * factor); + // + // // validate if there is really a display that can show the complete plugin size + // for (auto& display : Desktop::getInstance().getDisplays().displays) { + // int height = display.userArea.getHeight(); + // int width = display.userArea.getWidth(); + // + // TRACE("Testing size %d x %d < Dexed Window %d x %d", height, width, rect.getWidth(), rect.getHeight() ); + // if ( height > rect.getHeight() && width > rect.getWidth() ) { + // TRACE("Found factor %f for display %s with size %d x %d", factor, display.userArea.toString().toRawUTF8(), height, width ); + // return factor; + // } + // } + // } + // + // TRACE("No suitable display found, returning default scale factor 1.0"); + + // For now, always return 4.0f as the maximum scale factor. + return 4.0f; } void DexedAudioProcessorEditor::resetZoomFactor() { + TRACE("Resetting zoom factor to 1.0"); processor->setZoomFactor(1.0); processor->savePreference(); AffineTransform scale = AffineTransform::scale(processor->getZoomFactor()); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index b3c0e90a..7867f23d 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -76,7 +76,7 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor, public ComboBox: virtual bool isInterestedInFileDrag (const StringArray &files) override; virtual void filesDropped (const StringArray &files, int x, int y ) override; std::unique_ptr createFocusTraverser() override; - + bool keyPressed(const KeyPress& key, Component* originatingComponent) override; static const int WINDOW_SIZE_X = 866; diff --git a/Source/PluginParam.cpp b/Source/PluginParam.cpp index 2edcb408..c824bb7f 100644 --- a/Source/PluginParam.cpp +++ b/Source/PluginParam.cpp @@ -843,8 +843,8 @@ void DexedAudioProcessor::loadPreference() { controllers.at.parseConfig(prop.getValue(String("aftertouchMod")).toRawUTF8()); } - if ( prop.containsKey( String("dpiScaleFactor") ) ) { - zoomFactor = prop.getDoubleValue(String("dpiScaleFactor")); + if ( prop.containsKey( String("zoomFactor") ) ) { + zoomFactor = prop.getDoubleValue(String("zoomFactor")); } controllers.refresh(); @@ -878,7 +878,7 @@ void DexedAudioProcessor::savePreference() { prop.setValue(String("aftertouchMod"), mod_cfg); prop.setValue(String("engineType"), (int) engineType); - prop.setValue(String("dpiScaleFactor"), zoomFactor); + prop.setValue(String("zoomFactor"), zoomFactor); prop.save(); } From 932cf6198f1654a976840faa5b8f29b0d8c3eedf Mon Sep 17 00:00:00 2001 From: Pascal Gauthier Date: Sat, 29 Nov 2025 00:08:55 -0500 Subject: [PATCH 09/10] Update plugin version to 1.0.1 --- Source/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index fa57a78c..3f06b020 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -13,7 +13,7 @@ endif() message(STATUS "Building Dexed in formats: ${DEXED_JUCE_FORMATS}") juce_add_plugin("${BaseTargetName}" - VERSION "1.0.0" # FORCING THIS SINCE OLDER VERSION WILL NOT BE ABLE TO SYNC PLUGIN DATA. THIS WILL GET UPDATED ONCE 1.0 is released. + VERSION "1.0.1" ICON_BIG "../assets/ui/dexedIcon.png" ICON_SMALL "../assets/ui/dexedIcon.png" COMPANY_NAME "Digital Suburban" From 3a32816143caae92de3746e0afcb467208876d0c Mon Sep 17 00:00:00 2001 From: Pascal Gauthier Date: Sat, 29 Nov 2025 00:20:59 -0500 Subject: [PATCH 10/10] Update project version to 1.0.1 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dc0eb33..f81961f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.16) -project(Dexed VERSION 0.9.9) +project(Dexed VERSION 1.0.1) #Compile commands, useful for some IDEs like VS-Code set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE) @@ -72,4 +72,4 @@ target_compile_options(${PROJECT_NAME} PUBLIC endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/assets/installers") -include(installer) \ No newline at end of file +include(installer)