3#include "PluginProcessor.h"
4#include "CustomLookAndFeel/DeathMetalLookAndFeel.h"
5#include "CustomLookAndFeel/FontAudioLookAndFeel.h"
16 void paint(juce::Graphics &)
override;
17 void resized()
override;
19 void loadFileButtonClicked()
21 juce::Logger::writeToLog(
"Button clicked");
22 fileChooser = std::make_unique<juce::FileChooser>(
23 "Select file...", juce::File::getSpecialLocation(juce::File::userHomeDirectory),
"*.wav");
25 fileChooser->launchAsync(
26 juce::FileBrowserComponent::openMode | juce::FileBrowserComponent::canSelectFiles,
27 [
this](
const juce::FileChooser &chooser) {
28 auto audioFile = chooser.getResult();
29 if (audioFile.getFileName().isNotEmpty())
31 if (processorRef.loadFile(audioFile))
33 juce::Logger::writeToLog(audioFile.getFileName());
34 fileName.setText(audioFile.getFullPathName(), juce::NotificationType::dontSendNotification);
38 juce::NativeMessageBox::showMessageBoxAsync(
39 juce::AlertWindow::WarningIcon,
"Error",
40 "The file \"" + audioFile.getFileName() +
41 "\" is encoded in a format that isn't supported.");
42 fileName.setText(
"No file loaded", juce::NotificationType::dontSendNotification);
48 void playButtonClicked()
58 juce::TextButton loadFileButton;
59 juce::TextButton playButton;
60 juce::Slider gainSlider;
61 juce::TextButton loopButton;
63 std::unique_ptr<juce::FileChooser> fileChooser;
65 juce::AudioProcessorValueTreeState &valueTreeState;
67 using SliderAttachment = juce::AudioProcessorValueTreeState::SliderAttachment;
68 using ButtonAttachment = juce::AudioProcessorValueTreeState::ButtonAttachment;
70 std::unique_ptr<SliderAttachment> gainAttachment;
71 std::unique_ptr<ButtonAttachment> loopAttachment;
72 std::unique_ptr<ButtonAttachment> playAttachment;
Definition PluginEditor.h:11
Definition PluginProcessor.h:9
Definition FontAudioLookAndFeel.h:7