remove unused interfaces and data classes

This commit is contained in:
Alex Birch 2019-07-28 23:17:19 +01:00
parent cdf6f89019
commit 84caf499b0
No known key found for this signature in database
GPG Key ID: 305EB1F98D44ACBA
24 changed files with 6 additions and 884 deletions

View File

@ -33,7 +33,6 @@
21AC354419419A4D80ADE43A /* include_juce_audio_plugin_client_AU_2.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E47C0A828016F7D0D63C0D6 /* include_juce_audio_plugin_client_AU_2.mm */; };
2918F46AFD2AB89F9FA847DC /* include_juce_events.mm in Sources */ = {isa = PBXBuildFile; fileRef = 373EF982A53046CE00BECE68 /* include_juce_events.mm */; };
2E77C6FAF1BCDB9EB29D20B9 /* PluginProcessor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D53CAB963D5051C786D3A52D /* PluginProcessor.cpp */; };
35099D9322CAA87D00CD4523 /* Params.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 35099D9122CAA87D00CD4523 /* Params.cpp */; };
358E458C22BEE5090087ED8D /* RecentFilesMenuTemplate.nib in Resources */ = {isa = PBXBuildFile; fileRef = 78CC5234CCFE3B170585DDAD /* RecentFilesMenuTemplate.nib */; };
358E458D22BEE5090087ED8D /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1616112041466F7324D7E19 /* Accelerate.framework */; };
358E458E22BEE5090087ED8D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28CA077CDD21D0FEC66FC290 /* AudioToolbox.framework */; };
@ -123,7 +122,6 @@
8502F736BECFB9CB752AC72F /* Pills.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2C62C3F0621604CDB65B55A6 /* Pills.cpp */; };
85E6C3826F86B1258C407725 /* FluidSynthModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DA25104C95E55D1822BFFBE2 /* FluidSynthModel.cpp */; };
909EB835CB55BF0B86B4BD93 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26949DA45B5FE0F3A0355733 /* CoreMIDI.framework */; };
9AF2F3DE22C71A7F465B2EAD /* BankAndPreset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECFA95359BC1DDDD1CC86C3 /* BankAndPreset.cpp */; };
9C107CE4B586E4B097D9D04E /* SurjectiveMidiKeyboardComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4119A8200AC54674C00EFE66 /* SurjectiveMidiKeyboardComponent.cpp */; };
9C2580F953071AD611EB6166 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28CA077CDD21D0FEC66FC290 /* AudioToolbox.framework */; };
AC5E4EF988D864A298E3650D /* TablesComponent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0DD5458189C039F5A4FAD62D /* TablesComponent.cpp */; };
@ -139,7 +137,6 @@
CB8F898ACB35575C1695E223 /* include_juce_gui_basics.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5276945E14F83CA02C05B41 /* include_juce_gui_basics.mm */; };
DB7F85571650636DB9ECE092 /* include_juce_audio_plugin_client_AU.r in Rez */ = {isa = PBXBuildFile; fileRef = 5704CA923F677280C02D97C6 /* include_juce_audio_plugin_client_AU.r */; };
DDF28AD28F639A561292FE28 /* include_juce_core.mm in Sources */ = {isa = PBXBuildFile; fileRef = F69B741A63932433977CFCD8 /* include_juce_core.mm */; };
DF84F5E7E386AF7A38854939 /* Preset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59F9FEC807012C10B8A1FA07 /* Preset.cpp */; };
E08B3A2AF85F9FCF991F1CA2 /* include_juce_audio_basics.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13E201F5B25AC078DB396A9C /* include_juce_audio_basics.mm */; };
FDAB0F06D8758FF0407BB851 /* include_juce_data_structures.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2C66D01D1DD9006E77E2E260 /* include_juce_data_structures.mm */; };
FE0869D2DF902682B6E4C925 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C481A535CF8A4CBC3E594003 /* WebKit.framework */; };
@ -284,11 +281,7 @@
2C66D01D1DD9006E77E2E260 /* include_juce_data_structures.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_data_structures.mm; path = ../../JuceLibraryCode/include_juce_data_structures.mm; sourceTree = SOURCE_ROOT; };
307CB49DF900DE4A612FF98E /* FluidSynthModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FluidSynthModel.h; path = ../../Source/FluidSynthModel.h; sourceTree = SOURCE_ROOT; };
35099D9022CA8EF500CD4523 /* Util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Util.h; path = ../../Source/Util.h; sourceTree = "<group>"; };
35099D9122CAA87D00CD4523 /* Params.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Params.cpp; path = ../../Source/Params.cpp; sourceTree = "<group>"; };
35099D9222CAA87D00CD4523 /* Params.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Params.h; path = ../../Source/Params.h; sourceTree = "<group>"; };
35099D9422CAB0A400CD4523 /* GuiConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GuiConstants.h; path = ../../Source/GuiConstants.h; sourceTree = "<group>"; };
35099D9522CAB7CD00CD4523 /* SlidersFragment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SlidersFragment.h; path = ../../Source/SlidersFragment.h; sourceTree = "<group>"; };
35099D9622CAC3C800CD4523 /* SharesParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharesParams.h; path = ../../Source/SharesParams.h; sourceTree = "<group>"; };
35880F58CB540AD30D1B0ED3 /* TablesComponent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TablesComponent.h; path = ../../Source/TablesComponent.h; sourceTree = SOURCE_ROOT; };
358E45B422BEE53A0087ED8D /* libpcre.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libpcre.1.dylib; sourceTree = "<group>"; };
358E45B522BEE53A0087ED8D /* libvorbisenc.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libvorbisenc.2.dylib; sourceTree = "<group>"; };
@ -316,12 +309,10 @@
5704CA923F677280C02D97C6 /* include_juce_audio_plugin_client_AU.r */ = {isa = PBXFileReference; lastKnownFileType = file.r; name = include_juce_audio_plugin_client_AU.r; path = ../../JuceLibraryCode/include_juce_audio_plugin_client_AU.r; sourceTree = SOURCE_ROOT; };
576A01FC6A3620A39BD1BDEE /* MyColours.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MyColours.h; path = ../../Source/MyColours.h; sourceTree = SOURCE_ROOT; };
5896415135C635B1EB2DC202 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
59F9FEC807012C10B8A1FA07 /* Preset.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Preset.cpp; path = ../../Source/Preset.cpp; sourceTree = SOURCE_ROOT; };
5A57BEB8628C7AE62ED1039F /* include_juce_audio_plugin_client_AU_1.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_audio_plugin_client_AU_1.mm; path = ../../JuceLibraryCode/include_juce_audio_plugin_client_AU_1.mm; sourceTree = SOURCE_ROOT; };
60ADEC8B20DC559737F84180 /* juce_gui_basics */ = {isa = PBXFileReference; lastKnownFileType = folder; name = juce_gui_basics; path = /Applications/JUCE/modules/juce_gui_basics; sourceTree = "<absolute>"; };
663ACFA11DCEC0D411B8497E /* juicysfplugin.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = juicysfplugin.entitlements; sourceTree = SOURCE_ROOT; };
6714B050717A7500EE7AE867 /* include_juce_audio_plugin_client_VST2.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = include_juce_audio_plugin_client_VST2.cpp; path = ../../JuceLibraryCode/include_juce_audio_plugin_client_VST2.cpp; sourceTree = SOURCE_ROOT; };
69DB3A0FB3D21F87D1E4B0C1 /* PresetsToBanks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PresetsToBanks.h; path = ../../Source/PresetsToBanks.h; sourceTree = SOURCE_ROOT; };
6A7F287E4159FA5167131D2B /* juce_audio_processors */ = {isa = PBXFileReference; lastKnownFileType = folder; name = juce_audio_processors; path = /Applications/JUCE/modules/juce_audio_processors; sourceTree = "<absolute>"; };
6C5DCE19B6DC0EF5BA12F99C /* juicysfplugin.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = juicysfplugin.app; sourceTree = BUILT_PRODUCTS_DIR; };
6D94DCB335360BDC7B3673BF /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@ -333,7 +324,6 @@
7C699A8B65F3F9FB5004F22D /* juce_gui_extra */ = {isa = PBXFileReference; lastKnownFileType = folder; name = juce_gui_extra; path = /Applications/JUCE/modules/juce_gui_extra; sourceTree = "<absolute>"; };
7D2457AD994644752178FC82 /* include_juce_audio_plugin_client_VST_utils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_audio_plugin_client_VST_utils.mm; path = ../../JuceLibraryCode/include_juce_audio_plugin_client_VST_utils.mm; sourceTree = SOURCE_ROOT; };
7E47C0A828016F7D0D63C0D6 /* include_juce_audio_plugin_client_AU_2.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_audio_plugin_client_AU_2.mm; path = ../../JuceLibraryCode/include_juce_audio_plugin_client_AU_2.mm; sourceTree = SOURCE_ROOT; };
88ADEBF51BD04FEA9422D276 /* FilePickerFragment.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FilePickerFragment.h; path = ../../Source/FilePickerFragment.h; sourceTree = SOURCE_ROOT; };
8990F3EAFFBBD6A42247C663 /* PluginEditor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PluginEditor.h; path = ../../Source/PluginEditor.h; sourceTree = SOURCE_ROOT; };
910F2E433646EE260D61A91B /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
91B7A726C6FDDEE3F364ED99 /* juce_events */ = {isa = PBXFileReference; lastKnownFileType = folder; name = juce_events; path = /Applications/JUCE/modules/juce_events; sourceTree = "<absolute>"; };
@ -342,8 +332,6 @@
A67D09546C4E4831438F7DBD /* CoreAudioKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudioKit.framework; path = System/Library/Frameworks/CoreAudioKit.framework; sourceTree = SDKROOT; };
A6BC2528C1717DDC2B66215E /* include_juce_graphics.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_graphics.mm; path = ../../JuceLibraryCode/include_juce_graphics.mm; sourceTree = SOURCE_ROOT; };
ADC93C26314F163B963461E2 /* include_juce_audio_utils.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_audio_utils.mm; path = ../../JuceLibraryCode/include_juce_audio_utils.mm; sourceTree = SOURCE_ROOT; };
AE397302E7E3F3A14A0C5F3C /* Preset.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Preset.h; path = ../../Source/Preset.h; sourceTree = SOURCE_ROOT; };
B000E7A360C0C86ADD3C911D /* BankAndPreset.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BankAndPreset.h; path = ../../Source/BankAndPreset.h; sourceTree = SOURCE_ROOT; };
B6D37AD919F9E83688578941 /* SurjectiveMidiKeyboardComponent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SurjectiveMidiKeyboardComponent.h; path = ../../Source/SurjectiveMidiKeyboardComponent.h; sourceTree = SOURCE_ROOT; };
BFB39134DE6876F9005CFA61 /* Pills.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Pills.h; path = ../../Source/Pills.h; sourceTree = SOURCE_ROOT; };
BFF57868318157F12F087F07 /* Info-AU.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-AU.plist"; sourceTree = SOURCE_ROOT; };
@ -356,10 +344,8 @@
D11295BAED9825695A4DEAB8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
D53CAB963D5051C786D3A52D /* PluginProcessor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = PluginProcessor.cpp; path = ../../Source/PluginProcessor.cpp; sourceTree = SOURCE_ROOT; };
DA25104C95E55D1822BFFBE2 /* FluidSynthModel.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = FluidSynthModel.cpp; path = ../../Source/FluidSynthModel.cpp; sourceTree = SOURCE_ROOT; };
DECFA95359BC1DDDD1CC86C3 /* BankAndPreset.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = BankAndPreset.cpp; path = ../../Source/BankAndPreset.cpp; sourceTree = SOURCE_ROOT; };
E4F84AFD6C449D10FDB5DB14 /* include_juce_audio_plugin_client_VST3.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = include_juce_audio_plugin_client_VST3.cpp; path = ../../JuceLibraryCode/include_juce_audio_plugin_client_VST3.cpp; sourceTree = SOURCE_ROOT; };
E89ECA468FF133B4677F8327 /* juicysfplugin.vst */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = juicysfplugin.vst; sourceTree = BUILT_PRODUCTS_DIR; };
F1EB35E262DC717222E2F93D /* ExposesComponents.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ExposesComponents.h; path = ../../Source/ExposesComponents.h; sourceTree = SOURCE_ROOT; };
F5276945E14F83CA02C05B41 /* include_juce_gui_basics.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_gui_basics.mm; path = ../../JuceLibraryCode/include_juce_gui_basics.mm; sourceTree = SOURCE_ROOT; };
F69B741A63932433977CFCD8 /* include_juce_core.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = include_juce_core.mm; path = ../../JuceLibraryCode/include_juce_core.mm; sourceTree = SOURCE_ROOT; };
FE960C7D2CFA204401860C13 /* juce_audio_formats */ = {isa = PBXFileReference; lastKnownFileType = folder; name = juce_audio_formats; path = /Applications/JUCE/modules/juce_audio_formats; sourceTree = "<absolute>"; };
@ -521,11 +507,6 @@
403EB0CF49CF1D62BF359002 /* Source */ = {
isa = PBXGroup;
children = (
35099D9622CAC3C800CD4523 /* SharesParams.h */,
DECFA95359BC1DDDD1CC86C3 /* BankAndPreset.cpp */,
B000E7A360C0C86ADD3C911D /* BankAndPreset.h */,
F1EB35E262DC717222E2F93D /* ExposesComponents.h */,
88ADEBF51BD04FEA9422D276 /* FilePickerFragment.h */,
C13A2FEAA636713EC7A905AF /* FilePicker.cpp */,
21828DE4341668D7E383F10A /* FilePicker.h */,
DA25104C95E55D1822BFFBE2 /* FluidSynthModel.cpp */,
@ -534,9 +515,6 @@
576A01FC6A3620A39BD1BDEE /* MyColours.h */,
2C62C3F0621604CDB65B55A6 /* Pills.cpp */,
BFB39134DE6876F9005CFA61 /* Pills.h */,
59F9FEC807012C10B8A1FA07 /* Preset.cpp */,
AE397302E7E3F3A14A0C5F3C /* Preset.h */,
69DB3A0FB3D21F87D1E4B0C1 /* PresetsToBanks.h */,
4119A8200AC54674C00EFE66 /* SurjectiveMidiKeyboardComponent.cpp */,
B6D37AD919F9E83688578941 /* SurjectiveMidiKeyboardComponent.h */,
CE8C41308A31A71A1177D0D5 /* TableComponent.cpp */,
@ -551,10 +529,7 @@
358E45F922C80DCA0087ED8D /* SlidersComponent.cpp */,
358E45FA22C80DCA0087ED8D /* SlidersComponent.h */,
35099D9022CA8EF500CD4523 /* Util.h */,
35099D9122CAA87D00CD4523 /* Params.cpp */,
35099D9222CAA87D00CD4523 /* Params.h */,
35099D9422CAB0A400CD4523 /* GuiConstants.h */,
35099D9522CAB7CD00CD4523 /* SlidersFragment.h */,
);
name = Source;
sourceTree = "<group>";
@ -937,12 +912,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9AF2F3DE22C71A7F465B2EAD /* BankAndPreset.cpp in Sources */,
598516649859A6D6BB2856EF /* FilePicker.cpp in Sources */,
85E6C3826F86B1258C407725 /* FluidSynthModel.cpp in Sources */,
BFD9EF2D67067FC1E5BA3546 /* MyColours.cpp in Sources */,
8502F736BECFB9CB752AC72F /* Pills.cpp in Sources */,
DF84F5E7E386AF7A38854939 /* Preset.cpp in Sources */,
9C107CE4B586E4B097D9D04E /* SurjectiveMidiKeyboardComponent.cpp in Sources */,
4AE057561AEA78489D9E50F0 /* TableComponent.cpp in Sources */,
AC5E4EF988D864A298E3650D /* TablesComponent.cpp in Sources */,
@ -950,7 +923,6 @@
7DF73014FFCCE46E228216DB /* PluginEditor.cpp in Sources */,
E08B3A2AF85F9FCF991F1CA2 /* include_juce_audio_basics.mm in Sources */,
C4D76C968347E2ACBAB5B6E7 /* include_juce_audio_devices.mm in Sources */,
35099D9322CAA87D00CD4523 /* Params.cpp in Sources */,
51C9DBCA840E334DB1804133 /* include_juce_audio_formats.mm in Sources */,
358E45FB22C80DCA0087ED8D /* SlidersComponent.cpp in Sources */,
5E5B833BBDD65F0D4271CA52 /* include_juce_audio_plugin_client_utils.cpp in Sources */,

View File

@ -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;
}

View File

@ -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)
};

View File

@ -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;
};

View File

@ -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,

View File

@ -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;
};

View File

@ -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);

View File

@ -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;
//}

View File

@ -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)
};

View File

@ -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);

View File

@ -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;
//}

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
};

View File

@ -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;

View File

@ -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;
};

View File

@ -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"}

View File

@ -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;

View File

@ -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;
};

View File

@ -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:

View File

@ -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
// );
// }

View File

@ -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)
};