2
0
Fork 0

2.1 update

Fixed LFO buttons not working or reverted issue.
Fixed Grey skin assets bitmap sizes.
This commit is contained in:
George Reales 2020-08-10 17:38:31 +02:00
parent 8b8f0fc1bd
commit f09c00d25c
11 changed files with 35 additions and 26 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 242 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 9 KiB

View file

@ -25,7 +25,7 @@
#include "ObxdVoice.h" #include "ObxdVoice.h"
enum ObxdParameters enum ObxdParameters
{ {
UNDEFINED = 0, UNDEFINED,
MIDILEARN, MIDILEARN,
VOLUME, VOLUME,
VOICE_COUNT, VOICE_COUNT,

View file

@ -68,7 +68,7 @@ public:
float val = parameter->getValue(); float val = parameter->getValue();
//sliderToControl->setValue(parameter->convertFrom0to1(val0to1)); //sliderToControl->setValue(parameter->convertFrom0to1(val0to1));
sliderToControl->setValue(val, NotificationType::dontSendNotification); 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; virtual ~KnobAttachment() = default;

View file

@ -31,7 +31,7 @@ public:
{ {
//this->setImages //this->setImages
kni = k; kni = k;
toogled = false; //toogled = false;
width = kni.getWidth(); width = kni.getWidth();
height = kni.getHeight(); height = kni.getHeight();
w2 = width; w2 = width;
@ -53,7 +53,7 @@ public:
TooglableButton& buttonToControl) : AudioProcessorValueTreeState::ButtonAttachment (stateToControl, parameterID, buttonToControl), buttonToControl(&buttonToControl) TooglableButton& buttonToControl) : AudioProcessorValueTreeState::ButtonAttachment (stateToControl, parameterID, buttonToControl), buttonToControl(&buttonToControl)
{ {
parameter = stateToControl.getParameter (parameterID); parameter = stateToControl.getParameter (parameterID);
buttonToControl.setParameter (parameter); //buttonToControl.setParameter (parameter);
} }
/* /*
ToggleAttachment (juce::AudioProcessorValueTreeState& stateToControl, ToggleAttachment (juce::AudioProcessorValueTreeState& stateToControl,
@ -64,11 +64,12 @@ public:
void updateToSlider(){ void updateToSlider(){
float val = parameter->getValue(); float val = parameter->getValue();
//buttonToControl->setValue(parameter->convertFrom0to1(val0to1), NotificationType::dontSendNotification); //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; virtual ~ToggleAttachment() = default;
}; };
/*
void setParameter (const AudioProcessorParameter* p) void setParameter (const AudioProcessorParameter* p)
{ {
if (parameter == p) if (parameter == p)
@ -76,8 +77,8 @@ public:
parameter = p; parameter = p;
repaint(); repaint();
} }*/
/*
void clicked() override void clicked() override
{ {
toogled = ! toogled; toogled = ! toogled;
@ -89,20 +90,21 @@ public:
//this->setColour(DrawableButton::ColourIds::backgroundColourId,Colours::lightpink); //this->setColour(DrawableButton::ColourIds::backgroundColourId,Colours::lightpink);
Button::clicked(); Button::clicked();
}; };*/
void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) override void paintButton (Graphics& g, bool isMouseOverButton, bool isButtonDown) override
{ {
int offset = 0; int offset = 0;
if (toogled) //if (toogled)
if (getToggleState())
{ {
offset = 1; offset = 1;
} }
g.drawImage(kni, 0, 0, getWidth(), getHeight(), 0, offset * h2, w2, h2); g.drawImage(kni, 0, 0, getWidth(), getHeight(), 0, offset * h2, w2, h2);
} }
/*
void setValue (float state, int notify) void setValue (float state, int notify)
{ {
if (state > 0.5) if (state > 0.5)
@ -110,23 +112,23 @@ public:
else toogled = false; else toogled = false;
repaint(); repaint();
} }*/
float getValue() /*float getValue()
{ {
if (toogled) if (toogled)
return 1; return 1;
else return 0; else return 0;
} }*/
//void paint(Graphics& g) //void paint(Graphics& g)
//{ //{
// g.drawImageTransformed(kni,AffineTransform::rotation(((getValue() - getMinimum())/(getMaximum() - getMinimum()))*float_Pi - float_Pi*2)); // g.drawImageTransformed(kni,AffineTransform::rotation(((getValue() - getMinimum())/(getMaximum() - getMinimum()))*float_Pi - float_Pi*2));
//} //}
bool toogled; //bool toogled;
private: private:
Image kni; Image kni;
int width, height, w2, h2; int width, height, w2, h2;
const AudioProcessorParameter* parameter {nullptr}; //const AudioProcessorParameter* parameter;
}; };

