File size: 1,054 Bytes
e99e9f9
 
 
ec53c6b
e99e9f9
 
 
 
 
 
 
 
 
 
 
 
 
 
ec53c6b
 
 
e99e9f9
 
be5e0ab
ec53c6b
e99e9f9
 
 
be5e0ab
ec53c6b
 
 
 
 
 
 
e99e9f9
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include <juce_gui_basics/juce_gui_basics.h>
#include <juce_audio_processors/juce_audio_processors.h>
#include "PluginBridgeProcessor.h"

class PluginBridgeEditor : public juce::AudioProcessorEditor,
                            private juce::Timer
{
public:
    explicit PluginBridgeEditor(PluginBridgeProcessor&);
    ~PluginBridgeEditor() override;

    void paint(juce::Graphics&) override;
    void resized() override;

private:
    void timerCallback() override;
    void scanPlugins();
    void showPluginMenu();
    void loadPluginByIndex(int index);

    PluginBridgeProcessor& processorRef;

    // UI elements
    juce::Label titleLabel;
    juce::Label statusLabel;
    juce::Label portLabel;
    juce::Label pluginLabel;
    juce::TextButton pluginButton{"Select Plugin..."};
    juce::TextEditor searchBox;

    // Scanned plugins
    juce::KnownPluginList knownPlugins;
    juce::AudioPluginFormatManager scanFormatManager;
    bool hasScanned = false;

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginBridgeEditor)
};