From 5d4f4452e4481df170565973ff2d118922048844 Mon Sep 17 00:00:00 2001 From: Tobias Stein Date: Mon, 19 Feb 2024 10:13:34 +0100 Subject: [PATCH 1/7] Create AR Comb ARP.vvp --- VASTvaporizer/Presets/AR Comb ARP.vvp | 934 ++++++++++++++++++++++++++ 1 file changed, 934 insertions(+) create mode 100644 VASTvaporizer/Presets/AR Comb ARP.vvp diff --git a/VASTvaporizer/Presets/AR Comb ARP.vvp b/VASTvaporizer/Presets/AR Comb ARP.vvp new file mode 100644 index 0000000..b18d907 --- /dev/null +++ b/VASTvaporizer/Presets/AR Comb ARP.vvp @@ -0,0 +1,934 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7e3a2b6d63f24111c9419cdc6c15c7c002529931 Mon Sep 17 00:00:00 2001 From: Tobias Stein Date: Mon, 19 Feb 2024 19:26:58 +0100 Subject: [PATCH 2/7] Highlight modulation sources on side panel --- VASTvaporizer/Source/Engine/VASTXperience.cpp | 142 +++++++++++------- VASTvaporizer/Source/Engine/VASTXperience.h | 4 + .../Source/Plugin/VASTAudioProcessor.cpp | 5 +- .../Plugin/VASTAudioProcessorEditor.cpp | 1 + .../Plugin/VASTControls/VASTDragSource.cpp | 89 ++++++++++- .../Plugin/VASTControls/VASTDragSource.h | 14 +- .../VASTControls/VASTParameterSlider.cpp | 48 ++++++ .../Plugin/VASTControls/VASTParameterSlider.h | 8 +- .../Source/Plugin/VASTHeaderComponent.cpp | 3 +- .../Source/Plugin/VASTLFOMsegComponent.h | 2 +- .../Plugin/VASTMSEGEditor/VASTARPEditor.cpp | 5 + .../Plugin/VASTMSEGEditor/VASTARPEditor.h | 3 +- .../Plugin/VASTMSEGEditor/VASTMSEGEditor.cpp | 5 + .../Plugin/VASTMSEGEditor/VASTMSEGEditor.h | 3 +- .../VASTMSEGEditor/VASTStepSeqEditor.cpp | 4 + .../Plugin/VASTMSEGEditor/VASTStepSeqEditor.h | 5 +- .../Source/Plugin/VASTSidePanelComponent.cpp | 139 +++++++++-------- .../Source/Plugin/VASTSidePanelComponent.h | 4 +- .../Plugin/VASTUtils/VASTLookAndFeel.cpp | 9 +- 19 files changed, 354 insertions(+), 139 deletions(-) diff --git a/VASTvaporizer/Source/Engine/VASTXperience.cpp b/VASTvaporizer/Source/Engine/VASTXperience.cpp index 57aa344..e517e61 100644 --- a/VASTvaporizer/Source/Engine/VASTXperience.cpp +++ b/VASTvaporizer/Source/Engine/VASTXperience.cpp @@ -752,7 +752,26 @@ bool CVASTXperience::processAudioBuffer(AudioSampleBuffer& buffer, MidiBuffer& m return true; } -//// called only from GUI THREAD +void CVASTXperience::parameterUpdatesAfterInit() { + m_Poly.updateVariables(); + m_Poly.updateLFO(0); + m_Poly.updateLFO(1); + m_Poly.updateLFO(2); + m_Poly.updateLFO(3); + m_Poly.updateLFO(4); + m_Poly.initArp(); + m_Set.modMatrixCalcBuffers(); +} + +void CVASTXperience::setIsInitDefaults(bool defaults) { + m_isInitDefaults.store(defaults); +} + +bool CVASTXperience::getIsInitDefaults() { + return m_isInitDefaults.load(); +} + +//// called only from GUI THREAD void CVASTXperience::parameterChanged(const String& parameterID, float newValue) { if (myProcessor->initNotCompleted()) return; @@ -764,6 +783,7 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) // normal post procs bool l_isBlocked = nonThreadsafeIsBlockedProcessingInfo(); + bool l_isInitDefaults = getIsInitDefaults(); const ScopedLock sl(paramChangeLock); if (0 == parameterID.compare("m_uPolyMode")) { @@ -856,210 +876,210 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) if (m_Poly.m_singleNote[i] != nullptr) //safety check for multiple host threads editing simultaneously m_Poly.m_singleNote[i]->setPortamentoTime(*m_Set.m_State->m_fPortamento); } - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_fMasterTune")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } //LFO if (0 == parameterID.compare("m_uLFOTimeBeats_LFO1")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(0); return; } if (0 == parameterID.compare("m_uLFOTimeBeats_LFO2")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(1); return; } if (0 == parameterID.compare("m_uLFOTimeBeats_LFO3")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(2); return; } if (0 == parameterID.compare("m_uLFOTimeBeats_LFO4")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(3); return; } if (0 == parameterID.compare("m_uLFOTimeBeats_LFO5")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(4); return; } if (0 == parameterID.compare("m_bLFOPerVoice_LFO1")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(0); return; } if (0 == parameterID.compare("m_bLFOPerVoice_LFO2")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(1); return; } if (0 == parameterID.compare("m_bLFOPerVoice_LFO3")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(2); return; } if (0 == parameterID.compare("m_bLFOPerVoice_LFO4")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(3); return; } if (0 == parameterID.compare("m_bLFOPerVoice_LFO5")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(4); return; } if (0 == parameterID.compare("m_fLFOFreq_LFO1")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(0); return; } if (0 == parameterID.compare("m_fLFOFreq_LFO2")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(1); return; } if (0 == parameterID.compare("m_fLFOFreq_LFO3")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(2); return; } if (0 == parameterID.compare("m_fLFOFreq_LFO4")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(3); return; } if (0 == parameterID.compare("m_fLFOFreq_LFO5")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(4); return; } if (0 == parameterID.compare("m_uLFOWave_LFO1")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(0); return; } if (0 == parameterID.compare("m_uLFOWave_LFO2")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(1); return; } if (0 == parameterID.compare("m_uLFOWave_LFO3")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(2); return; } if (0 == parameterID.compare("m_uLFOWave_LFO4")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(3); return; } if (0 == parameterID.compare("m_uLFOWave_LFO5")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(4); return; } if (0 == parameterID.compare("m_bLFOSynch_LFO1")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(0); return; } if (0 == parameterID.compare("m_bLFOSynch_LFO2")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(1); return; } if (0 == parameterID.compare("m_bLFOSynch_LFO3")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(2); return; } if (0 == parameterID.compare("m_bLFOSynch_LFO4")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(3); return; } if (0 == parameterID.compare("m_bLFOSynch_LFO5")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateLFO(4); return; } if (0 == parameterID.compare("m_uOscWave_OscA")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_uOscWave_OscB")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_uOscWave_OscC")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_uOscWave_OscD")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_iNumOscs_OscA"))) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_iNumOscs_OscB"))) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_iNumOscs_OscC"))) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_iNumOscs_OscD"))) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } @@ -1086,82 +1106,82 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) if ((0 == parameterID.compare("m_bOscOnOff_OscA"))) { m_Poly.m_OscBank[0].setChangedFlag(); - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_bOscOnOff_OscB"))) { m_Poly.m_OscBank[1].setChangedFlag(); - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_bOscOnOff_OscC"))) { m_Poly.m_OscBank[2].setChangedFlag(); - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_bOscOnOff_OscD"))) { m_Poly.m_OscBank[3].setChangedFlag(); - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if ((0 == parameterID.compare("m_bNoiseOnOff"))) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_iOscOct_OscA")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_iOscOct_OscB")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_iOscOct_OscC")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_iOscOct_OscD")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_fOscDetune_OscA")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_fOscDetune_OscB")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_fOscDetune_OscC")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_fOscDetune_OscD")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } @@ -1192,13 +1212,13 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) } if (0 == parameterID.compare("m_uVCAEnvMode")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } if (0 == parameterID.compare("m_uVCFEnvMode")) { - if (!l_isBlocked) + if (!l_isBlocked && !l_isInitDefaults) m_Poly.updateVariables(); return; } @@ -1254,12 +1274,14 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) //ARP if (0 == parameterID.compare("m_bARPOnOff")) { - m_Poly.initArp(); + if (!l_isInitDefaults) + m_Poly.initArp(); return; } if (0 == parameterID.compare("m_bARPOnOff")) { - m_Poly.initArp(); + if (!l_isInitDefaults) + m_Poly.initArp(); return; } @@ -1272,8 +1294,9 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) if (true == parameterID.startsWith("m_uModMatSrce")) { //starts with! int slot = String(parameterID.removeCharacters("m_uModMatSrce")).getIntValue() - 1; int oldVal = m_Set.modMatrixSlotDest[slot]; - m_Set.modMatrixCalcBuffers(); - int newVal = m_Set.modMatrixSlotDest[slot]; + if (!l_isInitDefaults) + m_Set.modMatrixCalcBuffers(); + int newVal = m_Set.modMatrixSlotDest[slot]; myProcessor->requestUIUpdate(false, false, true, oldVal, newVal); //only particular sliders shall be updated return; } @@ -1281,7 +1304,8 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) if (true == parameterID.startsWith("m_uModMatDest")) { //starts with! int slot = String(parameterID.removeCharacters("m_uModMatDest")).getIntValue() - 1; int oldVal = m_Set.modMatrixSlotDest[slot]; - m_Set.modMatrixCalcBuffers(); + if (!l_isInitDefaults) + m_Set.modMatrixCalcBuffers(); int newVal = m_Set.modMatrixSlotDest[slot]; myProcessor->requestUIUpdate(false, false, true, oldVal, newVal); //only particular sliders shall be updated return; @@ -1290,7 +1314,8 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) if (true == parameterID.startsWith("m_fModMatVal")) { //starts with! int slot = String(parameterID.removeCharacters("m_fModMatVal")).getIntValue() - 1; int oldVal = m_Set.modMatrixSlotDest[slot]; - m_Set.modMatrixCalcBuffers(); + if (!l_isInitDefaults) + m_Set.modMatrixCalcBuffers(); int newVal = m_Set.modMatrixSlotDest[slot]; myProcessor->requestUIUpdate(false, true, true, oldVal, newVal); //only particular sliders shall be updated return; @@ -1304,7 +1329,8 @@ void CVASTXperience::parameterChanged(const String& parameterID, float newValue) if (true == parameterID.startsWith("m_uModMatPolarity")) { //starts with! int slot = String(parameterID.removeCharacters("m_uModMatPolarity")).getIntValue() - 1; int oldVal = m_Set.modMatrixSlotDest[slot]; - m_Set.modMatrixCalcBuffers(); + if (!l_isInitDefaults) + m_Set.modMatrixCalcBuffers(); int newVal = m_Set.modMatrixSlotDest[slot]; myProcessor->requestUIUpdate(false, true, true, oldVal, newVal); //only particular sliders shall be updated return; diff --git a/VASTvaporizer/Source/Engine/VASTXperience.h b/VASTvaporizer/Source/Engine/VASTXperience.h index 5141fa6..2f660a5 100644 --- a/VASTvaporizer/Source/Engine/VASTXperience.h +++ b/VASTvaporizer/Source/Engine/VASTXperience.h @@ -53,6 +53,9 @@ class CVASTXperience : public CVASTEffect void setStateInformation(const void*, int) override {}; void updateTiming() override {}; void parameterChanged(const String&, float) override; + void parameterUpdatesAfterInit(); + void setIsInitDefaults(bool defaults); + bool getIsInitDefaults(); CVASTSettings m_Set; VASTAudioProcessor* myProcessor; @@ -114,6 +117,7 @@ class CVASTXperience : public CVASTEffect private: std::atomic m_midiBank = 0; CriticalSection paramChangeLock; + std::atomic m_isInitDefaults = false; JUCE_HEAVYWEIGHT_LEAK_DETECTOR(CVASTXperience) //JUCE_LEAK_DETECTOR(CVASTXperience) diff --git a/VASTvaporizer/Source/Plugin/VASTAudioProcessor.cpp b/VASTvaporizer/Source/Plugin/VASTAudioProcessor.cpp index 65a4316..e6de1f5 100644 --- a/VASTvaporizer/Source/Plugin/VASTAudioProcessor.cpp +++ b/VASTvaporizer/Source/Plugin/VASTAudioProcessor.cpp @@ -351,11 +351,14 @@ void VASTAudioProcessor::initializeToDefaults() { //int numparam = getNumParameters(); //deprecated int numparam = getParameters().size(); + m_pVASTXperience.setIsInitDefaults(true); for (int parameterIndex = 0; parameterIndex < numparam; parameterIndex++) { auto* param = getParameters()[parameterIndex]; float defVal = param->getDefaultValue(); param->setValueNotifyingHost(defVal); } + m_pVASTXperience.setIsInitDefaults(false); + m_pVASTXperience.parameterUpdatesAfterInit(); //reset wts and wav here for (int bank = 0; bank < 4; bank++) { @@ -520,7 +523,7 @@ void VASTAudioProcessor::initializeToDefaults() { m_pVASTXperience.m_fxBus1.initSequence(); m_pVASTXperience.m_fxBus2.initSequence(); m_pVASTXperience.m_fxBus3.initSequence(); - + //m_parameterState.undoManager->clearUndoHistory(); //TODO: there is a sporadic segfault here! m_parameterState.undoManager->beginNewTransaction(); //start new transcation only here? } diff --git a/VASTvaporizer/Source/Plugin/VASTAudioProcessorEditor.cpp b/VASTvaporizer/Source/Plugin/VASTAudioProcessorEditor.cpp index 8678edc..764f422 100644 --- a/VASTvaporizer/Source/Plugin/VASTAudioProcessorEditor.cpp +++ b/VASTvaporizer/Source/Plugin/VASTAudioProcessorEditor.cpp @@ -155,6 +155,7 @@ void VASTAudioProcessorEditor::timerCallback(int timerID) { vaporizerComponent->updateMatrixDisplay(); vaporizerComponent->updateHeader(); myProcessor->clearUIInitFlagAfterPresetLoad(); + myProcessor->requestUIUpdate(true, true, true, -1, -1); } if (myProcessor->needsUIUpdate()) { diff --git a/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.cpp b/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.cpp index 24ae988..3579159 100644 --- a/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.cpp +++ b/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.cpp @@ -6,7 +6,7 @@ VAST Dynamics #include "VASTDragSource.h" #include "../VASTAudioProcessorEditor.h" -VASTDragSource::VASTDragSource(const juce::String &componentName, const juce::String &dragText) { +VASTDragSource::VASTDragSource(int modSource, const juce::String &componentName, const juce::String &dragText, const juce::String &tooltipText) : m_toolTipText(tooltipText), m_modSource(modSource){ this->setName(componentName); this->setComponentID(componentName); @@ -37,6 +37,10 @@ VASTDragSource::VASTDragSource(const juce::String &componentName, const juce::St ddLabel->setColour(TextEditor::textColourId, Colours::black); ddLabel->setColour(TextEditor::backgroundColourId, Colour(0x00000000)); ddLabel->addListener(this); + this->addMouseListener(this, true); + + ddLabel->setTooltip(m_toolTipText); + ddImageButton->setTooltip(m_toolTipText); if (componentName.startsWithIgnoreCase("c_dd_CustomModulator")) ddLabel->setEditable(true); m_processor = NULL; @@ -65,14 +69,30 @@ void VASTDragSource::lookAndFeelChanged() { m_bufferc1 = c1; } +void VASTDragSource::setHighlighted() { + m_isHighlighted = true; +} + +void VASTDragSource::clearHighlighted() { + m_isHighlighted = false; +} + void VASTDragSource::paint(Graphics& g) { - if (m_processor == nullptr) return; - if (m_noLabel) return; - Colour c1 = m_processor->getCurrentVASTLookAndFeel()->findVASTColour(colOscillatorComponentHeaderGradientFrom); - Colour c2 = m_processor->getCurrentVASTLookAndFeel()->findVASTColour(colOscillatorComponentHeaderGradientTo); - Colour c3 = Colour(0xff4e575c); //TODO - g.setGradientFill(ColourGradient(c1, + if (m_processor == nullptr) return; + if (m_noLabel) return; + + Colour c1 = m_processor->getCurrentVASTLookAndFeel()->findVASTColour(colOscillatorComponentHeaderGradientFrom); + Colour c2 = m_processor->getCurrentVASTLookAndFeel()->findVASTColour(colOscillatorComponentHeaderGradientTo); + Colour c3 = Colour(0xff4e575c); //TODO + + if (m_isHighlighted) { + c1 = Colour(255,100,0); //TODO highlight color + c2 = Colour(255,100,0); //TODO highlight color + c3 = Colour(255,100,0); //TODO highlight color + } + + g.setGradientFill(ColourGradient(c1, proportionOfWidth(0), proportionOfHeight(0), c2, @@ -140,3 +160,58 @@ void VASTDragSource::setLabelDefaultText(String defaultText) ddLabel->setText(defaultText, NotificationType::sendNotificationSync); ddLabel->showEditor(); } + +void VASTDragSource::mouseEnter(const MouseEvent &e) +{ + for (int slot = 0; slotm_pVASTXperience.m_Set.modMatrixSlotGetValues(slot, l_value, l_curvy, l_srce, l_dest, polarity, lastSrceVals); + if (l_srce == m_modSource) { + String l_paramName = m_processor->autoDestinationGetParam(l_dest); + for (int i = 0; i < m_processor->m_mapParameterNameToControl.size(); i++) { + VASTParameterSlider* lslider = dynamic_cast(m_processor->m_mapParameterNameToControl[i]); + if (lslider != nullptr) { + if (lslider->getComponentID().equalsIgnoreCase(l_paramName)) { + if (lslider->isShowing()) + lslider->setHighlighted(); + lslider->repaint(); + } + } + } + } + } +} + +void VASTDragSource::mouseExit(const MouseEvent &e) { + for (int slot = 0; slotm_pVASTXperience.m_Set.modMatrixSlotGetValues(slot, l_value, l_curvy, l_srce, l_dest, polarity, lastSrceVals); + if (l_srce == m_modSource) { + String l_paramName = m_processor->autoDestinationGetParam(l_dest); + for (int i = 0; i < m_processor->m_mapParameterNameToControl.size(); i++) { + VASTParameterSlider* lslider = dynamic_cast(m_processor->m_mapParameterNameToControl[i]); + if (lslider != nullptr) { + if (lslider->getComponentID().equalsIgnoreCase(l_paramName)) { + if (lslider->isShowing()) + lslider->clearHighlighted(); + lslider->repaint(); + } + } + } + } + } +} + +int VASTDragSource::getModSource() { + return m_modSource; +} diff --git a/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.h b/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.h index ab7dfd1..02b0ea3 100644 --- a/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.h +++ b/VASTvaporizer/Source/Plugin/VASTControls/VASTDragSource.h @@ -13,7 +13,7 @@ class VASTDragSource : public GroupComponent, Label::Listener { public: - VASTDragSource(const juce::String &componentName, const juce::String &dragText); + VASTDragSource(int modSource, const juce::String &componentName, const juce::String &dragText, const juce::String &tooltipText); ~VASTDragSource(); void resized() override; @@ -26,12 +26,20 @@ class VASTDragSource : public GroupComponent, Label::Listener void editorShown(Label *, TextEditor &) override; void labelTextChanged(Label* labelThatHasChanged) override; void setLabelDefaultText(String defaultText); - + void setHighlighted(); + void clearHighlighted(); + int getModSource(); + private: + void mouseEnter(const MouseEvent &e) override; + void mouseExit(const MouseEvent &e) override; std::unique_ptr ddImageButton; std::unique_ptr