GUI fixes
This commit is contained in:
parent
2efb25b9a9
commit
b26face84b
3 changed files with 137 additions and 76 deletions
|
@ -14,20 +14,32 @@ It contains the basic startup code for a Juce application.
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFilter)
|
ObxdAudioProcessorEditor::ObxdAudioProcessorEditor (ObxdAudioProcessor& ownerFilter)
|
||||||
: AudioProcessorEditor (&ownerFilter), processor (ownerFilter)
|
: AudioProcessorEditor (&ownerFilter), processor (ownerFilter),
|
||||||
|
skinFolder (processor.getSkinFolder()),
|
||||||
|
progStart (2000),
|
||||||
|
bankStart (1000),
|
||||||
|
skinStart (0),
|
||||||
|
skins (processor.getSkinFiles()),
|
||||||
|
banks (processor.getBankFiles())
|
||||||
{
|
{
|
||||||
skinFolder = ownerFilter.getCurrentSkinFolder();
|
// skinFolder = ownerFilter.getCurrentSkinFolder(); // initialized above
|
||||||
loadSkin (processor);
|
loadSkin (processor);
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObxdAudioProcessorEditor::loadSkin(ObxdAudioProcessor& ownerFilter){
|
void ObxdAudioProcessorEditor::loadSkin (ObxdAudioProcessor& ownerFilter)
|
||||||
|
{
|
||||||
|
knobAttachments.clear();
|
||||||
|
buttonListAttachments.clear();
|
||||||
|
toggleAttachments.clear();
|
||||||
imageButtons.clear();
|
imageButtons.clear();
|
||||||
|
popupMenus.clear();
|
||||||
ownerFilter.removeChangeListener (this);
|
ownerFilter.removeChangeListener (this);
|
||||||
//File coords("/Users/jimmy/Downloads/coords.xml");
|
//File coords("/Users/jimmy/Downloads/coords.xml");
|
||||||
skinFolder = ownerFilter.getCurrentSkinFolder();
|
skinFolder = ownerFilter.getCurrentSkinFolder();
|
||||||
File coords = skinFolder.getChildFile ("coords.xml");
|
File coords = skinFolder.getChildFile ("coords.xml");
|
||||||
bool useClassicSkin = coords.existsAsFile();
|
bool useClassicSkin = coords.existsAsFile();
|
||||||
|
|
||||||
if (! useClassicSkin) {
|
if (! useClassicSkin) {
|
||||||
rebuildComponents (processor);
|
rebuildComponents (processor);
|
||||||
return;
|
return;
|
||||||
|
@ -35,12 +47,14 @@ void ObxdAudioProcessorEditor::loadSkin(ObxdAudioProcessor& ownerFilter){
|
||||||
|
|
||||||
XmlDocument skin (coords);
|
XmlDocument skin (coords);
|
||||||
XmlElement* doc = skin.getDocumentElement();
|
XmlElement* doc = skin.getDocumentElement();
|
||||||
if (doc) {
|
if (doc)
|
||||||
|
{
|
||||||
if (doc->getTagName() == "PROPERTIES"){
|
if (doc->getTagName() == "PROPERTIES")
|
||||||
|
{
|
||||||
forEachXmlChildElementWithTagName(*doc, child, "VALUE"){
|
forEachXmlChildElementWithTagName(*doc, child, "VALUE")
|
||||||
if (child->hasAttribute("NAME") && child->hasAttribute("x") && child->hasAttribute("y")) {
|
{
|
||||||
|
if (child->hasAttribute("NAME") && child->hasAttribute("x") && child->hasAttribute("y"))
|
||||||
|
{
|
||||||
String name = child->getStringAttribute("NAME");
|
String name = child->getStringAttribute("NAME");
|
||||||
int x = child->getIntAttribute("x");
|
int x = child->getIntAttribute("x");
|
||||||
int y = child->getIntAttribute("y");
|
int y = child->getIntAttribute("y");
|
||||||
|
@ -150,7 +164,7 @@ void ObxdAudioProcessorEditor::loadSkin(ObxdAudioProcessor& ownerFilter){
|
||||||
|
|
||||||
if (name == "menu")
|
if (name == "menu")
|
||||||
{
|
{
|
||||||
addMenu (x, y, d,
|
addMenuButton (x, y, d,
|
||||||
ImageCache::getFromFile (skinFolder.getChildFile ("menu.png")));
|
ImageCache::getFromFile (skinFolder.getChildFile ("menu.png")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,34 +175,35 @@ void ObxdAudioProcessorEditor::loadSkin(ObxdAudioProcessor& ownerFilter){
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare data
|
// Prepare data
|
||||||
if (voiceSwitch){
|
if (voiceSwitch)
|
||||||
|
{
|
||||||
for (int i = 1; i <= 32; ++i)
|
for (int i = 1; i <= 32; ++i)
|
||||||
{
|
{
|
||||||
voiceSwitch->addChoice (String (i));
|
voiceSwitch->addChoice (String (i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto voiceOption = ownerFilter.getPluginState().getParameter (ownerFilter.getEngineParameterId (VOICE_COUNT))->getValue();
|
||||||
|
voiceSwitch->setValue (voiceOption, dontSendNotification);
|
||||||
}
|
}
|
||||||
if (legatoSwitch) {
|
|
||||||
|
if (legatoSwitch)
|
||||||
|
{
|
||||||
legatoSwitch->addChoice ("Keep All");
|
legatoSwitch->addChoice ("Keep All");
|
||||||
legatoSwitch->addChoice ("Keep Filter Envelope");
|
legatoSwitch->addChoice ("Keep Filter Envelope");
|
||||||
legatoSwitch->addChoice ("Keep Amplitude Envelope");
|
legatoSwitch->addChoice ("Keep Amplitude Envelope");
|
||||||
legatoSwitch->addChoice ("Retrig");
|
legatoSwitch->addChoice ("Retrig");
|
||||||
|
auto legatoOption = ownerFilter.getPluginState().getParameter (ownerFilter.getEngineParameterId (LEGATOMODE))->getValue();
|
||||||
|
legatoSwitch->setValue (legatoOption, dontSendNotification);
|
||||||
}
|
}
|
||||||
buttonListAttachments.add (new ButtonList::ButtonListAttachment (ownerFilter.getPluginState(),
|
|
||||||
ownerFilter.getEngineParameterId (VOICE_COUNT),
|
|
||||||
*voiceSwitch));
|
|
||||||
|
|
||||||
buttonListAttachments.add (new ButtonList::ButtonListAttachment (ownerFilter.getPluginState(),
|
|
||||||
ownerFilter.getEngineParameterId (LEGATOMODE),
|
|
||||||
*legatoSwitch));
|
|
||||||
|
|
||||||
|
createMenu();
|
||||||
ownerFilter.addChangeListener (this);
|
ownerFilter.addChangeListener (this);
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
ObxdAudioProcessorEditor::~ObxdAudioProcessorEditor()
|
ObxdAudioProcessorEditor::~ObxdAudioProcessorEditor()
|
||||||
{
|
{
|
||||||
processor.removeChangeListener (this);
|
processor.removeChangeListener (this);
|
||||||
// deleteAllChildren(); // WATCH OUT!
|
// deleteAllChildren(); // Method to be avoided
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObxdAudioProcessorEditor::placeLabel (int x, int y, String text)
|
void ObxdAudioProcessorEditor::placeLabel (int x, int y, String text)
|
||||||
|
@ -204,6 +219,10 @@ void ObxdAudioProcessorEditor::placeLabel (int x, int y, String text)
|
||||||
ButtonList* ObxdAudioProcessorEditor::addList (int x, int y, int width, int height, ObxdAudioProcessor& filter, int parameter, String /*name*/, Image img)
|
ButtonList* ObxdAudioProcessorEditor::addList (int x, int y, int width, int height, ObxdAudioProcessor& filter, int parameter, String /*name*/, Image img)
|
||||||
{
|
{
|
||||||
ButtonList *bl = new ButtonList (img, height);
|
ButtonList *bl = new ButtonList (img, height);
|
||||||
|
buttonListAttachments.add (new ButtonList::ButtonListAttachment (filter.getPluginState(),
|
||||||
|
filter.getEngineParameterId (parameter),
|
||||||
|
*bl));
|
||||||
|
|
||||||
bl->setBounds (x, y, width, height);
|
bl->setBounds (x, y, width, height);
|
||||||
addAndMakeVisible (bl);
|
addAndMakeVisible (bl);
|
||||||
|
|
||||||
|
@ -214,40 +233,46 @@ ButtonList* ObxdAudioProcessorEditor::addList (int x, int y, int width, int heig
|
||||||
Knob* ObxdAudioProcessorEditor::addKnob (int x, int y, int d, ObxdAudioProcessor& filter, int parameter, String /*name*/, float defval)
|
Knob* ObxdAudioProcessorEditor::addKnob (int x, int y, int d, ObxdAudioProcessor& filter, int parameter, String /*name*/, float defval)
|
||||||
{
|
{
|
||||||
Knob* knob = new Knob (ImageCache::getFromFile(skinFolder.getChildFile("knob.png")), 144);
|
Knob* knob = new Knob (ImageCache::getFromFile(skinFolder.getChildFile("knob.png")), 144);
|
||||||
|
knobAttachments.add (new Knob::KnobAttachment (filter.getPluginState(),
|
||||||
|
filter.getEngineParameterId (parameter),
|
||||||
|
*knob));
|
||||||
|
|
||||||
knob->setSliderStyle (Slider::RotaryVerticalDrag);
|
knob->setSliderStyle (Slider::RotaryVerticalDrag);
|
||||||
knob->setTextBoxStyle (knob->NoTextBox, true, 0, 0);
|
knob->setTextBoxStyle (knob->NoTextBox, true, 0, 0);
|
||||||
knob->setRange (0, 1);
|
knob->setRange (0, 1);
|
||||||
addAndMakeVisible (knob);
|
|
||||||
knob->setBounds (x, y, d+(d/6), d+(d/6));
|
knob->setBounds (x, y, d+(d/6), d+(d/6));
|
||||||
knob->setTextBoxIsEditable (false);
|
knob->setTextBoxIsEditable (false);
|
||||||
knob->setDoubleClickReturnValue (true, defval);
|
knob->setDoubleClickReturnValue (true, defval);
|
||||||
knobAttachments.add (new Knob::KnobAttachment (filter.getPluginState(),
|
knob->setValue (filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue());
|
||||||
|
addAndMakeVisible (knob);
|
||||||
filter.getEngineParameterId (parameter),
|
|
||||||
*knob));
|
|
||||||
|
|
||||||
return knob;
|
return knob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ObxdAudioProcessorEditor::clean(){
|
void ObxdAudioProcessorEditor::clean()
|
||||||
|
{
|
||||||
this->removeAllChildren();
|
this->removeAllChildren();
|
||||||
}
|
}
|
||||||
|
|
||||||
TooglableButton* ObxdAudioProcessorEditor::addButton (int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name)
|
TooglableButton* ObxdAudioProcessorEditor::addButton (int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name)
|
||||||
{
|
{
|
||||||
TooglableButton* button = new TooglableButton (ImageCache::getFromFile(skinFolder.getChildFile("button.png")));
|
TooglableButton* button = new TooglableButton (ImageCache::getFromFile(skinFolder.getChildFile("button.png")));
|
||||||
addAndMakeVisible (button);
|
|
||||||
button->setBounds (x, y, w, h);
|
|
||||||
button->setButtonText (name);
|
|
||||||
toggleAttachments.add (new TooglableButton::ToggleAttachment (filter.getPluginState(),
|
toggleAttachments.add (new TooglableButton::ToggleAttachment (filter.getPluginState(),
|
||||||
filter.getEngineParameterId (parameter),
|
filter.getEngineParameterId (parameter),
|
||||||
*button));
|
*button));
|
||||||
|
|
||||||
|
button->setBounds (x, y, w, h);
|
||||||
|
button->setButtonText (name);
|
||||||
|
button->setValue (filter.getPluginState().getParameter (filter.getEngineParameterId (parameter))->getValue(),
|
||||||
|
dontSendNotification);
|
||||||
|
|
||||||
|
addAndMakeVisible (button);
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObxdAudioProcessorEditor::addMenu (int x, int y, int d, const Image& image)
|
void ObxdAudioProcessorEditor::addMenuButton (int x, int y, int d, const Image& image)
|
||||||
{
|
{
|
||||||
ImageButton* imageButton;
|
ImageButton* imageButton;
|
||||||
imageButtons.add (imageButton = new ImageButton());
|
imageButtons.add (imageButton = new ImageButton());
|
||||||
|
@ -283,18 +308,15 @@ void ObxdAudioProcessorEditor::rebuildComponents (ObxdAudioProcessor& ownerFilte
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObxdAudioProcessorEditor::createMenu (const Point<int> pos)
|
void ObxdAudioProcessorEditor::createMenu ()
|
||||||
{
|
{
|
||||||
PopupMenu menu;
|
PopupMenu* menu = new PopupMenu();
|
||||||
PopupMenu progMenu;
|
PopupMenu progMenu;
|
||||||
PopupMenu bankMenu;
|
PopupMenu bankMenu;
|
||||||
PopupMenu skinMenu;
|
PopupMenu skinMenu;
|
||||||
|
|
||||||
|
skins = processor.getSkinFiles();
|
||||||
Array<File> skins;
|
banks = processor.getBankFiles();
|
||||||
const Array<File>& banks = processor.getBankFiles();
|
|
||||||
|
|
||||||
int progStart = 2000;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
for (int i = 0; i < processor.getNumPrograms(); ++i)
|
for (int i = 0; i < processor.getNumPrograms(); ++i)
|
||||||
|
@ -305,11 +327,9 @@ void ObxdAudioProcessorEditor::createMenu (const Point<int> pos)
|
||||||
i == processor.getCurrentProgram());
|
i == processor.getCurrentProgram());
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addSubMenu("Programs", progMenu);
|
menu->addSubMenu("Programs", progMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bankStart = 1000;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const String currentBank = processor.getCurrentBankFile().getFileName();
|
const String currentBank = processor.getCurrentBankFile().getFileName();
|
||||||
|
|
||||||
|
@ -322,19 +342,10 @@ void ObxdAudioProcessorEditor::createMenu (const Point<int> pos)
|
||||||
bank.getFileName() == currentBank);
|
bank.getFileName() == currentBank);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addSubMenu ("Banks", bankMenu);
|
menu->addSubMenu ("Banks", bankMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
int skinStart = 0;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
DirectoryIterator it (processor.getSkinFolder(), false, "*", File::findDirectories);
|
|
||||||
|
|
||||||
while (it.next())
|
|
||||||
{
|
|
||||||
skins.addUsingDefaultSort (it.getFile());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < skins.size(); ++i)
|
for (int i = 0; i < skins.size(); ++i)
|
||||||
{
|
{
|
||||||
const File skin = skins.getUnchecked (i);
|
const File skin = skins.getUnchecked (i);
|
||||||
|
@ -344,11 +355,15 @@ void ObxdAudioProcessorEditor::createMenu (const Point<int> pos)
|
||||||
skin.getFileName() == skinFolder.getFileName());
|
skin.getFileName() == skinFolder.getFileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addSubMenu ("Skins", skinMenu);
|
menu->addSubMenu ("Skins", skinMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
popupMenus.add (menu);
|
||||||
|
}
|
||||||
|
|
||||||
int result = menu.showAt (Rectangle<int> (pos.getX(), pos.getY(), 1, 1));
|
void ObxdAudioProcessorEditor::resultFromMenu (const Point<int> pos)
|
||||||
|
{
|
||||||
|
int result = popupMenus[0]->showAt (Rectangle<int> (pos.getX(), pos.getY(), 1, 1));
|
||||||
|
|
||||||
if (result >= (skinStart + 1) && result <= (skinStart + skins.size()))
|
if (result >= (skinStart + 1) && result <= (skinStart + skins.size()))
|
||||||
{
|
{
|
||||||
|
@ -369,12 +384,16 @@ void ObxdAudioProcessorEditor::createMenu (const Point<int> pos)
|
||||||
|
|
||||||
const File bankFile = banks.getUnchecked (result);
|
const File bankFile = banks.getUnchecked (result);
|
||||||
processor.loadFromFXBFile (bankFile);
|
processor.loadFromFXBFile (bankFile);
|
||||||
|
clean();
|
||||||
|
loadSkin (processor);
|
||||||
}
|
}
|
||||||
else if (result >= (progStart + 1) && result <= (progStart + processor.getNumPrograms()))
|
else if (result >= (progStart + 1) && result <= (progStart + processor.getNumPrograms()))
|
||||||
{
|
{
|
||||||
result -= 1;
|
result -= 1;
|
||||||
result -= progStart;
|
result -= progStart;
|
||||||
processor.setCurrentProgram (result);
|
processor.setCurrentProgram (result);
|
||||||
|
clean();
|
||||||
|
loadSkin (processor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,7 +408,7 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b)
|
||||||
auto dx = imageButton->getWidth();
|
auto dx = imageButton->getWidth();
|
||||||
auto pos = Point<int> (x, y + dx);
|
auto pos = Point<int> (x, y + dx);
|
||||||
|
|
||||||
createMenu (pos);
|
resultFromMenu (pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,17 +416,21 @@ void ObxdAudioProcessorEditor::buttonClicked (Button* b)
|
||||||
void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source)
|
void ObxdAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* source)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (int i = 0; i < knobAttachments.size(); i++){
|
for (int i = 0; i < knobAttachments.size(); ++i)
|
||||||
|
{
|
||||||
knobAttachments[i]->updateToSlider();
|
knobAttachments[i]->updateToSlider();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < toggleAttachments.size(); i++){
|
for (int i = 0; i < toggleAttachments.size(); ++i)
|
||||||
|
{
|
||||||
toggleAttachments[i]->updateToSlider();
|
toggleAttachments[i]->updateToSlider();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < buttonListAttachments.size(); i++){
|
for (int i = 0; i < buttonListAttachments.size(); ++i)
|
||||||
|
{
|
||||||
buttonListAttachments[i]->updateToSlider();
|
buttonListAttachments[i]->updateToSlider();
|
||||||
}
|
}
|
||||||
|
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,7 +438,7 @@ void ObxdAudioProcessorEditor::mouseUp (const MouseEvent& e)
|
||||||
{
|
{
|
||||||
if (e.mods.isRightButtonDown() || e.mods.isCommandDown())
|
if (e.mods.isRightButtonDown() || e.mods.isCommandDown())
|
||||||
{
|
{
|
||||||
createMenu (e.getMouseDownScreenPosition());
|
resultFromMenu (e.getMouseDownScreenPosition());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,9 @@ private:
|
||||||
void placeLabel (int x, int y, String text);
|
void placeLabel (int x, int y, String text);
|
||||||
TooglableButton* addButton (int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name);
|
TooglableButton* addButton (int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name);
|
||||||
ButtonList* addList(int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name, Image img);
|
ButtonList* addList(int x, int y, int w, int h, ObxdAudioProcessor& filter, int parameter, String name, Image img);
|
||||||
void addMenu (int x, int y, int d, const Image&);
|
void addMenuButton (int x, int y, int d, const Image&);
|
||||||
void createMenu (const Point<int>);
|
void createMenu ();
|
||||||
|
void resultFromMenu (const Point<int>);
|
||||||
void clean();
|
void clean();
|
||||||
|
|
||||||
void rebuildComponents (ObxdAudioProcessor&);
|
void rebuildComponents (ObxdAudioProcessor&);
|
||||||
|
@ -137,6 +138,14 @@ private:
|
||||||
OwnedArray<ButtonList::ButtonListAttachment> buttonListAttachments;
|
OwnedArray<ButtonList::ButtonListAttachment> buttonListAttachments;
|
||||||
|
|
||||||
OwnedArray<ImageButton> imageButtons;
|
OwnedArray<ImageButton> imageButtons;
|
||||||
|
|
||||||
|
OwnedArray<PopupMenu> popupMenus;
|
||||||
|
|
||||||
|
int progStart;
|
||||||
|
int bankStart;
|
||||||
|
int skinStart;
|
||||||
|
Array<File> skins;
|
||||||
|
Array<File> banks;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PLUGINEDITOR_H_INCLUDED
|
#endif // PLUGINEDITOR_H_INCLUDED
|
||||||
|
|
|
@ -35,6 +35,8 @@ AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
|
||||||
|
|
||||||
for (int i = 0; i < PARAM_COUNT; ++i)
|
for (int i = 0; i < PARAM_COUNT; ++i)
|
||||||
{
|
{
|
||||||
|
if (i == 0) continue; // skip undefined
|
||||||
|
|
||||||
auto id = ObxdAudioProcessor::getEngineParameterId (i);
|
auto id = ObxdAudioProcessor::getEngineParameterId (i);
|
||||||
auto name = TRANS (id);
|
auto name = TRANS (id);
|
||||||
auto range = NormalisableRange<float> {0.0f, 1.0f};
|
auto range = NormalisableRange<float> {0.0f, 1.0f};
|
||||||
|
@ -75,19 +77,23 @@ ObxdAudioProcessor::ObxdAudioProcessor()
|
||||||
currentBank = "Init";
|
currentBank = "Init";
|
||||||
|
|
||||||
scanAndUpdateBanks();
|
scanAndUpdateBanks();
|
||||||
initAllParams();
|
scanAndUpdateSkins();
|
||||||
|
|
||||||
|
for (int i = 0; i < PARAM_COUNT; ++i)
|
||||||
|
{
|
||||||
|
if (i == 0) continue; // skip undefined
|
||||||
|
|
||||||
|
apvtState.addParameterListener (getEngineParameterId (i), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
apvtState.state = ValueTree (JucePlugin_Name);
|
||||||
|
|
||||||
if (bankFiles.size() > 0)
|
if (bankFiles.size() > 0)
|
||||||
{
|
{
|
||||||
loadFromFXBFile (bankFiles[0]);
|
loadFromFXBFile (bankFiles[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < PARAM_COUNT; ++i)
|
initAllParams();
|
||||||
{
|
|
||||||
apvtState.addParameterListener (getEngineParameterId (i), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
apvtState.state = ValueTree (JucePlugin_Name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ObxdAudioProcessor::~ObxdAudioProcessor()
|
ObxdAudioProcessor::~ObxdAudioProcessor()
|
||||||
|
@ -575,17 +581,35 @@ void ObxdAudioProcessor::scanAndUpdateBanks()
|
||||||
bankFiles.clearQuick();
|
bankFiles.clearQuick();
|
||||||
|
|
||||||
DirectoryIterator it (getBanksFolder(), false, "*.fxb", File::findFiles);
|
DirectoryIterator it (getBanksFolder(), false, "*.fxb", File::findFiles);
|
||||||
|
|
||||||
while (it.next())
|
while (it.next())
|
||||||
{
|
{
|
||||||
bankFiles.addUsingDefaultSort (it.getFile());
|
bankFiles.addUsingDefaultSort (it.getFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObxdAudioProcessor::scanAndUpdateSkins()
|
||||||
|
{
|
||||||
|
skinFiles.clearQuick();
|
||||||
|
DirectoryIterator it (getSkinFolder(), false, "*", File::findDirectories);
|
||||||
|
|
||||||
|
while (it.next())
|
||||||
|
{
|
||||||
|
skinFiles.addUsingDefaultSort (it.getFile());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const Array<File>& ObxdAudioProcessor::getBankFiles() const
|
const Array<File>& ObxdAudioProcessor::getBankFiles() const
|
||||||
{
|
{
|
||||||
return bankFiles;
|
return bankFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Array<File>& ObxdAudioProcessor::getSkinFiles() const
|
||||||
|
{
|
||||||
|
return skinFiles;
|
||||||
|
}
|
||||||
|
|
||||||
File ObxdAudioProcessor::getCurrentBankFile() const
|
File ObxdAudioProcessor::getCurrentBankFile() const
|
||||||
{
|
{
|
||||||
return getBanksFolder().getChildFile(currentBank);
|
return getBanksFolder().getChildFile(currentBank);
|
||||||
|
@ -742,7 +766,12 @@ void ObxdAudioProcessor::setEngineParameterValue (int index, float newValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
programs.currentProgramPtr->values[index] = newValue;
|
programs.currentProgramPtr->values[index] = newValue;
|
||||||
|
|
||||||
|
// Skip Undefined
|
||||||
|
if (index != 0)
|
||||||
|
{
|
||||||
apvtState.getParameter(getEngineParameterId(index))->setValue(newValue);
|
apvtState.getParameter(getEngineParameterId(index))->setValue(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch (index)
|
switch (index)
|
||||||
|
|
Loading…
Reference in a new issue