- save
This commit is contained in:
parent
ac22ea5e75
commit
a27c62f062
27 changed files with 1170 additions and 384 deletions
|
|
@ -3,6 +3,7 @@
|
|||
//
|
||||
|
||||
#include "BaseComponent.h"
|
||||
#include "../../Utils.h"
|
||||
#include "../../Fonts/Fonts.h"
|
||||
#include <utility>
|
||||
|
||||
|
|
@ -13,40 +14,42 @@ BaseComponent::BaseComponent (const std::string& processId)
|
|||
|
||||
BaseComponent::~BaseComponent ()
|
||||
{
|
||||
m_label.reset ();
|
||||
m_label.reset();
|
||||
}
|
||||
|
||||
void BaseComponent::addLabel (const std::string& label_text, LabelPosition labelPosition)
|
||||
{
|
||||
m_enableLabel = true;
|
||||
m_label = std::make_shared<LabelComponent> (this, label_text);
|
||||
m_label->setPosition (labelPosition);
|
||||
m_label = std::make_shared<LabelComponent>(this, label_text);
|
||||
m_label->setPosition(labelPosition);
|
||||
addAndMakeVisible(*m_label);
|
||||
}
|
||||
|
||||
void BaseComponent::resized ()
|
||||
{
|
||||
if (m_enableLabel && m_label != nullptr)
|
||||
{
|
||||
LabelPosition position = m_label->getLabelPosition ();
|
||||
LabelPosition position = m_label->getLabelPosition();
|
||||
if (position == LabelPosition::TOP)
|
||||
{
|
||||
m_label->setBounds (0, 0, getWidth (), 15);
|
||||
m_label->setBounds(0, 0, getWidth(), VeNo::Utils::getCalculatedHeight(15));
|
||||
}
|
||||
else if (position == LabelPosition::BOTTOM)
|
||||
{
|
||||
m_label->setBounds (0, getHeight () - 20, getWidth (), 15);
|
||||
auto height = VeNo::Utils::getCalculatedHeight(15);
|
||||
m_label->setBounds(0, getHeight() - height, getWidth(), height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BaseComponent::paint (Graphics& g)
|
||||
{
|
||||
g.setFont (*VenoFonts::getNormal ());
|
||||
g.setFont(*VenoFonts::getNormal());
|
||||
}
|
||||
|
||||
void BaseComponent::setParameter (std::string name, std::string group)
|
||||
{
|
||||
m_name = std::move (name);
|
||||
m_group = std::move (group);
|
||||
setName (m_name);
|
||||
m_name = std::move(name);
|
||||
m_group = std::move(group);
|
||||
setName(m_name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ private:
|
|||
std::string m_group;
|
||||
std::string m_name;
|
||||
bool m_enableLabel = false;
|
||||
std::shared_ptr<LabelComponent> m_label;
|
||||
public:
|
||||
explicit BaseComponent (const std::string& processId);
|
||||
~BaseComponent () override;
|
||||
|
|
@ -29,5 +28,6 @@ public:
|
|||
void paint (Graphics& g) override;
|
||||
protected:
|
||||
std::string m_processId;
|
||||
std::shared_ptr<LabelComponent> m_label;
|
||||
};
|
||||
#endif //VENO_BASECOMPONENT_H
|
||||
|
|
|
|||
65
Source/Veno/GUI/Components/Config/VeNoColour.cpp
Normal file
65
Source/Veno/GUI/Components/Config/VeNoColour.cpp
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#include "VeNoColour.h"
|
||||
#include <utility>
|
||||
#include "../../../Core/Config.h"
|
||||
#include "../../../Utils.h"
|
||||
|
||||
using ColourOption = ColourSelector::ColourSelectorOptions;
|
||||
VeNoColour::~VeNoColour ()
|
||||
{
|
||||
BaseComponent::m_label.reset();
|
||||
m_selector.reset();
|
||||
}
|
||||
|
||||
VeNoColour::VeNoColour (const std::string& processId, ThemeColour index)
|
||||
: BaseComponent(processId)
|
||||
{
|
||||
m_index = index;
|
||||
m_selector = std::make_unique<ColourSelector>(
|
||||
ColourOption::showColourAtTop|ColourOption::editableColour|ColourOption::showColourspace);
|
||||
m_selector->setCurrentColour(Config::getInstance()->getCurrentTheme()->getColour(index),
|
||||
NotificationType::dontSendNotification);
|
||||
m_selector->addChangeListener(this);
|
||||
m_selector->setOpaque(false);
|
||||
addAndMakeVisible(*m_selector);
|
||||
}
|
||||
|
||||
void VeNoColour::setName (std::string name)
|
||||
{
|
||||
m_name = std::move(name);
|
||||
if (BaseComponent::m_label == nullptr)
|
||||
{
|
||||
BaseComponent::addLabel(m_name, LabelPosition::TOP);
|
||||
}
|
||||
}
|
||||
|
||||
void VeNoColour::changeListenerCallback (ChangeBroadcaster* source)
|
||||
{
|
||||
auto selector = m_selector->getCurrentColour();
|
||||
auto* colour = new Colour(selector.getRed(), selector.getGreen(), selector.getBlue(),
|
||||
1.0f);
|
||||
Config::getInstance()->getCurrentTheme()->setColour(m_index, colour);
|
||||
Config::getInstance()->repaintAll();
|
||||
}
|
||||
|
||||
void VeNoColour::resized ()
|
||||
{
|
||||
auto h = VeNo::Utils::getCalculatedHeight(30);
|
||||
if (BaseComponent::m_label != nullptr)
|
||||
{
|
||||
BaseComponent::m_label->setBounds(0, 0, getWidth(), h);
|
||||
}
|
||||
if (m_selector != nullptr)
|
||||
{
|
||||
m_selector->setBounds(0, h, getWidth(), getHeight() - h);
|
||||
}
|
||||
}
|
||||
|
||||
void VeNoColour::paint (Graphics& g)
|
||||
{
|
||||
g.setColour(Colours::white);
|
||||
BaseComponent::paint(g);
|
||||
}
|
||||
27
Source/Veno/GUI/Components/Config/VeNoColour.h
Normal file
27
Source/Veno/GUI/Components/Config/VeNoColour.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#ifndef VENO_VENOCOLOUR_H
|
||||
#define VENO_VENOCOLOUR_H
|
||||
|
||||
#include "JuceHeader.h"
|
||||
#include "../BaseComponent.h"
|
||||
#include "../../Theme/Theme.h"
|
||||
|
||||
class VeNoColour : public BaseComponent, ChangeListener
|
||||
{
|
||||
private:
|
||||
ThemeColour m_index;
|
||||
std::unique_ptr<ColourSelector> m_selector;
|
||||
std::string m_name;
|
||||
public:
|
||||
explicit VeNoColour (const std::string& processId, ThemeColour index);
|
||||
~VeNoColour () override;
|
||||
void setName(std::string name);
|
||||
void resized () override;
|
||||
void paint (Graphics& g) override;
|
||||
private:
|
||||
void changeListenerCallback (ChangeBroadcaster* source) override;
|
||||
};
|
||||
#endif //VENO_VENOCOLOUR_H
|
||||
34
Source/Veno/GUI/Components/Config/VenoConfigButton.cpp
Normal file
34
Source/Veno/GUI/Components/Config/VenoConfigButton.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#include "VenoConfigButton.h"
|
||||
#include "../../../Core/Config.h"
|
||||
#include "../../../Utils.h"
|
||||
#include "../../../VenoInstance.h"
|
||||
#include "../../../Utils/Logger.h"
|
||||
|
||||
VenoConfigButton::VenoConfigButton (const std::string& processId) : BaseComponent(processId)
|
||||
{
|
||||
setMouseCursor(MouseCursor::PointingHandCursor);
|
||||
}
|
||||
|
||||
void VenoConfigButton::paint (Graphics& g)
|
||||
{
|
||||
auto theme = Config::getInstance()->getCurrentTheme();
|
||||
VeNo::Utils::setFontSize(16.0f, g);
|
||||
g.setColour(theme->getColour(ThemeColour::accent));
|
||||
g.drawRect(0, 0, getWidth(), getHeight());
|
||||
g.drawFittedText("Config", 0, 0, getWidth(), getHeight(), Justification::centred, 1, 1);
|
||||
}
|
||||
|
||||
void VenoConfigButton::mouseDown (const MouseEvent& event)
|
||||
{
|
||||
// open Window on click :)
|
||||
auto state = VenoInstance::getInstance(m_processId)->state;
|
||||
if (state->configScreen != nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
state->configScreen = new VenoConfigScreen(m_processId);
|
||||
}
|
||||
21
Source/Veno/GUI/Components/Config/VenoConfigButton.h
Normal file
21
Source/Veno/GUI/Components/Config/VenoConfigButton.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#ifndef VENO_VENOCONFIGBUTTON_H
|
||||
#define VENO_VENOCONFIGBUTTON_H
|
||||
|
||||
#include "JuceHeader.h"
|
||||
#include "../BaseComponent.h"
|
||||
|
||||
class VenoConfigButton : public BaseComponent
|
||||
{
|
||||
public:
|
||||
VenoConfigButton (const std::string& processId);
|
||||
~VenoConfigButton() = default;
|
||||
void paint (Graphics& g) override;
|
||||
void mouseDown (const MouseEvent& event) override;
|
||||
private:
|
||||
|
||||
};
|
||||
#endif //VENO_VENOCONFIGBUTTON_H
|
||||
84
Source/Veno/GUI/Components/Config/VenoPreColours.cpp
Normal file
84
Source/Veno/GUI/Components/Config/VenoPreColours.cpp
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#include "VenoPreColours.h"
|
||||
#include "../../../Core/Config.h"
|
||||
|
||||
VenoPreColours::VenoPreColours (const std::string& processId) : BaseComponent(processId)
|
||||
{
|
||||
initSliders();
|
||||
initButtons();
|
||||
}
|
||||
|
||||
VenoPreColours::~VenoPreColours ()
|
||||
{
|
||||
m_scaleSlider.reset();
|
||||
m_fpsSlider.reset();
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
m_pre[i].reset();
|
||||
}
|
||||
}
|
||||
|
||||
void VenoPreColours::initSliders ()
|
||||
{
|
||||
m_fpsSlider = std::make_shared<Slider>();
|
||||
m_fpsSlider->setRange(15, 90, 1);
|
||||
m_fpsSlider->setValue(Config::getInstance()->getFps());
|
||||
m_fpsSlider->setSliderStyle(Slider::SliderStyle::LinearHorizontal);
|
||||
m_fpsSlider->setTooltip("FPS");
|
||||
m_scaleSlider = std::make_shared<Slider>();
|
||||
m_scaleSlider->setRange(0.5f, 2.5f, 0.1);
|
||||
m_scaleSlider->setValue(Config::getInstance()->getScale());
|
||||
m_scaleSlider->setSliderStyle(Slider::SliderStyle::LinearHorizontal);
|
||||
m_scaleSlider->setTooltip("Scale");
|
||||
m_scaleSlider->addListener(this);
|
||||
m_fpsSlider->addListener(this);
|
||||
addAndMakeVisible(*m_fpsSlider);
|
||||
addAndMakeVisible(*m_scaleSlider);
|
||||
}
|
||||
|
||||
void VenoPreColours::sliderValueChanged (Slider* slider)
|
||||
{
|
||||
if (slider == m_fpsSlider.get())
|
||||
{
|
||||
Config::getInstance()->setFps(slider->getValue());
|
||||
}
|
||||
if (slider == m_scaleSlider.get())
|
||||
{
|
||||
Config::getInstance()->setScale(slider->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
void VenoPreColours::initButtons ()
|
||||
{
|
||||
//4
|
||||
m_pre.resize(4);
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
m_pre[i] = std::make_unique<TextButton>(m_names[i]);
|
||||
m_pre[i]->addListener(this);
|
||||
addAndMakeVisible(m_pre[i].get());
|
||||
}
|
||||
}
|
||||
|
||||
void VenoPreColours::buttonClicked (Button* button)
|
||||
{
|
||||
auto text = button->getButtonText().toStdString();
|
||||
Config::getInstance()->getCurrentTheme()->setDefault(text);
|
||||
}
|
||||
|
||||
void VenoPreColours::resized ()
|
||||
{
|
||||
auto bounds = Rectangle<int>();
|
||||
bounds.setBounds(0,0,getWidth(), getHeight()-100);
|
||||
auto bWidth = (getWidth()-80) / 4;
|
||||
for (int i = 0; i < 4 ; ++i)
|
||||
{
|
||||
m_pre[i]->setBounds((bWidth * i) + 40, 110, bWidth, 50);
|
||||
}
|
||||
// set slider and button position
|
||||
m_fpsSlider->setBounds(20, 0, getWidth()-40, 50);
|
||||
m_scaleSlider->setBounds(20, 50, getWidth()-40, 50);
|
||||
}
|
||||
30
Source/Veno/GUI/Components/Config/VenoPreColours.h
Normal file
30
Source/Veno/GUI/Components/Config/VenoPreColours.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#ifndef VENO_VENOPRECOLOURS_H
|
||||
#define VENO_VENOPRECOLOURS_H
|
||||
|
||||
#include "JuceHeader.h"
|
||||
#include "../../Components/BaseComponent.h"
|
||||
|
||||
class VenoPreColours : public BaseComponent, public Slider::Listener, Button::Listener
|
||||
{
|
||||
public:
|
||||
VenoPreColours (const std::string& processId);
|
||||
~VenoPreColours();
|
||||
void initSliders();
|
||||
void initButtons();
|
||||
void sliderValueChanged (Slider* slider) override;
|
||||
void resized () override;
|
||||
private:
|
||||
void buttonClicked (Button* button) override;
|
||||
protected:
|
||||
std::shared_ptr<Slider> m_fpsSlider;
|
||||
std::shared_ptr<Slider> m_scaleSlider;
|
||||
std::vector<std::unique_ptr<TextButton>> m_pre;
|
||||
std::string m_names[4]{
|
||||
"LED", "Blood", "Orange Dream", "Ocean"
|
||||
};
|
||||
};
|
||||
#endif //VENO_VENOPRECOLOURS_H
|
||||
|
|
@ -7,56 +7,56 @@
|
|||
#include "../../../Core/Config.h"
|
||||
#include "../../../Fonts/Fonts.h"
|
||||
|
||||
SidebarLCD::SidebarLCD (const std::string& process_id) : BaseComponent (process_id)
|
||||
SidebarLCD::SidebarLCD (const std::string& process_id) : BaseComponent(process_id)
|
||||
{
|
||||
waveform = std::make_unique<Waveforms> (process_id);
|
||||
addAndMakeVisible (*waveform);
|
||||
waveform = std::make_unique<Waveforms>(process_id);
|
||||
addAndMakeVisible(*waveform);
|
||||
}
|
||||
|
||||
SidebarLCD::~SidebarLCD ()
|
||||
{
|
||||
waveform.reset (nullptr);
|
||||
waveform.reset(nullptr);
|
||||
}
|
||||
|
||||
void SidebarLCD::drawHeadline (Graphics& g)
|
||||
{
|
||||
float fontSize = VeNo::Utils::setFontSize (12.0f, g) + 2;
|
||||
float fontSize = VeNo::Utils::setFontSize(12.0f, g) + 2;
|
||||
int line = m_innerY + fontSize + 2;
|
||||
g.drawText (">>> VeNo <<<", 0, m_innerY, getWidth () - m_width, fontSize,
|
||||
Justification::centred,
|
||||
true);
|
||||
g.drawLine (0, line, getWidth (), line);
|
||||
g.drawText(">>> VeNo <<<", 0, m_innerY, getWidth() - m_width, fontSize,
|
||||
Justification::centred,
|
||||
true);
|
||||
g.drawLine(0, line, getWidth(), line);
|
||||
}
|
||||
|
||||
void SidebarLCD::drawFooter (Graphics& g)
|
||||
{
|
||||
float fontSize = VeNo::Utils::setFontSize (8.0f, g) + 4;
|
||||
float fontSize = VeNo::Utils::setFontSize(8.0f, g) + 4;
|
||||
int space = m_innerY + fontSize;
|
||||
int line = getHeight () - space;
|
||||
g.drawText ("by VersusTuneZ", 0, line, getWidth () - m_width, fontSize,
|
||||
Justification::horizontallyCentred,
|
||||
true);
|
||||
g.drawLine (0, line - 4, getWidth (), line - 4);
|
||||
int line = getHeight() - space;
|
||||
g.drawText("by VersusTuneZ", 0, line, getWidth() - m_width, fontSize,
|
||||
Justification::horizontallyCentred,
|
||||
true);
|
||||
g.drawLine(0, line - 4, getWidth(), line - 4);
|
||||
}
|
||||
|
||||
void SidebarLCD::resized ()
|
||||
{
|
||||
float topSpace = (12 * Config::getInstance ()->getScale ()) + 4 + m_innerY;
|
||||
float topSpace = (12 * Config::getInstance()->getScale()) + 4 + m_innerY;
|
||||
if (waveform != nullptr)
|
||||
{
|
||||
waveform->setBounds (0, topSpace * 2, getWidth (), getHeight () - (topSpace * 4));
|
||||
waveform->setBounds(0, topSpace * 2, getWidth(), getHeight() - (topSpace * 4));
|
||||
}
|
||||
}
|
||||
|
||||
void SidebarLCD::paint (Graphics& g)
|
||||
{
|
||||
std::shared_ptr<Theme> theme = Config::getInstance ()->getCurrentTheme ();
|
||||
auto colour = theme->getColour (ThemeColour::lcd_bg);
|
||||
g.fillAll (colour);
|
||||
std::shared_ptr<Theme> theme = Config::getInstance()->getCurrentTheme();
|
||||
auto colour = theme->getColour(ThemeColour::lcd_bg);
|
||||
g.fillAll(colour);
|
||||
// background
|
||||
auto accent = theme->getColour (ThemeColour::lcd);
|
||||
g.setColour (accent);
|
||||
g.setFont (*VenoFonts::getLCD ());
|
||||
drawHeadline (g);
|
||||
drawFooter (g);
|
||||
auto accent = theme->getColour(ThemeColour::lcd);
|
||||
g.setColour(accent);
|
||||
g.setFont(*VenoFonts::getLCD());
|
||||
drawHeadline(g);
|
||||
drawFooter(g);
|
||||
}
|
||||
|
|
@ -9,33 +9,30 @@
|
|||
#include "../../../VenoInstance.h"
|
||||
#include "../../../Fonts/Fonts.h"
|
||||
|
||||
Waveforms::Waveforms (const std::string& processId) : BaseComponent (processId)
|
||||
Waveforms::Waveforms (const std::string& processId) : BaseComponent(processId)
|
||||
{
|
||||
m_context.setOpenGLVersionRequired (OpenGLContext::OpenGLVersion::openGL3_2);
|
||||
m_context.setRenderer (this);
|
||||
m_context.setContinuousRepainting (false);
|
||||
m_context.setComponentPaintingEnabled (true);
|
||||
m_context.attachTo (*this);
|
||||
auto fps = Config::getInstance ()->getFps ();
|
||||
startTimerHz (Config::getInstance ()->getFps ());
|
||||
std::srand (unsigned (time (nullptr)));
|
||||
pickRandomText = (std::rand () % RANDOM_TEXT_COUNT);
|
||||
setMouseCursor(MouseCursor::PointingHandCursor);
|
||||
m_context.setOpenGLVersionRequired(OpenGLContext::OpenGLVersion::openGL3_2);
|
||||
m_context.setRenderer(this);
|
||||
m_context.setContinuousRepainting(false);
|
||||
m_context.setComponentPaintingEnabled(true);
|
||||
m_context.attachTo(*this);
|
||||
setFps();
|
||||
std::srand(unsigned(time(nullptr)));
|
||||
pickRandomText = (std::rand() % RANDOM_TEXT_COUNT);
|
||||
m_ticks = 0;
|
||||
// is something that
|
||||
m_time_needed = roundToInt (4000 / (1000 / fps));
|
||||
m_time_needed_startup = roundToInt (1000 / (1000 / fps));
|
||||
}
|
||||
|
||||
Waveforms::~Waveforms ()
|
||||
{
|
||||
stopTimer ();
|
||||
shaderProgram.reset ();
|
||||
m_context.detach ();
|
||||
stopTimer();
|
||||
shaderProgram.reset();
|
||||
m_context.detach();
|
||||
}
|
||||
|
||||
void Waveforms::newOpenGLContextCreated ()
|
||||
{
|
||||
compileOpenGLShaderProgram ();
|
||||
compileOpenGLShaderProgram();
|
||||
}
|
||||
|
||||
void Waveforms::openGLContextClosing ()
|
||||
|
|
@ -45,23 +42,23 @@ void Waveforms::openGLContextClosing ()
|
|||
|
||||
void Waveforms::renderOpenGL ()
|
||||
{
|
||||
if (!isShowing () || shaderProgram == nullptr || !shaderProgram->getLastError ().isEmpty ())
|
||||
if (!isShowing() || shaderProgram == nullptr || !shaderProgram->getLastError().isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto theme = Config::getInstance ()->getCurrentTheme ();
|
||||
auto theme = Config::getInstance()->getCurrentTheme();
|
||||
if (theme == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
glViewport (0, 0, getWidth (), getHeight ());
|
||||
OpenGLHelpers::clear (theme->getColour (ThemeColour::lcd_bg));
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
shaderProgram->use ();
|
||||
auto color = theme->getColour (ThemeColour::lcd);
|
||||
shaderProgram->setUniform ("color", color.getFloatRed (), color.getFloatGreen (), color.getFloatBlue (),
|
||||
color.getFloatAlpha ());
|
||||
glViewport(0, 0, getWidth(), getHeight());
|
||||
OpenGLHelpers::clear(theme->getColour(ThemeColour::lcd_bg));
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
shaderProgram->use();
|
||||
auto color = theme->getColour(ThemeColour::lcd);
|
||||
shaderProgram->setUniform("color", color.getFloatRed(), color.getFloatGreen(), color.getFloatBlue(),
|
||||
color.getFloatAlpha());
|
||||
if (m_isWelcome || m_isStarting || m_isChangingData)
|
||||
{
|
||||
return;
|
||||
|
|
@ -69,33 +66,28 @@ void Waveforms::renderOpenGL ()
|
|||
switch (m_mode)
|
||||
{
|
||||
case 1:
|
||||
drawAudioOutput ();
|
||||
drawAudioOutput();
|
||||
break;
|
||||
case 2:
|
||||
drawWaveTable ();
|
||||
drawWaveTable();
|
||||
break;
|
||||
case 3:
|
||||
drawSpectrum ();
|
||||
drawSpectrum();
|
||||
break;
|
||||
default:
|
||||
drawPeakMeter ();
|
||||
drawPeakMeter();
|
||||
}
|
||||
}
|
||||
|
||||
void Waveforms::handleAsyncUpdate ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Waveforms::compileOpenGLShaderProgram ()
|
||||
{
|
||||
std::unique_ptr<OpenGLShaderProgram> shaderProgramAttempt
|
||||
= std::make_unique<OpenGLShaderProgram> (m_context);
|
||||
if (shaderProgramAttempt->addVertexShader ({BinaryData::WaveForm_vertex_glsl})
|
||||
&& shaderProgramAttempt->addFragmentShader ({BinaryData::WaveForm_fragment_glsl})
|
||||
&& shaderProgramAttempt->link ())
|
||||
= std::make_unique<OpenGLShaderProgram>(m_context);
|
||||
if (shaderProgramAttempt->addVertexShader({BinaryData::WaveForm_vertex_glsl})
|
||||
&& shaderProgramAttempt->addFragmentShader({BinaryData::WaveForm_fragment_glsl})
|
||||
&& shaderProgramAttempt->link())
|
||||
{
|
||||
shaderProgram = std::move (shaderProgramAttempt);
|
||||
shaderProgram = std::move(shaderProgramAttempt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -121,15 +113,16 @@ void Waveforms::timerCallback ()
|
|||
{
|
||||
if (m_isWelcome || m_isStarting || m_isChangingData || needToClear)
|
||||
{
|
||||
repaint ();
|
||||
repaint();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_context.isAttached ())
|
||||
if (m_context.isAttached())
|
||||
{
|
||||
m_context.triggerRepaint ();
|
||||
m_context.triggerRepaint();
|
||||
}
|
||||
}
|
||||
setFps();
|
||||
}
|
||||
|
||||
void Waveforms::drawWaveTable ()
|
||||
|
|
@ -140,63 +133,61 @@ void Waveforms::drawWaveTable ()
|
|||
void Waveforms::drawAudioOutput ()
|
||||
{
|
||||
// draw audio from the oscillators
|
||||
auto instance = VenoInstance::getInstance (BaseComponent::m_processId);
|
||||
auto buffer = instance->audioBuffer->getBuffer ();
|
||||
glBegin (GL_LINE_STRIP);
|
||||
auto instance = VenoInstance::getInstance(BaseComponent::m_processId);
|
||||
auto buffer = instance->audioBuffer->getBuffer();
|
||||
glBegin(GL_LINE_STRIP);
|
||||
float posX = -1;
|
||||
float inc = 2.0f / buffer.size ();
|
||||
float inc = 2.0f / buffer.size();
|
||||
for (float i : buffer)
|
||||
{
|
||||
glVertex2f (posX, i);
|
||||
glVertex2f(posX, i);
|
||||
posX += inc;
|
||||
}
|
||||
glEnd ();
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void Waveforms::drawPeakMeter ()
|
||||
{
|
||||
auto theme = Config::getInstance ()->getCurrentTheme ();
|
||||
auto theme = Config::getInstance()->getCurrentTheme();
|
||||
if (theme == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto instance = VenoInstance::getInstance (BaseComponent::m_processId);
|
||||
instance->audioBuffer->calcPeak ();
|
||||
auto instance = VenoInstance::getInstance(BaseComponent::m_processId);
|
||||
instance->audioBuffer->calcPeak();
|
||||
// draw peak signal
|
||||
auto leftChannel = jmap (Decibels::gainToDecibels (instance->audioBuffer->leftPeak, -80.0f), -80.0f, 6.0f, -1.0f,
|
||||
1.0f);
|
||||
selectColourByPeak (leftChannel);
|
||||
glBegin (GL_TRIANGLES);
|
||||
glVertex2f (-0.9f, leftChannel);
|
||||
glVertex2f (-0.9f, -1.0f);
|
||||
glVertex2f (-0.01f, -1.0f);
|
||||
glVertex2f (-0.9f, leftChannel);
|
||||
glVertex2f (-0.01f, leftChannel);
|
||||
glVertex2f (-0.01f, -1.0f);
|
||||
glEnd ();
|
||||
auto rightChannel = jmap (Decibels::gainToDecibels (instance->audioBuffer->rightPeak, -80.0f), -80.0f, 6.0f, -1.0f,
|
||||
1.0f);
|
||||
selectColourByPeak (rightChannel);
|
||||
glBegin (GL_TRIANGLES);
|
||||
glVertex2f (0.9f, rightChannel);
|
||||
glVertex2f (0.9f, -1.0f);
|
||||
glVertex2f (0.01f, -1.0f);
|
||||
glVertex2f (0.9f, rightChannel);
|
||||
glVertex2f (0.01f, rightChannel);
|
||||
glVertex2f (0.01f, -1.0f);
|
||||
glEnd ();
|
||||
auto leftChannel = getdBForChannel(instance->audioBuffer->leftPeak);
|
||||
selectColourByPeak(leftChannel);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f(-0.9f, leftChannel);
|
||||
glVertex2f(-0.9f, -1.0f);
|
||||
glVertex2f(-0.01f, -1.0f);
|
||||
glVertex2f(-0.9f, leftChannel);
|
||||
glVertex2f(-0.01f, leftChannel);
|
||||
glVertex2f(-0.01f, -1.0f);
|
||||
glEnd();
|
||||
auto rightChannel = getdBForChannel(instance->audioBuffer->rightPeak);
|
||||
selectColourByPeak(rightChannel);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f(0.9f, rightChannel);
|
||||
glVertex2f(0.9f, -1.0f);
|
||||
glVertex2f(0.01f, -1.0f);
|
||||
glVertex2f(0.9f, rightChannel);
|
||||
glVertex2f(0.01f, rightChannel);
|
||||
glVertex2f(0.01f, -1.0f);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void Waveforms::paint (Graphics& g)
|
||||
{
|
||||
std::shared_ptr<Theme> theme = Config::getInstance ()->getCurrentTheme ();
|
||||
auto accent = theme->getColour (ThemeColour::lcd);
|
||||
g.setColour (accent);
|
||||
g.setFont (*VenoFonts::getLCD ());
|
||||
VeNo::Utils::setFontSize (16.0f, g);
|
||||
std::shared_ptr<Theme> theme = Config::getInstance()->getCurrentTheme();
|
||||
auto accent = theme->getColour(ThemeColour::lcd);
|
||||
g.setColour(accent);
|
||||
g.setFont(*VenoFonts::getLCD());
|
||||
VeNo::Utils::setFontSize(16.0f, g);
|
||||
if (m_isWelcome)
|
||||
{
|
||||
drawWelcome (g, getWidth (), getHeight (), 0, 0);
|
||||
drawWelcome(g, getWidth(), getHeight(), 0, 0);
|
||||
m_ticks++;
|
||||
if (m_ticks > m_time_needed_startup)
|
||||
{
|
||||
|
|
@ -207,8 +198,8 @@ void Waveforms::paint (Graphics& g)
|
|||
}
|
||||
else if (m_isStarting)
|
||||
{
|
||||
g.drawText (m_warmUpText[pickRandomText], 0, 0, getWidth (), getHeight (),
|
||||
Justification::centred, true);
|
||||
g.drawText(m_warmUpText[pickRandomText], 0, 0, getWidth(), getHeight(),
|
||||
Justification::centred, true);
|
||||
m_ticks++;
|
||||
if (m_ticks > m_time_needed_startup)
|
||||
{
|
||||
|
|
@ -219,7 +210,7 @@ void Waveforms::paint (Graphics& g)
|
|||
}
|
||||
else if (m_isChangingData)
|
||||
{
|
||||
drawChangedParameter (g, getWidth (), getHeight (), 0, 0);
|
||||
drawChangedParameter(g, getWidth(), getHeight(), 0, 0);
|
||||
m_ticks++;
|
||||
if (m_ticks > m_time_needed)
|
||||
{
|
||||
|
|
@ -230,7 +221,7 @@ void Waveforms::paint (Graphics& g)
|
|||
}
|
||||
else
|
||||
{
|
||||
g.resetToDefaultState ();
|
||||
g.resetToDefaultState();
|
||||
needToClear = false;
|
||||
}
|
||||
}
|
||||
|
|
@ -238,19 +229,19 @@ void Waveforms::paint (Graphics& g)
|
|||
void Waveforms::drawChangedParameter (Graphics& g, int w, int h, int x, int y) const
|
||||
{
|
||||
int halfHeight = h / 2;
|
||||
float font = VeNo::Utils::setFontSize (12, g);
|
||||
g.drawText (changingParameter, x, y + halfHeight - font, w, font, Justification::centred, true);
|
||||
g.drawText (std::to_string (changedValue), x, y + halfHeight + 4, w, font, Justification::centred,
|
||||
true);
|
||||
float font = VeNo::Utils::setFontSize(12, g);
|
||||
g.drawText(changingParameter, x, y + halfHeight - font, w, font, Justification::centred, true);
|
||||
g.drawText(std::to_string(changedValue), x, y + halfHeight + 4, w, font, Justification::centred,
|
||||
true);
|
||||
}
|
||||
|
||||
void Waveforms::drawWelcome (Graphics& g, int w, int h, int x, int y)
|
||||
{
|
||||
float font = VeNo::Utils::setFontSize (12, g);
|
||||
float font = VeNo::Utils::setFontSize(12, g);
|
||||
int halfHeight = h / 2;
|
||||
g.drawText (m_readyText, x, y + halfHeight - font, w, font, Justification::centred, true);
|
||||
g.drawText (SystemStats::getLogonName (), x, y + halfHeight + 4, w, font, Justification::centred,
|
||||
true);
|
||||
g.drawText(m_readyText, x, y + halfHeight - font, w, font, Justification::centred, true);
|
||||
g.drawText(SystemStats::getLogonName(), x, y + halfHeight + 4, w, font, Justification::centred,
|
||||
true);
|
||||
}
|
||||
|
||||
void Waveforms::drawSpectrum ()
|
||||
|
|
@ -259,20 +250,39 @@ void Waveforms::drawSpectrum ()
|
|||
|
||||
void Waveforms::selectColourByPeak (float value)
|
||||
{
|
||||
auto theme = Config::getInstance ()->getCurrentTheme ();
|
||||
auto theme = Config::getInstance()->getCurrentTheme();
|
||||
if (theme == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto color = theme->getColour (ThemeColour::lcd);
|
||||
if (value > 0.8 && value < 0.9)
|
||||
{
|
||||
color = theme->getColour (ThemeColour::warning);
|
||||
}
|
||||
auto color = theme->getColour(ThemeColour::lcd);
|
||||
if (value > 0.9)
|
||||
{
|
||||
color = theme->getColour (ThemeColour::clip);
|
||||
color = theme->getColour(ThemeColour::clip);
|
||||
}
|
||||
else if (value > 0.8)
|
||||
{
|
||||
color = theme->getColour(ThemeColour::warning);
|
||||
}
|
||||
shaderProgram->setUniform("color", color.getFloatRed(), color.getFloatGreen(), color.getFloatBlue(),
|
||||
color.getFloatAlpha());
|
||||
}
|
||||
|
||||
float Waveforms::getdBForChannel (float value)
|
||||
{
|
||||
float v = VeNo::Utils::clamp(Decibels::gainToDecibels(value, -60.0f), -60.0f, 6.0f);
|
||||
return jmap(v, -60.0f, 6.0f, -1.0f,
|
||||
1.0f);
|
||||
}
|
||||
|
||||
void Waveforms::setFps ()
|
||||
{
|
||||
if(m_currentFps != Config::getInstance()->getFps()) {
|
||||
m_currentFps = Config::getInstance()->getFps();
|
||||
// is something that
|
||||
m_time_needed = roundToInt(4000 / (1000 / m_currentFps));
|
||||
m_time_needed_startup = roundToInt(1000 / (1000 / m_currentFps));
|
||||
stopTimer();
|
||||
startTimer(m_currentFps);
|
||||
}
|
||||
shaderProgram->setUniform ("color", color.getFloatRed (), color.getFloatGreen (), color.getFloatBlue (),
|
||||
color.getFloatAlpha ());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
// opengl context :D
|
||||
class Waveforms : public BaseComponent,
|
||||
private OpenGLRenderer,
|
||||
private AsyncUpdater,
|
||||
private Timer
|
||||
{
|
||||
protected:
|
||||
|
|
@ -34,7 +33,6 @@ public:
|
|||
void newOpenGLContextCreated () override;
|
||||
void openGLContextClosing () override;
|
||||
void renderOpenGL () override;
|
||||
void handleAsyncUpdate () override;
|
||||
void mouseDown (const MouseEvent& e) override;
|
||||
void mouseDrag (const MouseEvent& e) override;
|
||||
void paint (Graphics& g) override;
|
||||
|
|
@ -51,7 +49,10 @@ private:
|
|||
void drawWelcome (Graphics& g, int w, int h, int x, int y);
|
||||
void compileOpenGLShaderProgram ();
|
||||
void selectColourByPeak (float value);
|
||||
float getdBForChannel (float value);
|
||||
void setFps();
|
||||
OpenGLContext m_context;
|
||||
std::unique_ptr<OpenGLShaderProgram> shaderProgram;
|
||||
int m_currentFps = 0;
|
||||
};
|
||||
#endif //VENO_WAVEFORMS_H
|
||||
|
|
|
|||
|
|
@ -8,19 +8,20 @@ LabelComponent::LabelComponent (Component* parent, std::string name)
|
|||
{
|
||||
m_text = name;
|
||||
m_parent = parent;
|
||||
m_label = std::make_shared<Label> (m_parent->getName (), name);
|
||||
m_label = std::make_shared<Label>(m_parent->getName(), name);
|
||||
addAndMakeVisible(*m_label);
|
||||
}
|
||||
|
||||
LabelComponent::~LabelComponent ()
|
||||
{
|
||||
m_label.reset ();
|
||||
m_label.reset();
|
||||
}
|
||||
|
||||
void LabelComponent::resized ()
|
||||
{
|
||||
if (m_label != nullptr)
|
||||
{
|
||||
m_label->setBounds (0, 0, getWidth (), getHeight ());
|
||||
m_label->setBounds(0, 0, getWidth(), getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
77
Source/Veno/GUI/GUIParts/ConfigScreen/ConfigComponent.cpp
Normal file
77
Source/Veno/GUI/GUIParts/ConfigScreen/ConfigComponent.cpp
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#include "ConfigComponent.h"
|
||||
#include <utility>
|
||||
|
||||
ConfigComponent::ConfigComponent (std::string pid)
|
||||
{
|
||||
m_pid = std::move(pid);
|
||||
m_colors.resize(8);
|
||||
auto theme = Config::getInstance()->getCurrentTheme();
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
m_colors[i] = std::make_unique<VeNoColour>(pid, getColorForId(i));
|
||||
m_colors[i]->setName(m_names[i]);
|
||||
addAndMakeVisible(m_colors[i].get());
|
||||
}
|
||||
m_preColours = std::make_unique<VenoPreColours>(pid);
|
||||
addAndMakeVisible(*m_preColours);
|
||||
flexBox.flexDirection = FlexBox::Direction::row;
|
||||
flexBox.justifyContent = FlexBox::JustifyContent::flexStart;
|
||||
flexBox.flexWrap = FlexBox::Wrap::wrap;
|
||||
auto w = 200;
|
||||
auto h = 100;
|
||||
for (auto& color : m_colors)
|
||||
{
|
||||
auto item = FlexItem(w, h, *color);
|
||||
item.margin = FlexItem::Margin(5, 5, 5, 5);
|
||||
flexBox.items.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
ConfigComponent::~ConfigComponent ()
|
||||
{
|
||||
for (auto& color : m_colors)
|
||||
{
|
||||
color.reset();
|
||||
}
|
||||
m_colors.clear();
|
||||
}
|
||||
|
||||
ThemeColour ConfigComponent::getColorForId (int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
default:
|
||||
return ThemeColour::bg;
|
||||
case 1:
|
||||
return ThemeColour::bg_two;
|
||||
case 2:
|
||||
return ThemeColour::accent;
|
||||
case 3:
|
||||
return ThemeColour::accent_two;
|
||||
case 4:
|
||||
return ThemeColour::warning;
|
||||
case 5:
|
||||
return ThemeColour::clip;
|
||||
case 6:
|
||||
return ThemeColour::lcd_bg;
|
||||
case 7:
|
||||
return ThemeColour::lcd;
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigComponent::paint (Graphics& g)
|
||||
{
|
||||
g.fillAll(Colours::black);
|
||||
}
|
||||
|
||||
void ConfigComponent::resized ()
|
||||
{
|
||||
auto bounds = Rectangle<int>();
|
||||
bounds.setBounds(0,0,getWidth(), getHeight()-200);
|
||||
flexBox.performLayout(bounds);
|
||||
m_preColours->setBounds(0, getHeight() - 200, getWidth(), 200);
|
||||
}
|
||||
30
Source/Veno/GUI/GUIParts/ConfigScreen/ConfigComponent.h
Normal file
30
Source/Veno/GUI/GUIParts/ConfigScreen/ConfigComponent.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#ifndef VENO_CONFIGCOMPONENT_H
|
||||
#define VENO_CONFIGCOMPONENT_H
|
||||
|
||||
#include "JuceHeader.h"
|
||||
#include "../../../Core/Config.h"
|
||||
#include "../../Components/Config/VeNoColour.h"
|
||||
#include "../../Components/Config/VenoPreColours.h"
|
||||
|
||||
class ConfigComponent : public Component
|
||||
{
|
||||
public:
|
||||
explicit ConfigComponent(std::string pid);
|
||||
~ConfigComponent() override;
|
||||
void paint (Graphics& g) override;
|
||||
void resized () override;
|
||||
protected:
|
||||
static ThemeColour getColorForId(int id);
|
||||
std::string m_pid;
|
||||
std::string m_names[8]{
|
||||
"Background", "BackgroundTwo", "Accent", "Accent Two", "Warning", "Clip", "LCD Background", "LCD"
|
||||
};
|
||||
std::vector<std::unique_ptr<VeNoColour>> m_colors;
|
||||
std::unique_ptr<VenoPreColours> m_preColours;
|
||||
FlexBox flexBox;
|
||||
};
|
||||
#endif //VENO_CONFIGCOMPONENT_H
|
||||
49
Source/Veno/GUI/GUIParts/ConfigScreen/VenoConfigScreen.cpp
Normal file
49
Source/Veno/GUI/GUIParts/ConfigScreen/VenoConfigScreen.cpp
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#include "VenoConfigScreen.h"
|
||||
#include "../../../VenoInstance.h"
|
||||
|
||||
VenoConfigScreen::VenoConfigScreen (const std::string& pid) : DocumentWindow("VeNo Config", Colours::black,
|
||||
DocumentWindow::closeButton, true)
|
||||
{
|
||||
m_pid = pid;
|
||||
auto w = 840;
|
||||
auto h = 800;
|
||||
component = std::make_shared<ConfigComponent>(pid);
|
||||
component->setSize(w, h);
|
||||
m_lookHandler = std::make_unique<LookHandler>();
|
||||
component->setLookAndFeel(m_lookHandler->getLook());
|
||||
centreWithSize(w, h);
|
||||
setAlwaysOnTop(true);
|
||||
setContentOwned(component.get(), false);
|
||||
setResizable(false, false);
|
||||
setUsingNativeTitleBar(true);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
VenoConfigScreen::~VenoConfigScreen ()
|
||||
{
|
||||
component->setLookAndFeel(nullptr);
|
||||
m_lookHandler.reset();
|
||||
component.reset();
|
||||
}
|
||||
|
||||
void VenoConfigScreen::closeButtonPressed ()
|
||||
{
|
||||
auto state = VenoInstance::getInstance(m_pid)->state;
|
||||
if (state != nullptr && state->configScreen != nullptr)
|
||||
{
|
||||
delete state->configScreen;
|
||||
state->configScreen = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void VenoConfigScreen::paint (Graphics& graphics)
|
||||
{
|
||||
}
|
||||
|
||||
void VenoConfigScreen::resized ()
|
||||
{
|
||||
}
|
||||
28
Source/Veno/GUI/GUIParts/ConfigScreen/VenoConfigScreen.h
Normal file
28
Source/Veno/GUI/GUIParts/ConfigScreen/VenoConfigScreen.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#ifndef VENO_VENOCONFIGSCREEN_H
|
||||
#define VENO_VENOCONFIGSCREEN_H
|
||||
|
||||
#include "JuceHeader.h"
|
||||
#include "../../../Core/Config.h"
|
||||
#include "../../Components/Config/VeNoColour.h"
|
||||
#include "ConfigComponent.h"
|
||||
|
||||
class VenoConfigScreen : public DocumentWindow
|
||||
{
|
||||
public:
|
||||
explicit VenoConfigScreen (const std::string& pid);
|
||||
~VenoConfigScreen () override;
|
||||
void closeButtonPressed () override;
|
||||
void paint (Graphics& graphics) override;
|
||||
void resized () override;
|
||||
private:
|
||||
std::string m_pid;
|
||||
std::shared_ptr<ConfigComponent> component;
|
||||
std::unique_ptr<LookHandler> m_lookHandler;
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VenoConfigScreen)
|
||||
|
||||
};
|
||||
#endif //VENO_VENOCONFIGSCREEN_H
|
||||
|
|
@ -3,3 +3,48 @@
|
|||
//
|
||||
|
||||
#include "Sidebar.h"
|
||||
#include "VenoLogo.h"
|
||||
#include "../../../Utils.h"
|
||||
|
||||
Sidebar::Sidebar (const std::string& processId) : BaseComponent(processId)
|
||||
{
|
||||
m_lcd = std::make_unique<SidebarLCD>(processId);
|
||||
m_configButton = std::make_unique<VenoConfigButton>(processId);
|
||||
addAndMakeVisible(*m_lcd);
|
||||
addAndMakeVisible(*m_configButton);
|
||||
}
|
||||
|
||||
Sidebar::~Sidebar ()
|
||||
{
|
||||
m_lcd.reset(nullptr);
|
||||
m_configButton.reset(nullptr);
|
||||
}
|
||||
|
||||
void Sidebar::resized ()
|
||||
{
|
||||
if (m_lcd != nullptr)
|
||||
{
|
||||
m_lcd->setBounds(0, (getWidth() / 5) + 30, getWidth(), VeNo::Utils::getCalculatedHeight(175));
|
||||
}
|
||||
if (m_configButton != nullptr)
|
||||
{
|
||||
auto height = VeNo::Utils::getCalculatedHeight(30);
|
||||
auto margin = VeNo::Utils::getCalculatedWidth(10);
|
||||
m_configButton->setBounds(margin, getHeight()-height-margin, (getWidth()/2)-(margin*2), height);
|
||||
}
|
||||
}
|
||||
|
||||
void Sidebar::paint (Graphics& g)
|
||||
{
|
||||
auto logo = VenoLogo::getInstance()->getLogo();
|
||||
if (logo.isValid())
|
||||
{
|
||||
float height = getWidth() / 5;
|
||||
g.drawImage(logo, 0, 15, getWidth(), height, 0, 0, 500, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
g.setFont(getWidth() / 4);
|
||||
g.drawSingleLineText("VeNo", 0, 25);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,13 +7,21 @@
|
|||
|
||||
#include "JuceHeader.h"
|
||||
#include "../../Components/BaseComponent.h"
|
||||
#include "../../Components/LCD/SidebarLCD.h"
|
||||
#include "SidebarMixer.h"
|
||||
#include "../../Components/Config/VenoConfigButton.h"
|
||||
|
||||
class Sidebar : public BaseComponent
|
||||
{
|
||||
private:
|
||||
public:
|
||||
Sidebar ();
|
||||
~Sidebar ();
|
||||
Sidebar (const std::string& processId);
|
||||
~Sidebar () override;
|
||||
void resized () override;
|
||||
void paint (Graphics& g) override;
|
||||
protected:
|
||||
std::unique_ptr<SidebarLCD> m_lcd;
|
||||
std::unique_ptr<SidebarMixer> m_mixer;
|
||||
std::unique_ptr<VenoConfigButton> m_configButton;
|
||||
};
|
||||
#endif //VENO_SIDEBAR_H
|
||||
|
|
|
|||
36
Source/Veno/GUI/GUIParts/Sidebar/VenoLogo.cpp
Normal file
36
Source/Veno/GUI/GUIParts/Sidebar/VenoLogo.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// Created by versustune on 14.06.20.
|
||||
//
|
||||
|
||||
#include "VenoLogo.h"
|
||||
|
||||
VenoLogo* VenoLogo::instance = nullptr;
|
||||
|
||||
VenoLogo* VenoLogo::getInstance ()
|
||||
{
|
||||
if (instance == nullptr)
|
||||
{
|
||||
instance = new VenoLogo();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
VenoLogo::VenoLogo ()
|
||||
{
|
||||
MemoryOutputStream mo;
|
||||
auto result = Base64::convertFromBase64(mo, base64logo);
|
||||
if (result)
|
||||
{
|
||||
realLogo = juce::PNGImageFormat::loadFrom(mo.getData(), mo.getDataSize());
|
||||
}
|
||||
}
|
||||
|
||||
Image VenoLogo::getLogo ()
|
||||
{
|
||||
return getInstance()->realLogo;
|
||||
}
|
||||
|
||||
void VenoLogo::deleteInstance ()
|
||||
{
|
||||
delete instance;
|
||||
}
|
||||
25
Source/Veno/GUI/GUIParts/Sidebar/VenoLogo.h
Normal file
25
Source/Veno/GUI/GUIParts/Sidebar/VenoLogo.h
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue