2020-05-20 16:44:46 -07:00
|
|
|
#include "PluginProcessor.h"
|
|
|
|
|
#include "PluginEditor.h"
|
|
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|
WavetableAudioProcessorEditor::WavetableAudioProcessorEditor (WavetableAudioProcessor& p)
|
2023-09-23 11:10:21 -07:00
|
|
|
: ProcessorEditor (p), wtProc (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);
|
2023-09-23 11:10:21 -07:00
|
|
|
|
2023-09-29 20:07:45 -07:00
|
|
|
usage.panic.onClick = [this]
|
|
|
|
|
{
|
|
|
|
|
wtProc.presetLoaded = true;
|
|
|
|
|
};
|
2023-09-07 20:46:00 -07:00
|
|
|
addAndMakeVisible (usage);
|
|
|
|
|
|
2023-10-05 05:23:29 -07:00
|
|
|
addChildComponent (modOverview);
|
2026-01-10 17:06:49 -08:00
|
|
|
addAndMakeVisible (modOverlay);
|
|
|
|
|
|
2023-10-05 06:37:27 -07:00
|
|
|
usage.setBounds (45, 12, 80, 16);
|
2023-10-05 05:23:29 -07:00
|
|
|
modOverview.setBounds (usage.getRight() + 10, 12, 150, 16);
|
2023-10-05 05:42:08 -07:00
|
|
|
scope.setBounds (704, 5, 187, 30);
|
2023-08-31 11:17:49 -07:00
|
|
|
|
2023-09-29 09:01:29 -07:00
|
|
|
setSize (943, 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);
|
2026-01-10 17:06:49 -08:00
|
|
|
modOverlay.setBounds (getLocalBounds());
|
2020-05-20 16:44:46 -07:00
|
|
|
}
|
2023-08-31 21:02:23 -07:00
|
|
|
|
|
|
|
|
void WavetableAudioProcessorEditor::addMenuItems (juce::PopupMenu& m)
|
|
|
|
|
{
|
|
|
|
|
m.addSeparator();
|
2023-09-23 11:10:21 -07:00
|
|
|
m.addItem ("MPE", true, wtProc.globalParams.mpe->getUserValueBool(), [this]
|
2023-08-31 21:02:23 -07:00
|
|
|
{
|
2023-09-23 11:10:21 -07:00
|
|
|
wtProc.globalParams.mpe->setUserValue (wtProc.globalParams.mpe->getUserValueBool() ? 0.0f : 1.0f);
|
2023-10-20 18:49:05 -07:00
|
|
|
|
|
|
|
|
if (auto props = wtProc.getSettings())
|
|
|
|
|
props->setValue ("mpe", wtProc.globalParams.mpe->getUserValueBool());
|
2023-08-31 21:02:23 -07:00
|
|
|
});
|
2023-09-01 20:23:08 -07:00
|
|
|
|
|
|
|
|
auto setSize = [this] (float scale)
|
|
|
|
|
{
|
|
|
|
|
if (auto p = findParentComponentOfClass<gin::ScaledPluginEditor>())
|
|
|
|
|
p->setScale (scale);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
juce::PopupMenu um;
|
|
|
|
|
um.addItem ("50%", [setSize] { setSize (0.50f); });
|
|
|
|
|
um.addItem ("75%", [setSize] { setSize (0.75f); });
|
|
|
|
|
um.addItem ("100%", [setSize] { setSize (1.00f); });
|
|
|
|
|
um.addItem ("150%", [setSize] { setSize (1.50f); });
|
|
|
|
|
um.addItem ("200%", [setSize] { setSize (2.00f); });
|
|
|
|
|
|
|
|
|
|
m.addSubMenu ("UI Size", um);
|
2026-01-10 17:06:49 -08:00
|
|
|
|
|
|
|
|
m.addSeparator();
|
|
|
|
|
|
2026-07-28 16:27:38 +02:00
|
|
|
m.addItem ("Manual", [] { juce::URL ("https://github.com/FigBug/Wavetable/blob/master/README.md").launchInDefaultBrowser(); });
|
2023-08-31 21:02:23 -07:00
|
|
|
}
|