wavetable/plugin/Source/PluginEditor.cpp

71 lines
2.1 KiB
C++
Raw Normal View History

2020-05-20 16:44:46 -07:00
#include "PluginProcessor.h"
#include "PluginEditor.h"
//==============================================================================
WavetableAudioProcessorEditor::WavetableAudioProcessorEditor (WavetableAudioProcessor& p)
2023-08-23 08:45:23 -07:00
: ProcessorEditor (p), vaProc (p)
2020-05-20 16:44:46 -07:00
{
2023-08-31 11:17:49 -07:00
scope.setName ("scope");
scope.setNumChannels (2);
scope.setTriggerMode (gin::TriggeredScope::TriggerMode::Up);
scope.setColour (gin::TriggeredScope::traceColourId + 0, findColour(gin::PluginLookAndFeel::accentColourId, true).withAlpha (0.7f));
scope.setColour (gin::TriggeredScope::traceColourId + 1, findColour(gin::PluginLookAndFeel::accentColourId, true).withAlpha (0.7f));
scope.setColour (gin::TriggeredScope::lineColourId, juce::Colours::transparentBlack);
2020-05-20 16:44:46 -07:00
2023-08-31 11:17:49 -07:00
addAndMakeVisible (editor);
addAndMakeVisible (scope);
scope.setBounds (674, 5, 177, 30);
setSize (901, 671);
2020-05-20 16:44:46 -07:00
}
WavetableAudioProcessorEditor::~WavetableAudioProcessorEditor()
{
}
//==============================================================================
2023-08-25 09:47:50 -07:00
void WavetableAudioProcessorEditor::showAboutInfo()
{
#if JUCE_DEBUG
if (inspector == nullptr)
{
inspector = std::make_unique<melatonin::Inspector> (*this);
inspector->setVisible(true);
}
else
{
inspector = nullptr;
}
#else
ProcessorEditor::showAboutInfo();
#endif
}
2023-08-23 08:45:23 -07:00
void WavetableAudioProcessorEditor::paint (juce::Graphics& g)
2020-05-20 16:44:46 -07:00
{
ProcessorEditor::paint (g);
2023-08-23 08:45:23 -07:00
titleBar.setShowBrowser (true);
2020-05-20 16:44:46 -07:00
2023-08-23 08:45:23 -07:00
g.fillAll (findColour (gin::PluginLookAndFeel::blackColourId));
2020-05-20 16:44:46 -07:00
}
void WavetableAudioProcessorEditor::resized()
{
ProcessorEditor::resized ();
2023-08-23 08:45:23 -07:00
auto rc = getLocalBounds().reduced (1);
rc.removeFromTop (40);
2020-05-20 16:44:46 -07:00
2023-08-23 08:45:23 -07:00
editor.setBounds (rc);
2023-08-27 07:57:23 -07:00
patchBrowser.setBounds (rc);
2020-05-20 16:44:46 -07:00
}
2023-08-31 21:02:23 -07:00
void WavetableAudioProcessorEditor::addMenuItems (juce::PopupMenu& m)
{
m.addSeparator();
m.addItem ("MPE", true, vaProc.globalParams.mpe->getUserValueBool(), [this]
{
vaProc.globalParams.mpe->setUserValue (vaProc.globalParams.mpe->getUserValueBool() ? 0.0f : 1.0f);
});
}