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