pluginbridge / Source /Plugin /PluginBridgeEditor.h
Sitar118
feat: channel name dropdown in Editor (Sprint 6 Part 5)
6b15202
Raw
History Blame Contribute Delete
1.78 kB
#pragma once
#include <juce_audio_processors/juce_audio_processors.h>
#include <juce_gui_basics/juce_gui_basics.h>
#include "PluginBridgeProcessor.h"
#include "PluginPickerComponent.h"
class PluginBridgeEditor : public juce::AudioProcessorEditor, private juce::Timer
{
public:
PluginBridgeEditor(PluginBridgeProcessor& p);
~PluginBridgeEditor() override;
void paint(juce::Graphics& g) override;
void resized() override;
private:
void timerCallback() override;
void showPluginMenu();
void hidePicker();
void attachPluginEditor();
void detachPluginEditor();
void showAudioOnlyUI();
void hideAudioOnlyUI();
PluginBridgeProcessor& processorRef;
// Top bar controls
juce::Label titleLabel;
juce::Label mcpStatusLabel;
juce::Label pluginStatusLabel;
juce::TextButton selectButton{"Select Plugin"};
juce::ComboBox channelDropdown;
// In-process plugin editor (null for unsafe plugins)
std::unique_ptr<juce::AudioProcessorEditor> pluginEditor;
// Plugin browser — shown inline when user hits Select Plugin
std::unique_ptr<PluginPickerComponent> activePicker;
// Shown instead of plugin editor when plugin is unsafe (audio-only mode)
juce::Label audioOnlyLabel;
bool showingError = false;
bool audioOnlyMode = false;
static constexpr int kTopBarHeight = 32;
static constexpr int kChannelBarHeight = 26;
static constexpr int kHeaderHeight = kTopBarHeight + kChannelBarHeight;
static constexpr int kAudioOnlyHeight = 80;
static constexpr int kDefaultWidth = PluginPickerComponent::kWidth;
static constexpr int kDefaultHeight = kHeaderHeight;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginBridgeEditor)
};