remove unused interfaces and data classes
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 13/04/2018.
|
||||
// Copyright (c) 2018 Birchlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#include "BankAndPreset.h"
|
||||
|
||||
BankAndPreset::BankAndPreset(int bank, int preset)
|
||||
: bank(bank),
|
||||
preset(preset)
|
||||
{}
|
||||
|
||||
int BankAndPreset::getBank() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
int BankAndPreset::getPreset() {
|
||||
return preset;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 13/04/2018.
|
||||
// Copyright (c) 2018 Birchlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
class BankAndPreset {
|
||||
public:
|
||||
BankAndPreset(int bank, int preset);
|
||||
|
||||
int getBank();
|
||||
int getPreset();
|
||||
|
||||
private:
|
||||
int bank;
|
||||
int preset;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (BankAndPreset)
|
||||
};
|
||||
|
@ -1,18 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 11/04/2018.
|
||||
// Copyright (c) 2018 Birchlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FilePickerFragment.h"
|
||||
#include "SlidersFragment.h"
|
||||
|
||||
class ExposesComponents {
|
||||
public:
|
||||
virtual ~ExposesComponents() {}
|
||||
|
||||
virtual FilePickerFragment& getFilePicker() = 0;
|
||||
virtual SlidersFragment& getSliders() = 0;
|
||||
|
||||
};
|
@ -6,10 +6,8 @@
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "FluidSynthModel.h"
|
||||
#include "FilePickerFragment.h"
|
||||
|
||||
class FilePicker: public Component,
|
||||
public FilePickerFragment,
|
||||
public ValueTree::Listener,
|
||||
private FilenameComponentListener
|
||||
{
|
||||
@ -23,7 +21,7 @@ public:
|
||||
void resized() override;
|
||||
void paint (Graphics& g) override;
|
||||
|
||||
virtual void setDisplayedFilePath(const String&) override;
|
||||
void setDisplayedFilePath(const String&);
|
||||
|
||||
|
||||
virtual void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged,
|
||||
|
@ -1,14 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 11/04/2018.
|
||||
// Copyright (c) 2018 Birchlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
class FilePickerFragment {
|
||||
public:
|
||||
virtual ~FilePickerFragment() {}
|
||||
|
||||
virtual void setDisplayedFilePath(const String&) = 0;
|
||||
};
|
@ -5,11 +5,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "SharesParams.h"
|
||||
#include <fluidsynth.h>
|
||||
#include <memory>
|
||||
#include "BankAndPreset.h"
|
||||
#include "PresetsToBanks.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -69,10 +66,6 @@ private:
|
||||
|
||||
float currentSampleRate;
|
||||
|
||||
fluid_preset_t* getFirstPreset();
|
||||
void selectFirstPreset();
|
||||
unique_ptr<BankAndPreset> getFirstBankAndPreset();
|
||||
|
||||
void unloadAndLoadFont(const String &absPath);
|
||||
void loadFont(const String &absPath);
|
||||
|
||||
|
@ -1,152 +0,0 @@
|
||||
//
|
||||
// Params.cpp
|
||||
// juicysfplugin - Shared Code
|
||||
//
|
||||
// Created by Alex Birch on 01/07/2019.
|
||||
// Copyright © 2019 Birchlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#include "Params.h"
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "MidiConstants.h"
|
||||
#include "GuiConstants.h"
|
||||
#include "SharesParams.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
Params::Params() noexcept
|
||||
// : uiWidth{GuiConstants::minWidth}
|
||||
// , uiHeight{GuiConstants::minHeight}
|
||||
: soundFontPath{String()}
|
||||
// , preset{-1}
|
||||
// , bank{-1}
|
||||
// , attack{0}
|
||||
// , decay{0}
|
||||
// , sustain{0}
|
||||
// , release{0}
|
||||
// , filterCutOff{0}
|
||||
// .filterResonance{0}
|
||||
{
|
||||
}
|
||||
|
||||
void Params::setAttributesOnXml(shared_ptr<XmlElement> xml) {
|
||||
// xml->setAttribute("uiWidth", uiWidth);
|
||||
// xml->setAttribute("uiHeight", uiHeight);
|
||||
xml->setAttribute("soundFontPath", soundFontPath);
|
||||
// xml.setAttribute("preset", preset);
|
||||
// xml.setAttribute("bank", bank);
|
||||
// xml.setAttribute("attack", attack);
|
||||
// xml.setAttribute("decay", decay);
|
||||
// xml.setAttribute("sustain", sustain);
|
||||
// xml.setAttribute("release", release);
|
||||
// xml.setAttribute("filterCutOff", filterCutOff);
|
||||
// xml.setAttribute("filterResonance", filterResonance);
|
||||
}
|
||||
|
||||
void Params::loadAttributesFromXml(shared_ptr<XmlElement> xmlState) {
|
||||
// uiWidth = jmin(jmax(xmlState->getIntAttribute("uiWidth", uiWidth), GuiConstants::minWidth), GuiConstants::maxWidth);
|
||||
// uiHeight = jmin(jmax(xmlState->getIntAttribute("uiHeight", uiHeight), GuiConstants::minHeight), GuiConstants::maxHeight);
|
||||
soundFontPath = xmlState->getStringAttribute("soundFontPath", soundFontPath);
|
||||
// preset = xmlState->getIntAttribute("preset", preset);
|
||||
// bank = xmlState->getIntAttribute("bank", bank);
|
||||
// attack = jmin(jmax(xmlState->getIntAttribute("attack", attack), MidiConstants::midiMinValue), MidiConstants::midiMaxValue);
|
||||
// decay = jmin(jmax(xmlState->getIntAttribute("decay", decay), MidiConstants::midiMinValue), MidiConstants::midiMaxValue);
|
||||
// sustain = jmin(jmax(xmlState->getIntAttribute("sustain", sustain), MidiConstants::midiMinValue), MidiConstants::midiMaxValue);
|
||||
// release = jmin(jmax(xmlState->getIntAttribute("release", release), MidiConstants::midiMinValue), MidiConstants::midiMaxValue);
|
||||
// filterCutOff = jmin(jmax(xmlState->getIntAttribute("filterCutOff", filterCutOff), MidiConstants::midiMinValue), MidiConstants::midiMaxValue);
|
||||
// filterResonance = jmin(jmax(xmlState->getIntAttribute("filterResonance", filterResonance), MidiConstants::midiMinValue), MidiConstants::midiMaxValue);
|
||||
}
|
||||
|
||||
//void Params::acceptMidiControlEvent(int controller, int value) {
|
||||
// switch(static_cast<fluid_midi_control_change>(controller)) {
|
||||
// case SOUND_CTRL2: // MIDI CC 71 Timbre/Harmonic Intensity (filter resonance)
|
||||
// filterResonance = value;
|
||||
// break;
|
||||
// case SOUND_CTRL3: // MIDI CC 72 Release time
|
||||
// release = value;
|
||||
// break;
|
||||
// case SOUND_CTRL4: // MIDI CC 73 Attack time
|
||||
// attack = value;
|
||||
// break;
|
||||
// case SOUND_CTRL5: // MIDI CC 74 Brightness (cutoff frequency, FILTERFC)
|
||||
// filterCutOff = value;
|
||||
// break;
|
||||
// case SOUND_CTRL6: // MIDI CC 75 Decay Time
|
||||
// decay = value;
|
||||
// break;
|
||||
// case SOUND_CTRL10: // MIDI CC 79 undefined
|
||||
// sustain = value;
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
|
||||
void Params::setSoundFontPath(const String& value) {
|
||||
soundFontPath = value;
|
||||
}
|
||||
|
||||
String& Params::getSoundFontPath() {
|
||||
return soundFontPath;
|
||||
}
|
||||
//int Params::getPreset() {
|
||||
// return preset;
|
||||
//}
|
||||
//int Params::getBank() {
|
||||
// return bank;
|
||||
//}
|
||||
// int Params::getUiWidth() {
|
||||
// return uiWidth;
|
||||
// }
|
||||
// int Params::getUiHeight() {
|
||||
// return uiHeight;
|
||||
// }
|
||||
//int Params::getAttack() {
|
||||
// return attack;
|
||||
//}
|
||||
//int Params::getDecay() {
|
||||
// return decay;
|
||||
//}
|
||||
//int Params::getSustain() {
|
||||
// return sustain;
|
||||
//}
|
||||
//int Params::getRelease() {
|
||||
// return release;
|
||||
//}
|
||||
//int Params::getFilterCutOff() {
|
||||
// return filterCutOff;
|
||||
//}
|
||||
//int Params::getFilterResonance() {
|
||||
// return filterResonance;
|
||||
//}
|
||||
|
||||
//void Params::setPreset(int value) {
|
||||
// preset = value;
|
||||
//}
|
||||
//void Params::setBank(int value) {
|
||||
// bank = value;
|
||||
//}
|
||||
// void Params::setUiWidth(int value) {
|
||||
// uiWidth = value;
|
||||
// }
|
||||
// void Params::setUiHeight(int value) {
|
||||
// uiHeight = value;
|
||||
// }
|
||||
//void Params::setAttack(int value) {
|
||||
// attack = value;
|
||||
//}
|
||||
//void Params::setDecay(int value) {
|
||||
// decay = value;
|
||||
//}
|
||||
//void Params::setSustain(int value) {
|
||||
// sustain = value;
|
||||
//}
|
||||
//void Params::setRelease(int value) {
|
||||
// release = value;
|
||||
//}
|
||||
//void Params::setFilterCutOff(int value) {
|
||||
// filterCutOff = value;
|
||||
//}
|
||||
//void Params::setFilterResonance(int value) {
|
||||
// filterResonance = value;
|
||||
//}
|
@ -1,59 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "SharesParams.h"
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Params: public SharesParams {
|
||||
public:
|
||||
Params() noexcept;
|
||||
|
||||
virtual void setAttributesOnXml(shared_ptr<XmlElement> xml) override;
|
||||
virtual void loadAttributesFromXml(shared_ptr<XmlElement> xmlState) override;
|
||||
// virtual void acceptMidiControlEvent(int controller, int value) override;
|
||||
|
||||
virtual void setSoundFontPath(const String& value) override;
|
||||
virtual String& getSoundFontPath() override;
|
||||
// virtual int getPreset() override;
|
||||
// virtual void setPreset(int value) override;
|
||||
// virtual int getBank() override;
|
||||
// virtual void setBank(int value) override;
|
||||
|
||||
// virtual int getUiWidth() override;
|
||||
// virtual void setUiWidth(int value) override;
|
||||
// virtual int getUiHeight() override;
|
||||
// virtual void setUiHeight(int value) override;
|
||||
|
||||
// virtual int getAttack() override;
|
||||
// virtual void setAttack(int value) override;
|
||||
// virtual int getDecay() override;
|
||||
// virtual void setDecay(int value) override;
|
||||
// virtual int getSustain() override;
|
||||
// virtual void setSustain(int value) override;
|
||||
// virtual int getRelease() override;
|
||||
// virtual void setRelease(int value) override;
|
||||
|
||||
// virtual int getFilterCutOff() override;
|
||||
// virtual void setFilterCutOff(int value) override;
|
||||
// virtual int getFilterResonance() override;
|
||||
// virtual void setFilterResonance(int value) override;
|
||||
|
||||
private:
|
||||
// int uiWidth;
|
||||
// int uiHeight;
|
||||
|
||||
String soundFontPath;
|
||||
// int preset;
|
||||
// int bank;
|
||||
|
||||
// int attack;
|
||||
// int decay;
|
||||
// int sustain;
|
||||
// int release;
|
||||
|
||||
// int filterCutOff;
|
||||
// int filterResonance;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Params)
|
||||
};
|
@ -11,7 +11,6 @@ using namespace std;
|
||||
class Pill
|
||||
: public Component
|
||||
, public Button::Listener
|
||||
// , public AudioProcessorValueTreeState::Listener
|
||||
{
|
||||
public:
|
||||
Pill(
|
||||
@ -28,10 +27,7 @@ public:
|
||||
void paint(Graphics& g) override;
|
||||
|
||||
void bankChanged(int bank);
|
||||
|
||||
// virtual void parameterChanged (const String& parameterID, float newValue) override;
|
||||
private:
|
||||
// void loadToggleState();
|
||||
|
||||
AudioProcessorValueTreeState& valueTreeState;
|
||||
int bank;
|
||||
@ -48,20 +44,9 @@ class Pills
|
||||
public:
|
||||
Pills(
|
||||
AudioProcessorValueTreeState& valueTreeState
|
||||
// string label
|
||||
// const vector<string> &items,
|
||||
// const function<void (int)> &onItemSelected,
|
||||
// const function<int (const string&)> &itemToIDMapper,
|
||||
// int initiallySelectedItem
|
||||
);
|
||||
~Pills();
|
||||
|
||||
// void setItems(
|
||||
// const vector<string> &items,
|
||||
// int initiallySelectedItem
|
||||
// );
|
||||
|
||||
// void buttonClicked (Button* button) override;
|
||||
|
||||
void cycle(bool right);
|
||||
|
||||
virtual void parameterChanged (const String& parameterID, float newValue) override;
|
||||
@ -81,17 +66,10 @@ private:
|
||||
void loadModelFrom(ValueTree& banks);
|
||||
|
||||
AudioProcessorValueTreeState& valueTreeState;
|
||||
// string label;
|
||||
// vector<string> items;
|
||||
// function<void (int)> onItemSelected;
|
||||
// function<int (const string&)> itemToIDMapper;
|
||||
|
||||
// OwnedArray<Pill> buttons;
|
||||
vector<unique_ptr<Pill>> pills;
|
||||
Button *selected;
|
||||
|
||||
// Pill* addToList (Pill* newButton);
|
||||
|
||||
void updatePillToggleStates();
|
||||
|
||||
void populate(int initiallySelectedItem);
|
||||
|
@ -19,7 +19,6 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor(
|
||||
: AudioProcessorEditor{&p}
|
||||
, processor{p}
|
||||
, valueTreeState{valueTreeState}
|
||||
// sharedParams{p.getSharedParams()},
|
||||
, midiKeyboard{p.keyboardState, SurjectiveMidiKeyboardComponent::horizontalKeyboard}
|
||||
, tablesComponent{valueTreeState}
|
||||
, filePicker{valueTreeState}
|
||||
@ -31,30 +30,6 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor(
|
||||
GuiConstants::minHeight,
|
||||
GuiConstants::maxWidth,
|
||||
GuiConstants::maxHeight);
|
||||
|
||||
// int width, height;
|
||||
// {
|
||||
// RangedAudioParameter *param {valueTreeState.getParameter("uiWidthPersist")};
|
||||
// jassert(dynamic_cast<AudioParameterInt*> (param) != nullptr);
|
||||
// AudioParameterInt* castParam {dynamic_cast<AudioParameterInt*> (param)};
|
||||
// width = castParam->get();
|
||||
// }
|
||||
// {
|
||||
// RangedAudioParameter *param {valueTreeState.getParameter("uiHeightPersist")};
|
||||
// jassert(dynamic_cast<AudioParameterInt*> (param) != nullptr);
|
||||
// AudioParameterInt* castParam {dynamic_cast<AudioParameterInt*> (param)};
|
||||
// height = castParam->get();
|
||||
// }
|
||||
|
||||
// valueTreeState.addParameterListener("uiWidthPersist", this);
|
||||
// valueTreeState.addParameterListener("uiHeightPersist", this);
|
||||
// valueTreeState.addParameterListener("uiWidth", this);
|
||||
// valueTreeState.addParameterListener("uiHeight", this);
|
||||
|
||||
// valueTreeState.state.addListener(this);
|
||||
|
||||
// setSize(GuiConstants::minWidth, GuiConstants::minHeight);
|
||||
// setSize(width, height);
|
||||
|
||||
lastUIWidth.referTo(valueTreeState.state.getChildWithName("uiState").getPropertyAsValue("width", nullptr));
|
||||
lastUIHeight.referTo(valueTreeState.state.getChildWithName("uiState").getPropertyAsValue("height", nullptr));
|
||||
@ -65,8 +40,6 @@ JuicySFAudioProcessorEditor::JuicySFAudioProcessorEditor(
|
||||
lastUIWidth.addListener(this);
|
||||
lastUIHeight.addListener(this);
|
||||
|
||||
// processor.subscribeToStateChanges(this);
|
||||
|
||||
midiKeyboard.setName ("MIDI Keyboard");
|
||||
|
||||
midiKeyboard.setWantsKeyboardFocus(false);
|
||||
@ -90,76 +63,14 @@ JuicySFAudioProcessorEditor::~JuicySFAudioProcessorEditor()
|
||||
{
|
||||
lastUIWidth.removeListener(this);
|
||||
lastUIHeight.removeListener(this);
|
||||
// valueTreeState.removeParameterListener("uiWidthPersist", this);
|
||||
// valueTreeState.removeParameterListener("uiHeightPersist", this);
|
||||
// valueTreeState.removeParameterListener("uiWidth", this);
|
||||
// valueTreeState.removeParameterListener("uiHeight", this);
|
||||
// valueTreeState.state.removeListener(this);
|
||||
// processor.unsubscribeFromStateChanges(this);
|
||||
}
|
||||
|
||||
// void JuicySFAudioProcessorEditor::valueTreePropertyChanged(ValueTree& treeWhosePropertyHasChanged,
|
||||
// const Identifier& property) {
|
||||
// // if (treeWhosePropertyHasChanged.getType() == Identifier("PARAM")) {
|
||||
// const String propertyString{property.toString()};
|
||||
// if (propertyString == "uiWidth") {
|
||||
// // String soundFontPath{treeWhosePropertyHasChanged.getProperty("soundFontPath", "")};
|
||||
// // if (soundFontPath.isNotEmpty()) {
|
||||
// // loadFont(soundFontPath);
|
||||
// // }
|
||||
// int value{treeWhosePropertyHasChanged.getProperty("uiWidth", GuiConstants::minWidth)};
|
||||
// setSize(value, getHeight());
|
||||
// } else if (propertyString == "uiHeight") {
|
||||
// int value{treeWhosePropertyHasChanged.getProperty("uiHeight", GuiConstants::minHeight)};
|
||||
// setSize(getWidth(), value);
|
||||
// }
|
||||
// // }
|
||||
// }
|
||||
|
||||
// void JuicySFAudioProcessorEditor::parameterChanged(const String& parameterID, float newValue) {
|
||||
// // if (parameterID == "uiWidthPersist"
|
||||
// // || parameterID == "uiHeightPersist") {
|
||||
// if (parameterID == "uiWidth"
|
||||
// || parameterID == "uiHeight") {
|
||||
// RangedAudioParameter *param {valueTreeState.getParameter(parameterID)};
|
||||
// jassert(dynamic_cast<AudioParameterInt*> (param) != nullptr);
|
||||
// AudioParameterInt* castParam {dynamic_cast<AudioParameterInt*> (param)};
|
||||
// int value{castParam->get()};
|
||||
// if (parameterID == "uiWidth") {
|
||||
// setSize(value, getHeight());
|
||||
// } else if (parameterID == "uiHeight") {
|
||||
// setSize(getWidth(), value);
|
||||
// }
|
||||
// // if (parameterID == "uiWidthPersist") {
|
||||
// // setSize(value, getHeight());
|
||||
// // } else if (parameterID == "uiHeightPersist") {
|
||||
// // setSize(getWidth(), value);
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
|
||||
//void JuicySFAudioProcessorEditor::getStateInformation (XmlElement& xml) {
|
||||
// // save
|
||||
// xml.setAttribute ("uiWidth", getWidth());
|
||||
// xml.setAttribute ("uiHeight", getHeight());
|
||||
//}
|
||||
//
|
||||
//void JuicySFAudioProcessorEditor::setStateInformation (XmlElement* xmlState) {
|
||||
// // load
|
||||
// setSize (xmlState->getIntAttribute ("uiWidth", getWidth()),
|
||||
// xmlState->getIntAttribute ("uiHeight", getHeight()));
|
||||
//}
|
||||
|
||||
//==============================================================================
|
||||
void JuicySFAudioProcessorEditor::paint (Graphics& g)
|
||||
{
|
||||
// (Our component is opaque, so we must completely fill the background with a solid colour)
|
||||
g.fillAll (getLookAndFeel().findColour (ResizableWindow::backgroundColourId));
|
||||
|
||||
// g.setColour (Colours::white);
|
||||
// g.setFont (15.0f);
|
||||
// g.drawFittedText ("Hello World!", getLocalBounds(), Justification::centred, 1);
|
||||
|
||||
if (!focusInitialized) {
|
||||
if (!hasKeyboardFocus(false) && isVisible()) {
|
||||
grabKeyboardFocus();
|
||||
@ -175,13 +86,9 @@ void JuicySFAudioProcessorEditor::resized()
|
||||
const int padding{8};
|
||||
const int pianoHeight{70};
|
||||
const int filePickerHeight{25};
|
||||
// const int slidersHeight{150};
|
||||
Rectangle<int> r{getLocalBounds()};
|
||||
filePicker.setBounds(r.removeFromTop(filePickerHeight + padding).reduced(padding, 0).withTrimmedTop(padding));
|
||||
|
||||
// Rectangle<int> r2 (getLocalBounds());
|
||||
// slidersComponent.setBounds(r2.removeFromLeft(filePickerWidth + padding).reduced(padding, 0).withTrimmedLeft(padding));
|
||||
|
||||
midiKeyboard.setBounds (r.removeFromBottom (pianoHeight).reduced(padding, 0));
|
||||
|
||||
Rectangle<int> rContent{r.reduced(0, padding)};
|
||||
@ -191,50 +98,9 @@ void JuicySFAudioProcessorEditor::resized()
|
||||
|
||||
lastUIWidth = getWidth();
|
||||
lastUIHeight = getHeight();
|
||||
|
||||
// valueTreeState.state.setPropertyExcludingListener(this, "uiWidth", getWidth(), nullptr);
|
||||
// valueTreeState.state.setPropertyExcludingListener(this, "uiHeight", getHeight(), nullptr);
|
||||
|
||||
// {
|
||||
// // RangedAudioParameter *param {valueTreeState.getParameter("uiWidthTemp")};
|
||||
// RangedAudioParameter *param {valueTreeState.getParameter("uiWidth")};
|
||||
// // param->setValueNotifyingHost(param->convertTo0to1(getWidth()));
|
||||
// jassert(dynamic_cast<AudioParameterInt*> (param) != nullptr);
|
||||
// AudioParameterInt* castParam {dynamic_cast<AudioParameterInt*> (param)};
|
||||
// *castParam = getWidth();
|
||||
// // castParam->AudioProcessorParameter::setValue(castParam->convertTo0to1(static_cast<float>(getWidth())));
|
||||
// }
|
||||
// {
|
||||
// // RangedAudioParameter *param {valueTreeState.getParameter("uiHeightTemp")};
|
||||
// RangedAudioParameter *param {valueTreeState.getParameter("uiHeight")};
|
||||
// // param->setValueNotifyingHost(param->convertTo0to1(getHeight()));
|
||||
// jassert(dynamic_cast<AudioParameterInt*> (param) != nullptr);
|
||||
// AudioParameterInt* castParam {dynamic_cast<AudioParameterInt*> (param)};
|
||||
// *castParam = getHeight();
|
||||
// // castParam->AudioProcessorParameter::setValue(castParam->convertTo0to1(static_cast<float>(getHeight())));
|
||||
// }
|
||||
|
||||
// sharedParams.setUiWidth(getWidth());
|
||||
// sharedParams.setUiHeight(getHeight());
|
||||
|
||||
// Rectangle<int> r2 (getLocalBounds());
|
||||
// r2.reduce(0, padding);
|
||||
// r2.removeFromBottom(pianoHeight);
|
||||
// r2.removeFromTop(filePickerHeight);
|
||||
// tablesComponent.setBounds (r2);
|
||||
//
|
||||
// Rectangle<int> r3 (getLocalBounds());
|
||||
// r3.removeFromTop(filePickerHeight);
|
||||
//
|
||||
// filePicker.setBounds(r3);
|
||||
}
|
||||
|
||||
bool JuicySFAudioProcessorEditor::keyPressed(const KeyPress &key) {
|
||||
// if (!hasKeyboardFocus(false))
|
||||
// return false;
|
||||
// if (key.getKeyCode() == KeyPress::upKey){
|
||||
// }
|
||||
// cout << "hey\n";
|
||||
const int cursorKeys[] = {
|
||||
KeyPress::leftKey,
|
||||
KeyPress::rightKey,
|
||||
@ -250,24 +116,9 @@ bool JuicySFAudioProcessorEditor::keyPressed(const KeyPress &key) {
|
||||
} else {
|
||||
return midiKeyboard.keyPressed(key);
|
||||
}
|
||||
// for(auto childComponent : getChildren()) {
|
||||
// if (childComponent->keyPressed(key)) return true;
|
||||
// }
|
||||
return false;
|
||||
}
|
||||
|
||||
bool JuicySFAudioProcessorEditor::keyStateChanged (bool isKeyDown) {
|
||||
return midiKeyboard.keyStateChanged(isKeyDown);
|
||||
// for(auto childComponent : getChildren()) {
|
||||
// if (childComponent->keyStateChanged(isKeyDown)) return true;
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
|
||||
//FilePickerFragment& JuicySFAudioProcessorEditor::getFilePicker() {
|
||||
// return filePicker;
|
||||
//}
|
||||
//
|
||||
//SlidersFragment& JuicySFAudioProcessorEditor::getSliders() {
|
||||
// return slidersComponent;
|
||||
//}
|
||||
|
@ -14,10 +14,7 @@
|
||||
#include "PluginProcessor.h"
|
||||
#include "TablesComponent.h"
|
||||
#include "SurjectiveMidiKeyboardComponent.h"
|
||||
#include "FilePickerFragment.h"
|
||||
#include "ExposesComponents.h"
|
||||
#include "FilePicker.h"
|
||||
#include "StateChangeSubscriber.h"
|
||||
#include "SlidersComponent.h"
|
||||
|
||||
//==============================================================================
|
||||
@ -25,12 +22,7 @@
|
||||
*/
|
||||
class JuicySFAudioProcessorEditor
|
||||
: public AudioProcessorEditor
|
||||
// , public AudioProcessorValueTreeState::Listener
|
||||
, private Value::Listener
|
||||
// , public ValueTree::Listener
|
||||
/*,
|
||||
, public ExposesComponents
|
||||
public StateChangeSubscriber*/
|
||||
{
|
||||
public:
|
||||
JuicySFAudioProcessorEditor(
|
||||
@ -46,28 +38,6 @@ public:
|
||||
bool keyPressed(const KeyPress &key) override;
|
||||
bool keyStateChanged (bool isKeyDown) override;
|
||||
|
||||
// void getStateInformation (XmlElement& xml) override;
|
||||
// void setStateInformation (XmlElement* xmlState) override;
|
||||
|
||||
// virtual FilePickerFragment& getFilePicker() override;
|
||||
// virtual SlidersFragment& getSliders() override;
|
||||
// virtual void parameterChanged (const String& parameterID, float newValue) override;
|
||||
|
||||
// int getWidth();
|
||||
// int getHeight();
|
||||
|
||||
// virtual void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged,
|
||||
// const Identifier& property) override;
|
||||
// inline virtual void valueTreeChildAdded (ValueTree& parentTree,
|
||||
// ValueTree& childWhichHasBeenAdded) override {};
|
||||
// inline virtual void valueTreeChildRemoved (ValueTree& parentTree,
|
||||
// ValueTree& childWhichHasBeenRemoved,
|
||||
// int indexFromWhichChildWasRemoved) override {};
|
||||
// inline virtual void valueTreeChildOrderChanged (ValueTree& parentTreeWhoseChildrenHaveMoved,
|
||||
// int oldIndex, int newIndex) override {};
|
||||
// inline virtual void valueTreeParentChanged (ValueTree& treeWhoseParentHasChanged) override {};
|
||||
// inline virtual void valueTreeRedirected (ValueTree& treeWhichHasBeenChanged) override {};
|
||||
|
||||
private:
|
||||
void valueChanged (Value&) override;
|
||||
|
||||
@ -76,7 +46,6 @@ private:
|
||||
JuicySFAudioProcessor& processor;
|
||||
|
||||
AudioProcessorValueTreeState& valueTreeState;
|
||||
// SharesParams& sharedParams;
|
||||
|
||||
// these are used to persist the UI's size - the values are stored along with the
|
||||
// filter's other parameters, and the UI component will update them when it gets
|
||||
|
@ -10,11 +10,8 @@
|
||||
|
||||
#include "PluginProcessor.h"
|
||||
#include "PluginEditor.h"
|
||||
#include "ExposesComponents.h"
|
||||
#include "MidiConstants.h"
|
||||
#include "Util.h"
|
||||
#include "SharesParams.h"
|
||||
#include "Params.h"
|
||||
#include "GuiConstants.h"
|
||||
|
||||
using namespace std;
|
||||
|
@ -12,9 +12,6 @@
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "FluidSynthModel.h"
|
||||
#include "StateChangeSubscriber.h"
|
||||
#include "SharesParams.h"
|
||||
#include "Params.h"
|
||||
#include <list>
|
||||
|
||||
using namespace std;
|
||||
|
@ -1,21 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 17/09/2017.
|
||||
//
|
||||
|
||||
#include "Preset.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
Preset::Preset(
|
||||
int preset,
|
||||
string name
|
||||
) : preset(preset),
|
||||
name(name) {}
|
||||
|
||||
int Preset::getPreset() {
|
||||
return preset;
|
||||
}
|
||||
|
||||
string Preset::getName() {
|
||||
return name;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 17/09/2017.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Preset {
|
||||
public:
|
||||
Preset(
|
||||
int preset,
|
||||
string name
|
||||
);
|
||||
|
||||
int getPreset();
|
||||
string getName();
|
||||
|
||||
private:
|
||||
int preset;
|
||||
string name;
|
||||
};
|
@ -1,10 +0,0 @@
|
||||
// http://www.synthfont.com/Tutorial6.html
|
||||
// a bank can hold many (128) presets
|
||||
// bank 128 is reserved for percussion
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Preset.h"
|
||||
#include <map>
|
||||
|
||||
typedef std::multimap<int, Preset> BanksToPresets;
|
@ -1,49 +0,0 @@
|
||||
//
|
||||
// Created by Alex Birch on 10/04/2018.
|
||||
// Copyright (c) 2018 Birchlabs. All rights reserved.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class SharesParams {
|
||||
public:
|
||||
virtual ~SharesParams() {}
|
||||
|
||||
virtual void setAttributesOnXml(shared_ptr<XmlElement> xml) = 0;
|
||||
virtual void loadAttributesFromXml(shared_ptr<XmlElement> xmlState) = 0;
|
||||
// virtual void acceptMidiControlEvent(int controller, int value) = 0;
|
||||
|
||||
virtual void setSoundFontPath(const String& value) = 0;
|
||||
virtual String& getSoundFontPath() = 0;
|
||||
// virtual int getPreset() = 0;
|
||||
// virtual void setPreset(int value) = 0;
|
||||
// virtual int getBank() = 0;
|
||||
// virtual void setBank(int value) = 0;
|
||||
|
||||
// virtual int getUiWidth() = 0;
|
||||
// virtual void setUiWidth(int value) = 0;
|
||||
// virtual int getUiHeight() = 0;
|
||||
// virtual void setUiHeight(int value) = 0;
|
||||
|
||||
// virtual int getAttack() = 0;
|
||||
// virtual void setAttack(int value) = 0;
|
||||
// virtual int getDecay() = 0;
|
||||
// virtual void setDecay(int value) = 0;
|
||||
// virtual int getSustain() = 0;
|
||||
// virtual void setSustain(int value) = 0;
|
||||
// virtual int getRelease() = 0;
|
||||
// virtual void setRelease(int value) = 0;
|
||||
|
||||
// virtual int getFilterCutOff() = 0;
|
||||
// virtual void setFilterCutOff(int value) = 0;
|
||||
// virtual int getFilterResonance() = 0;
|
||||
// virtual void setFilterResonance(int value) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "Util.h"
|
||||
using SliderAttachment = AudioProcessorValueTreeState::SliderAttachment;
|
||||
|
||||
std::function<void()> SlidersComponent::makeSliderListener(Slider& slider, int controller/*, std::function<void()> callback*/) {
|
||||
std::function<void()> SlidersComponent::makeSliderListener(Slider& slider, int controller) {
|
||||
return [this, controller, &slider]{
|
||||
|
||||
RangedAudioParameter *param {valueTreeState.getParameter("release")};
|
||||
@ -25,7 +25,6 @@ std::function<void()> SlidersComponent::makeSliderListener(Slider& slider, int c
|
||||
DEBUG_PRINT(s);
|
||||
// slider.setValue(slider.getValue(), NotificationType::dontSendNotification);
|
||||
fluidSynthModel.setControllerValue(controller, slider.getValue());
|
||||
// callback();
|
||||
};
|
||||
}
|
||||
|
||||
@ -95,30 +94,9 @@ void SlidersComponent::acceptMidiControlEvent(int controller, int value) {
|
||||
}
|
||||
}
|
||||
|
||||
// void SlidersComponent::updateAttackSlider(int value) {
|
||||
// attackSlider.setValue(value, NotificationType::dontSendNotification);
|
||||
// }
|
||||
// void SlidersComponent::updateDecaySlider(int value) {
|
||||
// decaySlider.setValue(value, NotificationType::dontSendNotification);
|
||||
// }
|
||||
// void SlidersComponent::updateSustainSlider(int value) {
|
||||
// sustainSlider.setValue(value, NotificationType::dontSendNotification);
|
||||
// }
|
||||
// void SlidersComponent::updateReleaseSlider(int value) {
|
||||
// releaseSlider.setValue(value, NotificationType::dontSendNotification);
|
||||
// }
|
||||
// void SlidersComponent::updateFilterCutOffSlider(int value) {
|
||||
// filterCutOffSlider.setValue(value, NotificationType::dontSendNotification);
|
||||
// }
|
||||
// void SlidersComponent::updateFilterResonanceSlider(int value) {
|
||||
// filterResonanceSlider.setValue(value, NotificationType::dontSendNotification);
|
||||
// }
|
||||
|
||||
SlidersComponent::SlidersComponent(
|
||||
// SharesParams& sharedParams,
|
||||
AudioProcessorValueTreeState& valueTreeState,
|
||||
FluidSynthModel& fluidSynthModel)
|
||||
// : sharedParams{sharedParams}
|
||||
: valueTreeState{valueTreeState}
|
||||
, fluidSynthModel{fluidSynthModel}
|
||||
, envelopeGroup{"envelopeGroup", "Envelope"}
|
||||
|
@ -2,18 +2,14 @@
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "FluidSynthModel.h"
|
||||
#include "SharesParams.h"
|
||||
#include "SlidersFragment.h"
|
||||
|
||||
using namespace std;
|
||||
using SliderAttachment = AudioProcessorValueTreeState::SliderAttachment;
|
||||
|
||||
class SlidersComponent : public Component,
|
||||
public SlidersFragment
|
||||
class SlidersComponent : public Component
|
||||
{
|
||||
public:
|
||||
SlidersComponent(
|
||||
// SharesParams& sharedParams,
|
||||
AudioProcessorValueTreeState& valueTreeState,
|
||||
FluidSynthModel& fluidSynthModel);
|
||||
~SlidersComponent();
|
||||
@ -22,20 +18,11 @@ public:
|
||||
|
||||
const int getDesiredWidth();
|
||||
|
||||
virtual void acceptMidiControlEvent(int controller, int value) override;
|
||||
|
||||
// virtual void updateAttackSlider(int value) override;
|
||||
// virtual void updateDecaySlider(int value) override;
|
||||
// virtual void updateSustainSlider(int value) override;
|
||||
// virtual void updateReleaseSlider(int value) override;
|
||||
|
||||
// virtual void updateFilterCutOffSlider(int value) override;
|
||||
// virtual void updateFilterResonanceSlider(int value) override;
|
||||
void acceptMidiControlEvent(int controller, int value);
|
||||
|
||||
private:
|
||||
std::function<void()> makeSliderListener(Slider& slider, int controller);
|
||||
|
||||
// SharesParams& sharedParams;
|
||||
AudioProcessorValueTreeState& valueTreeState;
|
||||
FluidSynthModel& fluidSynthModel;
|
||||
|
||||
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
|
||||
class SlidersFragment {
|
||||
public:
|
||||
virtual ~SlidersFragment() {}
|
||||
|
||||
virtual void acceptMidiControlEvent(int controller, int value) = 0;
|
||||
|
||||
// virtual void updateAttackSlider(int value) = 0;
|
||||
// virtual void updateDecaySlider(int value) = 0;
|
||||
// virtual void updateSustainSlider(int value) = 0;
|
||||
// virtual void updateReleaseSlider(int value) = 0;
|
||||
|
||||
// virtual void updateFilterCutOffSlider(int value) = 0;
|
||||
// virtual void updateFilterResonanceSlider(int value) = 0;
|
||||
};
|
@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "PresetsToBanks.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <map>
|
||||
@ -40,11 +39,6 @@ class TableComponent : public Component,
|
||||
public:
|
||||
TableComponent(
|
||||
AudioProcessorValueTreeState& valueTreeState
|
||||
// const vector<string> &columns,
|
||||
// const vector<TableRow> &rows,
|
||||
// const function<void (int)> &onRowSelected,
|
||||
// const function<int (const vector<string>&)> &rowToIDMapper,
|
||||
// int initiallySelectedRow
|
||||
);
|
||||
~TableComponent();
|
||||
|
||||
@ -74,8 +68,6 @@ public:
|
||||
|
||||
void resized() override;
|
||||
|
||||
// void setRows(const vector<TableRow>& rows, int initiallySelectedRow);
|
||||
|
||||
bool keyPressed(const KeyPress &key) override;
|
||||
|
||||
virtual void parameterChanged (const String& parameterID, float newValue) override;
|
||||
@ -92,7 +84,6 @@ public:
|
||||
inline virtual void valueTreeParentChanged (ValueTree& treeWhoseParentHasChanged) override {};
|
||||
inline virtual void valueTreeRedirected (ValueTree& treeWhichHasBeenChanged) override {};
|
||||
private:
|
||||
// void loadModelFrom(ValueTree& presets);
|
||||
void loadModelFrom(ValueTree& banks);
|
||||
void repopulateTable();
|
||||
void selectCurrentPreset();
|
||||
@ -105,12 +96,8 @@ private:
|
||||
typedef multimap<int, TableRow> BanksToPresets;
|
||||
BanksToPresets banksToPresets;
|
||||
|
||||
// vector<string> columns;
|
||||
vector<TableRow> rows;
|
||||
|
||||
// function<void (int)> onRowSelected;
|
||||
// function<int (const vector<string>&)> rowToIDMapper;
|
||||
|
||||
// A comparator used to sort our data when the user clicks a column header
|
||||
class DataSorter {
|
||||
public:
|
||||
|
@ -9,153 +9,19 @@ using namespace placeholders;
|
||||
|
||||
TablesComponent::TablesComponent(
|
||||
AudioProcessorValueTreeState& valueTreeState
|
||||
// FluidSynthModel& fluidSynthModel
|
||||
)
|
||||
: valueTreeState{valueTreeState}
|
||||
// , fluidSynthModel{fluidSynthModel}
|
||||
, banks{valueTreeState}
|
||||
, presetTable{valueTreeState}
|
||||
// , banksToPresets{fluidSynthModel.getBanks()}
|
||||
// , initialised{false}
|
||||
{
|
||||
// fluid_preset_t* currentPreset = getCurrentPreset();
|
||||
// selectedBank = -1;
|
||||
// int selectedPreset = -1;
|
||||
|
||||
|
||||
|
||||
// if (currentPreset != nullptr) {
|
||||
// selectedBank = fluid_preset_get_banknum(currentPreset);
|
||||
// selectedPreset = fluid_preset_get_num(currentPreset);
|
||||
// }
|
||||
|
||||
// auto rowToPresetMapper = [this](const vector<string> &row) {
|
||||
// return stoi(row[0]);
|
||||
// };
|
||||
// auto itemToBankMapper = [](const string &item) {
|
||||
// return stoi(item);
|
||||
// };
|
||||
|
||||
// presetTable = new TableComponent(
|
||||
// valueTreeState,
|
||||
// // {"#", "Name"},
|
||||
// // mapPresets(
|
||||
// // banksToPresets,
|
||||
// // selectedBank
|
||||
// // ),
|
||||
// // [this](int preset){
|
||||
// // this->onPresetSelected(preset);
|
||||
// // },
|
||||
// // rowToPresetMapper,
|
||||
// // presetToIndexMapper(selectedPreset)
|
||||
// );
|
||||
// banks = new Pills(
|
||||
// "Banks",
|
||||
// mapBanks(banksToPresets),
|
||||
// [this](int bank){
|
||||
// this->onBankSelected(bank);
|
||||
// },
|
||||
// itemToBankMapper,
|
||||
// selectedBank
|
||||
// );
|
||||
|
||||
presetTable.setWantsKeyboardFocus(false);
|
||||
|
||||
addAndMakeVisible(presetTable);
|
||||
|
||||
addAndMakeVisible(banks);
|
||||
|
||||
// initialised = true;
|
||||
|
||||
// fluidSynthModel.addListener(this);
|
||||
}
|
||||
|
||||
// fluid_preset_t* TablesComponent::getCurrentPreset() {
|
||||
// shared_ptr<fluid_synth_t> synth {fluidSynthModel.getSynth()};
|
||||
|
||||
// return fluid_synth_get_channel_preset(synth.get(), fluidSynthModel.getChannel());
|
||||
// }
|
||||
|
||||
// Preset TablesComponent::getFirstPresetInBank(int bank) {
|
||||
// pair<BanksToPresets::const_iterator, BanksToPresets::const_iterator> iterators = banksToPresets.equal_range(bank);
|
||||
// BanksToPresets::const_iterator it = iterators.first;
|
||||
// return it->second;
|
||||
// }
|
||||
|
||||
// void TablesComponent::onBankSelected(int bank) {
|
||||
// if (!initialised || bank == -1) {
|
||||
// return;
|
||||
// }
|
||||
// cout << "Bank " << bank << endl;
|
||||
// selectedBank = bank;
|
||||
// Preset firstPresetInBank = getFirstPresetInBank(bank);
|
||||
// presetTable->setRows(
|
||||
// mapPresets(
|
||||
// banksToPresets,
|
||||
// bank
|
||||
// ),
|
||||
// presetToIndexMapper(firstPresetInBank.getPreset())
|
||||
// );
|
||||
// }
|
||||
|
||||
// int TablesComponent::presetToIndexMapper(int preset) {
|
||||
// int ix = 0;
|
||||
// pair<BanksToPresets::const_iterator, BanksToPresets::const_iterator> iterators = this->banksToPresets.equal_range(this->selectedBank);
|
||||
// for (auto it = iterators.first; it != iterators.second; ++it, ix++) {
|
||||
// Preset b = it->second;
|
||||
// if (preset == b.getPreset()) {
|
||||
// return ix;
|
||||
// }
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
// void TablesComponent::onPresetSelected(int preset) {
|
||||
// if (!initialised || preset == -1) {
|
||||
// return;
|
||||
// }
|
||||
// cout << "Preset " << preset << endl;
|
||||
// // selectedPreset = preset;
|
||||
// fluidSynthModel.changePreset(selectedBank, preset);
|
||||
// }
|
||||
|
||||
// TablesComponent::~TablesComponent() {
|
||||
// delete presetTable;
|
||||
// delete banks;
|
||||
// // fluidSynthModel.removeListener(this);
|
||||
// }
|
||||
|
||||
// vector<string> TablesComponent::mapBanks(const BanksToPresets &banksToPresets) {
|
||||
// vector<string> rows;
|
||||
|
||||
// const auto compareKey = [](const BanksToPresets::value_type& lhs, const BanksToPresets::value_type& rhs) {
|
||||
// return lhs.first < rhs.first;
|
||||
// };
|
||||
|
||||
// for(auto i = banksToPresets.begin(); i != banksToPresets.end(); i = std::upper_bound(i, banksToPresets.end(), *i, compareKey)) {
|
||||
// rows.push_back(to_string(i->first));
|
||||
// }
|
||||
|
||||
// return rows;
|
||||
// }
|
||||
|
||||
|
||||
// vector<vector<string>> TablesComponent::mapPresets(const BanksToPresets &banksToPresets, int bank) {
|
||||
// vector<vector<string>> rows;
|
||||
|
||||
// pair<BanksToPresets::const_iterator, BanksToPresets::const_iterator> iterators = banksToPresets.equal_range(bank);
|
||||
// for (auto it = iterators.first; it != iterators.second; ++it) {
|
||||
// Preset b = it->second;
|
||||
// vector<string> row;
|
||||
// row.push_back(to_string(b.getPreset()));
|
||||
// row.push_back(b.getName());
|
||||
|
||||
// rows.push_back(row);
|
||||
// }
|
||||
|
||||
// return rows;
|
||||
// }
|
||||
|
||||
void TablesComponent::resized() {
|
||||
Rectangle<int> r (getLocalBounds());
|
||||
banks.setBounds (r.removeFromTop(27).reduced(5,0));
|
||||
@ -171,25 +37,3 @@ bool TablesComponent::keyPressed(const KeyPress &key) {
|
||||
}
|
||||
return presetTable.keyPressed(key);
|
||||
}
|
||||
|
||||
// void TablesComponent::fontChanged(FluidSynthModel *, const String &) {
|
||||
// banksToPresets = fluidSynthModel.getBanks();
|
||||
|
||||
// fluid_preset_t* currentPreset = getCurrentPreset();
|
||||
|
||||
// selectedBank = fluid_preset_get_banknum(currentPreset);
|
||||
// int selectedPreset = fluid_preset_get_num(currentPreset);
|
||||
|
||||
// presetTable->setRows(
|
||||
// mapPresets(
|
||||
// banksToPresets,
|
||||
// selectedBank
|
||||
// ),
|
||||
// presetToIndexMapper(selectedPreset)
|
||||
// );
|
||||
|
||||
// banks->setItems(
|
||||
// mapBanks(banksToPresets),
|
||||
// selectedBank
|
||||
// );
|
||||
// }
|
||||
|
@ -7,50 +7,28 @@
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "Pills.h"
|
||||
#include "TableComponent.h"
|
||||
#include "Preset.h"
|
||||
#include "PresetsToBanks.h"
|
||||
#include "FluidSynthModel.h"
|
||||
#include <memory>
|
||||
#include <fluidsynth.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class TablesComponent : public Component/*,
|
||||
public FluidSynthModel::Listener */
|
||||
class TablesComponent : public Component
|
||||
{
|
||||
public:
|
||||
TablesComponent(
|
||||
AudioProcessorValueTreeState& valueTreeState
|
||||
// FluidSynthModel& fluidSynthModel
|
||||
);
|
||||
// ~TablesComponent();
|
||||
|
||||
void resized() override;
|
||||
|
||||
bool keyPressed(const KeyPress &key) override;
|
||||
// void fontChanged(FluidSynthModel *, const String &) override;
|
||||
|
||||
private:
|
||||
AudioProcessorValueTreeState& valueTreeState;
|
||||
// FluidSynthModel& fluidSynthModel;
|
||||
// int selectedBank;
|
||||
|
||||
Pills banks;
|
||||
TableComponent presetTable;
|
||||
|
||||
// BanksToPresets banksToPresets;
|
||||
|
||||
// static vector<vector<string>> mapPresets(const BanksToPresets &banksToPresets, int bank);
|
||||
// static vector<string> mapBanks(const BanksToPresets &banksToPresets);
|
||||
|
||||
// void onBankSelected(int bank);
|
||||
// void onPresetSelected(int preset);
|
||||
// int presetToIndexMapper(int preset);
|
||||
|
||||
// fluid_preset_t* getCurrentPreset();
|
||||
// Preset getFirstPresetInBank(int bank);
|
||||
|
||||
// bool initialised;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TablesComponent)
|
||||
};
|
||||
|
Reference in New Issue
Block a user