#pragma once #include #include #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 pluginEditor; // Plugin browser — shown inline when user hits Select Plugin std::unique_ptr 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) };