first commit
This commit is contained in:
commit
452c5cabba
20 changed files with 863 additions and 0 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
/Builds/
|
||||||
|
/JuceLibraryCode/
|
||||||
|
.idea
|
||||||
|
.iml
|
28
Source/PluginEditor.cpp
Normal file
28
Source/PluginEditor.cpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#include "PluginProcessor.h"
|
||||||
|
#include "PluginEditor.h"
|
||||||
|
#include "Veno/Core/Config.h"
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
VenoAudioProcessorEditor::VenoAudioProcessorEditor(VenoAudioProcessor &p)
|
||||||
|
: AudioProcessorEditor(&p), processor(p) {
|
||||||
|
Config::getInstance()->registerEditor(this, id);
|
||||||
|
LookAndFeel::setDefaultLookAndFeel(look);
|
||||||
|
setSize(400, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
VenoAudioProcessorEditor::~VenoAudioProcessorEditor() {
|
||||||
|
LookAndFeel::setDefaultLookAndFeel(nullptr);
|
||||||
|
Config::getInstance()->removeEditor(id);
|
||||||
|
delete look;
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
void VenoAudioProcessorEditor::paint(Graphics &g) {
|
||||||
|
g.fillAll(getLookAndFeel().findColour(ResizableWindow::backgroundColourId));
|
||||||
|
g.setColour(Colours::white);
|
||||||
|
g.setFont(15.0f);
|
||||||
|
g.drawFittedText("Hello World!", getLocalBounds(), Justification::centred, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void VenoAudioProcessorEditor::resized() {
|
||||||
|
}
|
21
Source/PluginEditor.h
Normal file
21
Source/PluginEditor.h
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <JuceHeader.h>
|
||||||
|
#include "PluginProcessor.h"
|
||||||
|
#include "Veno/GUI/LookAndFeel/LookHandler.h"
|
||||||
|
|
||||||
|
class VenoAudioProcessorEditor : public AudioProcessorEditor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
VenoAudioProcessorEditor (VenoAudioProcessor&);
|
||||||
|
~VenoAudioProcessorEditor();
|
||||||
|
void paint (Graphics&) override;
|
||||||
|
void resized() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
VenoAudioProcessor& processor;
|
||||||
|
std::string id = Uuid().toString().toStdString();
|
||||||
|
LookAndFeel_V4 *look = new LookHandler();
|
||||||
|
|
||||||
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VenoAudioProcessorEditor)
|
||||||
|
};
|
191
Source/PluginProcessor.cpp
Normal file
191
Source/PluginProcessor.cpp
Normal file
|
@ -0,0 +1,191 @@
|
||||||
|
/*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
This file was auto-generated!
|
||||||
|
|
||||||
|
It contains the basic framework code for a JUCE plugin processor.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PluginProcessor.h"
|
||||||
|
#include "PluginEditor.h"
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
VenoAudioProcessor::VenoAudioProcessor()
|
||||||
|
#ifndef JucePlugin_PreferredChannelConfigurations
|
||||||
|
: AudioProcessor (BusesProperties()
|
||||||
|
#if ! JucePlugin_IsMidiEffect
|
||||||
|
#if ! JucePlugin_IsSynth
|
||||||
|
.withInput ("Input", AudioChannelSet::stereo(), true)
|
||||||
|
#endif
|
||||||
|
.withOutput ("Output", AudioChannelSet::stereo(), true)
|
||||||
|
#endif
|
||||||
|
)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
VenoAudioProcessor::~VenoAudioProcessor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
const String VenoAudioProcessor::getName() const
|
||||||
|
{
|
||||||
|
return JucePlugin_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VenoAudioProcessor::acceptsMidi() const
|
||||||
|
{
|
||||||
|
#if JucePlugin_WantsMidiInput
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VenoAudioProcessor::producesMidi() const
|
||||||
|
{
|
||||||
|
#if JucePlugin_ProducesMidiOutput
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool VenoAudioProcessor::isMidiEffect() const
|
||||||
|
{
|
||||||
|
#if JucePlugin_IsMidiEffect
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
double VenoAudioProcessor::getTailLengthSeconds() const
|
||||||
|
{
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int VenoAudioProcessor::getNumPrograms()
|
||||||
|
{
|
||||||
|
return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs,
|
||||||
|
// so this should be at least 1, even if you're not really implementing programs.
|
||||||
|
}
|
||||||
|
|
||||||
|
int VenoAudioProcessor::getCurrentProgram()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VenoAudioProcessor::setCurrentProgram (int index)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const String VenoAudioProcessor::getProgramName (int index)
|
||||||
|
{
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void VenoAudioProcessor::changeProgramName (int index, const String& newName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
void VenoAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
|
||||||
|
{
|
||||||
|
// Use this method as the place to do any pre-playback
|
||||||
|
// initialisation that you need..
|
||||||
|
}
|
||||||
|
|
||||||
|
void VenoAudioProcessor::releaseResources()
|
||||||
|
{
|
||||||
|
// When playback stops, you can use this as an opportunity to free up any
|
||||||
|
// spare memory, etc.
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef JucePlugin_PreferredChannelConfigurations
|
||||||
|
bool VenoAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
|
||||||
|
{
|
||||||
|
#if JucePlugin_IsMidiEffect
|
||||||
|
ignoreUnused (layouts);
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
// This is the place where you check if the layout is supported.
|
||||||
|
// In this template code we only support mono or stereo.
|
||||||
|
if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono()
|
||||||
|
&& layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// This checks if the input layout matches the output layout
|
||||||
|
#if ! JucePlugin_IsSynth
|
||||||
|
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void VenoAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
|
||||||
|
{
|
||||||
|
ScopedNoDenormals noDenormals;
|
||||||
|
auto totalNumInputChannels = getTotalNumInputChannels();
|
||||||
|
auto totalNumOutputChannels = getTotalNumOutputChannels();
|
||||||
|
|
||||||
|
// In case we have more outputs than inputs, this code clears any output
|
||||||
|
// channels that didn't contain input data, (because these aren't
|
||||||
|
// guaranteed to be empty - they may contain garbage).
|
||||||
|
// This is here to avoid people getting screaming feedback
|
||||||
|
// when they first compile a plugin, but obviously you don't need to keep
|
||||||
|
// this code if your algorithm always overwrites all the output channels.
|
||||||
|
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
|
||||||
|
buffer.clear (i, 0, buffer.getNumSamples());
|
||||||
|
|
||||||
|
// This is the place where you'd normally do the guts of your plugin's
|
||||||
|
// audio processing...
|
||||||
|
// Make sure to reset the state if your inner loop is processing
|
||||||
|
// the samples and the outer loop is handling the channels.
|
||||||
|
// Alternatively, you can process the samples with the channels
|
||||||
|
// interleaved by keeping the same state.
|
||||||
|
for (int channel = 0; channel < totalNumInputChannels; ++channel)
|
||||||
|
{
|
||||||
|
auto* channelData = buffer.getWritePointer (channel);
|
||||||
|
|
||||||
|
// ..do something to the data...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
bool VenoAudioProcessor::hasEditor() const
|
||||||
|
{
|
||||||
|
return true; // (change this to false if you choose to not supply an editor)
|
||||||
|
}
|
||||||
|
|
||||||
|
AudioProcessorEditor* VenoAudioProcessor::createEditor()
|
||||||
|
{
|
||||||
|
return new VenoAudioProcessorEditor (*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
void VenoAudioProcessor::getStateInformation (MemoryBlock& destData)
|
||||||
|
{
|
||||||
|
// You should use this method to store your parameters in the memory block.
|
||||||
|
// You could do that either as raw data, or use the XML or ValueTree classes
|
||||||
|
// as intermediaries to make it easy to save and load complex data.
|
||||||
|
}
|
||||||
|
|
||||||
|
void VenoAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
||||||
|
{
|
||||||
|
// You should use this method to restore your parameters from this memory block,
|
||||||
|
// whose contents will have been created by the getStateInformation() call.
|
||||||
|
}
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
// This creates new instances of the plugin..
|
||||||
|
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
|
||||||
|
{
|
||||||
|
return new VenoAudioProcessor();
|
||||||
|
}
|
61
Source/PluginProcessor.h
Normal file
61
Source/PluginProcessor.h
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
This file was auto-generated!
|
||||||
|
|
||||||
|
It contains the basic framework code for a JUCE plugin processor.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <JuceHeader.h>
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
class VenoAudioProcessor : public AudioProcessor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//==============================================================================
|
||||||
|
VenoAudioProcessor();
|
||||||
|
~VenoAudioProcessor();
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
void prepareToPlay (double sampleRate, int samplesPerBlock) override;
|
||||||
|
void releaseResources() override;
|
||||||
|
|
||||||
|
#ifndef JucePlugin_PreferredChannelConfigurations
|
||||||
|
bool isBusesLayoutSupported (const BusesLayout& layouts) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void processBlock (AudioBuffer<float>&, MidiBuffer&) override;
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
AudioProcessorEditor* createEditor() override;
|
||||||
|
bool hasEditor() const override;
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
const String getName() const override;
|
||||||
|
|
||||||
|
bool acceptsMidi() const override;
|
||||||
|
bool producesMidi() const override;
|
||||||
|
bool isMidiEffect() const override;
|
||||||
|
double getTailLengthSeconds() const override;
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
int getNumPrograms() override;
|
||||||
|
int getCurrentProgram() override;
|
||||||
|
void setCurrentProgram (int index) override;
|
||||||
|
const String getProgramName (int index) override;
|
||||||
|
void changeProgramName (int index, const String& newName) override;
|
||||||
|
|
||||||
|
//==============================================================================
|
||||||
|
void getStateInformation (MemoryBlock& destData) override;
|
||||||
|
void setStateInformation (const void* data, int sizeInBytes) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
//==============================================================================
|
||||||
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VenoAudioProcessor)
|
||||||
|
};
|
57
Source/Veno/Core/AudioConfig.h
Normal file
57
Source/Veno/Core/AudioConfig.h
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 22.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_AUDIOCONFIG_H
|
||||||
|
#define VENO_AUDIOCONFIG_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* holds SampleRate and other needed sound information's :)
|
||||||
|
*/
|
||||||
|
class AudioConfig {
|
||||||
|
private:
|
||||||
|
static std::shared_ptr<AudioConfig> instance;
|
||||||
|
float sampleRate = 44100;
|
||||||
|
float bufferSize = 512; //maybe we need that... but this will update always!
|
||||||
|
bool needToReInit = false; //this is to reInit the Oscillators, ADSR and other stuff
|
||||||
|
public:
|
||||||
|
static std::shared_ptr<AudioConfig> getInstance() {
|
||||||
|
if (!instance)
|
||||||
|
instance = std::make_shared<AudioConfig>();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
float getSampleRate() const {
|
||||||
|
return sampleRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setSampleRate(float _sampleRate) {
|
||||||
|
if (sampleRate != _sampleRate) {
|
||||||
|
sampleRate = _sampleRate;
|
||||||
|
needToReInit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
float getBufferSize() const {
|
||||||
|
return bufferSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setBufferSize(float _bufferSize) {
|
||||||
|
AudioConfig::bufferSize = _bufferSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isNeedToReInit() const {
|
||||||
|
return needToReInit;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setNeedToReInit(bool _needToReInit) {
|
||||||
|
AudioConfig::needToReInit = _needToReInit;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //VENO_AUDIOCONFIG_H
|
73
Source/Veno/Core/Config.cpp
Normal file
73
Source/Veno/Core/Config.cpp
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 01.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Config.h"
|
||||||
|
|
||||||
|
std::shared_ptr<Config> Config::instance = nullptr;
|
||||||
|
|
||||||
|
Config::Config() {
|
||||||
|
// i want to load the config file here...
|
||||||
|
initConfig();
|
||||||
|
|
||||||
|
theme = std::make_shared<Theme>(config);
|
||||||
|
theme->init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Config::saveAll() {
|
||||||
|
if (config != nullptr) {
|
||||||
|
config->saveIfNeeded();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int Config::getCurrentLook() {
|
||||||
|
if (currentLook > 1) {
|
||||||
|
currentLook = 0;
|
||||||
|
}
|
||||||
|
return currentLook;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Config::initConfig() {
|
||||||
|
PropertiesFile::Options options;
|
||||||
|
options.applicationName = "config";
|
||||||
|
options.folderName = "veno";
|
||||||
|
options.filenameSuffix = "xml";
|
||||||
|
config = std::make_unique<PropertiesFile>(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Theme> Config::getCurrentTheme() {
|
||||||
|
return theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Config::getScale() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Config::setColourForIndex(Colour *colour, ThemeColour index) {
|
||||||
|
if (theme) {
|
||||||
|
theme->setColour(index, colour);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Config::~Config() {
|
||||||
|
config->save();
|
||||||
|
theme.reset();
|
||||||
|
config.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
//LEAK DETECTOR FIX!
|
||||||
|
void Config::registerEditor(AudioProcessorEditor *editor, const std::string &name) {
|
||||||
|
editors[name] = editor;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Config::removeEditor(const std::string &name) {
|
||||||
|
editors.erase(name);
|
||||||
|
if (editors.empty()) {
|
||||||
|
instance = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//for LCD :P let's be a bit funny xD
|
||||||
|
int Config::getEditorCount() {
|
||||||
|
editors.size();
|
||||||
|
}
|
52
Source/Veno/Core/Config.h
Normal file
52
Source/Veno/Core/Config.h
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 01.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_CONFIG_H
|
||||||
|
#define VENO_CONFIG_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
#include "../GUI/LookAndFeel/LookHandler.h"
|
||||||
|
#include "../GUI/Theme/Theme.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
class Config {
|
||||||
|
private:
|
||||||
|
std::shared_ptr<PropertiesFile> config = nullptr;
|
||||||
|
std::shared_ptr<Theme> theme = nullptr;
|
||||||
|
static std::shared_ptr<Config> instance;
|
||||||
|
int currentLook = 0; //nah move the bitch logic from current to next
|
||||||
|
std::unordered_map<std::string, AudioProcessorEditor *> editors;
|
||||||
|
public:
|
||||||
|
static std::shared_ptr<Config> getInstance() {
|
||||||
|
if (!instance)
|
||||||
|
instance = std::make_shared<Config>();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void saveAll();
|
||||||
|
|
||||||
|
int getCurrentLook();
|
||||||
|
|
||||||
|
void setColourForIndex(Colour *colour, ThemeColour index);
|
||||||
|
|
||||||
|
std::shared_ptr<Theme> getCurrentTheme();
|
||||||
|
|
||||||
|
double getScale();
|
||||||
|
|
||||||
|
// can be public but doesnt need!
|
||||||
|
Config();
|
||||||
|
|
||||||
|
~Config();
|
||||||
|
|
||||||
|
void registerEditor(AudioProcessorEditor *editor, const std::string& name);
|
||||||
|
|
||||||
|
void removeEditor(const std::string& name);
|
||||||
|
|
||||||
|
int getEditorCount();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void initConfig();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //VENO_CONFIG_H
|
5
Source/Veno/GUI/Components/BaseComponent.cpp
Normal file
5
Source/Veno/GUI/Components/BaseComponent.cpp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "BaseComponent.h"
|
25
Source/Veno/GUI/Components/BaseComponent.h
Normal file
25
Source/Veno/GUI/Components/BaseComponent.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_BASECOMPONENT_H
|
||||||
|
#define VENO_BASECOMPONENT_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* this is the base Component of all VeNo Components... it has all important Methods
|
||||||
|
*/
|
||||||
|
class BaseComponent : public Component {
|
||||||
|
private:
|
||||||
|
std::string prefix;
|
||||||
|
public:
|
||||||
|
BaseComponent() = default;
|
||||||
|
~BaseComponent() = default;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //VENO_BASECOMPONENT_H
|
5
Source/Veno/GUI/LookAndFeel/CrazyLook.cpp
Normal file
5
Source/Veno/GUI/LookAndFeel/CrazyLook.cpp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "CrazyLook.h"
|
17
Source/Veno/GUI/LookAndFeel/CrazyLook.h
Normal file
17
Source/Veno/GUI/LookAndFeel/CrazyLook.h
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_CRAZYLOOK_H
|
||||||
|
#define VENO_CRAZYLOOK_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
|
||||||
|
class CrazyLook : public LookAndFeel_V4 {
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //VENO_CRAZYLOOK_H
|
5
Source/Veno/GUI/LookAndFeel/FlatLook.cpp
Normal file
5
Source/Veno/GUI/LookAndFeel/FlatLook.cpp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "FlatLook.h"
|
17
Source/Veno/GUI/LookAndFeel/FlatLook.h
Normal file
17
Source/Veno/GUI/LookAndFeel/FlatLook.h
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_FLATLOOK_H
|
||||||
|
#define VENO_FLATLOOK_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
|
||||||
|
class FlatLook : public LookAndFeel_V4 {
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
protected:
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //VENO_FLATLOOK_H
|
20
Source/Veno/GUI/LookAndFeel/LookHandler.cpp
Normal file
20
Source/Veno/GUI/LookAndFeel/LookHandler.cpp
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "LookHandler.h"
|
||||||
|
#include "../../Core/Config.h"
|
||||||
|
|
||||||
|
LookHandler::LookHandler() {
|
||||||
|
selectLook(Config::getInstance()->getCurrentLook());
|
||||||
|
}
|
||||||
|
|
||||||
|
LookHandler::~LookHandler() {
|
||||||
|
//delete this shit!
|
||||||
|
delete feels[0];
|
||||||
|
delete feels[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
void LookHandler::selectLook(int index) {
|
||||||
|
currentLook = index;
|
||||||
|
}
|
30
Source/Veno/GUI/LookAndFeel/LookHandler.h
Normal file
30
Source/Veno/GUI/LookAndFeel/LookHandler.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 17.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_LOOKHANDLER_H
|
||||||
|
#define VENO_LOOKHANDLER_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
#include "CrazyLook.h"
|
||||||
|
#include "FlatLook.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* overwrite the basic look and feel based on the selected Look and Feel :)
|
||||||
|
*/
|
||||||
|
class LookHandler : public LookAndFeel_V4 {
|
||||||
|
private:
|
||||||
|
std::shared_ptr<LookAndFeel_V4> look;
|
||||||
|
int currentLook = 0;
|
||||||
|
public:
|
||||||
|
LookHandler();
|
||||||
|
~LookHandler();
|
||||||
|
void selectLook(int index);
|
||||||
|
protected:
|
||||||
|
//currently both available themes are CrazyLook <-- (this is a fun one xD) and FlatLook
|
||||||
|
LookAndFeel_V4 *feels[2] = {new FlatLook(), new CrazyLook()};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //VENO_LOOKHANDLER_H
|
50
Source/Veno/GUI/Theme/Theme.cpp
Normal file
50
Source/Veno/GUI/Theme/Theme.cpp
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 01.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "Theme.h"
|
||||||
|
#include "ThemePresets.cpp"
|
||||||
|
|
||||||
|
Theme::Theme(std::shared_ptr<PropertiesFile> file) {
|
||||||
|
configFile = file;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Theme::~Theme() {
|
||||||
|
colours.clear();
|
||||||
|
configFile.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Theme::setColour(ThemeColour index, Colour *colour) {
|
||||||
|
auto c = colours[index];
|
||||||
|
if (c) {
|
||||||
|
delete c;
|
||||||
|
colours[index] = colour;
|
||||||
|
} else {
|
||||||
|
colours[index] = colour;
|
||||||
|
}
|
||||||
|
configFile->setValue(ThemeColourToString(index), colour->toString());
|
||||||
|
configFile->save();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Theme::init() {
|
||||||
|
setLEDTheme(this);
|
||||||
|
getColourFromConfig(ThemeColour::bg);
|
||||||
|
getColourFromConfig(ThemeColour::bg_two);
|
||||||
|
getColourFromConfig(ThemeColour::accent);
|
||||||
|
getColourFromConfig(ThemeColour::accent_two);
|
||||||
|
getColourFromConfig(ThemeColour::warning);
|
||||||
|
getColourFromConfig(ThemeColour::clip);
|
||||||
|
getColourFromConfig(ThemeColour::lcd_bg);
|
||||||
|
getColourFromConfig(ThemeColour::lcd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Theme::getColourFromConfig(ThemeColour index) {
|
||||||
|
std::string key = ThemeColourToString(index);
|
||||||
|
if (configFile->containsKey(key)) {
|
||||||
|
auto baseColour = Colour::fromString(configFile->getValue(key));
|
||||||
|
auto *colour = new Colour(baseColour.getRed(), baseColour.getGreen(), baseColour.getBlue());
|
||||||
|
setColour(index, colour);
|
||||||
|
}
|
||||||
|
}
|
30
Source/Veno/GUI/Theme/Theme.h
Normal file
30
Source/Veno/GUI/Theme/Theme.h
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
//
|
||||||
|
// Created by versustune on 01.03.20.
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef VENO_THEME_H
|
||||||
|
#define VENO_THEME_H
|
||||||
|
|
||||||
|
#include "JuceHeader.h"
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
enum class ThemeColour {
|
||||||
|
bg = 0, bg_two, accent, accent_two, warning, clip, lcd_bg, lcd
|
||||||
|
};
|
||||||
|
|
||||||
|
class Theme {
|
||||||
|
private:
|
||||||
|
public:
|
||||||
|
Theme(std::shared_ptr<PropertiesFile> file);
|
||||||
|
~Theme();
|
||||||
|
|
||||||
|
void setColour(ThemeColour index, Colour *colour);
|
||||||
|
void init();
|
||||||
|
void getColourFromConfig(ThemeColour index);
|
||||||
|
protected:
|
||||||
|
std::map<ThemeColour, Colour*> colours;
|
||||||
|
std::shared_ptr<PropertiesFile> configFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif //VENO_THEME_H
|
37
Source/Veno/GUI/Theme/ThemePresets.cpp
Normal file
37
Source/Veno/GUI/Theme/ThemePresets.cpp
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
#include "Theme.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* this file holds function that read some presets
|
||||||
|
* in the current Theme class
|
||||||
|
* so we doesn't have lot's of classes that only save some hex codes... and make the coding harder
|
||||||
|
* also good on this is that the user can slightly change the preset theme and doesn't have to make all of them himself
|
||||||
|
*
|
||||||
|
* maybe i want a double look and feel... that's make it easier to implement different knob styles, slider styles and co
|
||||||
|
*/
|
||||||
|
|
||||||
|
void setLEDTheme(Theme *theme) {
|
||||||
|
theme->setColour(ThemeColour::bg, new Colour(41, 47, 54));
|
||||||
|
theme->setColour(ThemeColour::bg_two, new Colour(217, 217, 217));
|
||||||
|
theme->setColour(ThemeColour::accent, new Colour(169, 208, 142));
|
||||||
|
theme->setColour(ThemeColour::accent_two, new Colour(139, 171, 117));
|
||||||
|
theme->setColour(ThemeColour::clip, new Colour(255, 23, 68));
|
||||||
|
theme->setColour(ThemeColour::warning, new Colour(255, 143, 0));
|
||||||
|
theme->setColour(ThemeColour::lcd_bg, new Colour(21, 21, 21));
|
||||||
|
theme->setColour(ThemeColour::lcd, new Colour(169, 208, 142));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string ThemeColourToString(ThemeColour index) {
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
|
case ThemeColour::bg: return "colour_bg";
|
||||||
|
case ThemeColour::bg_two: return "colour_bg_two";
|
||||||
|
case ThemeColour::accent: return "colour_accent";
|
||||||
|
case ThemeColour::accent_two: return "colour_accent_two";
|
||||||
|
case ThemeColour::clip: return "colour_clip";
|
||||||
|
case ThemeColour::warning: return "colour_warning";
|
||||||
|
case ThemeColour::lcd_bg: return "colour_lcd_bg";
|
||||||
|
case ThemeColour::lcd: return "colour_lcd";
|
||||||
|
default: return "";
|
||||||
|
}
|
||||||
|
}
|
135
Veno.jucer
Normal file
135
Veno.jucer
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<JUCERPROJECT id="ZP1QhJ" name="Veno" jucerVersion="5.4.7" companyName="VersusTuneZ"
|
||||||
|
companyWebsite="https://vstz.dev" companyEmail="info@vstz.dev"
|
||||||
|
splashScreenColour="Dark" projectType="audioplug" pluginCharacteristicsValue="pluginIsSynth,pluginProducesMidiOut,pluginWantsMidiIn"
|
||||||
|
pluginManufacturerCode="VSTZ" pluginCode="veno" pluginVST3Category="Generator,Instrument,Synth"
|
||||||
|
cppLanguageStandard="17">
|
||||||
|
<MAINGROUP id="m9l7SJ" name="Veno">
|
||||||
|
<GROUP id="{AAF9955A-D1A2-45FF-2C17-02C73D8064D3}" name="Source">
|
||||||
|
<GROUP id="{5791B3F9-67EA-BE3E-0208-47B8AF81F72F}" name="Veno">
|
||||||
|
<GROUP id="{B6FC2EBB-E15D-DE35-7ACC-81D051410D51}" name="Utils"/>
|
||||||
|
<GROUP id="{00F06C9B-B6B7-5466-5846-495A9FF5EC4A}" name="Static"/>
|
||||||
|
<GROUP id="{EFD25B6B-987D-435F-F8DE-BD6C2B831E62}" name="GUI">
|
||||||
|
<GROUP id="{53C33AC6-67D7-762E-FFD5-C82B7F51DA5F}" name="Components">
|
||||||
|
<FILE id="BobUXL" name="BaseComponent.cpp" compile="1" resource="0"
|
||||||
|
file="Source/Veno/GUI/Components/BaseComponent.cpp"/>
|
||||||
|
<FILE id="AbXWzA" name="BaseComponent.h" compile="0" resource="0" file="Source/Veno/GUI/Components/BaseComponent.h"/>
|
||||||
|
</GROUP>
|
||||||
|
<GROUP id="{EDE17E47-34A6-CDD7-4D68-0477CFCF0A64}" name="LookAndFeel">
|
||||||
|
<FILE id="SbCAQ4" name="CrazyLook.cpp" compile="1" resource="0" file="Source/Veno/GUI/LookAndFeel/CrazyLook.cpp"/>
|
||||||
|
<FILE id="SzNPQ8" name="CrazyLook.h" compile="0" resource="0" file="Source/Veno/GUI/LookAndFeel/CrazyLook.h"/>
|
||||||
|
<FILE id="XeAkpF" name="FlatLook.cpp" compile="1" resource="0" file="Source/Veno/GUI/LookAndFeel/FlatLook.cpp"/>
|
||||||
|
<FILE id="qcH3gA" name="FlatLook.h" compile="0" resource="0" file="Source/Veno/GUI/LookAndFeel/FlatLook.h"/>
|
||||||
|
<FILE id="vXs3Bc" name="LookHandler.cpp" compile="1" resource="0" file="Source/Veno/GUI/LookAndFeel/LookHandler.cpp"/>
|
||||||
|
<FILE id="RV79zE" name="LookHandler.h" compile="0" resource="0" file="Source/Veno/GUI/LookAndFeel/LookHandler.h"/>
|
||||||
|
</GROUP>
|
||||||
|
<GROUP id="{34CC9D96-503E-031F-2A15-5C78773D5C29}" name="Theme">
|
||||||
|
<FILE id="k1R247" name="Theme.cpp" compile="1" resource="0" file="Source/Veno/GUI/Theme/Theme.cpp"/>
|
||||||
|
<FILE id="FncBml" name="Theme.h" compile="0" resource="0" file="Source/Veno/GUI/Theme/Theme.h"/>
|
||||||
|
<FILE id="bsSSSl" name="ThemePresets.cpp" compile="1" resource="0"
|
||||||
|
file="Source/Veno/GUI/Theme/ThemePresets.cpp"/>
|
||||||
|
</GROUP>
|
||||||
|
</GROUP>
|
||||||
|
<GROUP id="{2E9A4660-1408-92E7-A653-7BA5E2FEE2DA}" name="Engine"/>
|
||||||
|
<GROUP id="{ACC73001-EF99-9282-8ADC-7BBE2EB85E06}" name="Core">
|
||||||
|
<FILE id="pu5RZU" name="AudioConfig.h" compile="0" resource="0" file="Source/Veno/Core/AudioConfig.h"/>
|
||||||
|
<FILE id="AfXpWs" name="Config.cpp" compile="1" resource="0" file="Source/Veno/Core/Config.cpp"/>
|
||||||
|
<FILE id="e1wHY7" name="Config.h" compile="0" resource="0" file="Source/Veno/Core/Config.h"/>
|
||||||
|
</GROUP>
|
||||||
|
</GROUP>
|
||||||
|
<FILE id="zASeb7" name="PluginProcessor.cpp" compile="1" resource="0"
|
||||||
|
file="Source/PluginProcessor.cpp"/>
|
||||||
|
<FILE id="FOOZiI" name="PluginProcessor.h" compile="0" resource="0"
|
||||||
|
file="Source/PluginProcessor.h"/>
|
||||||
|
<FILE id="qyoSYK" name="PluginEditor.cpp" compile="1" resource="0"
|
||||||
|
file="Source/PluginEditor.cpp"/>
|
||||||
|
<FILE id="cXcaN2" name="PluginEditor.h" compile="0" resource="0" file="Source/PluginEditor.h"/>
|
||||||
|
</GROUP>
|
||||||
|
</MAINGROUP>
|
||||||
|
<EXPORTFORMATS>
|
||||||
|
<VS2019 targetFolder="Builds/VisualStudio2019">
|
||||||
|
<CONFIGURATIONS>
|
||||||
|
<CONFIGURATION isDebug="1" name="Debug"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release"/>
|
||||||
|
</CONFIGURATIONS>
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_audio_basics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_devices" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_formats" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_plugin_client" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_processors" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_utils" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_core" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_cryptography" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_data_structures" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_events" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_graphics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_gui_basics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_gui_extra" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_opengl" path="../../Tools/JUCE/modules"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</VS2019>
|
||||||
|
<LINUX_MAKE targetFolder="Builds/LinuxMakefile">
|
||||||
|
<CONFIGURATIONS>
|
||||||
|
<CONFIGURATION isDebug="1" name="Debug"/>
|
||||||
|
<CONFIGURATION isDebug="0" name="Release"/>
|
||||||
|
</CONFIGURATIONS>
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_audio_basics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_devices" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_formats" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_plugin_client" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_processors" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_utils" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_core" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_cryptography" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_data_structures" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_events" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_graphics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_gui_basics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_gui_extra" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_opengl" path="../../Tools/JUCE/modules"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</LINUX_MAKE>
|
||||||
|
<CLION targetFolder="Builds/CLion" clionMakefileEnabled="1">
|
||||||
|
<MODULEPATHS>
|
||||||
|
<MODULEPATH id="juce_audio_basics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_devices" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_formats" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_plugin_client" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_processors" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_audio_utils" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_core" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_cryptography" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_data_structures" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_events" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_graphics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_gui_basics" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_gui_extra" path="../../Tools/JUCE/modules"/>
|
||||||
|
<MODULEPATH id="juce_opengl" path="../../Tools/JUCE/modules"/>
|
||||||
|
</MODULEPATHS>
|
||||||
|
</CLION>
|
||||||
|
</EXPORTFORMATS>
|
||||||
|
<MODULES>
|
||||||
|
<MODULE id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_audio_devices" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_audio_formats" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_audio_plugin_client" showAllCode="1" useLocalCopy="0"
|
||||||
|
useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_audio_processors" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_audio_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_cryptography" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
<MODULE id="juce_opengl" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||||
|
</MODULES>
|
||||||
|
<LIVE_SETTINGS>
|
||||||
|
<LINUX/>
|
||||||
|
</LIVE_SETTINGS>
|
||||||
|
<JUCEOPTIONS JUCE_VST3_CAN_REPLACE_VST2="0" JUCE_STRICT_REFCOUNTEDPOINTER="1"/>
|
||||||
|
</JUCERPROJECT>
|
Loading…
Reference in a new issue