2.1 update
Fixed LFO buttons not working or reverted issue. Fixed Grey skin assets bitmap sizes.
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 242 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 115 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 9 KiB |
|
@ -25,7 +25,7 @@
|
|||
#include "ObxdVoice.h"
|
||||
enum ObxdParameters
|
||||
{
|
||||
UNDEFINED = 0,
|
||||
UNDEFINED,
|
||||
MIDILEARN,
|
||||
VOLUME,
|
||||
VOICE_COUNT,
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
float val = parameter->getValue();
|
||||
//sliderToControl->setValue(parameter->convertFrom0to1(val0to1));
|
||||
sliderToControl->setValue(val, NotificationType::dontSendNotification);
|
||||
DBG(" Slider: " << sliderToControl->getName() << " " << sliderToControl->getValue() << " Parameter: "<< " " << parameter->getValue());
|
||||
DBG(" Slider: " << parameter->name << " " << sliderToControl->getValue() << " Parameter: "<< " " << parameter->getValue());
|
||||
}
|
||||
|
||||
virtual ~KnobAttachment() = default;
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
{
|
||||
//this->setImages
|
||||
kni = k;
|
||||
toogled = false;
|
||||
//toogled = false;
|
||||
width = kni.getWidth();
|
||||
height = kni.getHeight();
|
||||
w2 = width;
|
||||
|
@ -53,7 +53,7 @@ public:
|
|||
TooglableButton& buttonToControl) : AudioProcessorValueTreeState::ButtonAttachment (stateToControl, parameterID, buttonToControl), buttonToControl(&buttonToControl)
|
||||
{
|
||||
parameter = stateToControl.getParameter (parameterID);
|
||||
buttonToControl.setParameter (parameter);
|
||||
//buttonToControl.setParameter (parameter);
|
||||
}
|
||||
/*
|
||||
ToggleAttachment (juce::AudioProcessorValueTreeState& stateToControl,
|
||||
|
@ -64,11 +64,12 @@ public:
|
|||
void updateToSlider(){
|
||||
float val = parameter->getValue();
|
||||
//buttonToControl->setValue(parameter->convertFrom0to1(val0to1), NotificationType::dontSendNotification);
|
||||
buttonToControl->setValue(val, NotificationType::dontSendNotification);
|
||||
DBG("Toggle Parameter: " << parameter->name << " Val: " << val);
|
||||
buttonToControl->setToggleState(val, NotificationType::dontSendNotification);
|
||||
}
|
||||
virtual ~ToggleAttachment() = default;
|
||||
};
|
||||
|
||||
/*
|
||||
void setParameter (const AudioProcessorParameter* p)
|
||||
{
|
||||
if (parameter == p)
|
||||
|
@ -76,8 +77,8 @@ public:
|
|||
|
||||
parameter = p;
|
||||
repaint();
|
||||
}
|
||||
|
||||
}*/
|
||||
/*
|
||||
void clicked() override
|
||||
{
|
||||
toogled = ! toogled;
|
||||
|
@ -89,20 +90,21 @@ public:
|
|||
//this->setColour(DrawableButton::ColourIds::backgroundColourId,Colours::lightpink);
|
||||
Button::clicked();
|
||||
|
||||
};
|
||||
};*/
|
||||
|
||||
void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) override
|
||||
{
|
||||
int offset = 0;
|
||||
|
||||
if (toogled)
|
||||
//if (toogled)
|
||||
if (getToggleState())
|
||||
{
|
||||
offset = 1;
|
||||
}
|
||||
|
||||
g.drawImage(kni, 0, 0, getWidth(), getHeight(), 0, offset * h2, w2, h2);
|
||||
}
|
||||
|
||||
/*
|
||||
void setValue (float state, int notify)
|
||||
{
|
||||
if (state > 0.5)
|
||||
|
@ -110,23 +112,23 @@ public:
|
|||
else toogled = false;
|
||||
|
||||
repaint();
|
||||
}
|
||||
}*/
|
||||
|
||||
float getValue()
|
||||
/*float getValue()
|
||||
{
|
||||
if (toogled)
|
||||
return 1;
|
||||
else return 0;
|
||||
}
|
||||
}*/
|
||||
//void paint(Graphics& g)
|
||||
//{
|
||||
// g.drawImageTransformed(kni,AffineTransform::rotation(((getValue() - getMinimum())/(getMaximum() - getMinimum()))*float_Pi - float_Pi*2));
|
||||
//}
|
||||
|
||||
bool toogled;
|
||||
//bool toogled;
|
||||
|
||||
private:
|
||||
Image kni;
|
||||
int width, height, w2, h2;
|
||||
const AudioProcessorParameter* parameter {nullptr};
|
||||
//const AudioProcessorParameter* parameter;
|
||||
};
|
||||
|
|
|
@ -25,6 +25,8 @@ ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFil
|
|||
// skinFolder = ownerFilter.getCurrentSkinFolder(); // initialized above
|
||||
loadSkin (processor);
|
||||
repaint();
|
||||
|
||||
updateFromHost();
|
||||
}
|
||||
|
||||
void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter)
|
||||
|
@ -285,7 +287,7 @@ TooglableButton* ObxdAudioProcessorEditor::addButton (int x, int y, int w, int h
|
|||
TooglableButton* button = new TooglableButton (ImageCache::getFromFile(skinFolder.getChildFile("button@2x.png")));
|
||||
#endif
|
||||
if (parameter != UNLEARN){
|
||||
toggleAttachments.add (new TooglableButton::ToggleAttachment (filter.getPluginState(),
|
||||
toggleAttachments.add (new AudioProcessorValueTreeState::ButtonAttachment (filter.getPluginState(),
|
||||
filter.getEngineParameterId (parameter),
|
||||
*button));
|
||||
} else {
|
||||
|
@ -293,7 +295,7 @@ TooglableButton* ObxdAudioProcessorEditor::addButton (int x, int y, int w, int h
|
|||
}
|
||||
button->setBounds (x, y, w, h);
|
||||
button->setButtonText (name);
|
||||
button->setValue (filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(),
|
||||
button->setToggleState(filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(),
|
||||
dontSendNotification);
|
||||
|
||||
addAndMakeVisible (button);
|
||||
|
@ -463,18 +465,17 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b)
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
|
||||
void ObxdAudioProcessorEditor::updateFromHost() {
|
||||
for (int i = 0; i < knobAttachments.size(); ++i)
|
||||
{
|
||||
knobAttachments[i]->updateToSlider();
|
||||
}
|
||||
|
||||
/*
|
||||
for (int i = 0; i < toggleAttachments.size(); ++i)
|
||||
{
|
||||
toggleAttachments[i]->updateToSlider();
|
||||
}
|
||||
}*/
|
||||
|
||||
for (int i = 0; i < buttonListAttachments.size(); ++i)
|
||||
{
|
||||
|
@ -488,6 +489,10 @@ void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source
|
|||
|
||||
repaint();
|
||||
}
|
||||
void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
updateFromHost();
|
||||
}
|
||||
|
||||
void ObxdAudioProcessorEditor::mouseUp (const MouseEvent& e)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,8 @@ public:
|
|||
void mouseUp (const MouseEvent& e) override;
|
||||
void paint (Graphics& g) override;
|
||||
|
||||
void updateFromHost();
|
||||
|
||||
//==============================================================================
|
||||
void changeListenerCallback (ChangeBroadcaster* source) override;
|
||||
void buttonClicked (Button *) override;
|
||||
|
@ -134,7 +136,7 @@ private:
|
|||
|
||||
//==============================================================================
|
||||
OwnedArray<Knob::KnobAttachment> knobAttachments;
|
||||
OwnedArray<TooglableButton::ToggleAttachment> toggleAttachments;
|
||||
OwnedArray<AudioProcessorValueTreeState::ButtonAttachment> toggleAttachments;
|
||||
OwnedArray<ButtonList::ButtonListAttachment> buttonListAttachments;
|
||||
|
||||
OwnedArray<ImageButton> imageButtons;
|
||||
|
|
|
@ -102,7 +102,7 @@ void ObxdAudioProcessor::initAllParams()
|
|||
{
|
||||
for (int i = 0; i < PARAM_COUNT; ++i)
|
||||
{
|
||||
setEngineParameterValue (i, programs.currentProgramPtr->values[i]);
|
||||
setEngineParameterValue (i, programs.currentProgramPtr->values[i], true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,7 +173,7 @@ void ObxdAudioProcessor::setCurrentProgram (int index)
|
|||
isHostAutomatedChange = false;
|
||||
|
||||
for (int i = 0; i < PARAM_COUNT; ++i)
|
||||
setEngineParameterValue (i, programs.currentProgramPtr->values[i]);
|
||||
setEngineParameterValue (i, programs.currentProgramPtr->values[i], true);
|
||||
|
||||
isHostAutomatedChange = true;
|
||||
sendChangeMessage();
|
||||
|
|