@@ -10,7 +10,6 @@ if linux_embed | |||
'drowaudio-reverb', | |||
'drowaudio-tremolo', | |||
'luftikus', | |||
'obxd', | |||
'tal-dub-3', | |||
'tal-filter', | |||
'tal-filter-2', | |||
@@ -42,7 +41,6 @@ else | |||
'LUFSMeter', | |||
'LUFSMeter-Multi', | |||
'luftikus', | |||
'obxd', | |||
'pitchedDelay', | |||
'refine', | |||
'stereosourceseparation', | |||
@@ -1,35 +0,0 @@ | |||
/* | |||
============================================================================== | |||
This file is part of Obxd synthesizer. | |||
Copyright © 2013-2014 Filatov Vadim | |||
Contact author via email : | |||
justdat_@_e1.ru | |||
This file may be licensed under the terms of of the | |||
GNU General Public License Version 2 (the ``GPL''). | |||
Software distributed under the License is distributed | |||
on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either | |||
express or implied. See the GPL for the specific language | |||
governing rights and limitations. | |||
You should have received a copy of the GPL along with this | |||
program. If not, go to http://www.gnu.org/licenses/gpl.html | |||
or write to the Free Software Foundation, Inc., | |||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
#include "SynthEngine.h" | |||
class MidiMap | |||
{ | |||
public: | |||
int controllers[255]; | |||
MidiMap() | |||
{ | |||
for(int i = 0 ; i < 255;i++) | |||
controllers[i] = 0; | |||
} | |||
}; |
@@ -1,60 +0,0 @@ | |||
/* | |||
============================================================================== | |||
This file is part of Obxd synthesizer. | |||
Copyright ďż˝ 2013-2014 Filatov Vadim | |||
Contact author via email : | |||
justdat_@_e1.ru | |||
This file may be licensed under the terms of of the | |||
GNU General Public License Version 2 (the ``GPL''). | |||
Software distributed under the License is distributed | |||
on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either | |||
express or implied. See the GPL for the specific language | |||
governing rights and limitations. | |||
You should have received a copy of the GPL along with this | |||
program. If not, go to http://www.gnu.org/licenses/gpl.html | |||
or write to the Free Software Foundation, Inc., | |||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
#include "../Engine/SynthEngine.h" | |||
class ButtonList : public ComboBox{ | |||
private : | |||
int count; | |||
Image kni; | |||
int w2,h2; | |||
public: | |||
ButtonList(Image k,int fh) :ComboBox("cb") | |||
{ | |||
kni = k; | |||
count = 0; | |||
h2 =fh; | |||
w2 = k.getWidth(); | |||
} | |||
//int addItem | |||
void addChoise(String name) | |||
{ | |||
addItem(name,++count); | |||
} | |||
float getValue() | |||
{ | |||
return ((getSelectedId()-1)/ (float)(count-1)); | |||
} | |||
void setValue(float val,NotificationType notify) | |||
{ | |||
setSelectedId((int)(val*(count -1) + 1),notify); | |||
} | |||
void paintOverChildren(Graphics& g) | |||
{ | |||
int ofs = getSelectedId()-1; | |||
g.drawImage(kni, 0, 0, getWidth(), getHeight(), | |||
0, h2*ofs, w2, h2); | |||
} | |||
}; |
@@ -1,55 +0,0 @@ | |||
/* | |||
============================================================================== | |||
This file is part of Obxd synthesizer. | |||
Copyright © 2013-2014 Filatov Vadim | |||
Contact author via email : | |||
justdat_@_e1.ru | |||
This file may be licensed under the terms of of the | |||
GNU General Public License Version 2 (the ``GPL''). | |||
Software distributed under the License is distributed | |||
on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either | |||
express or implied. See the GPL for the specific language | |||
governing rights and limitations. | |||
You should have received a copy of the GPL along with this | |||
program. If not, go to http://www.gnu.org/licenses/gpl.html | |||
or write to the Free Software Foundation, Inc., | |||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
#include "../Engine/SynthEngine.h" | |||
class Knob : public Slider | |||
{ | |||
public: | |||
//Knob(Image image, const int numFrames, const bool stripIsHorizontal) : Slider("Knob") | |||
//{ | |||
// setTextBoxStyle(NoTextBox, 0, 0, 0); | |||
// setSliderStyle(RotaryVerticalDrag); | |||
// setRange(0.0f, 1.0f, 0.001f); | |||
//} | |||
Knob(Image k,int fh) : Slider("Knob") | |||
{ | |||
h2 =fh; | |||
w2 = k.getWidth(); | |||
numFr = k.getHeight() / h2; | |||
kni = k; | |||
}; | |||
void paint(Graphics& g) | |||
{ | |||
int ofs = (int)((getValue() - getMinimum()) / (getMaximum() - getMinimum()) * (numFr - 1)); | |||
g.drawImage(kni, 0, 0, getWidth(), getHeight(), | |||
0, h2*ofs, w2, h2); | |||
} | |||
private: | |||
Image kni; | |||
int fh,numFr; | |||
int w2,h2; | |||
}; |
@@ -1,83 +0,0 @@ | |||
/* | |||
============================================================================== | |||
This file is part of Obxd synthesizer. | |||
Copyright © 2013-2014 Filatov Vadim | |||
Contact author via email : | |||
justdat_@_e1.ru | |||
This file may be licensed under the terms of of the | |||
GNU General Public License Version 2 (the ``GPL''). | |||
Software distributed under the License is distributed | |||
on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either | |||
express or implied. See the GPL for the specific language | |||
governing rights and limitations. | |||
You should have received a copy of the GPL along with this | |||
program. If not, go to http://www.gnu.org/licenses/gpl.html | |||
or write to the Free Software Foundation, Inc., | |||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
#include "../Engine/SynthEngine.h" | |||
class TooglableButton : public ImageButton | |||
{ | |||
public: | |||
bool toogled; | |||
TooglableButton(Image k) :ImageButton() | |||
{ | |||
//this->setImages | |||
kni = k; | |||
toogled = false; | |||
width = kni.getWidth(); | |||
height = kni.getHeight(); | |||
w2=width; | |||
h2 = height / 2; | |||
this->setClickingTogglesState(true); | |||
} | |||
void clicked() | |||
{ | |||
toogled = !toogled; | |||
//this->setColour(1,Colours::blue); | |||
//if(toogled) | |||
// this->setColour(TextButton::ColourIds::buttonColourId,Colours::lightgreen); | |||
//else | |||
// this->removeColour(TextButton::ColourIds::buttonColourId); | |||
//this->setColour(DrawableButton::ColourIds::backgroundColourId,Colours::lightpink); | |||
Button::clicked(); | |||
}; | |||
void paintButton(Graphics& g, bool isMouseOverButton, bool isButtonDown) | |||
{ | |||
int offset = 0; | |||
if (toogled) | |||
{ | |||
offset = 1; | |||
} | |||
g.drawImage(kni, 0, 0, getWidth(), getHeight(), | |||
0, offset *h2, w2,h2); | |||
} | |||
void setValue(float state,int notify) | |||
{ | |||
if(state > 0.5) | |||
toogled = true; | |||
else toogled = false; | |||
repaint(); | |||
} | |||
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)); | |||
//} | |||
private: | |||
Image kni; | |||
int width,height,w2,h2; | |||
}; |
@@ -1,722 +0,0 @@ | |||
/* | |||
============================================================================== | |||
This file was auto-generated by the Introjucer! | |||
It contains the basic startup code for a Juce application. | |||
============================================================================== | |||
*/ | |||
#include "PluginProcessor.h" | |||
#include "PluginEditor.h" | |||
#include <utility> | |||
// #include "GUI/BinaryData.h" | |||
//============================================================================== | |||
ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor* ownerFilter) | |||
: AudioProcessorEditor (ownerFilter) | |||
{ | |||
rebuildComponents(); | |||
} | |||
ObxdAudioProcessorEditor::~ObxdAudioProcessorEditor() | |||
{ | |||
getFilter()->removeChangeListener(this); | |||
deleteAllChildren(); | |||
} | |||
void ObxdAudioProcessorEditor::placeLabel(int x , int y , String text) | |||
{ | |||
Label* lab = new Label(); | |||
lab->setBounds(x,y,110,20); | |||
lab->setJustificationType(Justification::centred); | |||
lab->setText(text,dontSendNotification);lab->setInterceptsMouseClicks(false,true); | |||
addAndMakeVisible(lab); | |||
} | |||
ButtonList* ObxdAudioProcessorEditor::addNormalButtonList(int x, int y,int width, ObxdAudioProcessor* filter, int parameter,String name,Image img) | |||
{ | |||
ButtonList *bl = new ButtonList(img,24); | |||
bl->setBounds(x, y, width, 24); | |||
//bl->setValue(filter->getParameter(parameter),dontSendNotification); | |||
addAndMakeVisible(bl); | |||
bl->addListener (this); | |||
return bl; | |||
} | |||
Knob* ObxdAudioProcessorEditor::addNormalKnob(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval) | |||
{ | |||
Knob* knob = new Knob(ImageCache::getFromMemory(BinaryData::knoblsd_png,BinaryData::knoblsd_pngSize),48); | |||
//Label* knobl = new Label(); | |||
knob->setSliderStyle(Slider::RotaryVerticalDrag); | |||
knob->setTextBoxStyle(knob->NoTextBox,true,0,0); | |||
knob->setRange(0,1); | |||
addAndMakeVisible(knob); | |||
//addAndMakeVisible(knobl); | |||
knob->setBounds(x, y, 48,48); | |||
knob->setValue(filter->getParameter(parameter),dontSendNotification); | |||
//knobl->setJustificationType(Justification::centred); | |||
//knobl->setInterceptsMouseClicks(false,true); | |||
//knobl->setBounds(x-10,y+40,60,10); | |||
//knobl->setText(name,dontSendNotification); | |||
knob->setTextBoxIsEditable(false); | |||
knob->setDoubleClickReturnValue(true,defval); | |||
knob->addListener (this); | |||
return knob; | |||
} | |||
Knob* ObxdAudioProcessorEditor::addNormalKnobClassic(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval) | |||
{ | |||
Knob* knob = new Knob(ImageCache::getFromMemory(BinaryData::knoblsd_png,BinaryData::knoblsd_pngSize),48); | |||
//Label* knobl = new Label(); | |||
knob->setSliderStyle(Slider::RotaryVerticalDrag); | |||
knob->setTextBoxStyle(knob->NoTextBox,true,0,0); | |||
knob->setRange(0,1); | |||
addAndMakeVisible(knob); | |||
//addAndMakeVisible(knobl); | |||
knob->setBounds(x+2, y, 42,42); | |||
knob->setValue(filter->getParameter(parameter),dontSendNotification); | |||
//knobl->setJustificationType(Justification::centred); | |||
//knobl->setInterceptsMouseClicks(false,true); | |||
//knobl->setBounds(x-10,y+40,60,10); | |||
//knobl->setText(name,dontSendNotification); | |||
knob->setTextBoxIsEditable(false); | |||
knob->setDoubleClickReturnValue(true,defval); | |||
knob->addListener (this); | |||
return knob; | |||
} | |||
Knob* ObxdAudioProcessorEditor::addTinyKnob(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval) | |||
{ | |||
//Knob* knob = new Knob(ImageCache::getFromMemory(BinaryData::knobssd_png,BinaryData::knobssd_pngSize),42); | |||
Knob* knob = new Knob(ImageCache::getFromMemory(BinaryData::knoblsd_png,BinaryData::knoblsd_pngSize),48); | |||
//Label* knobl = new Label(); | |||
knob->setSliderStyle(Slider::RotaryVerticalDrag); | |||
knob->setTextBoxStyle(knob->NoTextBox,true,0,0); | |||
knob->setRange(0,1); | |||
addAndMakeVisible(knob); | |||
//addAndMakeVisible(knobl); | |||
knob->setBounds(x, y, 36,36); | |||
knob->setValue(filter->getParameter(parameter),dontSendNotification); | |||
//knobl->setJustificationType(Justification::centred); | |||
//knobl->setInterceptsMouseClicks(false,true); | |||
//knobl->setBounds(x-10,y+25,50,10); | |||
//knobl->setText(name,dontSendNotification); | |||
knob->setTextBoxIsEditable(false); | |||
knob->setDoubleClickReturnValue(true,defval); | |||
knob->addListener (this); | |||
return knob; | |||
} | |||
TooglableButton* ObxdAudioProcessorEditor::addNormalTooglableButton(int x , int y , ObxdAudioProcessor* filter,int parameter,String name) | |||
{ | |||
TooglableButton* button = new TooglableButton(ImageCache::getFromMemory(BinaryData::button_png,BinaryData::button_pngSize)); | |||
// button->setButtonStyle(DrawableButton::ButtonStyle::ImageAboveTextLabel); | |||
addAndMakeVisible(button); | |||
button->setBounds(x,y,19,35); | |||
button->setButtonText(name); | |||
button->setValue(filter->getParameter(parameter),0); | |||
button->addListener(this); | |||
return button; | |||
} | |||
TooglableButton* ObxdAudioProcessorEditor::addTinyTooglableButton(int x , int y , ObxdAudioProcessor* filter,int parameter,String name) | |||
{ | |||
TooglableButton* button = new TooglableButton(ImageCache::getFromMemory(BinaryData::button_png,BinaryData::button_pngSize)); | |||
// button->setButtonStyle(DrawableButton::ButtonStyle::ImageAboveTextLabel); | |||
addAndMakeVisible(button); | |||
button->setBounds(x,y,20,20); | |||
button->setButtonText(name); | |||
button->setValue(filter->getParameter(parameter),0); | |||
button->addListener(this); | |||
return button; | |||
} | |||
ButtonList* ObxdAudioProcessorEditor::addNormalButtonListClassic(int x, int y,int width, ObxdAudioProcessor* filter, int parameter,String name,Image img) | |||
{ | |||
ButtonList *bl = new ButtonList(img,32); | |||
bl->setBounds(x, y, width, 32); | |||
//bl->setValue(filter->getParameter(parameter),dontSendNotification); | |||
addAndMakeVisible(bl); | |||
bl->addListener (this); | |||
return bl; | |||
} | |||
Knob* ObxdAudioProcessorEditor::addTinyKnobClassic(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval) | |||
{ | |||
Knob* knob = new Knob(ImageCache::getFromMemory(BinaryData::knoblsd_png,BinaryData::knoblsd_pngSize),48); | |||
//Label* knobl = new Label(); | |||
knob->setSliderStyle(Slider::RotaryVerticalDrag); | |||
knob->setTextBoxStyle(knob->NoTextBox,true,0,0); | |||
knob->setRange(0,1); | |||
addAndMakeVisible(knob); | |||
//addAndMakeVisible(knobl); | |||
knob->setBounds(x+3, y+3, 36,36); | |||
knob->setValue(filter->getParameter(parameter),dontSendNotification); | |||
//knobl->setJustificationType(Justification::centred); | |||
//knobl->setInterceptsMouseClicks(false,true); | |||
//knobl->setBounds(x-10,y+25,50,10); | |||
//knobl->setText(name,dontSendNotification); | |||
knob->setTextBoxIsEditable(false); | |||
knob->setDoubleClickReturnValue(true,defval); | |||
knob->addListener (this); | |||
return knob; | |||
} | |||
TooglableButton* ObxdAudioProcessorEditor::addNormalTooglableButtonClassic(int x , int y , ObxdAudioProcessor* filter,int parameter,String name) | |||
{ | |||
TooglableButton* button = new TooglableButton(ImageCache::getFromFile(skinFolder.getChildFile("button.png"))); | |||
// button->setButtonStyle(DrawableButton::ButtonStyle::ImageAboveTextLabel); | |||
addAndMakeVisible(button); | |||
button->setBounds(x,y,28,35); | |||
button->setButtonText(name); | |||
button->setValue(filter->getParameter(parameter),0); | |||
button->addListener(this); | |||
return button; | |||
} | |||
void ObxdAudioProcessorEditor::rebuildComponents() | |||
{ | |||
ObxdAudioProcessor* ownerFilter = getFilter(); | |||
skinFolder = ownerFilter->getCurrentSkinFolder(); | |||
bool useClassicSkin = skinFolder.getChildFile("legato.png").existsAsFile(); | |||
ownerFilter->removeChangeListener(this); | |||
deleteAllChildren(); | |||
if (! useClassicSkin) | |||
{ | |||
// This is where our plugin's editor size is set. | |||
setSize (1440, 450); | |||
cutoffKnob = addNormalKnob(893,77,ownerFilter,CUTOFF,"Cutoff",0.4); | |||
resonanceKnob = addNormalKnob(990,77,ownerFilter,RESONANCE,"Resonance",0); | |||
filterEnvelopeAmtKnob = addNormalKnob(1088,77,ownerFilter,ENVELOPE_AMT,"Envelope",0); | |||
multimodeKnob = addNormalKnob(990,167,ownerFilter,MULTIMODE,"Multimode",0.5); | |||
volumeKnob = addNormalKnob(56,77,ownerFilter,VOLUME,"Volume",0.4); | |||
portamentoKnob = addNormalKnob(188,77,ownerFilter,PORTAMENTO,"Portamento",0); | |||
osc1PitchKnob = addNormalKnob(593,77,ownerFilter,OSC1P,"Osc1Pitch",0); | |||
pulseWidthKnob = addNormalKnob(691,77,ownerFilter,PW,"PW",0); | |||
osc2PitchKnob = addNormalKnob(788,77,ownerFilter,OSC2P,"Osc2Pitch",0); | |||
osc1MixKnob = addNormalKnob(597,237,ownerFilter,OSC1MIX,"Osc1",1); | |||
osc2MixKnob = addNormalKnob(788,237,ownerFilter,OSC2MIX,"Osc2",1); | |||
noiseMixKnob = addNormalKnob(691,237,ownerFilter,NOISEMIX,"Noise",0); | |||
xmodKnob = addNormalKnob(656,324,ownerFilter,XMOD,"Xmod",0); | |||
osc2DetuneKnob = addNormalKnob(800,324,ownerFilter,OSC2_DET,"Detune",0); | |||
envPitchModKnob = addNormalKnob(728,324,ownerFilter,ENVPITCH,"PEnv",0); | |||
brightnessKnob = addNormalKnob(586,324,ownerFilter,BRIGHTNESS,"Bri",1); | |||
attackKnob = addNormalKnob(1182,165,ownerFilter,LATK,"Atk",0); | |||
decayKnob = addNormalKnob(1246,165,ownerFilter,LDEC,"Dec",0); | |||
sustainKnob = addNormalKnob(1309,165,ownerFilter,LSUS,"Sus",1); | |||
releaseKnob = addNormalKnob(1373,165,ownerFilter,LREL,"Rel",0); | |||
fattackKnob = addNormalKnob(1182,75,ownerFilter,FATK,"Atk",0); | |||
fdecayKnob = addNormalKnob(1246,75,ownerFilter,FDEC,"Dec",0); | |||
fsustainKnob = addNormalKnob(1309,75,ownerFilter,FSUS,"Sus",1); | |||
freleaseKnob = addNormalKnob(1373,75,ownerFilter,FREL,"Rel",0); | |||
lfoFrequencyKnob = addNormalKnob(293,77,ownerFilter,LFOFREQ,"Freq",0); | |||
lfoAmt1Knob = addNormalKnob(390,77,ownerFilter,LFO1AMT,"Pitch",0); | |||
lfoAmt2Knob = addNormalKnob(488,77,ownerFilter,LFO2AMT,"PWM",0); | |||
lfoSinButton = addNormalTooglableButton(309,162,ownerFilter,LFOSINWAVE,"Sin"); | |||
lfoSquareButton = addNormalTooglableButton(309,252,ownerFilter,LFOSQUAREWAVE,"SQ"); | |||
lfoSHButton = addNormalTooglableButton(309,335,ownerFilter,LFOSHWAVE,"S&H"); | |||
lfoOsc1Button = addNormalTooglableButton(406,162,ownerFilter,LFOOSC1,"Osc1"); | |||
lfoOsc2Button = addNormalTooglableButton(406,252,ownerFilter,LFOOSC2,"Osc2"); | |||
lfoFilterButton = addNormalTooglableButton(406,335,ownerFilter,LFOFILTER,"Filt"); | |||
lfoPwm1Button = addNormalTooglableButton(504,162,ownerFilter,LFOPW1,"Osc1"); | |||
lfoPwm2Button = addNormalTooglableButton(504,252,ownerFilter,LFOPW2,"Osc2"); | |||
hardSyncButton = addNormalTooglableButton(730,162,ownerFilter,OSC2HS,"Sync"); | |||
osc1SawButton = addNormalTooglableButton(587,162,ownerFilter,OSC1Saw,"S"); | |||
osc2SawButton = addNormalTooglableButton(782,162,ownerFilter,OSC2Saw,"S"); | |||
osc1PulButton = addNormalTooglableButton(632,162,ownerFilter,OSC1Pul,"P"); | |||
osc2PulButton = addNormalTooglableButton(827,162,ownerFilter,OSC2Pul,"P"); | |||
pitchQuantButton = addNormalTooglableButton(684,162,ownerFilter,OSCQuantize,"Step"); | |||
filterBPBlendButton = addNormalTooglableButton(1082,162,ownerFilter,BANDPASS,"Bp"); | |||
fourPoleButton = addNormalTooglableButton(1127,162,ownerFilter,FOURPOLE,"24"); | |||
filterHQButton = addNormalTooglableButton(932,162,ownerFilter,FILTER_WARM,"HQ"); | |||
filterKeyFollowButton = addNormalTooglableButton(887,162,ownerFilter,FLT_KF,"Key"); | |||
unisonButton = addNormalTooglableButton(205,162,ownerFilter,UNISON,"Uni"); | |||
tuneKnob = addNormalKnob(30,252,ownerFilter,TUNE,"Tune",0.5); | |||
transposeKnob = addNormalKnob(90,252,ownerFilter,OCTAVE,"Transpose",0.5); | |||
voiceDetuneKnob =addNormalKnob(188,252,ownerFilter,UDET,"VoiceDet",0); | |||
bendLfoRateKnob = addTinyKnob(928,300,ownerFilter,BENDLFORATE,"ModRate",0.4); | |||
veloFltEnvKnob = addTinyKnob(1013,300,ownerFilter,VFLTENV,"VFE",0); | |||
veloAmpEnvKnob = addTinyKnob(1111,300,ownerFilter,VAMPENV,"VAE",0); | |||
pan1Knob = addTinyKnob(914,368,ownerFilter,PAN1,"1",0.5); | |||
pan2Knob = addTinyKnob(977,368,ownerFilter,PAN2,"2",0.5); | |||
pan3Knob = addTinyKnob(1040,368,ownerFilter,PAN3,"3",0.5); | |||
pan4Knob = addTinyKnob(1103,368,ownerFilter,PAN4,"4",0.5); | |||
pan5Knob = addTinyKnob(1165,368,ownerFilter,PAN5,"5",0.5); | |||
pan6Knob = addTinyKnob(1228,368,ownerFilter,PAN6,"6",0.5); | |||
pan7Knob = addTinyKnob(1290,368,ownerFilter,PAN7,"7",0.5); | |||
pan8Knob = addTinyKnob(1353,368,ownerFilter,PAN8,"8",0.5); | |||
bendOsc2OnlyButton = addNormalTooglableButton(228,335,ownerFilter,BENDOSC2,"Osc2"); | |||
bendRangeButton = addNormalTooglableButton(183,335,ownerFilter,BENDRANGE,"12"); | |||
asPlayedAllocButton = addNormalTooglableButton(25,162,ownerFilter,ASPLAYEDALLOCATION,"APA"); | |||
filterDetuneKnob = addTinyKnob(1228,300,ownerFilter,FILTERDER,"Flt",0.2); | |||
portamentoDetuneKnob = addTinyKnob(1291,300,ownerFilter,PORTADER,"Port",0.2); | |||
envelopeDetuneKnob = addTinyKnob(1353,300,ownerFilter,ENVDER,"Env",0.2); | |||
voiceSwitch = addNormalButtonList(124,338,17,ownerFilter,VOICE_COUNT,"VoiceCount",ImageCache::getFromMemory(BinaryData::voices_png,BinaryData::voices_pngSize)); | |||
voiceSwitch ->addChoise("1"); | |||
voiceSwitch ->addChoise("2"); | |||
voiceSwitch ->addChoise("3"); | |||
voiceSwitch ->addChoise("4"); | |||
voiceSwitch ->addChoise("5"); | |||
voiceSwitch ->addChoise("6"); | |||
voiceSwitch ->addChoise("7"); | |||
voiceSwitch ->addChoise("8"); | |||
voiceSwitch ->setValue(ownerFilter->getParameter(VOICE_COUNT),dontSendNotification); | |||
legatoSwitch = addNormalButtonList(25,338,65,ownerFilter,LEGATOMODE,"Legato",ImageCache::getFromMemory(BinaryData::legato_png,BinaryData::legato_pngSize)); | |||
legatoSwitch ->addChoise("Keep All"); | |||
legatoSwitch ->addChoise("Keep Filter Envelope"); | |||
legatoSwitch ->addChoise("Keep Amplitude Envelope"); | |||
legatoSwitch ->addChoise("Retrig"); | |||
legatoSwitch ->setValue(ownerFilter->getParameter(LEGATOMODE),dontSendNotification); | |||
} | |||
else | |||
{ | |||
// This is where our plugin's editor size is set. | |||
setSize (1087, 442); | |||
cutoffKnob = addNormalKnobClassic(577,40,ownerFilter,CUTOFF,"Cutoff",0.4); | |||
resonanceKnob = addNormalKnobClassic(638,40,ownerFilter,RESONANCE,"Resonance",0); | |||
filterEnvelopeAmtKnob = addNormalKnobClassic(699,40,ownerFilter,ENVELOPE_AMT,"Envelope",0); | |||
multimodeKnob = addTinyKnobClassic(643,106,ownerFilter,MULTIMODE,"Multimode",0.5); | |||
volumeKnob = addNormalKnobClassic(53,120,ownerFilter,VOLUME,"Volume",0.4); | |||
portamentoKnob = addNormalKnobClassic(175,241,ownerFilter,PORTAMENTO,"Portamento",0); | |||
osc1PitchKnob = addNormalKnobClassic(271,40,ownerFilter,OSC1P,"Osc1Pitch",0); | |||
pulseWidthKnob = addNormalKnobClassic(334,40,ownerFilter,PW,"PW",0); | |||
osc2PitchKnob = addNormalKnobClassic(397,40,ownerFilter,OSC2P,"Osc2Pitch",0); | |||
osc1MixKnob = addNormalKnobClassic(490,40,ownerFilter,OSC1MIX,"Osc1",1); | |||
osc2MixKnob = addNormalKnobClassic(490,132,ownerFilter,OSC2MIX,"Osc2",1); | |||
noiseMixKnob = addNormalKnobClassic(490,224,ownerFilter,NOISEMIX,"Noise",0); | |||
xmodKnob = addNormalKnobClassic(334,168,ownerFilter,XMOD,"Xmod",0); | |||
osc2DetuneKnob = addNormalKnobClassic(334,104,ownerFilter,OSC2_DET,"Detune",0); | |||
envPitchModKnob = addNormalKnobClassic(376,232,ownerFilter,ENVPITCH,"PEnv",0); | |||
brightnessKnob = addNormalKnobClassic(291,232,ownerFilter,BRIGHTNESS,"Bri",1); | |||
attackKnob = addNormalKnobClassic(791,132,ownerFilter,LATK,"Atk",0); | |||
decayKnob = addNormalKnobClassic(853,132,ownerFilter,LDEC,"Dec",0); | |||
sustainKnob = addNormalKnobClassic(916,132,ownerFilter,LSUS,"Sus",1); | |||
releaseKnob = addNormalKnobClassic(980,132,ownerFilter,LREL,"Rel",0); | |||
fattackKnob = addNormalKnobClassic(791,40,ownerFilter,FATK,"Atk",0); | |||
fdecayKnob = addNormalKnobClassic(853,40,ownerFilter,FDEC,"Dec",0); | |||
fsustainKnob = addNormalKnobClassic(916,40,ownerFilter,FSUS,"Sus",1); | |||
freleaseKnob = addNormalKnobClassic(980,40,ownerFilter,FREL,"Rel",0); | |||
lfoFrequencyKnob = addNormalKnobClassic(576,207,ownerFilter,LFOFREQ,"Freq",0); | |||
lfoAmt1Knob = addNormalKnobClassic(640,207,ownerFilter,LFO1AMT,"Pitch",0); | |||
lfoAmt2Knob = addNormalKnobClassic(704,207,ownerFilter,LFO2AMT,"PWM",0); | |||
lfoSinButton = addNormalTooglableButtonClassic(587,269,ownerFilter,LFOSINWAVE,"Sin"); | |||
lfoSquareButton = addNormalTooglableButtonClassic(587,323,ownerFilter,LFOSQUAREWAVE,"SQ"); | |||
lfoSHButton = addNormalTooglableButtonClassic(587,378,ownerFilter,LFOSHWAVE,"S&H"); | |||
lfoOsc1Button = addNormalTooglableButtonClassic(651,269,ownerFilter,LFOOSC1,"Osc1"); | |||
lfoOsc2Button = addNormalTooglableButtonClassic(651,323,ownerFilter,LFOOSC2,"Osc2"); | |||
lfoFilterButton = addNormalTooglableButtonClassic(651,378,ownerFilter,LFOFILTER,"Filt"); | |||
lfoPwm1Button = addNormalTooglableButtonClassic(714,269,ownerFilter,LFOPW1,"Osc1"); | |||
lfoPwm2Button = addNormalTooglableButtonClassic(714,323,ownerFilter,LFOPW2,"Osc2"); | |||
hardSyncButton = addNormalTooglableButtonClassic(282,178,ownerFilter,OSC2HS,"Sync"); | |||
osc1SawButton = addNormalTooglableButtonClassic(265,114,ownerFilter,OSC1Saw,"S"); | |||
osc2SawButton = addNormalTooglableButtonClassic(394,114,ownerFilter,OSC2Saw,"S"); | |||
osc1PulButton = addNormalTooglableButtonClassic(296,114,ownerFilter,OSC1Pul,"P"); | |||
osc2PulButton = addNormalTooglableButtonClassic(425,114,ownerFilter,OSC2Pul,"P"); | |||
pitchQuantButton = addNormalTooglableButtonClassic(407,178,ownerFilter,OSCQuantize,"Step"); | |||
filterBPBlendButton = addNormalTooglableButtonClassic(697,110,ownerFilter,BANDPASS,"Bp"); | |||
fourPoleButton = addNormalTooglableButtonClassic(728,110,ownerFilter,FOURPOLE,"24"); | |||
filterHQButton = addNormalTooglableButtonClassic(604,110,ownerFilter,FILTER_WARM,"HQ"); | |||
filterKeyFollowButton = addNormalTooglableButtonClassic(573,110,ownerFilter,FLT_KF,"Key"); | |||
unisonButton = addNormalTooglableButtonClassic(125,251,ownerFilter,UNISON,"Uni"); | |||
tuneKnob = addNormalKnobClassic(114,120,ownerFilter,TUNE,"Tune",0.5); | |||
voiceDetuneKnob =addNormalKnobClassic(53,241,ownerFilter,UDET,"VoiceDet",0); | |||
veloAmpEnvKnob = addNormalKnobClassic(486,345,ownerFilter,VAMPENV,"VAE",0); | |||
veloFltEnvKnob = addNormalKnobClassic(428,345,ownerFilter,VFLTENV,"VFE",0); | |||
transposeKnob = addNormalKnobClassic(176,120,ownerFilter,OCTAVE,"Transpose",0.5); | |||
pan1Knob = addTinyKnobClassic(796,318,ownerFilter,PAN1,"1",0.5); | |||
pan2Knob = addTinyKnobClassic(858,318,ownerFilter,PAN2,"2",0.5); | |||
pan3Knob = addTinyKnobClassic(921,318,ownerFilter,PAN3,"3",0.5); | |||
pan4Knob = addTinyKnobClassic(984,318,ownerFilter,PAN4,"4",0.5); | |||
pan5Knob = addTinyKnobClassic(796,371,ownerFilter,PAN5,"5",0.5); | |||
pan6Knob = addTinyKnobClassic(858,371,ownerFilter,PAN6,"6",0.5); | |||
pan7Knob = addTinyKnobClassic(921,371,ownerFilter,PAN7,"7",0.5); | |||
pan8Knob = addTinyKnobClassic(984,371,ownerFilter,PAN8,"8",0.5); | |||
bendOsc2OnlyButton = addNormalTooglableButtonClassic(321,354,ownerFilter,BENDOSC2,"Osc2"); | |||
bendRangeButton = addNormalTooglableButtonClassic(267,354,ownerFilter,BENDRANGE,"12"); | |||
asPlayedAllocButton = addNormalTooglableButtonClassic(65,372,ownerFilter,ASPLAYEDALLOCATION,"APA"); | |||
filterDetuneKnob = addTinyKnobClassic(817,240,ownerFilter,FILTERDER,"Flt",0.2); | |||
envelopeDetuneKnob = addTinyKnobClassic(963,240,ownerFilter,ENVDER,"Env",0.2); | |||
portamentoDetuneKnob = addTinyKnobClassic(890,240,ownerFilter,PORTADER,"Port",0.2); | |||
bendLfoRateKnob = addNormalKnobClassic(364,345,ownerFilter,BENDLFORATE,"ModRate",0.4); | |||
voiceSwitch = addNormalButtonListClassic(172,321,38,ownerFilter,VOICE_COUNT,"VoiceCount",ImageCache::getFromFile(skinFolder.getChildFile("voices.png"))); | |||
voiceSwitch ->addChoise("1"); | |||
voiceSwitch ->addChoise("2"); | |||
voiceSwitch ->addChoise("3"); | |||
voiceSwitch ->addChoise("4"); | |||
voiceSwitch ->addChoise("5"); | |||
voiceSwitch ->addChoise("6"); | |||
voiceSwitch ->addChoise("7"); | |||
voiceSwitch ->addChoise("8"); | |||
voiceSwitch ->setValue(ownerFilter->getParameter(VOICE_COUNT),dontSendNotification); | |||
legatoSwitch = addNormalButtonListClassic(65,321,95,ownerFilter,LEGATOMODE,"Legato",ImageCache::getFromFile(skinFolder.getChildFile("legato.png"))); | |||
legatoSwitch ->addChoise("Keep all"); | |||
legatoSwitch ->addChoise("Keep fenv"); | |||
legatoSwitch ->addChoise("Keep aenv"); | |||
legatoSwitch ->addChoise("Retrig"); | |||
legatoSwitch ->setValue(ownerFilter->getParameter(LEGATOMODE),dontSendNotification); | |||
} | |||
ownerFilter->addChangeListener(this); | |||
repaint(); | |||
} | |||
void ObxdAudioProcessorEditor::buttonClicked(Button * b) | |||
{ | |||
TooglableButton* tb = (TooglableButton*)(b); | |||
ObxdAudioProcessor* flt = getFilter(); | |||
#define bp(T) {flt->setParameterNotifyingHost(T,tb->getValue());} | |||
#define handleBParam(K,T) if (tb == K) {bp(T)} else | |||
handleBParam(hardSyncButton,OSC2HS) | |||
handleBParam(osc1SawButton,OSC1Saw) | |||
handleBParam(osc2SawButton,OSC2Saw) | |||
handleBParam(osc1PulButton,OSC1Pul) | |||
handleBParam(osc2PulButton,OSC2Pul) | |||
handleBParam(filterKeyFollowButton,FLT_KF) | |||
handleBParam(pitchQuantButton,OSCQuantize) | |||
handleBParam(unisonButton,UNISON) | |||
handleBParam(filterHQButton,FILTER_WARM) | |||
handleBParam(filterBPBlendButton,BANDPASS) | |||
handleBParam(lfoSinButton,LFOSINWAVE) | |||
handleBParam(lfoSquareButton,LFOSQUAREWAVE) | |||
handleBParam(lfoSHButton,LFOSHWAVE) | |||
handleBParam(lfoOsc1Button,LFOOSC1) | |||
handleBParam(lfoOsc2Button,LFOOSC2) | |||
handleBParam(lfoFilterButton,LFOFILTER) | |||
handleBParam(lfoPwm1Button,LFOPW1) | |||
handleBParam(lfoPwm2Button,LFOPW2) | |||
handleBParam(bendOsc2OnlyButton,BENDOSC2) | |||
handleBParam(bendRangeButton,BENDRANGE) | |||
handleBParam(fourPoleButton,FOURPOLE) | |||
handleBParam(asPlayedAllocButton,ASPLAYEDALLOCATION) | |||
{}; | |||
} | |||
void ObxdAudioProcessorEditor::comboBoxChanged (ComboBox* cb) | |||
{ | |||
ButtonList* bl = (ButtonList*)(cb); | |||
ObxdAudioProcessor* flt = getFilter(); | |||
#define cp(T) {flt->setParameterNotifyingHost(T,bl->getValue());} | |||
#define handleCParam(K,T) if (bl == K) {cp(T)} else | |||
handleCParam(voiceSwitch,VOICE_COUNT) | |||
handleCParam(legatoSwitch,LEGATOMODE) | |||
{}; | |||
} | |||
void ObxdAudioProcessorEditor::sliderValueChanged (Slider* c) | |||
{ | |||
ObxdAudioProcessor* flt = getFilter(); | |||
// flt->beginParameterChangeGesture(); | |||
#define sp(T) {flt->setParameterNotifyingHost(T,c->getValue());} | |||
#define handleSParam(K,T) if (c == K) {sp(T)} else | |||
handleSParam(cutoffKnob,CUTOFF) | |||
handleSParam(resonanceKnob,RESONANCE) | |||
handleSParam(volumeKnob,VOLUME) | |||
handleSParam(osc1PitchKnob,OSC1P) | |||
handleSParam(osc2PitchKnob,OSC2P) | |||
handleSParam(osc2DetuneKnob,OSC2_DET) | |||
handleSParam(portamentoKnob,PORTAMENTO) | |||
handleSParam(filterEnvelopeAmtKnob,ENVELOPE_AMT) | |||
handleSParam(pulseWidthKnob,PW) | |||
handleSParam(xmodKnob,XMOD) | |||
handleSParam(multimodeKnob,MULTIMODE) | |||
handleSParam(attackKnob,LATK) | |||
handleSParam(decayKnob,LDEC) | |||
handleSParam(sustainKnob,LSUS) | |||
handleSParam(releaseKnob,LREL) | |||
handleSParam(fattackKnob,FATK) | |||
handleSParam(fdecayKnob,FDEC) | |||
handleSParam(fsustainKnob,FSUS) | |||
handleSParam(freleaseKnob,FREL) | |||
handleSParam(osc1MixKnob,OSC1MIX) | |||
handleSParam(osc2MixKnob,OSC2MIX) | |||
handleSParam(noiseMixKnob,NOISEMIX) | |||
handleSParam(voiceDetuneKnob,UDET) | |||
handleSParam(filterDetuneKnob,FILTERDER) | |||
handleSParam(envelopeDetuneKnob,ENVDER) | |||
handleSParam(portamentoDetuneKnob,PORTADER) | |||
handleSParam(lfoFrequencyKnob,LFOFREQ) | |||
handleSParam(lfoAmt1Knob,LFO1AMT) | |||
handleSParam(lfoAmt2Knob,LFO2AMT) | |||
handleSParam(pan1Knob,PAN1) | |||
handleSParam(pan2Knob,PAN2) | |||
handleSParam(pan3Knob,PAN3) | |||
handleSParam(pan4Knob,PAN4) | |||
handleSParam(pan5Knob,PAN5) | |||
handleSParam(pan6Knob,PAN6) | |||
handleSParam(pan7Knob,PAN7) | |||
handleSParam(pan8Knob,PAN8) | |||
handleSParam(tuneKnob,TUNE) | |||
handleSParam(brightnessKnob,BRIGHTNESS) | |||
handleSParam(envPitchModKnob,ENVPITCH) | |||
handleSParam(bendLfoRateKnob,BENDLFORATE) | |||
handleSParam(veloAmpEnvKnob,VAMPENV) | |||
handleSParam(veloFltEnvKnob,VFLTENV) | |||
handleSParam(transposeKnob,OCTAVE) | |||
//magic crystal | |||
{}; | |||
//else if(c == cutoffKnob) | |||
//{sp(CUTOFF);} | |||
//else if(c == resonanceKnob) | |||
//{sp(RESONANCE);} | |||
//else if(c == portamentoKnob) | |||
//{sp(PORTAMENTO);} | |||
//else if(c == volumeKnob) | |||
//{sp(VOLUME);} | |||
//else if(c == osc1PitchKnob) | |||
//{sp(OSC1P);} | |||
//else if (c == osc2PitchKnob) | |||
//{sp(OSC2P);} | |||
} | |||
//============================================================================== | |||
void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source) | |||
{ | |||
ObxdAudioProcessor* filter = getFilter(); | |||
float pr[PARAM_COUNT]; | |||
filter->getCallbackLock().enter(); | |||
for(int i = 0 ; i < PARAM_COUNT;++i) | |||
pr[i] = filter->getPrograms().currentProgramPtr->values[i]; | |||
filter->getCallbackLock().exit(); | |||
#define rn(T,P) (T->setValue(pr[P],dontSendNotification)); | |||
rn(cutoffKnob,CUTOFF) | |||
rn(resonanceKnob,RESONANCE) | |||
rn(volumeKnob,VOLUME) | |||
rn(osc1PitchKnob,OSC1P) | |||
rn(osc2PitchKnob,OSC2P) | |||
rn(osc2DetuneKnob,OSC2_DET) | |||
rn(portamentoKnob,PORTAMENTO) | |||
rn(filterEnvelopeAmtKnob,ENVELOPE_AMT) | |||
rn(pulseWidthKnob,PW) | |||
rn(xmodKnob,XMOD) | |||
rn(multimodeKnob,MULTIMODE) | |||
rn(brightnessKnob,BRIGHTNESS) | |||
rn(envPitchModKnob,ENVPITCH) | |||
rn(attackKnob,LATK) | |||
rn(decayKnob,LDEC) | |||
rn(sustainKnob,LSUS) | |||
rn(releaseKnob,LREL) | |||
rn(fattackKnob,FATK) | |||
rn(fdecayKnob,FDEC) | |||
rn(fsustainKnob,FSUS) | |||
rn(freleaseKnob,FREL) | |||
rn(osc1MixKnob,OSC1MIX) | |||
rn(osc2MixKnob,OSC2MIX) | |||
rn(noiseMixKnob,NOISEMIX) | |||
rn(voiceDetuneKnob,UDET) | |||
rn(lfoFrequencyKnob,LFOFREQ) | |||
rn(lfoAmt1Knob,LFO1AMT) | |||
rn(lfoAmt2Knob,LFO2AMT) | |||
rn(tuneKnob,TUNE) | |||
rn(bendLfoRateKnob,BENDLFORATE) | |||
rn(veloAmpEnvKnob,VAMPENV) | |||
rn(veloFltEnvKnob,VFLTENV) | |||
//buttons | |||
rn(hardSyncButton,OSC2HS) | |||
rn(osc1SawButton,OSC1Saw) | |||
rn(osc2SawButton,OSC2Saw) | |||
rn(osc1PulButton,OSC1Pul) | |||
rn(osc2PulButton,OSC2Pul) | |||
rn(filterKeyFollowButton,FLT_KF) | |||
rn(pitchQuantButton,OSCQuantize) | |||
rn(unisonButton,UNISON) | |||
rn(filterDetuneKnob,FILTERDER) | |||
rn(envelopeDetuneKnob,ENVDER) | |||
rn(portamentoDetuneKnob,PORTADER) | |||
rn(filterHQButton,FILTER_WARM) | |||
rn(filterBPBlendButton,BANDPASS) | |||
rn(lfoSinButton,LFOSINWAVE) | |||
rn(lfoSquareButton,LFOSQUAREWAVE) | |||
rn(lfoSHButton,LFOSHWAVE) | |||
rn(bendOsc2OnlyButton,BENDOSC2) | |||
rn(bendRangeButton,BENDRANGE) | |||
rn(lfoOsc1Button,LFOOSC1) | |||
rn(lfoOsc2Button,LFOOSC2) | |||
rn(lfoFilterButton,LFOFILTER) | |||
rn(lfoPwm1Button,LFOPW1) | |||
rn(lfoPwm2Button,LFOPW2) | |||
rn(fourPoleButton,FOURPOLE) | |||
rn(transposeKnob,OCTAVE) | |||
rn(pan1Knob,PAN1) | |||
rn(pan2Knob,PAN2) | |||
rn(pan3Knob,PAN3) | |||
rn(pan4Knob,PAN4) | |||
rn(pan5Knob,PAN5) | |||
rn(pan6Knob,PAN6) | |||
rn(pan7Knob,PAN7) | |||
rn(pan8Knob,PAN8) | |||
rn(voiceSwitch,VOICE_COUNT) | |||
rn(legatoSwitch,LEGATOMODE) | |||
rn(asPlayedAllocButton,ASPLAYEDALLOCATION) | |||
} | |||
void ObxdAudioProcessorEditor::mouseUp(const MouseEvent& e) | |||
{ | |||
if (e.mods.isRightButtonDown() || e.mods.isCommandDown()) | |||
{ | |||
PopupMenu menu; | |||
PopupMenu skinMenu; | |||
PopupMenu bankMenu; | |||
Array<File> skins; | |||
const Array<File>& banks = getFilter()->getBankFiles(); | |||
int skinStart = 0; | |||
{ | |||
DirectoryIterator it(getFilter()->getSkinFolder(), false, "*", File::findDirectories); | |||
while (it.next()) | |||
{ | |||
skins.add(it.getFile()); | |||
} | |||
for (int i = 0; i < skins.size(); ++i) | |||
{ | |||
const File skin = skins.getUnchecked(i); | |||
skinMenu.addItem(i + skinStart + 1, skin.getFileName(), true, skin.getFileName() == skinFolder.getFileName()); | |||
} | |||
menu.addSubMenu("Skins", skinMenu); | |||
} | |||
int bankStart = 1000; | |||
{ | |||
const String currentBank = getFilter()->getCurrentBankFile().getFileName(); | |||
for (int i = 0; i < banks.size(); ++i) | |||
{ | |||
const File bank = banks.getUnchecked(i); | |||
bankMenu.addItem(i + bankStart + 1, bank.getFileName(), true, bank.getFileName() == currentBank); | |||
} | |||
menu.addSubMenu("Banks", bankMenu); | |||
} | |||
const juce::Point<int> pos = e.getMouseDownScreenPosition(); | |||
int result = menu.showAt(Rectangle<int>(pos.getX(), pos.getY(), 1, 1)); | |||
if (result >= (skinStart + 1) && result <= (skinStart + skins.size())) | |||
{ | |||
result -= 1; | |||
result -= skinStart; | |||
const File newSkinFolder = skins.getUnchecked(result); | |||
getFilter()->setCurrentSkinFolder(newSkinFolder.getFileName()); | |||
rebuildComponents(); | |||
} | |||
else if (result >= (bankStart + 1) && result <= (bankStart + banks.size())) | |||
{ | |||
result -= 1; | |||
result -= bankStart; | |||
const File bankFile = banks.getUnchecked(result); | |||
getFilter()->loadFromFXBFile(bankFile); | |||
} | |||
} | |||
} | |||
void ObxdAudioProcessorEditor::paint(Graphics& g) | |||
{ | |||
g.fillAll (Colours::white); | |||
const File mainFile(skinFolder.getChildFile("main.png")); | |||
if (skinFolder.exists() && mainFile.exists()) | |||
{ | |||
const Image image = ImageCache::getFromFile(mainFile); | |||
g.drawImage (image, | |||
0, 0, image.getWidth(), image.getHeight(), | |||
0, 0, image.getWidth(), image.getHeight()); | |||
} | |||
else | |||
{ | |||
const Image image = ImageCache::getFromMemory(BinaryData::main_png, BinaryData::main_pngSize); | |||
g.drawImage (image, | |||
0, 0, image.getWidth(), image.getHeight(), | |||
0, 0, image.getWidth(), image.getHeight()); | |||
} | |||
} |
@@ -1,88 +0,0 @@ | |||
#pragma once | |||
/* | |||
============================================================================== | |||
This file was auto-generated by the Introjucer! | |||
It contains the basic startup code for a Juce application. | |||
============================================================================== | |||
*/ | |||
#ifndef PLUGINEDITOR_H_INCLUDED | |||
#define PLUGINEDITOR_H_INCLUDED | |||
#include "JuceHeader.h" | |||
#include "PluginProcessor.h" | |||
#include "Gui/Knob.h" | |||
#include "Gui/TooglableButton.h" | |||
#include "Gui/ButtonList.h" | |||
//============================================================================== | |||
/** | |||
*/ | |||
class ObxdAudioProcessorEditor : | |||
public AudioProcessorEditor, | |||
// public AudioProcessorListener, | |||
public ChangeListener, | |||
public Slider::Listener, | |||
public Button::Listener, | |||
public ComboBox::Listener | |||
{ | |||
public: | |||
ObxdAudioProcessorEditor(ObxdAudioProcessor* ownerFilter); | |||
~ObxdAudioProcessorEditor(); | |||
void mouseUp(const MouseEvent& e); | |||
void paint(Graphics& g); | |||
//============================================================================== | |||
void changeListenerCallback (ChangeBroadcaster* source); | |||
private: | |||
Knob* addNormalKnob(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval); | |||
Knob* addTinyKnob(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval); | |||
void placeLabel(int x , int y,String text); | |||
TooglableButton* addNormalTooglableButton(int x , int y , ObxdAudioProcessor* filter,int parameter,String name); | |||
TooglableButton* addTinyTooglableButton(int x , int y , ObxdAudioProcessor* filter,int parameter,String name); | |||
ButtonList* addNormalButtonList(int x , int y ,int width, ObxdAudioProcessor* filter,int parameter,String name,Image img); | |||
void sliderValueChanged (Slider*); | |||
void buttonClicked (Button *); | |||
void comboBoxChanged(ComboBox*); | |||
Knob* addNormalKnobClassic(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval); | |||
Knob* addTinyKnobClassic(int x , int y ,ObxdAudioProcessor* filter, int parameter,String name,float defval); | |||
TooglableButton* addNormalTooglableButtonClassic(int x , int y , ObxdAudioProcessor* filter,int parameter,String name); | |||
ButtonList* addNormalButtonListClassic(int x , int y ,int width, ObxdAudioProcessor* filter,int parameter,String name,Image img); | |||
void rebuildComponents(); | |||
//============================================================================== | |||
ObxdAudioProcessor* getFilter() noexcept { return (ObxdAudioProcessor*)getAudioProcessor();} | |||
//============================================================================== | |||
Knob* cutoffKnob,*resonanceKnob,*osc1PitchKnob,*osc2PitchKnob,*osc2DetuneKnob,*volumeKnob, | |||
*portamentoKnob,*voiceDetuneKnob,*filterEnvelopeAmtKnob,*pulseWidthKnob,*xmodKnob,*multimodeKnob,*attackKnob,*decayKnob,*sustainKnob,*releaseKnob, | |||
*fattackKnob,*fdecayKnob,*fsustainKnob,*freleaseKnob,*osc1MixKnob,*osc2MixKnob,*noiseMixKnob, | |||
*filterDetuneKnob,*envelopeDetuneKnob,*portamentoDetuneKnob, | |||
*tuneKnob, | |||
*lfoFrequencyKnob,*lfoAmt1Knob,*lfoAmt2Knob, | |||
*pan1Knob,*pan2Knob,*pan3Knob,*pan4Knob,*pan5Knob,*pan6Knob,*pan7Knob,*pan8Knob, | |||
*brightnessKnob,*envPitchModKnob, | |||
*bendLfoRateKnob,*veloAmpEnvKnob,*veloFltEnvKnob,*transposeKnob; | |||
TooglableButton* hardSyncButton,*osc1SawButton,*osc2SawButton,*osc1PulButton,*osc2PulButton,*filterKeyFollowButton,*unisonButton,*pitchQuantButton, | |||
*filterHQButton,*filterBPBlendButton, | |||
*lfoSinButton,*lfoSquareButton,*lfoSHButton,*lfoOsc1Button,*lfoOsc2Button,*lfoFilterButton, | |||
*lfoPwm1Button,*lfoPwm2Button, | |||
*bendRangeButton,*bendOsc2OnlyButton, | |||
*fourPoleButton,*asPlayedAllocButton; | |||
ButtonList *voiceSwitch,*legatoSwitch; | |||
File skinFolder; | |||
}; | |||
#endif // PLUGINEDITOR_H_INCLUDED |
@@ -1,938 +0,0 @@ | |||
/* | |||
============================================================================== | |||
This file was auto-generated! | |||
It contains the basic startup code for a Juce application. | |||
============================================================================== | |||
*/ | |||
#include "PluginProcessor.h" | |||
#include "PluginEditor.h" | |||
#include "Engine/Params.h" | |||
//============================================================================== | |||
#define S(T) (juce::String(T)) | |||
//============================================================================== | |||
ObxdAudioProcessor::ObxdAudioProcessor() | |||
: programs() | |||
, configLock("__" JucePlugin_Name "ConfigLock__") | |||
{ | |||
isHostAutomatedChange = true; | |||
synth.setSampleRate(44100); | |||
PropertiesFile::Options options; | |||
options.applicationName = JucePlugin_Name; | |||
options.storageFormat = PropertiesFile::storeAsXML; | |||
options.millisecondsBeforeSaving = 2500; | |||
options.processLock = &configLock; | |||
config = new PropertiesFile(getDocumentFolder().getChildFile("Settings.xml"), options); | |||
currentSkin = config->containsKey("skin") ? config->getValue("skin") : "discoDSP Grey"; | |||
currentBank = "Init"; | |||
scanAndUpdateBanks(); | |||
initAllParams(); | |||
if (bankFiles.size() > 0) | |||
{ | |||
loadFromFXBFile(bankFiles[0]); | |||
} | |||
} | |||
ObxdAudioProcessor::~ObxdAudioProcessor() | |||
{ | |||
config->saveIfNeeded(); | |||
config = nullptr; | |||
} | |||
//============================================================================== | |||
void ObxdAudioProcessor::initAllParams() | |||
{ | |||
for (int i = 0 ; i < PARAM_COUNT; i++) | |||
{ | |||
setParameter(i, programs.currentProgramPtr->values[i]); | |||
} | |||
} | |||
//============================================================================== | |||
int ObxdAudioProcessor::getNumParameters() | |||
{ | |||
return PARAM_COUNT; | |||
} | |||
float ObxdAudioProcessor::getParameter (int index) | |||
{ | |||
return programs.currentProgramPtr->values[index]; | |||
} | |||
void ObxdAudioProcessor::setParameter (int index, float newValue) | |||
{ | |||
programs.currentProgramPtr->values[index] = newValue; | |||
switch(index) | |||
{ | |||
case SELF_OSC_PUSH: | |||
synth.processSelfOscPush(newValue); | |||
break; | |||
case PW_ENV_BOTH: | |||
synth.processPwEnvBoth(newValue); | |||
break; | |||
case PW_OSC2_OFS: | |||
synth.processPwOfs(newValue); | |||
break; | |||
case ENV_PITCH_BOTH: | |||
synth.processPitchModBoth(newValue); | |||
break; | |||
case FENV_INVERT: | |||
synth.processInvertFenv(newValue); | |||
break; | |||
case LEVEL_DIF: | |||
synth.processLoudnessDetune(newValue); | |||
break; | |||
case PW_ENV: | |||
synth.processPwEnv(newValue); | |||
break; | |||
case LFO_SYNC: | |||
synth.procLfoSync(newValue); | |||
break; | |||
case ECONOMY_MODE: | |||
synth.procEconomyMode(newValue); | |||
break; | |||
case VAMPENV: | |||
synth.procAmpVelocityAmount(newValue); | |||
break; | |||
case VFLTENV: | |||
synth.procFltVelocityAmount(newValue); | |||
break; | |||
case ASPLAYEDALLOCATION: | |||
synth.procAsPlayedAlloc(newValue); | |||
break; | |||
case BENDLFORATE: | |||
synth.procModWheelFrequency(newValue); | |||
break; | |||
case FOURPOLE: | |||
synth.processFourPole(newValue); | |||
break; | |||
case LEGATOMODE: | |||
synth.processLegatoMode(newValue); | |||
break; | |||
case ENVPITCH: | |||
synth.processEnvelopeToPitch(newValue); | |||
break; | |||
case OSCQuantize: | |||
synth.processPitchQuantization(newValue); | |||
break; | |||
case VOICE_COUNT: | |||
synth.setVoiceCount(newValue); | |||
break; | |||
case BANDPASS: | |||
synth.processBandpassSw(newValue); | |||
break; | |||
case FILTER_WARM: | |||
synth.processOversampling(newValue); | |||
break; | |||
case BENDOSC2: | |||
synth.procPitchWheelOsc2Only(newValue); | |||
break; | |||
case BENDRANGE: | |||
synth.procPitchWheelAmount(newValue); | |||
break; | |||
case NOISEMIX: | |||
synth.processNoiseMix(newValue); | |||
break; | |||
case OCTAVE: | |||
synth.processOctave(newValue); | |||
break; | |||
case TUNE: | |||
synth.processTune(newValue); | |||
break; | |||
case BRIGHTNESS: | |||
synth.processBrightness(newValue); | |||
break; | |||
case MULTIMODE: | |||
synth.processMultimode(newValue); | |||
break; | |||
case LFOFREQ: | |||
synth.processLfoFrequency(newValue); | |||
break; | |||
case LFO1AMT: | |||
synth.processLfoAmt1(newValue); | |||
break; | |||
case LFO2AMT: | |||
synth.processLfoAmt2(newValue); | |||
break; | |||
case LFOSINWAVE: | |||
synth.processLfoSine(newValue); | |||
break; | |||
case LFOSQUAREWAVE: | |||
synth.processLfoSquare(newValue); | |||
break; | |||
case LFOSHWAVE: | |||
synth.processLfoSH(newValue); | |||
break; | |||
case LFOFILTER: | |||
synth.processLfoFilter(newValue); | |||
break; | |||
case LFOOSC1: | |||
synth.processLfoOsc1(newValue); | |||
break; | |||
case LFOOSC2: | |||
synth.processLfoOsc2(newValue); | |||
break; | |||
case LFOPW1: | |||
synth.processLfoPw1(newValue); | |||
break; | |||
case LFOPW2: | |||
synth.processLfoPw2(newValue); | |||
break; | |||
case PORTADER: | |||
synth.processPortamentoDetune(newValue); | |||
break; | |||
case FILTERDER: | |||
synth.processFilterDetune(newValue); | |||
break; | |||
case ENVDER: | |||
synth.processEnvelopeDetune(newValue); | |||
break; | |||
case XMOD: | |||
synth.processOsc2Xmod(newValue); | |||
break; | |||
case OSC2HS: | |||
synth.processOsc2HardSync(newValue); | |||
break; | |||
case OSC2P: | |||
synth.processOsc2Pitch(newValue); | |||
break; | |||
case OSC1P: | |||
synth.processOsc1Pitch(newValue); | |||
break; | |||
case PORTAMENTO: | |||
synth.processPortamento(newValue); | |||
break; | |||
case UNISON: | |||
synth.processUnison(newValue); | |||
break; | |||
case FLT_KF: | |||
synth.processFilterKeyFollow(newValue); | |||
break; | |||
case OSC1MIX: | |||
synth.processOsc1Mix(newValue); | |||
break; | |||
case OSC2MIX: | |||
synth.processOsc2Mix(newValue); | |||
break; | |||
case PW: | |||
synth.processPulseWidth(newValue); | |||
break; | |||
case OSC1Saw: | |||
synth.processOsc1Saw(newValue); | |||
break; | |||
case OSC2Saw: | |||
synth.processOsc2Saw(newValue); | |||
break; | |||
case OSC1Pul: | |||
synth.processOsc1Pulse(newValue); | |||
break; | |||
case OSC2Pul: | |||
synth.processOsc2Pulse(newValue); | |||
break; | |||
case VOLUME: | |||
synth.processVolume(newValue); | |||
break; | |||
case UDET: | |||
synth.processDetune(newValue); | |||
break; | |||
case OSC2_DET: | |||
synth.processOsc2Det(newValue); | |||
break; | |||
case CUTOFF: | |||
synth.processCutoff(newValue); | |||
break; | |||
case RESONANCE: | |||
synth.processResonance(newValue); | |||
break; | |||
case ENVELOPE_AMT: | |||
synth.processFilterEnvelopeAmt(newValue); | |||
break; | |||
case LATK: | |||
synth.processLoudnessEnvelopeAttack(newValue); | |||
break; | |||
case LDEC: | |||
synth.processLoudnessEnvelopeDecay(newValue); | |||
break; | |||
case LSUS: | |||
synth.processLoudnessEnvelopeSustain(newValue); | |||
break; | |||
case LREL: | |||
synth.processLoudnessEnvelopeRelease(newValue); | |||
break; | |||
case FATK: | |||
synth.processFilterEnvelopeAttack(newValue); | |||
break; | |||
case FDEC: | |||
synth.processFilterEnvelopeDecay(newValue); | |||
break; | |||
case FSUS: | |||
synth.processFilterEnvelopeSustain(newValue); | |||
break; | |||
case FREL: | |||
synth.processFilterEnvelopeRelease(newValue); | |||
break; | |||
case PAN1: | |||
synth.processPan(newValue,1); | |||
break; | |||
case PAN2: | |||
synth.processPan(newValue,2); | |||
break; | |||
case PAN3: | |||
synth.processPan(newValue,3); | |||
break; | |||
case PAN4: | |||
synth.processPan(newValue,4); | |||
break; | |||
case PAN5: | |||
synth.processPan(newValue,5); | |||
break; | |||
case PAN6: | |||
synth.processPan(newValue,6); | |||
break; | |||
case PAN7: | |||
synth.processPan(newValue,7); | |||
break; | |||
case PAN8: | |||
synth.processPan(newValue,8); | |||
break; | |||
} | |||
//DIRTY HACK | |||
//This should be checked to avoid stalling on gui update | |||
//It is needed because some hosts do wierd stuff | |||
if(isHostAutomatedChange) | |||
sendChangeMessage(); | |||
} | |||
const String ObxdAudioProcessor::getParameterName (int index) | |||
{ | |||
switch(index) | |||
{ | |||
case SELF_OSC_PUSH: | |||
return S("SelfOscPush"); | |||
case ENV_PITCH_BOTH: | |||
return S("EnvPitchBoth"); | |||
case FENV_INVERT: | |||
return S("FenvInvert"); | |||
case PW_OSC2_OFS: | |||
return S("PwOfs"); | |||
case LEVEL_DIF: | |||
return S("LevelDif"); | |||
case PW_ENV_BOTH: | |||
return S("PwEnvBoth"); | |||
case PW_ENV: | |||
return S("PwEnv"); | |||
case LFO_SYNC: | |||
return S("LfoSync"); | |||
case ECONOMY_MODE: | |||
return S("EconomyMode"); | |||
case UNUSED_1: | |||
return S("Unused 1"); | |||
case UNUSED_2: | |||
return S("Unused 2"); | |||
case VAMPENV: | |||
return S("VAmpFactor"); | |||
case VFLTENV: | |||
return S("VFltFactor"); | |||
case ASPLAYEDALLOCATION: | |||
return S("AsPlayedAllocation"); | |||
case BENDLFORATE: | |||
return S("VibratoRate"); | |||
case FOURPOLE: | |||
return S("FourPole"); | |||
case LEGATOMODE: | |||
return S("LegatoMode"); | |||
case ENVPITCH: | |||
return S("EnvelopeToPitch"); | |||
case OSCQuantize: | |||
return S("PitchQuant"); | |||
case VOICE_COUNT: | |||
return S("VoiceCount"); | |||
case BANDPASS: | |||
return S("BandpassBlend"); | |||
case FILTER_WARM: | |||
return S("Filter_Warm"); | |||
case BENDRANGE: | |||
return S("BendRange"); | |||
case BENDOSC2: | |||
return S("BendOsc2Only"); | |||
case OCTAVE: | |||
return S("Octave"); | |||
case TUNE: | |||
return S("Tune"); | |||
case BRIGHTNESS: | |||
return S("Brightness"); | |||
case NOISEMIX: | |||
return S("NoiseMix"); | |||
case OSC1MIX: | |||
return S("Osc1Mix"); | |||
case OSC2MIX: | |||
return S("Osc2Mix"); | |||
case MULTIMODE: | |||
return S("Multimode"); | |||
case LFOSHWAVE: | |||
return S("LfoSampleHoldWave"); | |||
case LFOSINWAVE: | |||
return S("LfoSineWave"); | |||
case LFOSQUAREWAVE: | |||
return S("LfoSquareWave"); | |||
case LFO1AMT: | |||
return S("LfoAmount1"); | |||
case LFO2AMT: | |||
return S("LfoAmount2"); | |||
case LFOFILTER: | |||
return S("LfoFilter"); | |||
case LFOOSC1: | |||
return S("LfoOsc1"); | |||
case LFOOSC2: | |||
return S("LfoOsc2"); | |||
case LFOFREQ: | |||
return S("LfoFrequency"); | |||
case LFOPW1: | |||
return S("LfoPw1"); | |||
case LFOPW2: | |||
return S("LfoPw2"); | |||
case PORTADER: | |||
return S("PortamentoDetune"); | |||
case FILTERDER: | |||
return S("FilterDetune"); | |||
case ENVDER: | |||
return S("EnvelopeDetune"); | |||
case PAN1: | |||
return S("Pan1"); | |||
case PAN2: | |||
return S("Pan2"); | |||
case PAN3: | |||
return S("Pan3"); | |||
case PAN4: | |||
return S("Pan4"); | |||
case PAN5: | |||
return S("Pan5"); | |||
case PAN6: | |||
return S("Pan6"); | |||
case PAN7: | |||
return S("Pan7"); | |||
case PAN8: | |||
return S("Pan8"); | |||
case XMOD: | |||
return S("Xmod"); | |||
case OSC2HS: | |||
return S("Osc2HardSync"); | |||
case OSC1P: | |||
return S("Osc1Pitch"); | |||
case OSC2P: | |||
return S("Osc2Pitch"); | |||
case PORTAMENTO: | |||
return S("Portamento"); | |||
case UNISON: | |||
return S("Unison"); | |||
case FLT_KF: | |||
return S("FilterKeyFollow"); | |||
case PW: | |||
return S("PulseWidth"); | |||
case OSC2Saw: | |||
return S("Osc2Saw"); | |||
case OSC1Saw: | |||
return S("Osc1Saw"); | |||
case OSC1Pul: | |||
return S("Osc1Pulse"); | |||
case OSC2Pul: | |||
return S("Osc2Pulse"); | |||
case VOLUME: | |||
return S("Volume"); | |||
case UDET: | |||
return S("VoiceDetune"); | |||
case OSC2_DET: | |||
return S("Oscillator2detune"); | |||
case CUTOFF: | |||
return S("Cutoff"); | |||
case RESONANCE: | |||
return S("Resonance"); | |||
case ENVELOPE_AMT: | |||
return S("FilterEnvAmount"); | |||
case LATK: | |||
return S("Attack"); | |||
case LDEC: | |||
return S("Decay"); | |||
case LSUS: | |||
return S("Sustain"); | |||
case LREL: | |||
return S("Release"); | |||
case FATK: | |||
return S("FilterAttack"); | |||
case FDEC: | |||
return S("FilterDecay"); | |||
case FSUS: | |||
return S("FilterSustain"); | |||
case FREL: | |||
return S("FilterRelease"); | |||
} | |||
return String(); | |||
} | |||
const String ObxdAudioProcessor::getParameterText (int index) | |||
{ | |||
return String(programs.currentProgramPtr->values[index],2); | |||
} | |||
//============================================================================== | |||
const String ObxdAudioProcessor::getName() const | |||
{ | |||
return JucePlugin_Name; | |||
} | |||
const String ObxdAudioProcessor::getInputChannelName (int channelIndex) const | |||
{ | |||
return String (channelIndex + 1); | |||
} | |||
const String ObxdAudioProcessor::getOutputChannelName (int channelIndex) const | |||
{ | |||
return String (channelIndex + 1); | |||
} | |||
bool ObxdAudioProcessor::isInputChannelStereoPair (int index) const | |||
{ | |||
return true; | |||
} | |||
bool ObxdAudioProcessor::isOutputChannelStereoPair (int index) const | |||
{ | |||
return true; | |||
} | |||
bool ObxdAudioProcessor::acceptsMidi() const | |||
{ | |||
#if JucePlugin_WantsMidiInput | |||
return true; | |||
#else | |||
return false; | |||
#endif | |||
} | |||
bool ObxdAudioProcessor::producesMidi() const | |||
{ | |||
#if JucePlugin_ProducesMidiOutput | |||
return true; | |||
#else | |||
return false; | |||
#endif | |||
} | |||
bool ObxdAudioProcessor::silenceInProducesSilenceOut() const | |||
{ | |||
return false; | |||
} | |||
double ObxdAudioProcessor::getTailLengthSeconds() const | |||
{ | |||
return 0.0; | |||
} | |||
//============================================================================== | |||
int ObxdAudioProcessor::getNumPrograms() | |||
{ | |||
return PROGRAMCOUNT; | |||
} | |||
int ObxdAudioProcessor::getCurrentProgram() | |||
{ | |||
return programs.currentProgram; | |||
} | |||
void ObxdAudioProcessor::setCurrentProgram (int index) | |||
{ | |||
programs.currentProgram = index; | |||
programs.currentProgramPtr = programs.programs + programs.currentProgram; | |||
isHostAutomatedChange = false; | |||
for(int i = 0 ; i < PARAM_COUNT;i++) | |||
setParameter(i,programs.currentProgramPtr->values[i]); | |||
isHostAutomatedChange = true; | |||
sendChangeMessage(); | |||
updateHostDisplay(); | |||
} | |||
const String ObxdAudioProcessor::getProgramName (int index) | |||
{ | |||
return programs.programs[index].name; | |||
} | |||
void ObxdAudioProcessor::changeProgramName (int index, const String& newName) | |||
{ | |||
programs.programs[index].name = newName; | |||
} | |||
//============================================================================== | |||
void ObxdAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) | |||
{ | |||
// Use this method as the place to do any pre-playback | |||
// initialisation that you need.. | |||
nextMidi = MidiMessage(0xF0); | |||
midiMsg = MidiMessage(0xF0); | |||
synth.setSampleRate(sampleRate); | |||
} | |||
void ObxdAudioProcessor::releaseResources() | |||
{ | |||
} | |||
inline void ObxdAudioProcessor::processMidiPerSample(MidiBuffer::Iterator* iter,const int samplePos) | |||
{ | |||
while (getNextEvent(iter, samplePos)) | |||
{ | |||
if(midiMsg.isNoteOn()) | |||
{ | |||
synth.procNoteOn(midiMsg.getNoteNumber(),midiMsg.getFloatVelocity()); | |||
} | |||
if (midiMsg.isNoteOff()) | |||
{ | |||
synth.procNoteOff(midiMsg.getNoteNumber()); | |||
} | |||
if(midiMsg.isPitchWheel()) | |||
{ | |||
// [0..16383] center = 8192; | |||
synth.procPitchWheel((midiMsg.getPitchWheelValue()-8192) / 8192.0); | |||
} | |||
if(midiMsg.isController() && midiMsg.getControllerNumber()==1) | |||
synth.procModWheel(midiMsg.getControllerValue() / 127.0); | |||
if(midiMsg.isSustainPedalOn()) | |||
{ | |||
synth.sustainOn(); | |||
} | |||
if(midiMsg.isSustainPedalOff() || midiMsg.isAllNotesOff()||midiMsg.isAllSoundOff()) | |||
{ | |||
synth.sustainOff(); | |||
} | |||
if(midiMsg.isAllNotesOff()) | |||
{ | |||
synth.allNotesOff(); | |||
} | |||
if(midiMsg.isAllSoundOff()) | |||
{ | |||
synth.allSoundOff(); | |||
} | |||
} | |||
} | |||
bool ObxdAudioProcessor::getNextEvent(MidiBuffer::Iterator* iter,const int samplePos) | |||
{ | |||
if (hasMidiMessage && midiEventPos <= samplePos) | |||
{ | |||
midiMsg = nextMidi; | |||
hasMidiMessage = iter->getNextEvent(nextMidi, midiEventPos); | |||
return true; | |||
} | |||
return false; | |||
} | |||
void ObxdAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) | |||
{ | |||
MidiBuffer::Iterator ppp(midiMessages); | |||
hasMidiMessage = ppp.getNextEvent(nextMidi,midiEventPos); | |||
int samplePos = 0; | |||
int numSamples = buffer.getNumSamples(); | |||
float* channelData1 = buffer.getWritePointer(0); | |||
float* channelData2 = buffer.getWritePointer(1); | |||
AudioPlayHead::CurrentPositionInfo pos; | |||
if (getPlayHead() != 0 && getPlayHead()->getCurrentPosition (pos)) | |||
{ | |||
synth.setPlayHead(pos.bpm,pos.ppqPosition); | |||
} | |||
while (samplePos < numSamples) | |||
{ | |||
processMidiPerSample(&ppp,samplePos); | |||
synth.processSample(channelData1+samplePos,channelData2+samplePos); | |||
samplePos++; | |||
} | |||
} | |||
//============================================================================== | |||
bool ObxdAudioProcessor::hasEditor() const | |||
{ | |||
return true; | |||
} | |||
AudioProcessorEditor* ObxdAudioProcessor::createEditor() | |||
{ | |||
return new ObxdAudioProcessorEditor (this); | |||
} | |||
//============================================================================== | |||
void ObxdAudioProcessor::getStateInformation (MemoryBlock& destData) | |||
{ | |||
XmlElement xmlState = XmlElement("Datsounds"); | |||
xmlState.setAttribute(S("currentProgram"), programs.currentProgram); | |||
XmlElement* xprogs = new XmlElement("programs"); | |||
for (int i = 0; i < PROGRAMCOUNT; ++i) | |||
{ | |||
XmlElement* xpr = new XmlElement("program"); | |||
xpr->setAttribute(S("programName"), programs.programs[i].name); | |||
for (int k = 0; k < PARAM_COUNT; ++k) | |||
{ | |||
xpr->setAttribute(String(k), programs.programs[i].values[k]); | |||
} | |||
xprogs->addChildElement(xpr); | |||
} | |||
xmlState.addChildElement(xprogs); | |||
copyXmlToBinary(xmlState,destData); | |||
} | |||
void ObxdAudioProcessor::setStateInformation (const void* data, int sizeInBytes) | |||
{ | |||
if (XmlElement* const xmlState = getXmlFromBinary(data,sizeInBytes)) | |||
{ | |||
XmlElement* xprogs = xmlState->getFirstChildElement(); | |||
if (xprogs->hasTagName(S("programs"))) | |||
{ | |||
int i = 0; | |||
forEachXmlChildElement(*xprogs, e) | |||
{ | |||
programs.programs[i].setDefaultValues(); | |||
for (int k = 0; k < PARAM_COUNT; ++k) | |||
{ | |||
programs.programs[i].values[k] = e->getDoubleAttribute(String(k), programs.programs[i].values[k]); | |||
} | |||
programs.programs[i].name = e->getStringAttribute(S("programName"), S("Default")); | |||
++i; | |||
} | |||
} | |||
setCurrentProgram(xmlState->getIntAttribute(S("currentProgram"), 0)); | |||
delete xmlState; | |||
} | |||
} | |||
void ObxdAudioProcessor::setCurrentProgramStateInformation(const void* data,int sizeInBytes) | |||
{ | |||
if (XmlElement* const e = getXmlFromBinary(data, sizeInBytes)) | |||
{ | |||
programs.currentProgramPtr->setDefaultValues(); | |||
for (int k = 0; k < PARAM_COUNT; ++k) | |||
{ | |||
programs.currentProgramPtr->values[k] = e->getDoubleAttribute(String(k), programs.currentProgramPtr->values[k]); | |||
} | |||
programs.currentProgramPtr->name = e->getStringAttribute(S("programName"), S("Default")); | |||
setCurrentProgram(programs.currentProgram); | |||
delete e; | |||
} | |||
} | |||
void ObxdAudioProcessor::getCurrentProgramStateInformation(MemoryBlock& destData) | |||
{ | |||
XmlElement xmlState = XmlElement("Datsounds"); | |||
for (int k = 0; k < PARAM_COUNT; ++k) | |||
{ | |||
xmlState.setAttribute(String(k), programs.currentProgramPtr->values[k]); | |||
} | |||
xmlState.setAttribute(S("programName"), programs.currentProgramPtr->name); | |||
copyXmlToBinary(xmlState, destData); | |||
} | |||
//============================================================================== | |||
bool ObxdAudioProcessor::loadFromFXBFile(const File& fxbFile) | |||
{ | |||
MemoryBlock mb; | |||
if (! fxbFile.loadFileAsData(mb)) | |||
return false; | |||
const void* const data = mb.getData(); | |||
const size_t dataSize = mb.getSize(); | |||
if (dataSize < 28) | |||
return false; | |||
const fxSet* const set = (const fxSet*) data; | |||
if ((! compareMagic (set->chunkMagic, "CcnK")) || fxbSwap (set->version) > fxbVersionNum) | |||
return false; | |||
if (compareMagic (set->fxMagic, "FxBk")) | |||
{ | |||
// bank of programs | |||
if (fxbSwap (set->numPrograms) >= 0) | |||
{ | |||
const int oldProg = getCurrentProgram(); | |||
const int numParams = fxbSwap (((const fxProgram*) (set->programs))->numParams); | |||
const int progLen = (int) sizeof (fxProgram) + (numParams - 1) * (int) sizeof (float); | |||
for (int i = 0; i < fxbSwap (set->numPrograms); ++i) | |||
{ | |||
if (i != oldProg) | |||
{ | |||
const fxProgram* const prog = (const fxProgram*) (((const char*) (set->programs)) + i * progLen); | |||
if (((const char*) prog) - ((const char*) set) >= (ssize_t) dataSize) | |||
return false; | |||
if (fxbSwap (set->numPrograms) > 0) | |||
setCurrentProgram (i); | |||
if (! restoreProgramSettings (prog)) | |||
return false; | |||
} | |||
} | |||
if (fxbSwap (set->numPrograms) > 0) | |||
setCurrentProgram (oldProg); | |||
const fxProgram* const prog = (const fxProgram*) (((const char*) (set->programs)) + oldProg * progLen); | |||
if (((const char*) prog) - ((const char*) set) >= (ssize_t) dataSize) | |||
return false; | |||
if (! restoreProgramSettings (prog)) | |||
return false; | |||
} | |||
} | |||
else if (compareMagic (set->fxMagic, "FxCk")) | |||
{ | |||
// single program | |||
const fxProgram* const prog = (const fxProgram*) data; | |||
if (! compareMagic (prog->chunkMagic, "CcnK")) | |||
return false; | |||
changeProgramName (getCurrentProgram(), prog->prgName); | |||
for (int i = 0; i < fxbSwap (prog->numParams); ++i) | |||
setParameter (i, fxbSwapFloat (prog->params[i])); | |||
} | |||
else if (compareMagic (set->fxMagic, "FBCh")) | |||
{ | |||
// non-preset chunk | |||
const fxChunkSet* const cset = (const fxChunkSet*) data; | |||
if ((size_t) fxbSwap (cset->chunkSize) + sizeof (fxChunkSet) - 8 > (size_t) dataSize) | |||
return false; | |||
setStateInformation(cset->chunk, fxbSwap (cset->chunkSize)); | |||
} | |||
else if (compareMagic (set->fxMagic, "FPCh")) | |||
{ | |||
// preset chunk | |||
const fxProgramSet* const cset = (const fxProgramSet*) data; | |||
if ((size_t) fxbSwap (cset->chunkSize) + sizeof (fxProgramSet) - 8 > (size_t) dataSize) | |||
return false; | |||
setCurrentProgramStateInformation(cset->chunk, fxbSwap (cset->chunkSize)); | |||
changeProgramName (getCurrentProgram(), cset->name); | |||
} | |||
else | |||
{ | |||
return false; | |||
} | |||
currentBank = fxbFile.getFileName(); | |||
updateHostDisplay(); | |||
return true; | |||
} | |||
bool ObxdAudioProcessor::restoreProgramSettings(const fxProgram* const prog) | |||
{ | |||
if (compareMagic (prog->chunkMagic, "CcnK") | |||
&& compareMagic (prog->fxMagic, "FxCk")) | |||
{ | |||
changeProgramName (getCurrentProgram(), prog->prgName); | |||
for (int i = 0; i < fxbSwap (prog->numParams); ++i) | |||
setParameter (i, fxbSwapFloat (prog->params[i])); | |||
return true; | |||
} | |||
return false; | |||
} | |||
//============================================================================== | |||
void ObxdAudioProcessor::scanAndUpdateBanks() | |||
{ | |||
bankFiles.clearQuick(); | |||
DirectoryIterator it(getBanksFolder(), false, "*.fxb", File::findFiles); | |||
while (it.next()) | |||
{ | |||
bankFiles.add(it.getFile()); | |||
} | |||
} | |||
const Array<File>& ObxdAudioProcessor::getBankFiles() const | |||
{ | |||
return bankFiles; | |||
} | |||
File ObxdAudioProcessor::getCurrentBankFile() const | |||
{ | |||
return getBanksFolder().getChildFile(currentBank); | |||
} | |||
//============================================================================== | |||
File ObxdAudioProcessor::getDocumentFolder() const | |||
{ | |||
File folder = File::getSpecialLocation(File::userDocumentsDirectory).getChildFile("discoDSP").getChildFile("OB-Xd"); | |||
if (folder.isSymbolicLink()) | |||
folder = folder.getLinkedTarget(); | |||
return folder; | |||
} | |||
File ObxdAudioProcessor::getSkinFolder() const | |||
{ | |||
return getDocumentFolder().getChildFile("Skins"); | |||
} | |||
File ObxdAudioProcessor::getBanksFolder() const | |||
{ | |||
return getDocumentFolder().getChildFile("Banks"); | |||
} | |||
File ObxdAudioProcessor::getCurrentSkinFolder() const | |||
{ | |||
return getSkinFolder().getChildFile(currentSkin); | |||
} | |||
void ObxdAudioProcessor::setCurrentSkinFolder(const String& folderName) | |||
{ | |||
currentSkin = folderName; | |||
config->setValue("skin", folderName); | |||
config->setNeedsToBeSaved(true); | |||
} | |||
//============================================================================== | |||
// This creates new instances of the plugin.. | |||
AudioProcessor* JUCE_CALLTYPE createPluginFilter() | |||
{ | |||
return new ObxdAudioProcessor(); | |||
} |
@@ -2,9 +2,11 @@ | |||
if linux_embed | |||
plugins = [ | |||
'obxd', | |||
] | |||
else | |||
plugins = [ | |||
'obxd', | |||
] | |||
endif | |||
@@ -22,7 +24,7 @@ plugin_include_dirs = [ | |||
# build flags for plugins | |||
build_flags_plugin = [ | |||
'-Werror=deprecated-declarations', | |||
'-Wno-deprecated-declarations', # FIXME | |||
] | |||
build_flag_plugin_cpp = [ | |||
@@ -0,0 +1,116 @@ | |||
<?xml version="1.0"?> | |||
<PROPERTIES> | |||
<VALUE NAME="guisize" x="1800" y="562"/> | |||
<VALUE NAME="menu" x="5" y="5" d="20"/> | |||
<!------- MANUAL -----> | |||
<VALUE NAME="volumeKnob" x="70" y="95" d="60"/> | |||
<VALUE NAME="asPlayedAllocButton" x="28" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiLearnButton" x="87" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiUnlearnButton" x="151" y="218" w="34" h="60"/> | |||
<VALUE NAME="tuneKnob" x="16" y="333" d="60"/> | |||
<VALUE NAME="transposeKnob" x="124" y="333" d="60"/> | |||
<VALUE NAME="voiceSwitch" x="156" y="477" w="17" h="24"/> | |||
<VALUE NAME="legatoSwitch" x="39" y="477" w="65" h="24"/> | |||
<!------- CONTROL -----> | |||
<VALUE NAME="portamentoKnob" x="233" y="95" d="60"/> | |||
<VALUE NAME="unisonButton" x="251" y="218" w="34" h="60"/> | |||
<VALUE NAME="voiceDetuneKnob" x="233" y="333" d="60"/> | |||
<VALUE NAME="bendRangeButton" x="227" y="452" w="34" h="60"/> | |||
<VALUE NAME="bendOsc2OnlyButton" x="283" y="452" w="34" h="60"/> | |||
<!------- MODULATION -----> | |||
<VALUE NAME="lfoFrequencyKnob" x="366" y="94" d="60"/> | |||
<VALUE NAME="lfoAmt1Knob" x="488" y="94" d="60"/> | |||
<VALUE NAME="lfoAmt2Knob" x="610" y="94" d="60"/> | |||
<VALUE NAME="lfoSinButton" x="385" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoSquareButton" x="385" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoSHButton" x="385" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc1Button" x="504" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc2Button" x="504" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoFilterButton" x="504" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm1Button" x="629" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm2Button" x="629" y="340" w="34" h="60"/> | |||
<!------- OSCILLATORS -----> | |||
<VALUE NAME="osc1PitchKnob" x="741" y="94" d="60"/> | |||
<VALUE NAME="pulseWidthKnob" x="864" y="94" d="60"/> | |||
<VALUE NAME="osc2PitchKnob" x="985" y="94" d="60"/> | |||
<VALUE NAME="osc1SawButton" x="734" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1PulButton" x="790" y="218" w="34" h="60"/> | |||
<VALUE NAME="pitchQuantButton" x="855" y="218" w="34" h="60"/> | |||
<VALUE NAME="hardSyncButton" x="913" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2SawButton" x="978" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2PulButton" x="1034" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1MixKnob" x="741" y="333" d="60"/> | |||
<VALUE NAME="noiseMixKnob" x="864" y="333" d="60"/> | |||
<VALUE NAME="osc2MixKnob" x="985" y="333" d="60"/> | |||
<VALUE NAME="brightnessKnob" x="726" y="449" d="60"/> | |||
<VALUE NAME="xmodKnob" x="820" y="449" d="60"/> | |||
<VALUE NAME="envPitchModKnob" x="904" y="449" d="60"/> | |||
<VALUE NAME="osc2DetuneKnob" x="994" y="449" d="60"/> | |||
<!------- FILTER -----> | |||
<VALUE NAME="cutoffKnob" x="1116" y="94" d="60"/> | |||
<VALUE NAME="resonanceKnob" x="1238" y="94" d="60"/> | |||
<VALUE NAME="filterEnvelopeAmtKnob" x="1360" y="98" d="60"/> | |||
<VALUE NAME="multimodeKnob" x="1238" y="210" d="60"/> | |||
<VALUE NAME="filterKeyFollowButton" x="1109" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterHQButton" x="1165" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterBPBlendButton" x="1353" y="218" w="34" h="60"/> | |||
<VALUE NAME="fourPoleButton" x="1409" y="218" w="34" h="60"/> | |||
<!------- FILTER ENVELOPE -----> | |||
<VALUE NAME="fattackKnob" x="1478" y="94" d="60"/> | |||
<VALUE NAME="fdecayKnob" x="1558" y="94" d="60"/> | |||
<VALUE NAME="fsustainKnob" x="1636" y="94" d="60"/> | |||
<VALUE NAME="freleaseKnob" x="1716" y="94" d="60"/> | |||
<!------- LOUDNESS ENVELOPE -----> | |||
<VALUE NAME="attackKnob" x="1478" y="210" d="60"/> | |||
<VALUE NAME="decayKnob" x="1558" y="210" d="60"/> | |||
<VALUE NAME="sustainKnob" x="1636" y="210" d="60"/> | |||
<VALUE NAME="releaseKnob" x="1716" y="210" d="60"/> | |||
<!------- VOICE VARIATION -----> | |||
<VALUE NAME="bendLfoRateKnob" x="1140" y="390" d="45"/> | |||
<VALUE NAME="veloFltEnvKnob" x="1250" y="390" d="45"/> | |||
<VALUE NAME="veloAmpEnvKnob" x="1360" y="390" d="45"/> | |||
<VALUE NAME="filterDetuneKnob" x="1470" y="390" d="45"/> | |||
<VALUE NAME="portamentoDetuneKnob" x="1580" y="390" d="45"/> | |||
<VALUE NAME="envelopeDetuneKnob" x="1690" y="390" d="45"/> | |||
<VALUE NAME="pan1Knob" x="1140" y="472" d="45"/> | |||
<VALUE NAME="pan2Knob" x="1218" y="472" d="45"/> | |||
<VALUE NAME="pan3Knob" x="1297" y="472" d="45"/> | |||
<VALUE NAME="pan4Knob" x="1375" y="472" d="45"/> | |||
<VALUE NAME="pan5Knob" x="1454" y="472" d="45"/> | |||
<VALUE NAME="pan6Knob" x="1532" y="472" d="45"/> | |||
<VALUE NAME="pan7Knob" x="1611" y="472" d="45"/> | |||
<VALUE NAME="pan8Knob" x="1690" y="472" d="45"/> | |||
</PROPERTIES> |
@@ -0,0 +1,116 @@ | |||
<?xml version="1.0"?> | |||
<PROPERTIES> | |||
<VALUE NAME="guisize" x="1800" y="562"/> | |||
<VALUE NAME="menu" x="5" y="5" d="20"/> | |||
<!------- MANUAL -----> | |||
<VALUE NAME="volumeKnob" x="70" y="95" d="60"/> | |||
<VALUE NAME="asPlayedAllocButton" x="28" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiLearnButton" x="87" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiUnlearnButton" x="151" y="218" w="34" h="60"/> | |||
<VALUE NAME="tuneKnob" x="16" y="333" d="60"/> | |||
<VALUE NAME="transposeKnob" x="124" y="333" d="60"/> | |||
<VALUE NAME="voiceSwitch" x="156" y="477" w="17" h="24"/> | |||
<VALUE NAME="legatoSwitch" x="39" y="477" w="65" h="24"/> | |||
<!------- CONTROL -----> | |||
<VALUE NAME="portamentoKnob" x="233" y="95" d="60"/> | |||
<VALUE NAME="unisonButton" x="251" y="218" w="34" h="60"/> | |||
<VALUE NAME="voiceDetuneKnob" x="233" y="333" d="60"/> | |||
<VALUE NAME="bendRangeButton" x="227" y="452" w="34" h="60"/> | |||
<VALUE NAME="bendOsc2OnlyButton" x="283" y="452" w="34" h="60"/> | |||
<!------- MODULATION -----> | |||
<VALUE NAME="lfoFrequencyKnob" x="366" y="94" d="60"/> | |||
<VALUE NAME="lfoAmt1Knob" x="488" y="94" d="60"/> | |||
<VALUE NAME="lfoAmt2Knob" x="610" y="94" d="60"/> | |||
<VALUE NAME="lfoSinButton" x="385" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoSquareButton" x="385" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoSHButton" x="385" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc1Button" x="504" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc2Button" x="504" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoFilterButton" x="504" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm1Button" x="629" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm2Button" x="629" y="340" w="34" h="60"/> | |||
<!------- OSCILLATORS -----> | |||
<VALUE NAME="osc1PitchKnob" x="741" y="94" d="60"/> | |||
<VALUE NAME="pulseWidthKnob" x="864" y="94" d="60"/> | |||
<VALUE NAME="osc2PitchKnob" x="985" y="94" d="60"/> | |||
<VALUE NAME="osc1SawButton" x="734" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1PulButton" x="790" y="218" w="34" h="60"/> | |||
<VALUE NAME="pitchQuantButton" x="855" y="218" w="34" h="60"/> | |||
<VALUE NAME="hardSyncButton" x="913" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2SawButton" x="978" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2PulButton" x="1034" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1MixKnob" x="741" y="333" d="60"/> | |||
<VALUE NAME="noiseMixKnob" x="864" y="333" d="60"/> | |||
<VALUE NAME="osc2MixKnob" x="985" y="333" d="60"/> | |||
<VALUE NAME="brightnessKnob" x="726" y="449" d="60"/> | |||
<VALUE NAME="xmodKnob" x="820" y="449" d="60"/> | |||
<VALUE NAME="envPitchModKnob" x="904" y="449" d="60"/> | |||
<VALUE NAME="osc2DetuneKnob" x="994" y="449" d="60"/> | |||
<!------- FILTER -----> | |||
<VALUE NAME="cutoffKnob" x="1116" y="94" d="60"/> | |||
<VALUE NAME="resonanceKnob" x="1238" y="94" d="60"/> | |||
<VALUE NAME="filterEnvelopeAmtKnob" x="1360" y="98" d="60"/> | |||
<VALUE NAME="multimodeKnob" x="1238" y="210" d="60"/> | |||
<VALUE NAME="filterKeyFollowButton" x="1109" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterHQButton" x="1165" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterBPBlendButton" x="1353" y="218" w="34" h="60"/> | |||
<VALUE NAME="fourPoleButton" x="1409" y="218" w="34" h="60"/> | |||
<!------- FILTER ENVELOPE -----> | |||
<VALUE NAME="fattackKnob" x="1478" y="94" d="60"/> | |||
<VALUE NAME="fdecayKnob" x="1558" y="94" d="60"/> | |||
<VALUE NAME="fsustainKnob" x="1636" y="94" d="60"/> | |||
<VALUE NAME="freleaseKnob" x="1716" y="94" d="60"/> | |||
<!------- LOUDNESS ENVELOPE -----> | |||
<VALUE NAME="attackKnob" x="1478" y="210" d="60"/> | |||
<VALUE NAME="decayKnob" x="1558" y="210" d="60"/> | |||
<VALUE NAME="sustainKnob" x="1636" y="210" d="60"/> | |||
<VALUE NAME="releaseKnob" x="1716" y="210" d="60"/> | |||
<!------- VOICE VARIATION -----> | |||
<VALUE NAME="bendLfoRateKnob" x="1140" y="390" d="45"/> | |||
<VALUE NAME="veloFltEnvKnob" x="1250" y="390" d="45"/> | |||
<VALUE NAME="veloAmpEnvKnob" x="1360" y="390" d="45"/> | |||
<VALUE NAME="filterDetuneKnob" x="1470" y="390" d="45"/> | |||
<VALUE NAME="portamentoDetuneKnob" x="1580" y="390" d="45"/> | |||
<VALUE NAME="envelopeDetuneKnob" x="1690" y="390" d="45"/> | |||
<VALUE NAME="pan1Knob" x="1140" y="472" d="45"/> | |||
<VALUE NAME="pan2Knob" x="1218" y="472" d="45"/> | |||
<VALUE NAME="pan3Knob" x="1297" y="472" d="45"/> | |||
<VALUE NAME="pan4Knob" x="1375" y="472" d="45"/> | |||
<VALUE NAME="pan5Knob" x="1454" y="472" d="45"/> | |||
<VALUE NAME="pan6Knob" x="1532" y="472" d="45"/> | |||
<VALUE NAME="pan7Knob" x="1611" y="472" d="45"/> | |||
<VALUE NAME="pan8Knob" x="1690" y="472" d="45"/> | |||
</PROPERTIES> |
@@ -0,0 +1,116 @@ | |||
<?xml version="1.0"?> | |||
<PROPERTIES> | |||
<VALUE NAME="guisize" x="1800" y="562"/> | |||
<VALUE NAME="menu" x="5" y="5" d="20"/> | |||
<!------- MANUAL -----> | |||
<VALUE NAME="volumeKnob" x="70" y="95" d="62"/> | |||
<VALUE NAME="asPlayedAllocButton" x="28" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiLearnButton" x="87" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiUnlearnButton" x="151" y="218" w="34" h="60"/> | |||
<VALUE NAME="tuneKnob" x="16" y="333" d="62"/> | |||
<VALUE NAME="transposeKnob" x="124" y="333" d="62"/> | |||
<VALUE NAME="voiceSwitch" x="159" y="477" w="17" h="24"/> | |||
<VALUE NAME="legatoSwitch" x="42" y="477" w="65" h="24"/> | |||
<!------- CONTROL -----> | |||
<VALUE NAME="portamentoKnob" x="233" y="95" d="62"/> | |||
<VALUE NAME="unisonButton" x="251" y="218" w="34" h="60"/> | |||
<VALUE NAME="voiceDetuneKnob" x="233" y="333" d="62"/> | |||
<VALUE NAME="bendRangeButton" x="227" y="452" w="34" h="60"/> | |||
<VALUE NAME="bendOsc2OnlyButton" x="283" y="452" w="34" h="60"/> | |||
<!------- MODULATION -----> | |||
<VALUE NAME="lfoFrequencyKnob" x="366" y="94" d="62"/> | |||
<VALUE NAME="lfoAmt1Knob" x="488" y="94" d="62"/> | |||
<VALUE NAME="lfoAmt2Knob" x="610" y="94" d="62"/> | |||
<VALUE NAME="lfoSinButton" x="385" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoSquareButton" x="385" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoSHButton" x="385" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc1Button" x="504" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc2Button" x="504" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoFilterButton" x="504" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm1Button" x="629" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm2Button" x="629" y="340" w="34" h="60"/> | |||
<!------- OSCILLATORS -----> | |||
<VALUE NAME="osc1PitchKnob" x="741" y="94" d="62"/> | |||
<VALUE NAME="pulseWidthKnob" x="864" y="94" d="62"/> | |||
<VALUE NAME="osc2PitchKnob" x="985" y="94" d="62"/> | |||
<VALUE NAME="osc1SawButton" x="734" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1PulButton" x="790" y="218" w="34" h="60"/> | |||
<VALUE NAME="pitchQuantButton" x="855" y="218" w="34" h="60"/> | |||
<VALUE NAME="hardSyncButton" x="913" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2SawButton" x="978" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2PulButton" x="1034" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1MixKnob" x="741" y="333" d="62"/> | |||
<VALUE NAME="noiseMixKnob" x="864" y="333" d="62"/> | |||
<VALUE NAME="osc2MixKnob" x="985" y="333" d="62"/> | |||
<VALUE NAME="brightnessKnob" x="726" y="449" d="62"/> | |||
<VALUE NAME="xmodKnob" x="820" y="449" d="62"/> | |||
<VALUE NAME="envPitchModKnob" x="904" y="449" d="62"/> | |||
<VALUE NAME="osc2DetuneKnob" x="994" y="449" d="62"/> | |||
<!------- FILTER -----> | |||
<VALUE NAME="cutoffKnob" x="1116" y="94" d="62"/> | |||
<VALUE NAME="resonanceKnob" x="1238" y="94" d="62"/> | |||
<VALUE NAME="filterEnvelopeAmtKnob" x="1360" y="98" d="62"/> | |||
<VALUE NAME="multimodeKnob" x="1238" y="210" d="62"/> | |||
<VALUE NAME="filterKeyFollowButton" x="1109" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterHQButton" x="1165" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterBPBlendButton" x="1353" y="218" w="34" h="60"/> | |||
<VALUE NAME="fourPoleButton" x="1409" y="218" w="34" h="60"/> | |||
<!------- FILTER ENVELOPE -----> | |||
<VALUE NAME="fattackKnob" x="1478" y="94" d="62"/> | |||
<VALUE NAME="fdecayKnob" x="1558" y="94" d="62"/> | |||
<VALUE NAME="fsustainKnob" x="1636" y="94" d="62"/> | |||
<VALUE NAME="freleaseKnob" x="1716" y="94" d="62"/> | |||
<!------- LOUDNESS ENVELOPE -----> | |||
<VALUE NAME="attackKnob" x="1478" y="210" d="62"/> | |||
<VALUE NAME="decayKnob" x="1558" y="210" d="62"/> | |||
<VALUE NAME="sustainKnob" x="1636" y="210" d="62"/> | |||
<VALUE NAME="releaseKnob" x="1716" y="210" d="62"/> | |||
<!------- VOICE VARIATION -----> | |||
<VALUE NAME="bendLfoRateKnob" x="1140" y="390" d="45"/> | |||
<VALUE NAME="veloFltEnvKnob" x="1250" y="390" d="45"/> | |||
<VALUE NAME="veloAmpEnvKnob" x="1360" y="390" d="45"/> | |||
<VALUE NAME="filterDetuneKnob" x="1470" y="390" d="45"/> | |||
<VALUE NAME="portamentoDetuneKnob" x="1580" y="390" d="45"/> | |||
<VALUE NAME="envelopeDetuneKnob" x="1690" y="390" d="45"/> | |||
<VALUE NAME="pan1Knob" x="1140" y="472" d="45"/> | |||
<VALUE NAME="pan2Knob" x="1218" y="472" d="45"/> | |||
<VALUE NAME="pan3Knob" x="1297" y="472" d="45"/> | |||
<VALUE NAME="pan4Knob" x="1375" y="472" d="45"/> | |||
<VALUE NAME="pan5Knob" x="1454" y="472" d="45"/> | |||
<VALUE NAME="pan6Knob" x="1532" y="472" d="45"/> | |||
<VALUE NAME="pan7Knob" x="1611" y="472" d="45"/> | |||
<VALUE NAME="pan8Knob" x="1690" y="472" d="45"/> | |||
</PROPERTIES> |
@@ -0,0 +1,116 @@ | |||
<?xml version="1.0"?> | |||
<PROPERTIES> | |||
<VALUE NAME="guisize" x="1800" y="562"/> | |||
<VALUE NAME="menu" x="5" y="5" d="20"/> | |||
<!------- MANUAL -----> | |||
<VALUE NAME="volumeKnob" x="70" y="95" d="60"/> | |||
<VALUE NAME="asPlayedAllocButton" x="28" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiLearnButton" x="87" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiUnlearnButton" x="151" y="218" w="34" h="60"/> | |||
<VALUE NAME="tuneKnob" x="16" y="333" d="60"/> | |||
<VALUE NAME="transposeKnob" x="124" y="333" d="60"/> | |||
<VALUE NAME="voiceSwitch" x="156" y="477" w="17" h="24"/> | |||
<VALUE NAME="legatoSwitch" x="39" y="477" w="65" h="24"/> | |||
<!------- CONTROL -----> | |||
<VALUE NAME="portamentoKnob" x="233" y="95" d="60"/> | |||
<VALUE NAME="unisonButton" x="251" y="218" w="34" h="60"/> | |||
<VALUE NAME="voiceDetuneKnob" x="233" y="333" d="60"/> | |||
<VALUE NAME="bendRangeButton" x="227" y="452" w="34" h="60"/> | |||
<VALUE NAME="bendOsc2OnlyButton" x="283" y="452" w="34" h="60"/> | |||
<!------- MODULATION -----> | |||
<VALUE NAME="lfoFrequencyKnob" x="366" y="94" d="60"/> | |||
<VALUE NAME="lfoAmt1Knob" x="488" y="94" d="60"/> | |||
<VALUE NAME="lfoAmt2Knob" x="610" y="94" d="60"/> | |||
<VALUE NAME="lfoSinButton" x="385" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoSquareButton" x="385" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoSHButton" x="385" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc1Button" x="504" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc2Button" x="504" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoFilterButton" x="504" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm1Button" x="629" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm2Button" x="629" y="340" w="34" h="60"/> | |||
<!------- OSCILLATORS -----> | |||
<VALUE NAME="osc1PitchKnob" x="741" y="94" d="60"/> | |||
<VALUE NAME="pulseWidthKnob" x="864" y="94" d="60"/> | |||
<VALUE NAME="osc2PitchKnob" x="985" y="94" d="60"/> | |||
<VALUE NAME="osc1SawButton" x="734" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1PulButton" x="790" y="218" w="34" h="60"/> | |||
<VALUE NAME="pitchQuantButton" x="855" y="218" w="34" h="60"/> | |||
<VALUE NAME="hardSyncButton" x="913" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2SawButton" x="978" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2PulButton" x="1034" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1MixKnob" x="741" y="333" d="60"/> | |||
<VALUE NAME="noiseMixKnob" x="864" y="333" d="60"/> | |||
<VALUE NAME="osc2MixKnob" x="985" y="333" d="60"/> | |||
<VALUE NAME="brightnessKnob" x="726" y="449" d="60"/> | |||
<VALUE NAME="xmodKnob" x="820" y="449" d="60"/> | |||
<VALUE NAME="envPitchModKnob" x="904" y="449" d="60"/> | |||
<VALUE NAME="osc2DetuneKnob" x="994" y="449" d="60"/> | |||
<!------- FILTER -----> | |||
<VALUE NAME="cutoffKnob" x="1116" y="94" d="60"/> | |||
<VALUE NAME="resonanceKnob" x="1238" y="94" d="60"/> | |||
<VALUE NAME="filterEnvelopeAmtKnob" x="1360" y="98" d="60"/> | |||
<VALUE NAME="multimodeKnob" x="1238" y="210" d="60"/> | |||
<VALUE NAME="filterKeyFollowButton" x="1109" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterHQButton" x="1165" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterBPBlendButton" x="1353" y="218" w="34" h="60"/> | |||
<VALUE NAME="fourPoleButton" x="1409" y="218" w="34" h="60"/> | |||
<!------- FILTER ENVELOPE -----> | |||
<VALUE NAME="fattackKnob" x="1478" y="94" d="60"/> | |||
<VALUE NAME="fdecayKnob" x="1558" y="94" d="60"/> | |||
<VALUE NAME="fsustainKnob" x="1636" y="94" d="60"/> | |||
<VALUE NAME="freleaseKnob" x="1716" y="94" d="60"/> | |||
<!------- LOUDNESS ENVELOPE -----> | |||
<VALUE NAME="attackKnob" x="1478" y="210" d="60"/> | |||
<VALUE NAME="decayKnob" x="1558" y="210" d="60"/> | |||
<VALUE NAME="sustainKnob" x="1636" y="210" d="60"/> | |||
<VALUE NAME="releaseKnob" x="1716" y="210" d="60"/> | |||
<!------- VOICE VARIATION -----> | |||
<VALUE NAME="bendLfoRateKnob" x="1140" y="390" d="45"/> | |||
<VALUE NAME="veloFltEnvKnob" x="1250" y="390" d="45"/> | |||
<VALUE NAME="veloAmpEnvKnob" x="1360" y="390" d="45"/> | |||
<VALUE NAME="filterDetuneKnob" x="1470" y="390" d="45"/> | |||
<VALUE NAME="portamentoDetuneKnob" x="1580" y="390" d="45"/> | |||
<VALUE NAME="envelopeDetuneKnob" x="1690" y="390" d="45"/> | |||
<VALUE NAME="pan1Knob" x="1140" y="472" d="45"/> | |||
<VALUE NAME="pan2Knob" x="1218" y="472" d="45"/> | |||
<VALUE NAME="pan3Knob" x="1297" y="472" d="45"/> | |||
<VALUE NAME="pan4Knob" x="1375" y="472" d="45"/> | |||
<VALUE NAME="pan5Knob" x="1454" y="472" d="45"/> | |||
<VALUE NAME="pan6Knob" x="1532" y="472" d="45"/> | |||
<VALUE NAME="pan7Knob" x="1611" y="472" d="45"/> | |||
<VALUE NAME="pan8Knob" x="1690" y="472" d="45"/> | |||
</PROPERTIES> |
@@ -0,0 +1,116 @@ | |||
<?xml version="1.0"?> | |||
<PROPERTIES> | |||
<VALUE NAME="guisize" x="1800" y="562"/> | |||
<VALUE NAME="menu" x="5" y="5" d="20"/> | |||
<!------- MANUAL -----> | |||
<VALUE NAME="volumeKnob" x="70" y="95" d="62"/> | |||
<VALUE NAME="asPlayedAllocButton" x="28" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiLearnButton" x="87" y="218" w="34" h="60"/> | |||
<VALUE NAME="midiUnlearnButton" x="151" y="218" w="34" h="60"/> | |||
<VALUE NAME="tuneKnob" x="16" y="333" d="62"/> | |||
<VALUE NAME="transposeKnob" x="124" y="333" d="62"/> | |||
<VALUE NAME="voiceSwitch" x="159" y="477" w="17" h="24"/> | |||
<VALUE NAME="legatoSwitch" x="42" y="477" w="65" h="24"/> | |||
<!------- CONTROL -----> | |||
<VALUE NAME="portamentoKnob" x="233" y="95" d="62"/> | |||
<VALUE NAME="unisonButton" x="251" y="218" w="34" h="60"/> | |||
<VALUE NAME="voiceDetuneKnob" x="233" y="333" d="62"/> | |||
<VALUE NAME="bendRangeButton" x="227" y="452" w="34" h="60"/> | |||
<VALUE NAME="bendOsc2OnlyButton" x="283" y="452" w="34" h="60"/> | |||
<!------- MODULATION -----> | |||
<VALUE NAME="lfoFrequencyKnob" x="366" y="94" d="62"/> | |||
<VALUE NAME="lfoAmt1Knob" x="488" y="94" d="62"/> | |||
<VALUE NAME="lfoAmt2Knob" x="610" y="94" d="62"/> | |||
<VALUE NAME="lfoSinButton" x="385" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoSquareButton" x="385" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoSHButton" x="385" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc1Button" x="504" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoOsc2Button" x="504" y="340" w="34" h="60"/> | |||
<VALUE NAME="lfoFilterButton" x="504" y="452" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm1Button" x="629" y="218" w="34" h="60"/> | |||
<VALUE NAME="lfoPwm2Button" x="629" y="340" w="34" h="60"/> | |||
<!------- OSCILLATORS -----> | |||
<VALUE NAME="osc1PitchKnob" x="741" y="94" d="62"/> | |||
<VALUE NAME="pulseWidthKnob" x="864" y="94" d="62"/> | |||
<VALUE NAME="osc2PitchKnob" x="985" y="94" d="62"/> | |||
<VALUE NAME="osc1SawButton" x="734" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1PulButton" x="790" y="218" w="34" h="60"/> | |||
<VALUE NAME="pitchQuantButton" x="855" y="218" w="34" h="60"/> | |||
<VALUE NAME="hardSyncButton" x="913" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2SawButton" x="978" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc2PulButton" x="1034" y="218" w="34" h="60"/> | |||
<VALUE NAME="osc1MixKnob" x="741" y="333" d="62"/> | |||
<VALUE NAME="noiseMixKnob" x="864" y="333" d="62"/> | |||
<VALUE NAME="osc2MixKnob" x="985" y="333" d="62"/> | |||
<VALUE NAME="brightnessKnob" x="726" y="449" d="62"/> | |||
<VALUE NAME="xmodKnob" x="820" y="449" d="62"/> | |||
<VALUE NAME="envPitchModKnob" x="904" y="449" d="62"/> | |||
<VALUE NAME="osc2DetuneKnob" x="994" y="449" d="62"/> | |||
<!------- FILTER -----> | |||
<VALUE NAME="cutoffKnob" x="1116" y="94" d="62"/> | |||
<VALUE NAME="resonanceKnob" x="1238" y="94" d="62"/> | |||
<VALUE NAME="filterEnvelopeAmtKnob" x="1360" y="98" d="62"/> | |||
<VALUE NAME="multimodeKnob" x="1238" y="210" d="62"/> | |||
<VALUE NAME="filterKeyFollowButton" x="1109" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterHQButton" x="1165" y="218" w="34" h="60"/> | |||
<VALUE NAME="filterBPBlendButton" x="1353" y="218" w="34" h="60"/> | |||
<VALUE NAME="fourPoleButton" x="1409" y="218" w="34" h="60"/> | |||
<!------- FILTER ENVELOPE -----> | |||
<VALUE NAME="fattackKnob" x="1478" y="94" d="62"/> | |||
<VALUE NAME="fdecayKnob" x="1558" y="94" d="62"/> | |||
<VALUE NAME="fsustainKnob" x="1636" y="94" d="62"/> | |||
<VALUE NAME="freleaseKnob" x="1716" y="94" d="62"/> | |||
<!------- LOUDNESS ENVELOPE -----> | |||
<VALUE NAME="attackKnob" x="1478" y="210" d="62"/> | |||
<VALUE NAME="decayKnob" x="1558" y="210" d="62"/> | |||
<VALUE NAME="sustainKnob" x="1636" y="210" d="62"/> | |||
<VALUE NAME="releaseKnob" x="1716" y="210" d="62"/> | |||
<!------- VOICE VARIATION -----> | |||
<VALUE NAME="bendLfoRateKnob" x="1140" y="390" d="45"/> | |||
<VALUE NAME="veloFltEnvKnob" x="1250" y="390" d="45"/> | |||
<VALUE NAME="veloAmpEnvKnob" x="1360" y="390" d="45"/> | |||
<VALUE NAME="filterDetuneKnob" x="1470" y="390" d="45"/> | |||
<VALUE NAME="portamentoDetuneKnob" x="1580" y="390" d="45"/> | |||
<VALUE NAME="envelopeDetuneKnob" x="1690" y="390" d="45"/> | |||
<VALUE NAME="pan1Knob" x="1140" y="472" d="45"/> | |||
<VALUE NAME="pan2Knob" x="1218" y="472" d="45"/> | |||
<VALUE NAME="pan3Knob" x="1297" y="472" d="45"/> | |||
<VALUE NAME="pan4Knob" x="1375" y="472" d="45"/> | |||
<VALUE NAME="pan5Knob" x="1454" y="472" d="45"/> | |||
<VALUE NAME="pan6Knob" x="1532" y="472" d="45"/> | |||
<VALUE NAME="pan7Knob" x="1611" y="472" d="45"/> | |||
<VALUE NAME="pan8Knob" x="1690" y="472" d="45"/> | |||
</PROPERTIES> |
@@ -1,5 +1,9 @@ | |||
############################################################################### | |||
plugin_extra_include_dirs = include_directories([ | |||
'source', | |||
]) | |||
if linux_embed | |||
plugin_srcs = files([ | |||
'source/PluginProcessor.cpp', |
@@ -0,0 +1,268 @@ | |||
/* | |||
============================================================================== | |||
This is an automatically generated GUI class created by the Projucer! | |||
Be careful when adding custom code to these files, as only the code within | |||
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded | |||
and re-saved. | |||
Created with Projucer version: 6.0.8 | |||
------------------------------------------------------------------------------ | |||
The Projucer is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited. | |||
============================================================================== | |||
*/ | |||
//[Headers] You can add your own extra header files here... | |||
#include "../PluginEditor.h" | |||
//[/Headers] | |||
#include "PresetBar.h" | |||
//[MiscUserDefs] You can add your own user definitions and misc code here... | |||
//[/MiscUserDefs] | |||
//============================================================================== | |||
PresetBar::PresetBar (ObxdAudioProcessorEditor &gui) | |||
: editor(gui) | |||
{ | |||
//[Constructor_pre] You can add your own custom stuff here.. | |||
//[/Constructor_pre] | |||
presetNameLb.reset (new CustomLabel ("new label", | |||
TRANS("---\n"))); | |||
addAndMakeVisible (presetNameLb.get()); | |||
#ifdef JUCE_MAC | |||
presetNameLb->setFont (juce::Font ("Helvetica Neue", 16.00f, juce::Font::plain).withTypefaceStyle ("Bold")); | |||
#endif | |||
#ifdef JUCE_WINDOWS | |||
presetNameLb->setFont (juce::Font ("Arial", 16.00f, juce::Font::plain).withTypefaceStyle ("Bold")); | |||
#endif | |||
#ifdef JUCE_LINUX | |||
presetNameLb->setFont (juce::Font ("DejaVu Sans", 16.00f, juce::Font::plain).withTypefaceStyle ("Bold")); | |||
#endif | |||
presetNameLb->setJustificationType (juce::Justification::centred); | |||
presetNameLb->setEditable (false, false, false); | |||
presetNameLb->setColour (juce::TextEditor::textColourId, juce::Colours::black); | |||
presetNameLb->setColour (juce::TextEditor::backgroundColourId, juce::Colour (0x00000000)); | |||
presetNameLb->setBounds (24, 8, 368, 24); | |||
previousBtn.reset (new juce::ImageButton ("new button")); | |||
addAndMakeVisible (previousBtn.get()); | |||
previousBtn->setButtonText (juce::String()); | |||
previousBtn->addListener (this); | |||
previousBtn->setImages (false, true, true, | |||
juce::Image(), 1.000f, juce::Colour (0x00000000), | |||
juce::Image(), 1.000f, juce::Colour (0x00000000), | |||
juce::Image(), 1.000f, juce::Colour (0x00000000)); | |||
previousBtn->setBounds (407, 8, 20, 24); | |||
nextBtn.reset (new juce::ImageButton ("new button")); | |||
addAndMakeVisible (nextBtn.get()); | |||
nextBtn->setButtonText (juce::String()); | |||
nextBtn->addListener (this); | |||
nextBtn->setImages (false, true, true, | |||
juce::Image(), 1.000f, juce::Colour (0x00000000), | |||
juce::Image(), 1.000f, juce::Colour (0x00000000), | |||
juce::Image(), 1.000f, juce::Colour (0x00000000)); | |||
nextBtn->setBounds (435, 8, 20, 24); | |||
drawable1 = juce::Drawable::createFromImageData (presetnavigation_svg, presetnavigation_svgSize); | |||
//[UserPreSize] | |||
presetNameLb->leftClicked = [this](juce::Point<int> pos){ | |||
this->leftClicked(pos); | |||
}; | |||
//[/UserPreSize] | |||
setSize (471, 40); | |||
//[Constructor] You can add your own custom stuff here.. | |||
startTimer(50); | |||
//[/Constructor] | |||
} | |||
PresetBar::~PresetBar() | |||
{ | |||
//[Destructor_pre]. You can add your own custom destruction code here.. | |||
//[/Destructor_pre] | |||
presetNameLb = nullptr; | |||
previousBtn = nullptr; | |||
nextBtn = nullptr; | |||
drawable1 = nullptr; | |||
//[Destructor]. You can add your own custom destruction code here.. | |||
//[/Destructor] | |||
} | |||
//============================================================================== | |||
void PresetBar::paint (juce::Graphics& g) | |||
{ | |||
//[UserPrePaint] Add your own custom painting code here.. | |||
//[/UserPrePaint] | |||
g.fillAll (juce::Colours::black); | |||
{ | |||
int x = 0, y = 0, width = 471, height = 40; | |||
//[UserPaintCustomArguments] Customize the painting arguments here.. | |||
//[/UserPaintCustomArguments] | |||
g.setColour (juce::Colours::black); | |||
jassert (drawable1 != nullptr); | |||
if (drawable1 != nullptr) | |||
drawable1->drawWithin (g, juce::Rectangle<int> (x, y, width, height).toFloat(), | |||
juce::RectanglePlacement::centred, 1.000f); | |||
} | |||
//[UserPaint] Add your own custom painting code here.. | |||
//[/UserPaint] | |||
} | |||
void PresetBar::resized() | |||
{ | |||
//[UserPreResize] Add your own custom resize code here.. | |||
//[/UserPreResize] | |||
//[UserResized] Add your own custom resize handling here.. | |||
//[/UserResized] | |||
} | |||
void PresetBar::buttonClicked (juce::Button* buttonThatWasClicked) | |||
{ | |||
//[UserbuttonClicked_Pre] | |||
//[/UserbuttonClicked_Pre] | |||
if (buttonThatWasClicked == previousBtn.get()) | |||
{ | |||
//[UserButtonCode_previousBtn] -- add your button handler code here.. | |||
editor.prevProgram(); | |||
//update(); | |||
//[/UserButtonCode_previousBtn] | |||
} | |||
else if (buttonThatWasClicked == nextBtn.get()) | |||
{ | |||
//[UserButtonCode_nextBtn] -- add your button handler code here.. | |||
editor.nextProgram(); | |||
//update(); | |||
//[/UserButtonCode_nextBtn] | |||
} | |||
//[UserbuttonClicked_Post] | |||
//[/UserbuttonClicked_Post] | |||
} | |||
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... | |||
void PresetBar::timerCallback() { | |||
update(); | |||
} | |||
void PresetBar::update(){ | |||
presetNameLb->setText(editor.getCurrentProgramName(), NotificationType::dontSendNotification); | |||
} | |||
//[/MiscUserCode] | |||
//============================================================================== | |||
#if 0 | |||
/* -- Projucer information section -- | |||
This is where the Projucer stores the metadata that describe this GUI layout, so | |||
make changes in here at your peril! | |||
BEGIN_JUCER_METADATA | |||
<JUCER_COMPONENT documentType="Component" className="PresetBar" componentName="" | |||
parentClasses="public juce::Component, public Timer" constructorParams="ObxdAudioProcessorEditor &gui" | |||
variableInitialisers="editor(gui)" snapPixels="8" snapActive="1" | |||
snapShown="1" overlayOpacity="0.330" fixedSize="1" initialWidth="471" | |||
initialHeight="40"> | |||
<BACKGROUND backgroundColour="ff000000"> | |||
<IMAGE pos="0 0 471 40" resource="presetnavigation_svg" opacity="1.0" | |||
mode="1"/> | |||
</BACKGROUND> | |||
<LABEL name="new label" id="3debca48aa2294c8" memberName="presetNameLb" | |||
virtualName="" explicitFocusOrder="0" pos="24 8 368 24" edTextCol="ff000000" | |||
edBkgCol="0" labelText="--- " editableSingleClick="0" editableDoubleClick="0" | |||
focusDiscardsChanges="0" fontname="Default font" fontsize="15.0" | |||
kerning="0.0" bold="0" italic="0" justification="36"/> | |||
<IMAGEBUTTON name="new button" id="ecc6403235eead2" memberName="previousBtn" | |||
virtualName="" explicitFocusOrder="0" pos="407 8 20 24" buttonText="" | |||
connectedEdges="0" needsCallback="1" radioGroupId="0" keepProportions="1" | |||
resourceNormal="" opacityNormal="1.0" colourNormal="0" resourceOver="" | |||
opacityOver="1.0" colourOver="0" resourceDown="" opacityDown="1.0" | |||
colourDown="0"/> | |||
<IMAGEBUTTON name="new button" id="fab648fbebd2d318" memberName="nextBtn" | |||
virtualName="" explicitFocusOrder="0" pos="435 8 20 24" buttonText="" | |||
connectedEdges="0" needsCallback="1" radioGroupId="0" keepProportions="1" | |||
resourceNormal="" opacityNormal="1.0" colourNormal="0" resourceOver="" | |||
opacityOver="1.0" colourOver="0" resourceDown="" opacityDown="1.0" | |||
colourDown="0"/> | |||
</JUCER_COMPONENT> | |||
END_JUCER_METADATA | |||
*/ | |||
#endif | |||
//============================================================================== | |||
// Binary resources - be careful not to edit any of these sections! | |||
// JUCER_RESOURCE: presetnavigation_svg, 2078, "../../../../GitHub/OB-Xd/Source/Images/presetnavigation.svg" | |||
static const unsigned char resource_PresetBar_presetnavigation_svg[] = { 60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,32, | |||
115,116,97,110,100,97,108,111,110,101,61,34,110,111,34,63,62,10,60,33,68,79,67,84,89,80,69,32,115,118,103,32,80,85,66,76,73,67,32,34,45,47,47,87,51,67,47,47,68,84,68,32,83,86,71,32,49,46,49,47,47,69,78, | |||
34,32,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,71,114,97,112,104,105,99,115,47,83,86,71,47,49,46,49,47,68,84,68,47,115,118,103,49,49,46,100,116,100,34,62,10,60,115,118,103,32, | |||
119,105,100,116,104,61,34,49,48,48,37,34,32,104,101,105,103,104,116,61,34,49,48,48,37,34,32,118,105,101,119,66,111,120,61,34,48,32,48,32,52,55,49,32,51,57,34,32,118,101,114,115,105,111,110,61,34,49,46, | |||
49,34,32,120,109,108,110,115,61,34,104,116,116,112,58,47,47,119,119,119,46,119,51,46,111,114,103,47,50,48,48,48,47,115,118,103,34,32,120,109,108,110,115,58,120,108,105,110,107,61,34,104,116,116,112,58, | |||
47,47,119,119,119,46,119,51,46,111,114,103,47,49,57,57,57,47,120,108,105,110,107,34,32,120,109,108,58,115,112,97,99,101,61,34,112,114,101,115,101,114,118,101,34,32,120,109,108,110,115,58,115,101,114,105, | |||
102,61,34,104,116,116,112,58,47,47,119,119,119,46,115,101,114,105,102,46,99,111,109,47,34,32,115,116,121,108,101,61,34,102,105,108,108,45,114,117,108,101,58,101,118,101,110,111,100,100,59,99,108,105,112, | |||
45,114,117,108,101,58,101,118,101,110,111,100,100,59,115,116,114,111,107,101,45,108,105,110,101,99,97,112,58,114,111,117,110,100,59,115,116,114,111,107,101,45,108,105,110,101,106,111,105,110,58,114,111, | |||
117,110,100,59,115,116,114,111,107,101,45,109,105,116,101,114,108,105,109,105,116,58,49,46,53,59,34,62,10,32,32,32,32,60,114,101,99,116,32,120,61,34,48,34,32,121,61,34,48,34,32,119,105,100,116,104,61, | |||
34,52,55,49,34,32,104,101,105,103,104,116,61,34,51,57,34,47,62,10,32,32,32,32,60,112,97,116,104,32,100,61,34,77,51,57,56,44,57,46,50,48,53,67,51,57,56,44,55,46,52,51,54,32,51,57,54,46,53,54,52,44,54,32, | |||
51,57,52,46,55,57,53,44,54,76,50,52,46,50,48,53,44,54,67,50,50,46,52,51,54,44,54,32,50,49,44,55,46,52,51,54,32,50,49,44,57,46,50,48,53,76,50,49,44,50,57,46,55,57,53,67,50,49,44,51,49,46,53,54,52,32,50, | |||
50,46,52,51,54,44,51,51,32,50,52,46,50,48,53,44,51,51,76,51,57,52,46,55,57,53,44,51,51,67,51,57,54,46,53,54,52,44,51,51,32,51,57,56,44,51,49,46,53,54,52,32,51,57,56,44,50,57,46,55,57,53,76,51,57,56,44, | |||
57,46,50,48,53,90,34,32,115,116,121,108,101,61,34,115,116,114,111,107,101,58,114,103,98,40,49,50,49,44,49,50,49,44,49,50,49,41,59,115,116,114,111,107,101,45,119,105,100,116,104,58,49,112,120,59,34,47, | |||
62,10,32,32,32,32,60,103,32,116,114,97,110,115,102,111,114,109,61,34,109,97,116,114,105,120,40,49,44,48,44,48,44,49,44,52,46,50,50,50,54,54,44,49,49,46,48,50,52,53,41,34,62,10,32,32,32,32,32,32,32,32, | |||
60,103,32,116,114,97,110,115,102,111,114,109,61,34,109,97,116,114,105,120,40,50,52,44,48,44,48,44,50,52,44,52,48,54,46,54,50,49,44,49,55,46,50,54,52,53,41,34,62,10,32,32,32,32,32,32,32,32,32,32,32,32, | |||
60,112,97,116,104,32,100,61,34,77,48,46,52,50,53,44,45,48,46,49,53,54,67,48,46,52,51,53,44,45,48,46,49,52,55,32,48,46,52,51,57,44,45,48,46,49,51,53,32,48,46,52,51,57,44,45,48,46,49,50,50,67,48,46,52,51, | |||
57,44,45,48,46,49,48,57,32,48,46,52,51,53,44,45,48,46,48,57,55,32,48,46,52,50,53,44,45,48,46,48,56,56,67,48,46,52,49,53,44,45,48,46,48,55,56,32,48,46,52,48,52,44,45,48,46,48,55,51,32,48,46,51,57,49,44, | |||
45,48,46,48,55,51,67,48,46,51,55,55,44,45,48,46,48,55,51,32,48,46,51,54,54,44,45,48,46,48,55,56,32,48,46,51,53,54,44,45,48,46,48,56,55,76,48,46,49,49,50,44,45,48,46,51,51,50,67,48,46,49,48,50,44,45,48, | |||
46,51,52,49,32,48,46,48,57,56,44,45,48,46,51,53,51,32,48,46,48,57,56,44,45,48,46,51,54,54,67,48,46,48,57,56,44,45,48,46,51,56,32,48,46,49,48,51,44,45,48,46,51,57,49,32,48,46,49,49,50,44,45,48,46,52,48, | |||
49,76,48,46,51,53,54,44,45,48,46,54,52,53,67,48,46,51,54,54,44,45,48,46,54,53,52,32,48,46,51,55,55,44,45,48,46,54,53,57,32,48,46,51,57,49,44,45,48,46,54,53,57,67,48,46,52,48,52,44,45,48,46,54,53,57,32, | |||
48,46,52,49,53,44,45,48,46,54,53,52,32,48,46,52,50,53,44,45,48,46,54,52,53,67,48,46,52,51,53,44,45,48,46,54,51,53,32,48,46,52,51,57,44,45,48,46,54,50,52,32,48,46,52,51,57,44,45,48,46,54,49,67,48,46,52, | |||
51,57,44,45,48,46,53,57,55,32,48,46,52,51,53,44,45,48,46,53,56,53,32,48,46,52,50,53,44,45,48,46,53,55,54,76,48,46,50,49,53,44,45,48,46,51,54,54,76,48,46,52,50,53,44,45,48,46,49,53,54,90,34,32,115,116, | |||
121,108,101,61,34,102,105,108,108,58,114,103,98,40,49,50,49,44,49,50,49,44,49,50,49,41,59,102,105,108,108,45,114,117,108,101,58,110,111,110,122,101,114,111,59,34,47,62,10,32,32,32,32,32,32,32,32,60,47, | |||
103,62,10,32,32,32,32,60,47,103,62,10,32,32,32,32,60,103,32,116,114,97,110,115,102,111,114,109,61,34,109,97,116,114,105,120,40,49,44,48,44,48,44,49,44,51,49,46,50,50,50,55,44,49,49,46,48,50,52,53,41,34, | |||
62,10,32,32,32,32,32,32,32,32,60,103,32,116,114,97,110,115,102,111,114,109,61,34,109,97,116,114,105,120,40,50,52,44,48,44,48,44,50,52,44,52,48,54,46,54,50,49,44,49,55,46,50,54,52,53,41,34,62,10,32,32, | |||
32,32,32,32,32,32,32,32,32,32,60,112,97,116,104,32,100,61,34,77,48,46,51,50,50,44,45,48,46,51,54,54,76,48,46,49,49,50,44,45,48,46,53,55,54,67,48,46,49,48,51,44,45,48,46,53,56,53,32,48,46,48,57,56,44,45, | |||
48,46,53,57,55,32,48,46,48,57,56,44,45,48,46,54,49,67,48,46,48,57,56,44,45,48,46,54,50,52,32,48,46,49,48,50,44,45,48,46,54,51,53,32,48,46,49,49,50,44,45,48,46,54,52,53,67,48,46,49,50,50,44,45,48,46,54, | |||
53,52,32,48,46,49,51,51,44,45,48,46,54,53,57,32,48,46,49,52,54,44,45,48,46,54,53,57,67,48,46,49,54,44,45,48,46,54,53,57,32,48,46,49,55,49,44,45,48,46,54,53,52,32,48,46,49,56,49,44,45,48,46,54,52,53,76, | |||
48,46,52,50,53,44,45,48,46,52,48,49,67,48,46,52,51,53,44,45,48,46,51,57,49,32,48,46,52,51,57,44,45,48,46,51,56,32,48,46,52,51,57,44,45,48,46,51,54,54,67,48,46,52,51,57,44,45,48,46,51,53,51,32,48,46,52, | |||
51,53,44,45,48,46,51,52,49,32,48,46,52,50,53,44,45,48,46,51,51,50,76,48,46,49,56,49,44,45,48,46,48,56,55,67,48,46,49,55,49,44,45,48,46,48,55,56,32,48,46,49,54,44,45,48,46,48,55,51,32,48,46,49,52,54,44, | |||
45,48,46,48,55,51,67,48,46,49,51,51,44,45,48,46,48,55,51,32,48,46,49,50,50,44,45,48,46,48,55,56,32,48,46,49,49,50,44,45,48,46,48,56,56,67,48,46,49,48,50,44,45,48,46,48,57,55,32,48,46,48,57,56,44,45,48, | |||
46,49,48,57,32,48,46,48,57,56,44,45,48,46,49,50,50,67,48,46,48,57,56,44,45,48,46,49,51,53,32,48,46,49,48,51,44,45,48,46,49,52,55,32,48,46,49,49,50,44,45,48,46,49,53,54,76,48,46,51,50,50,44,45,48,46,51, | |||
54,54,90,34,32,115,116,121,108,101,61,34,102,105,108,108,58,114,103,98,40,49,50,49,44,49,50,49,44,49,50,49,41,59,102,105,108,108,45,114,117,108,101,58,110,111,110,122,101,114,111,59,34,47,62,10,32,32, | |||
32,32,32,32,32,32,60,47,103,62,10,32,32,32,32,60,47,103,62,10,60,47,115,118,103,62,10,0,0}; | |||
const char* PresetBar::presetnavigation_svg = (const char*) resource_PresetBar_presetnavigation_svg; | |||
const int PresetBar::presetnavigation_svgSize = 2078; | |||
//[EndFile] You can add extra defines here... | |||
//[/EndFile] | |||
@@ -0,0 +1,95 @@ | |||
/* | |||
============================================================================== | |||
This is an automatically generated GUI class created by the Projucer! | |||
Be careful when adding custom code to these files, as only the code within | |||
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded | |||
and re-saved. | |||
Created with Projucer version: 6.0.8 | |||
------------------------------------------------------------------------------ | |||
The Projucer is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited. | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
//[Headers] -- You can add your own extra header files here -- | |||
#include <JuceHeader.h> | |||
class ObxdAudioProcessorEditor; | |||
class CustomLabel: public juce::Label { | |||
public: | |||
CustomLabel (const String& componentName = String(), | |||
const String& labelText = String()): juce::Label(componentName, labelText) { | |||
} | |||
std::function<void(juce::Point<int> pos)> leftClicked; | |||
void mouseDown (const juce::MouseEvent& event) override { | |||
if (this->getBounds().contains(event.getMouseDownPosition()) && event.mods.isLeftButtonDown()){ | |||
leftClicked(event.getScreenPosition()); | |||
} | |||
}; | |||
}; | |||
//[/Headers] | |||
//============================================================================== | |||
/** | |||
//[Comments] | |||
An auto-generated component, created by the Projucer. | |||
Describe your class and how it works here! | |||
//[/Comments] | |||
*/ | |||
class PresetBar : public juce::Component, | |||
public Timer, | |||
public juce::Button::Listener | |||
{ | |||
public: | |||
//============================================================================== | |||
PresetBar (ObxdAudioProcessorEditor &gui); | |||
~PresetBar() override; | |||
//============================================================================== | |||
//[UserMethods] -- You can add your own custom methods in this section. | |||
void timerCallback() override; | |||
void update(); | |||
std::function<void(juce::Point<int> &pos)> leftClicked; | |||
//[/UserMethods] | |||
void paint (juce::Graphics& g) override; | |||
void resized() override; | |||
void buttonClicked (juce::Button* buttonThatWasClicked) override; | |||
// Binary resources: | |||
static const char* presetnavigation_svg; | |||
static const int presetnavigation_svgSize; | |||
private: | |||
//[UserVariables] -- You can add your own custom variables in this section. | |||
ObxdAudioProcessorEditor &editor; | |||
//[/UserVariables] | |||
//============================================================================== | |||
std::unique_ptr<CustomLabel> presetNameLb; | |||
std::unique_ptr<juce::ImageButton> previousBtn; | |||
std::unique_ptr<juce::ImageButton> nextBtn; | |||
std::unique_ptr<juce::Drawable> drawable1; | |||
//============================================================================== | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PresetBar) | |||
}; | |||
//[EndFile] You can add extra defines here... | |||
//[/EndFile] | |||
@@ -0,0 +1,138 @@ | |||
/* | |||
============================================================================== | |||
ScaleComponent.cpp | |||
Created: 27 Aug 2021 1:26:08pm | |||
Author: discoDSP | |||
============================================================================== | |||
*/ | |||
#include "../PluginProcessor.h" | |||
#include "ScaleComponent.h" | |||
//============================================================================== | |||
ScalableComponent::ScalableComponent(ObxdAudioProcessor* owner_) | |||
: scaleFactor(0.0f), | |||
isHighResolutionDisplay(false), | |||
processor(owner_) | |||
{ | |||
setScaleFactor(1.0f, false); | |||
} | |||
ScalableComponent::~ScalableComponent() | |||
{ | |||
} | |||
void ScalableComponent::setScaleFactor(float newScaleFactor, bool newIsHighResolutionDisplay) | |||
{ | |||
// until we get a freely scalable editor !!! | |||
jassert(newScaleFactor == 1.0f || newScaleFactor == 1.5f || newScaleFactor == 2.0f); | |||
if (scaleFactor != newScaleFactor || isHighResolutionDisplay != newIsHighResolutionDisplay) | |||
{ | |||
scaleFactor = newScaleFactor; | |||
isHighResolutionDisplay = newIsHighResolutionDisplay; | |||
scaleFactorChanged(); | |||
} | |||
} | |||
float ScalableComponent::getScaleImage(){ | |||
float scale = 1.0; | |||
if (!isHighResolutionDisplay) | |||
{ | |||
if (getScaleFactor() == 1.5f) | |||
{ | |||
scale= 0.75f; | |||
} | |||
else if (getScaleFactor() == 2.0f) | |||
{ | |||
scale= 0.5f; | |||
} | |||
} else { | |||
if (getScaleFactor() == 1.0f) //2x image | |||
{ | |||
scale= 0.5f; | |||
} | |||
else if (getScaleFactor() == 1.5f) //4x images =>150% | |||
{ | |||
scale= (0.25f + 0.125f); | |||
} | |||
else if (getScaleFactor() == 2.0f) //4x images =>200x | |||
{ | |||
scale= 0.5f; | |||
} | |||
} | |||
return scale; | |||
}; | |||
float ScalableComponent::getScaleFactor() const | |||
{ | |||
return scaleFactor; | |||
} | |||
bool ScalableComponent::getIsHighResolutionDisplay() const | |||
{ | |||
return isHighResolutionDisplay; | |||
} | |||
int ScalableComponent::getScaleInt(){ | |||
int scaleFactorInt = 1; | |||
if (scaleFactor == 1.5f) | |||
scaleFactorInt = 2; | |||
if (scaleFactor == 2.0f) | |||
scaleFactorInt = 4; | |||
if (isHighResolutionDisplay){ | |||
scaleFactorInt *= 2; | |||
} | |||
if (scaleFactorInt> 4){ | |||
scaleFactorInt=4; | |||
} | |||
return scaleFactorInt; | |||
} | |||
Image ScalableComponent::getScaledImageFromCache(const String& imageName, | |||
float scaleFactor, | |||
bool isHighResolutionDisplay) | |||
{ | |||
jassert(scaleFactor == 1.0f || scaleFactor == 1.5f || scaleFactor == 2.0f); | |||
this->isHighResolutionDisplay = isHighResolutionDisplay; | |||
int scaleFactorInt = getScaleInt(); | |||
String resourceName = imageName + "_png"; | |||
if (scaleFactorInt != 1){ | |||
resourceName = imageName + String::formatted("%dx_png", scaleFactorInt); | |||
} | |||
int size = 0; | |||
File skin; | |||
if (processor){ | |||
File f(processor->getCurrentSkinFolder()); | |||
if (f.isDirectory()){ | |||
skin=f; | |||
} | |||
} | |||
const char* data = nullptr; | |||
String image_file = imageName; | |||
if (scaleFactorInt ==1) | |||
image_file += ".png"; | |||
else | |||
image_file += String::formatted("@%dx.png", scaleFactorInt); | |||
DBG(" Loaf image: " << image_file); | |||
File file = skin.getChildFile(image_file); | |||
if (file.exists()){ | |||
return ImageCache::getFromFile(file); | |||
} else { | |||
data = BinaryData::getNamedResource((const char*)resourceName.toUTF8(), size); | |||
DBG(" Image: " << resourceName); | |||
return ImageCache::getFromMemory(data, size); | |||
} | |||
} | |||
void ScalableComponent::scaleFactorChanged() | |||
{ | |||
} |
@@ -0,0 +1,86 @@ | |||
/* | |||
============================================================================== | |||
ScaleComponent.h | |||
Created: 27 Aug 2021 1:26:08pm | |||
Author: discoDSP | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
//============================================================================== | |||
#include <JuceHeader.h> | |||
class ObxdAudioProcessor; | |||
//============================================================================== | |||
class ScalableComponent | |||
{ | |||
public: | |||
~ScalableComponent(); | |||
int getScaleInt(); | |||
void setScaleFactor(float newScaleFactor, bool newIsHighResolutionDisplay); | |||
float getScaleImage(); | |||
float getScaleFactor() const; | |||
bool getIsHighResolutionDisplay() const; | |||
virtual void scaleFactorChanged(); | |||
protected: | |||
ScalableComponent(ObxdAudioProcessor* owner_); | |||
Image getScaledImageFromCache(const String& imageName, float scaleFactor, bool isHighResolutionDisplay); | |||
private: | |||
ObxdAudioProcessor* processor; | |||
float scaleFactor; | |||
bool isHighResolutionDisplay; | |||
}; | |||
//============================================================================== | |||
class CustomLookAndFeel : public LookAndFeel_V4, | |||
public ScalableComponent | |||
{ | |||
public: | |||
CustomLookAndFeel(ObxdAudioProcessor* owner_):LookAndFeel_V4(), ScalableComponent(owner_) { | |||
this->setColour(PopupMenu::backgroundColourId, Colour(20, 20, 20)); | |||
this->setColour(PopupMenu::textColourId, Colour(245, 245, 245)); | |||
this->setColour(PopupMenu::highlightedBackgroundColourId, Colour(60, 60, 60)); | |||
this->setColour(Label::textColourId, Colour(245, 245, 245)); | |||
}; | |||
PopupMenu::Options getOptionsForComboBoxPopupMenu (ComboBox& box, Label& label) override | |||
{ | |||
PopupMenu::Options option = LookAndFeel_V4::getOptionsForComboBoxPopupMenu(box, label); | |||
return option.withStandardItemHeight (label.getHeight()/ getScaleFactor()); | |||
}; | |||
Font getPopupMenuFont () override | |||
{ | |||
float scaleFactor = getScaleFactor(); | |||
DBG("getPopupMenuFont::scaleFactor " << scaleFactor); | |||
if (scaleFactor > 1.0) scaleFactor *= 0.85; | |||
#ifdef JUCE_MAC | |||
return Font("Helvetica Neue", 18.0 * scaleFactor, Font::plain); | |||
#endif | |||
#ifdef JUCE_WINDOWS | |||
return Font("Arial", 18.0 * scaleFactor, Font::plain); | |||
#endif | |||
#ifdef JUCE_LINUX | |||
return Font("DejaVu Sans", 18.0 * scaleFactor, Font::plain); | |||
#endif | |||
} | |||
}; |
@@ -0,0 +1,206 @@ | |||
/* | |||
============================================================================== | |||
This is an automatically generated GUI class created by the Projucer! | |||
Be careful when adding custom code to these files, as only the code within | |||
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded | |||
and re-saved. | |||
Created with Projucer version: 6.0.8 | |||
------------------------------------------------------------------------------ | |||
The Projucer is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited. | |||
============================================================================== | |||
*/ | |||
//[Headers] You can add your own extra header files here... | |||
//[/Headers] | |||
#include "SetPresetNameWindow.h" | |||
//[MiscUserDefs] You can add your own user definitions and misc code here... | |||
//[/MiscUserDefs] | |||
//============================================================================== | |||
SetPresetNameWindow::SetPresetNameWindow () | |||
{ | |||
//[Constructor_pre] You can add your own custom stuff here.. | |||
//[/Constructor_pre] | |||
nameTextEditor.reset (new juce::TextEditor ("nameTextEditor")); | |||
addAndMakeVisible (nameTextEditor.get()); | |||
nameTextEditor->setMultiLine (false); | |||
nameTextEditor->setReturnKeyStartsNewLine (false); | |||
nameTextEditor->setReadOnly (false); | |||
nameTextEditor->setScrollbarsShown (true); | |||
nameTextEditor->setCaretVisible (true); | |||
nameTextEditor->setPopupMenuEnabled (false); | |||
nameTextEditor->setColour (juce::TextEditor::backgroundColourId, juce::Colours::black); | |||
nameTextEditor->setColour (juce::CaretComponent::caretColourId, juce::Colours::white); | |||
nameTextEditor->setText (juce::String()); | |||
cancel.reset (new juce::TextButton ("cancel")); | |||
addAndMakeVisible (cancel.get()); | |||
cancel->setButtonText (TRANS("Cancel")); | |||
cancel->addListener (this); | |||
cancel->setColour (juce::TextButton::buttonColourId, juce::Colours::black); | |||
Ok.reset (new juce::TextButton ("Ok")); | |||
addAndMakeVisible (Ok.get()); | |||
Ok->setButtonText (TRANS("OK")); | |||
Ok->addListener (this); | |||
Ok->setColour (juce::TextButton::buttonColourId, juce::Colours::black); | |||
//[UserPreSize] | |||
cancel->setColour (juce::ComboBox::ColourIds::outlineColourId, juce::Colours::white); | |||
Ok->setColour (juce::ComboBox::ColourIds::outlineColourId, juce::Colours::white); | |||
//[/UserPreSize] | |||
setSize (300, 150); | |||
//[Constructor] You can add your own custom stuff here.. | |||
//[/Constructor] | |||
} | |||
SetPresetNameWindow::~SetPresetNameWindow() | |||
{ | |||
//[Destructor_pre]. You can add your own custom destruction code here.. | |||
//[/Destructor_pre] | |||
nameTextEditor = nullptr; | |||
cancel = nullptr; | |||
Ok = nullptr; | |||
//[Destructor]. You can add your own custom destruction code here.. | |||
//[/Destructor] | |||
} | |||
//============================================================================== | |||
void SetPresetNameWindow::paint (juce::Graphics& g) | |||
{ | |||
//[UserPrePaint] Add your own custom painting code here.. | |||
//[/UserPrePaint] | |||
g.fillAll (juce::Colours::black); | |||
{ | |||
int x = 0, y = proportionOfHeight (0.0000f), width = proportionOfWidth (1.0000f), height = proportionOfHeight (1.0000f); | |||
juce::Colour fillColour = juce::Colours::black; | |||
juce::Colour strokeColour = juce::Colour (0xff666666); | |||
//[UserPaintCustomArguments] Customize the painting arguments here.. | |||
//[/UserPaintCustomArguments] | |||
g.setColour (fillColour); | |||
g.fillRect (x, y, width, height); | |||
g.setColour (strokeColour); | |||
g.drawRect (x, y, width, height, 1); | |||
} | |||
{ | |||
int x = proportionOfWidth (0.0000f), y = proportionOfHeight (0.1000f), width = proportionOfWidth (1.0000f), height = proportionOfHeight (0.2000f); | |||
juce::String text (TRANS("Preset Name")); | |||
juce::Colour fillColour = juce::Colours::white; | |||
//[UserPaintCustomArguments] Customize the painting arguments here.. | |||
//[/UserPaintCustomArguments] | |||
g.setColour (fillColour); | |||
g.setFont (juce::Font (15.00f, juce::Font::plain).withTypefaceStyle ("Regular")); | |||
g.drawText (text, x, y, width, height, | |||
juce::Justification::centred, true); | |||
} | |||
//[UserPaint] Add your own custom painting code here.. | |||
//[/UserPaint] | |||
} | |||
void SetPresetNameWindow::resized() | |||
{ | |||
//[UserPreResize] Add your own custom resize code here.. | |||
//[/UserPreResize] | |||
nameTextEditor->setBounds (proportionOfWidth (0.1500f), proportionOfHeight (0.3467f), proportionOfWidth (0.7000f), proportionOfHeight (0.1733f)); | |||
cancel->setBounds (proportionOfWidth (0.2000f), proportionOfHeight (0.7000f), proportionOfWidth (0.2500f), proportionOfHeight (0.1600f)); | |||
Ok->setBounds (proportionOfWidth (0.5500f), proportionOfHeight (0.7000f), proportionOfWidth (0.2500f), proportionOfHeight (0.1600f)); | |||
//[UserResized] Add your own custom resize handling here.. | |||
//[/UserResized] | |||
} | |||
void SetPresetNameWindow::buttonClicked (juce::Button* buttonThatWasClicked) | |||
{ | |||
//[UserbuttonClicked_Pre] | |||
//[/UserbuttonClicked_Pre] | |||
if (buttonThatWasClicked == cancel.get()) | |||
{ | |||
//[UserButtonCode_cancel] -- add your button handler code here.. | |||
callback(0, nameTextEditor->getText()); | |||
//[/UserButtonCode_cancel] | |||
} | |||
else if (buttonThatWasClicked == Ok.get()) | |||
{ | |||
//[UserButtonCode_Ok] -- add your button handler code here.. | |||
callback(1, nameTextEditor->getText()); | |||
//[/UserButtonCode_Ok] | |||
} | |||
//[UserbuttonClicked_Post] | |||
//[/UserbuttonClicked_Post] | |||
} | |||
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... | |||
void SetPresetNameWindow::grabTextEditorFocus() | |||
{ | |||
nameTextEditor->grabKeyboardFocus(); | |||
}; | |||
//[/MiscUserCode] | |||
//============================================================================== | |||
#if 0 | |||
/* -- Projucer information section -- | |||
This is where the Projucer stores the metadata that describe this GUI layout, so | |||
make changes in here at your peril! | |||
BEGIN_JUCER_METADATA | |||
<JUCER_COMPONENT documentType="Component" className="SetPresetNameWindow" componentName="" | |||
parentClasses="public juce::Component" constructorParams="" variableInitialisers="" | |||
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330" | |||
fixedSize="1" initialWidth="300" initialHeight="150"> | |||
<BACKGROUND backgroundColour="ff000000"> | |||
<RECT pos="0 0% 100% 100%" fill="solid: ff000000" hasStroke="1" stroke="1, mitered, butt" | |||
strokeColour="solid: ff666666"/> | |||
<TEXT pos="0% 10% 100% 20%" fill="solid: ffffffff" hasStroke="0" text="Preset Name" | |||
fontname="Default font" fontsize="15.0" kerning="0.0" bold="0" | |||
italic="0" justification="36"/> | |||
</BACKGROUND> | |||
<TEXTEDITOR name="nameTextEditor" id="13e287a1045d7d6d" memberName="nameTextEditor" | |||
virtualName="" explicitFocusOrder="0" pos="15% 34.667% 70% 17.333%" | |||
bkgcol="ff000000" caretcol="ffffffff" initialText="" multiline="0" | |||
retKeyStartsLine="0" readonly="0" scrollbars="1" caret="1" popupmenu="0"/> | |||
<TEXTBUTTON name="cancel" id="873979f2630a3992" memberName="cancel" virtualName="" | |||
explicitFocusOrder="0" pos="20% 70% 25% 16%" bgColOff="ff000000" | |||
buttonText="Cancel" connectedEdges="0" needsCallback="1" radioGroupId="0"/> | |||
<TEXTBUTTON name="Ok" id="2874357d53dac91e" memberName="Ok" virtualName="" | |||
explicitFocusOrder="0" pos="55% 70% 25% 16%" bgColOff="ff000000" | |||
buttonText="OK" connectedEdges="0" needsCallback="1" radioGroupId="0"/> | |||
</JUCER_COMPONENT> | |||
END_JUCER_METADATA | |||
*/ | |||
#endif | |||
//[EndFile] You can add extra defines here... | |||
//[/EndFile] | |||
@@ -0,0 +1,75 @@ | |||
/* | |||
============================================================================== | |||
This is an automatically generated GUI class created by the Projucer! | |||
Be careful when adding custom code to these files, as only the code within | |||
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded | |||
and re-saved. | |||
Created with Projucer version: 6.0.8 | |||
------------------------------------------------------------------------------ | |||
The Projucer is part of the JUCE library. | |||
Copyright (c) 2020 - Raw Material Software Limited. | |||
============================================================================== | |||
*/ | |||
#pragma once | |||
//[Headers] -- You can add your own extra header files here -- | |||
#include <JuceHeader.h> | |||
//[/Headers] | |||
//============================================================================== | |||
/** | |||
//[Comments] | |||
An auto-generated component, created by the Projucer. | |||
Describe your class and how it works here! | |||
//[/Comments] | |||
*/ | |||
class SetPresetNameWindow : public juce::Component, | |||
public juce::Button::Listener | |||
{ | |||
public: | |||
//============================================================================== | |||
SetPresetNameWindow (); | |||
~SetPresetNameWindow() override; | |||
//============================================================================== | |||
//[UserMethods] -- You can add your own custom methods in this section. | |||
std::function<void(int, juce::String)> callback; | |||
void setText(const String &txt){ | |||
nameTextEditor->setText(txt); | |||
} | |||
void grabTextEditorFocus(); | |||
//[/UserMethods] | |||
void paint (juce::Graphics& g) override; | |||
void resized() override; | |||
void buttonClicked (juce::Button* buttonThatWasClicked) override; | |||
private: | |||
//[UserVariables] -- You can add your own custom variables in this section. | |||
//[/UserVariables] | |||
//============================================================================== | |||
std::unique_ptr<juce::TextEditor> nameTextEditor; | |||
std::unique_ptr<juce::TextButton> cancel; | |||
std::unique_ptr<juce::TextButton> Ok; | |||
//============================================================================== | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SetPresetNameWindow) | |||
}; | |||
//[EndFile] You can add extra defines here... | |||
//[/EndFile] | |||
@@ -26,6 +26,7 @@ | |||
#include "VoiceQueue.h" | |||
#include "SynthEngine.h" | |||
#include "Lfo.h" | |||
#include "Tuning.h" | |||
class Motherboard | |||
{ | |||
@@ -42,14 +43,16 @@ private: | |||
float sampleRate,sampleRateInv; | |||
//JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Motherboard) | |||
public: | |||
Tuning tuning; | |||
bool asPlayedMode; | |||
Lfo mlfo,vibratoLfo; | |||
float vibratoAmount; | |||
bool vibratoEnabled; | |||
float Volume; | |||
const static int MAX_VOICES=8; | |||
float pannings[MAX_VOICES]; | |||
const static int MAX_VOICES = 32; | |||
const static int MAX_PANNINGS = 8; | |||
float pannings[MAX_PANNINGS]; | |||
ObxdVoice voices[MAX_VOICES]; | |||
bool uni; | |||
bool Oversample; | |||
@@ -79,7 +82,7 @@ public: | |||
// pannings = new float[MAX_VOICES]; | |||
totalvc = MAX_VOICES; | |||
vq = VoiceQueue(MAX_VOICES,voices); | |||
for(int i = 0 ; i < MAX_VOICES;++i) | |||
for(int i = 0 ; i < MAX_PANNINGS;++i) | |||
{ | |||
pannings[i]= 0.5; | |||
} | |||
@@ -342,13 +345,14 @@ public: | |||
} | |||
void processSample(float* sm1,float* sm2) | |||
{ | |||
tuning.updateMTSESPStatus(); | |||
mlfo.update(); | |||
vibratoLfo.update(); | |||
float vl=0,vr=0; | |||
float vlo = 0 , vro = 0 ; | |||
float lfovalue = mlfo.getVal(); | |||
float viblfo = vibratoEnabled?(vibratoLfo.getVal() * vibratoAmount):0; | |||
float lfovalue2=0,viblfo2=0; | |||
float lfovalue2=0,viblfo2; | |||
if(Oversample) | |||
{ | |||
mlfo.update(); | |||
@@ -359,15 +363,16 @@ public: | |||
for(int i = 0 ; i < totalvc;i++) | |||
{ | |||
voices[i].initTuning(&tuning); | |||
float x1 = processSynthVoice(voices[i],lfovalue,viblfo); | |||
if(Oversample) | |||
{ | |||
float x2 = processSynthVoice(voices[i],lfovalue2,viblfo2); | |||
vlo+=x2*(1-pannings[i]); | |||
vro+=x2*(pannings[i]); | |||
vlo+=x2*(1-pannings[i % MAX_PANNINGS]); | |||
vro+=x2*(pannings[i % MAX_PANNINGS]); | |||
} | |||
vl+=x1*(1-pannings[i]); | |||
vr+=x1*(pannings[i]); | |||
vl+=x1*(1-pannings[i % MAX_PANNINGS]); | |||
vr+=x1*(pannings[i % MAX_PANNINGS]); | |||
} | |||
if(Oversample) | |||
{ |