reVeno/Source/PluginEditor.cpp

34 lines
976 B
C++
Raw Normal View History

2020-04-03 13:23:19 +02:00
#include "PluginProcessor.h"
#include "PluginEditor.h"
#include "Veno/Core/Config.h"
2020-06-13 10:56:20 +02:00
#include "Veno/Utils/Logger.h"
#include "Veno/Fonts/Fonts.h"
2020-04-03 13:23:19 +02:00
VenoAudioProcessorEditor::VenoAudioProcessorEditor(VenoAudioProcessor &p)
: AudioProcessorEditor(&p), processor(p) {
m_id = p.m_id;
Config::getInstance()->registerEditor(this, m_id);
LookAndFeel::setDefaultLookAndFeel(m_look);
2020-06-13 10:56:20 +02:00
waveform = std::make_unique<SidebarLCD>(m_id);
setSize(600, 400);
addAndMakeVisible(*waveform);
2020-04-03 13:23:19 +02:00
}
VenoAudioProcessorEditor::~VenoAudioProcessorEditor() {
LookAndFeel::setDefaultLookAndFeel(nullptr);
2020-06-13 10:56:20 +02:00
waveform.reset(nullptr);
delete m_look;
2020-06-13 10:56:20 +02:00
Config::getInstance()->removeEditor(m_id);
2020-04-03 13:23:19 +02:00
}
void VenoAudioProcessorEditor::paint(Graphics &g) {
2020-06-13 10:56:20 +02:00
g.setFont(VenoFonts::getNormal());
g.fillAll(Colour(0, 0, 0));
2020-04-03 13:23:19 +02:00
}
void VenoAudioProcessorEditor::resized() {
2020-06-13 10:56:20 +02:00
if (waveform != nullptr) {
waveform->setBounds(0, 0, getWidth(), getHeight());
}
2020-04-03 13:23:19 +02:00
}