Skip to content

Commit

Permalink
Merge pull request #7 from Birch-san/save_load_CC
Browse files Browse the repository at this point in the history
Rewrite everything
  • Loading branch information
Birch-san authored Jul 30, 2019
2 parents 758dda4 + 21caa98 commit 5989267
Show file tree
Hide file tree
Showing 38 changed files with 1,328 additions and 1,332 deletions.
32 changes: 2 additions & 30 deletions Builds/MacOSX/juicysfplugin.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "345302E3C02BBFCDACE98BE7"
BuildableName = "juicysfplugin.component"
BlueprintName = "juicysfplugin - AU"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "/Applications/JUCE/extras/AudioPluginHost/Builds/MacOSX/build/Debug/AudioPluginHost.app">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "345302E3C02BBFCDACE98BE7"
BuildableName = "juicysfplugin.component"
BlueprintName = "juicysfplugin - AU"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "345302E3C02BBFCDACE98BE7"
BuildableName = "juicysfplugin.component"
BlueprintName = "juicysfplugin - AU"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "/Applications/JUCE/extras/AudioPluginHost/Builds/MacOSX/build/Debug/AudioPluginHost.app">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "24C399ED93EC47D5BEB26F76"
BuildableName = "juicysfplugin.app"
BlueprintName = "juicysfplugin - Standalone Plugin"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "48A570326AA09CE818BE1901"
BuildableName = "juicysfplugin.vst"
BlueprintName = "juicysfplugin - VST"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "/Applications/JUCE/extras/AudioPluginHost/Builds/MacOSX/build/Debug/AudioPluginHost.app">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "48A570326AA09CE818BE1901"
BuildableName = "juicysfplugin.vst"
BlueprintName = "juicysfplugin - VST"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "48A570326AA09CE818BE1901"
BuildableName = "juicysfplugin.vst"
BlueprintName = "juicysfplugin - VST"
ReferencedContainer = "container:juicysfplugin.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
BundleIdentifier = "com.roli.juce.pluginhost"
FilePath = "/Applications/JUCE/extras/AudioPluginHost/Builds/MacOSX/build/Debug/AudioPluginHost.app">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand Down
19 changes: 0 additions & 19 deletions Source/BankAndPreset.cpp

This file was deleted.

23 changes: 0 additions & 23 deletions Source/BankAndPreset.h

This file was deleted.

16 changes: 0 additions & 16 deletions Source/ExposesComponents.h

This file was deleted.

67 changes: 46 additions & 21 deletions Source/FilePicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,39 @@

#include "FilePicker.h"
#include "MyColours.h"
#include "Util.h"

FilePicker::FilePicker(
FluidSynthModel* fluidSynthModel
AudioProcessorValueTreeState& valueTreeState
// FluidSynthModel& fluidSynthModel
)
: fileChooser(
"File",
File(),
true,
false,
false,
"*.sf2;*.sf3",
String(),
"Choose a Soundfont file to load into the synthesizer"
),
fluidSynthModel(fluidSynthModel),
currentPath() {
: fileChooser{
"File",
File(),
true,
false,
false,
"*.sf2;*.sf3",
String(),
"Choose a Soundfont file to load into the synthesizer"}
, valueTreeState{valueTreeState}
// , fluidSynthModel{fluidSynthModel}
// , currentPath{}
{
// faster (rounded edges introduce transparency)
setOpaque (true);

setDisplayedFilePath(fluidSynthModel->getCurrentSoundFontAbsPath());
// setDisplayedFilePath(fluidSynthModel.getCurrentSoundFontAbsPath());
setDisplayedFilePath(valueTreeState.state.getChildWithName("soundFont").getProperty("path", ""));

addAndMakeVisible (fileChooser);
fileChooser.addListener (this);
valueTreeState.state.addListener(this);
// valueTreeState.state.getChildWithName("soundFont").sendPropertyChangeMessage("path");
}
FilePicker::~FilePicker() {
fileChooser.removeListener (this);
valueTreeState.state.removeListener(this);
}

void FilePicker::resized() {
Expand All @@ -46,15 +53,33 @@ void FilePicker::paint(Graphics& g)
}

void FilePicker::filenameComponentChanged (FilenameComponent*) {
currentPath = fileChooser.getCurrentFile().getFullPathName();
fluidSynthModel->onFileNameChanged(fileChooser.getCurrentFile().getFullPathName(), -1, -1);
// currentPath = fileChooser.getCurrentFile().getFullPathName();
// fluidSynthModel.onFileNameChanged(fileChooser.getCurrentFile().getFullPathName(), -1, -1);
Value value{valueTreeState.state.getChildWithName("soundFont").getPropertyAsValue("path", nullptr)};
value.setValue(fileChooser.getCurrentFile().getFullPathName());
// value = fileChooser.getCurrentFile().getFullPathName();
}

void FilePicker::setDisplayedFilePath(const String& path) {
if (!shouldChangeDisplayedFilePath(path)) {
return;
void FilePicker::valueTreePropertyChanged(ValueTree& treeWhosePropertyHasChanged,
const Identifier& property) {
if (treeWhosePropertyHasChanged.getType() == StringRef("soundFont")) {
// if (&treeWhosePropertyHasChanged == &valueTree) {
if (property == StringRef("path")) {
String soundFontPath{treeWhosePropertyHasChanged.getProperty("path", "")};
DEBUG_PRINT(soundFontPath);
setDisplayedFilePath(soundFontPath);
// if (soundFontPath.isNotEmpty()) {
// loadFont(soundFontPath);
// }
}
}
currentPath = path;
}

void FilePicker::setDisplayedFilePath(const String& path) {
if (!shouldChangeDisplayedFilePath(path)) {
return;
}
// currentPath = path;
fileChooser.setCurrentFile(File(path), true, dontSendNotification);
}

Expand All @@ -66,4 +91,4 @@ bool FilePicker::shouldChangeDisplayedFilePath(const String &path) {
return false;
}
return true;
}
}
Loading

0 comments on commit 5989267

Please sign in to comment.