View file

@ -25,6 +25,8 @@ ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFil
// skinFolder = ownerFilter.getCurrentSkinFolder(); // initialized above // skinFolder = ownerFilter.getCurrentSkinFolder(); // initialized above
loadSkin (processor); loadSkin (processor);
repaint(); repaint();
updateFromHost();
} }
void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter) 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"))); TooglableButton* button = new TooglableButton (ImageCache::getFromFile(skinFolder.getChildFile("button@2x.png")));
#endif #endif
if (parameter != UNLEARN){ if (parameter != UNLEARN){
toggleAttachments.add (new TooglableButton::ToggleAttachment (filter.getPluginState(), toggleAttachments.add (new AudioProcessorValueTreeState::ButtonAttachment (filter.getPluginState(),
filter.getEngineParameterId (parameter), filter.getEngineParameterId (parameter),
*button)); *button));
} else { } else {
@ -293,7 +295,7 @@ TooglableButton* ObxdAudioProcessorEditor::addButton (int x, int y, int w, int h
} }
button->setBounds (x, y, w, h); button->setBounds (x, y, w, h);
button->setButtonText (name); button->setButtonText (name);
button->setValue (filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(), button->setToggleState(filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(),
dontSendNotification); dontSendNotification);
addAndMakeVisible (button); 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) for (int i = 0; i < knobAttachments.size(); ++i)
{ {
knobAttachments[i]->updateToSlider(); knobAttachments[i]->updateToSlider();
} }
/*
for (int i = 0; i < toggleAttachments.size(); ++i) for (int i = 0; i < toggleAttachments.size(); ++i)
{ {
toggleAttachments[i]->updateToSlider(); toggleAttachments[i]->updateToSlider();
} }*/
for (int i = 0; i < buttonListAttachments.size(); ++i) for (int i = 0; i < buttonListAttachments.size(); ++i)
{ {
@ -488,6 +489,10 @@ void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source
repaint(); repaint();
} }
void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source)
{
updateFromHost();
}
void ObxdAudioProcessorEditor::mouseUp (const MouseEvent& e) void ObxdAudioProcessorEditor::mouseUp (const MouseEvent& e)
{ {

View file

@ -37,6 +37,8 @@ public:
void mouseUp (const MouseEvent& e) override; void mouseUp (const MouseEvent& e) override;
void paint (Graphics& g) override; void paint (Graphics& g) override;
void updateFromHost();
//============================================================================== //==============================================================================
void changeListenerCallback (ChangeBroadcaster* source) override; void changeListenerCallback (ChangeBroadcaster* source) override;
void buttonClicked (Button *) override; void buttonClicked (Button *) override;
@ -134,7 +136,7 @@ private:
//============================================================================== //==============================================================================
OwnedArray<Knob::KnobAttachment> knobAttachments; OwnedArray<Knob::KnobAttachment> knobAttachments;
OwnedArray<TooglableButton::ToggleAttachment> toggleAttachments; OwnedArray<AudioProcessorValueTreeState::ButtonAttachment> toggleAttachments;
OwnedArray<ButtonList::ButtonListAttachment> buttonListAttachments; OwnedArray<ButtonList::ButtonListAttachment> buttonListAttachments;
OwnedArray<ImageButton> imageButtons; OwnedArray<ImageButton> imageButtons;

View file

@ -102,7 +102,7 @@ void ObxdAudioProcessor::initAllParams()
{ {
for (int i = 0; i < PARAM_COUNT; ++i) 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; isHostAutomatedChange = false;
for (int i = 0; i < PARAM_COUNT; ++i) for (int i = 0; i < PARAM_COUNT; ++i)
setEngineParameterValue (i, programs.currentProgramPtr->values[i]); setEngineParameterValue (i, programs.currentProgramPtr->values[i], true);
isHostAutomatedChange = true; isHostAutomatedChange = true;
sendChangeMessage(); sendChangeMessage();