2018-02-27 08:25:20 +08:00
|
|
|
//
|
|
|
|
// Created by Alex Birch on 03/10/2017.
|
|
|
|
//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../JuceLibraryCode/JuceHeader.h"
|
|
|
|
#include "FluidSynthModel.h"
|
2018-06-14 07:43:17 +08:00
|
|
|
#include "FilePickerFragment.h"
|
2018-02-27 08:25:20 +08:00
|
|
|
|
|
|
|
class FilePicker: public Component,
|
2018-04-11 07:52:44 +08:00
|
|
|
public FilePickerFragment,
|
2019-07-11 06:52:15 +08:00
|
|
|
public ValueTree::Listener,
|
2018-02-27 08:25:20 +08:00
|
|
|
private FilenameComponentListener
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FilePicker(
|
2019-07-15 00:22:36 +08:00
|
|
|
AudioProcessorValueTreeState& valueTreeState
|
|
|
|
// FluidSynthModel& fluidSynthModel
|
2018-02-27 08:25:20 +08:00
|
|
|
);
|
|
|
|
~FilePicker();
|
|
|
|
|
|
|
|
void resized() override;
|
|
|
|
void paint (Graphics& g) override;
|
2018-04-11 07:52:44 +08:00
|
|
|
|
|
|
|
virtual void setDisplayedFilePath(const String&) override;
|
2019-07-11 06:52:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
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 {};
|
2018-02-27 08:25:20 +08:00
|
|
|
private:
|
|
|
|
FilenameComponent fileChooser;
|
|
|
|
|
2019-07-07 07:22:47 +08:00
|
|
|
AudioProcessorValueTreeState& valueTreeState;
|
2019-07-15 00:22:36 +08:00
|
|
|
// FluidSynthModel& fluidSynthModel;
|
2018-02-27 08:25:20 +08:00
|
|
|
|
2018-04-11 07:52:44 +08:00
|
|
|
String currentPath;
|
|
|
|
|
2018-02-27 08:25:20 +08:00
|
|
|
void filenameComponentChanged (FilenameComponent*) override;
|
|
|
|
|
2018-04-11 07:52:44 +08:00
|
|
|
bool shouldChangeDisplayedFilePath(const String &path);
|
|
|
|
|
2018-02-27 08:25:20 +08:00
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilePicker)
|
2019-07-28 06:04:20 +08:00
|
|
|
};
|