From 583809fd037c139f8de56d1ed4b069928f9c41dc Mon Sep 17 00:00:00 2001 From: George Reales Date: Tue, 21 Apr 2020 11:54:19 +0200 Subject: [PATCH] GUI code fixes --- Source/PluginEditor.cpp | 20 +++++++++++--------- Source/PluginEditor.h | 3 ++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 04925f7..319a9ca 100755 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -37,7 +37,8 @@ ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFil int x = child->getIntAttribute("x"); int y = child->getIntAttribute("y"); int d = child->getIntAttribute("d"); - int range = child->getIntAttribute("range"); + int w = child->getIntAttribute("w"); + int h = child->getIntAttribute("h"); if (name == "resonanceKnob"){ resonanceKnob = addKnob (x, y, d, ownerFilter, RESONANCE, "Resonance", 0); } if (name == "cutoffKnob"){ cutoffKnob = addKnob (x, y, d, ownerFilter, CUTOFF, "Cutoff", 0.4); } @@ -132,8 +133,8 @@ ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFil if (name == "guisize"){ setSize (x, y); } - if (name == "voiceSwitch"){ voiceSwitch = addList (x, y, range, ownerFilter, VOICE_COUNT, "VoiceCount", ImageCache::getFromFile(skinFolder.getChildFile("voices.png"))); } - if (name == "legatoSwitch"){ legatoSwitch = addList (x, y, range, ownerFilter, LEGATOMODE, "Legato", ImageCache::getFromFile(skinFolder.getChildFile("legato.png"))); } + if (name == "voiceSwitch"){ voiceSwitch = addList (x, y, w, h, ownerFilter, VOICE_COUNT, "VoiceCount", ImageCache::getFromFile(skinFolder.getChildFile("voices.png"))); } + if (name == "legatoSwitch"){ legatoSwitch = addList (x, y, w, h, ownerFilter, LEGATOMODE, "Legato", ImageCache::getFromFile(skinFolder.getChildFile("legato.png"))); } //DBG(" Name: " << name << " X: " <setBounds (x, y, width, 24); + ButtonList *bl = new ButtonList (img, height); + bl->setBounds (x, y, width, height); //bl->setValue(filter->getParameter(parameter),dontSendNotification); addAndMakeVisible (bl); // bl->addListener (this); @@ -331,15 +332,16 @@ void ObxdAudioProcessorEditor::rebuildComponents (ObxdAudioProcessor& ownerFilte portamentoDetuneKnob = addKnob (1291, 300, 36, ownerFilter, PORTADER, "Port", 0.2); envelopeDetuneKnob = addKnob (1353, 300, 36, ownerFilter, ENVDER, "Env", 0.2); - voiceSwitch = addList (124, 338, 17, ownerFilter, VOICE_COUNT, "VoiceCount", ImageCache::getFromMemory (BinaryData::voices_png, BinaryData::voices_pngSize)); + voiceSwitch = addList (124, 338, 17, 24, ownerFilter, VOICE_COUNT, "VoiceCount", ImageCache::getFromMemory (BinaryData::voices_png, BinaryData::voices_pngSize)); for (int i = 1; i <= 32; ++i) { voiceSwitch->addChoice (String (i)); } - legatoSwitch = addList (25, 338, 65, ownerFilter, LEGATOMODE, "Legato", ImageCache::getFromMemory (BinaryData::legato_png, BinaryData::legato_pngSize)); - legatoSwitch->addChoice ("Keep All"); + legatoSwitch = addList (25, 338, 65, 24, ownerFilter, LEGATOMODE, "Legato", ImageCache::getFromMemory (BinaryData::legato_png, BinaryData::legato_pngSize)); + + legatoSwitch->addChoice ("Keep All"); legatoSwitch->addChoice ("Keep Filter Envelope"); legatoSwitch->addChoice ("Keep Amplitude Envelope"); legatoSwitch->addChoice ("Retrig"); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 84abecc..c7d472c 100755 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -43,7 +43,8 @@ private: Knob* addKnob (int x, int y, int d, ObxdAudioProcessor& filter, int parameter, String name, float defval); void placeLabel (int x, int y, String text); TooglableButton* addButton (int x, int y, ObxdAudioProcessor& filter, int parameter, String name); - ButtonList* addList(int x, int y, int width, ObxdAudioProcessor& filter, int parameter, String name, Image img); + ButtonList* addList(int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name, Image img); + //Menu* addMenu (int x, int y); void rebuildComponents (ObxdAudioProcessor&);