Download Source/PluginBridgeEditor.cpp from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 2.01 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/5f757c7af709bb15e94e281c966ced2da8ec1fcf/Source/PluginBridgeEditor.cpp
- Command line
-
hf download hf://RAM2118/pluginbridge@5f757c7af709bb15e94e281c966ced2da8ec1fcf/Source/PluginBridgeEditor.cpp
-
curl -L -o PluginBridgeEditor.cpp https://huggingface.co/RAM2118/pluginbridge/resolve/5f757c7af709bb15e94e281c966ced2da8ec1fcf/Source/PluginBridgeEditor.cpp
2.01 kB
| PluginBridgeEditor::PluginBridgeEditor(PluginBridgeProcessor& p) | |
| : AudioProcessorEditor(&p), processorRef(p) | |
| { | |
| setSize(300, 150); | |
| titleLabel.setText("PluginBridge", juce::dontSendNotification); | |
| titleLabel.setFont(juce::FontOptions(20.0f)); | |
| titleLabel.setJustificationType(juce::Justification::centred); | |
| addAndMakeVisible(titleLabel); | |
| statusLabel.setText("MCP: starting...", juce::dontSendNotification); | |
| statusLabel.setFont(juce::FontOptions(14.0f)); | |
| statusLabel.setJustificationType(juce::Justification::centred); | |
| addAndMakeVisible(statusLabel); | |
| portLabel.setText("", juce::dontSendNotification); | |
| portLabel.setFont(juce::FontOptions(12.0f)); | |
| portLabel.setJustificationType(juce::Justification::centred); | |
| portLabel.setColour(juce::Label::textColourId, juce::Colours::grey); | |
| addAndMakeVisible(portLabel); | |
| startTimerHz(2); // Update status 2x per second | |
| } | |
| PluginBridgeEditor::~PluginBridgeEditor() | |
| { | |
| stopTimer(); | |
| } | |
| void PluginBridgeEditor::paint(juce::Graphics& g) | |
| { | |
| g.fillAll(juce::Colour(0xff1a1a2e)); | |
| } | |
| void PluginBridgeEditor::resized() | |
| { | |
| auto area = getLocalBounds().reduced(10); | |
| titleLabel.setBounds(area.removeFromTop(40)); | |
| area.removeFromTop(10); | |
| statusLabel.setBounds(area.removeFromTop(30)); | |
| portLabel.setBounds(area.removeFromTop(25)); | |
| } | |
| void PluginBridgeEditor::timerCallback() | |
| { | |
| if (processorRef.isMcpServerRunning()) { | |
| statusLabel.setText("MCP: running", juce::dontSendNotification); | |
| statusLabel.setColour(juce::Label::textColourId, juce::Colours::limegreen); | |
| portLabel.setText("http://127.0.0.1:" + juce::String(processorRef.getMcpServerPort()) + "/mcp", | |
| juce::dontSendNotification); | |
| } else { | |
| statusLabel.setText("MCP: offline", juce::dontSendNotification); | |
| statusLabel.setColour(juce::Label::textColourId, juce::Colours::red); | |
| portLabel.setText("", juce::dontSendNotification); | |
| } | |
| } | |