juicysfplugin/Source/FilePicker.h

52 lines
1.8 KiB
C
Raw Permalink Normal View History

2018-02-27 08:25:20 +08:00
//
// Created by Alex Birch on 03/10/2017.
//
#pragma once
2021-09-07 14:04:35 +08:00
#include <JuceHeader.h>
2018-02-27 08:25:20 +08:00
#include "FluidSynthModel.h"
class FilePicker: public Component,
public ValueTree::Listener,
2018-02-27 08:25:20 +08:00
private FilenameComponentListener
{
public:
FilePicker(
AudioProcessorValueTreeState& valueTreeState
// FluidSynthModel& fluidSynthModel
2018-02-27 08:25:20 +08:00
);
~FilePicker();
void resized() override;
void paint (Graphics& g) override;
void setDisplayedFilePath(const String&);
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;
AudioProcessorValueTreeState& valueTreeState;
// FluidSynthModel& fluidSynthModel;
2018-02-27 08:25:20 +08:00
String currentPath;
2018-02-27 08:25:20 +08:00
void filenameComponentChanged (FilenameComponent*) override;
bool shouldChangeDisplayedFilePath(const String &path);
2018-02-27 08:25:20 +08:00
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (FilePicker)
};