- reformat to JUCE-Guidelines
- added Matrix => half working ;)
This commit is contained in:
parent
26a2935e1c
commit
ac22ea5e75
58 changed files with 1220 additions and 799 deletions
|
|
@ -5,43 +5,54 @@
|
|||
#include "../Audio/WaveTable/WaveTableGenerator.h"
|
||||
|
||||
std::shared_ptr<AudioConfig> AudioConfig::m_instance;
|
||||
float AudioConfig::getSampleRate() {
|
||||
|
||||
float AudioConfig::getSampleRate ()
|
||||
{
|
||||
return m_sampleRate;
|
||||
}
|
||||
|
||||
void AudioConfig::setSampleRate(float _sampleRate) {
|
||||
if (m_sampleRate != _sampleRate) {
|
||||
void AudioConfig::setSampleRate (float _sampleRate)
|
||||
{
|
||||
if (m_sampleRate != _sampleRate)
|
||||
{
|
||||
m_sampleRate = _sampleRate;
|
||||
m_needToReInit = true;
|
||||
}
|
||||
}
|
||||
|
||||
float AudioConfig::getBufferSize() {
|
||||
float AudioConfig::getBufferSize ()
|
||||
{
|
||||
return m_bufferSize;
|
||||
}
|
||||
|
||||
void AudioConfig::setBufferSize(float _bufferSize) {
|
||||
void AudioConfig::setBufferSize (float _bufferSize)
|
||||
{
|
||||
m_bufferSize = _bufferSize;
|
||||
}
|
||||
|
||||
bool AudioConfig::isNeedToReInit() const {
|
||||
bool AudioConfig::isNeedToReInit () const
|
||||
{
|
||||
return m_needToReInit;
|
||||
}
|
||||
|
||||
void AudioConfig::setNeedToReInit(bool _needToReInit) {
|
||||
void AudioConfig::setNeedToReInit (bool _needToReInit)
|
||||
{
|
||||
m_needToReInit = _needToReInit;
|
||||
}
|
||||
|
||||
std::shared_ptr<AudioConfig> AudioConfig::getInstance() {
|
||||
std::shared_ptr<AudioConfig> AudioConfig::getInstance ()
|
||||
{
|
||||
if (AudioConfig::m_instance == nullptr)
|
||||
AudioConfig::m_instance = std::make_shared<AudioConfig>();
|
||||
AudioConfig::m_instance = std::make_shared<AudioConfig> ();
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
void AudioConfig::initWaveTables() {
|
||||
WaveTableGenerator::getInstance().init();
|
||||
void AudioConfig::initWaveTables ()
|
||||
{
|
||||
WaveTableGenerator::getInstance ().init ();
|
||||
}
|
||||
|
||||
AudioConfig::~AudioConfig() {
|
||||
WaveTableGenerator::getInstance().cleanTables();
|
||||
AudioConfig::~AudioConfig ()
|
||||
{
|
||||
WaveTableGenerator::getInstance ().cleanTables ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,33 +10,23 @@
|
|||
/**
|
||||
* holds SampleRate and other needed sound information's :)
|
||||
*/
|
||||
class AudioConfig {
|
||||
class AudioConfig
|
||||
{
|
||||
private:
|
||||
static std::shared_ptr<AudioConfig> m_instance;
|
||||
float m_sampleRate = 44100;
|
||||
float m_bufferSize = 512; //maybe we need that... but this will update always!
|
||||
bool m_needToReInit = false; //this is to reInit the Oscillators, ADSR and other stuff
|
||||
public:
|
||||
static std::shared_ptr<AudioConfig> getInstance();
|
||||
|
||||
float getSampleRate();
|
||||
|
||||
void setSampleRate(float _sampleRate);
|
||||
|
||||
float getBufferSize();
|
||||
|
||||
void setBufferSize(float _bufferSize);
|
||||
|
||||
bool isNeedToReInit() const;
|
||||
|
||||
void setNeedToReInit(bool _needToReInit);
|
||||
|
||||
static void initWaveTables();
|
||||
|
||||
~AudioConfig();
|
||||
|
||||
static std::shared_ptr<AudioConfig> getInstance ();
|
||||
float getSampleRate ();
|
||||
void setSampleRate (float _sampleRate);
|
||||
float getBufferSize ();
|
||||
void setBufferSize (float _bufferSize);
|
||||
bool isNeedToReInit () const;
|
||||
void setNeedToReInit (bool _needToReInit);
|
||||
static void initWaveTables ();
|
||||
~AudioConfig ();
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
#endif //VENO_AUDIOCONFIG_H
|
||||
|
|
|
|||
|
|
@ -3,82 +3,100 @@
|
|||
//
|
||||
|
||||
#include "Config.h"
|
||||
#include "../Fonts/Fonts.h"
|
||||
|
||||
std::shared_ptr<Config> Config::m_instance = nullptr;
|
||||
|
||||
Config::Config() {
|
||||
Config::Config ()
|
||||
{
|
||||
// i want to load the m_config file here...
|
||||
initConfig();
|
||||
|
||||
m_theme = std::make_shared<Theme>(m_config);
|
||||
m_theme->init();
|
||||
m_fps = m_config->getIntValue("waveform_fps", 60);
|
||||
initConfig ();
|
||||
m_theme = std::make_shared<Theme> (m_config);
|
||||
m_theme->init ();
|
||||
m_fps = m_config->getIntValue ("waveform_fps", 60);
|
||||
}
|
||||
|
||||
void Config::saveAll() {
|
||||
if (m_config != nullptr) {
|
||||
m_config->saveIfNeeded();
|
||||
void Config::saveAll ()
|
||||
{
|
||||
if (m_config != nullptr)
|
||||
{
|
||||
m_config->saveIfNeeded ();
|
||||
}
|
||||
}
|
||||
|
||||
int Config::getCurrentLook() {
|
||||
if (m_currentLook > 1) {
|
||||
int Config::getCurrentLook ()
|
||||
{
|
||||
if (m_currentLook > 1)
|
||||
{
|
||||
m_currentLook = 0;
|
||||
}
|
||||
return m_currentLook;
|
||||
}
|
||||
|
||||
void Config::initConfig() {
|
||||
void Config::initConfig ()
|
||||
{
|
||||
PropertiesFile::Options options;
|
||||
options.applicationName = "config";
|
||||
options.folderName = "veno";
|
||||
options.filenameSuffix = "xml";
|
||||
m_config = std::make_unique<PropertiesFile>(options);
|
||||
m_config = std::make_unique<PropertiesFile> (options);
|
||||
}
|
||||
|
||||
std::shared_ptr<Theme> Config::getCurrentTheme() {
|
||||
std::shared_ptr<Theme> Config::getCurrentTheme ()
|
||||
{
|
||||
return m_theme;
|
||||
}
|
||||
|
||||
double Config::getScale() {
|
||||
double Config::getScale ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Config::setColourForIndex(Colour *colour, ThemeColour index) {
|
||||
if (m_theme) {
|
||||
m_theme->setColour(index, colour);
|
||||
void Config::setColourForIndex (Colour* colour, ThemeColour index)
|
||||
{
|
||||
if (m_theme)
|
||||
{
|
||||
m_theme->setColour (index, colour);
|
||||
}
|
||||
}
|
||||
|
||||
Config::~Config() {
|
||||
m_config->save();
|
||||
m_theme.reset();
|
||||
m_config.reset();
|
||||
Config::~Config ()
|
||||
{
|
||||
m_config->save ();
|
||||
m_theme.reset ();
|
||||
m_config.reset ();
|
||||
}
|
||||
|
||||
//LEAK DETECTOR FIX!
|
||||
void Config::registerEditor(AudioProcessorEditor *editor, const std::string &name) {
|
||||
void Config::registerEditor (AudioProcessorEditor* editor, const std::string& name)
|
||||
{
|
||||
m_editors[name] = editor;
|
||||
}
|
||||
|
||||
void Config::removeEditor(const std::string &name) {
|
||||
m_editors.erase(name);
|
||||
if (m_editors.empty()) {
|
||||
void Config::removeEditor (const std::string& name)
|
||||
{
|
||||
m_editors.erase (name);
|
||||
if (m_editors.empty ())
|
||||
{
|
||||
VenoFonts::destroyAll ();
|
||||
m_instance = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
//for LCD :P let's be a bit funny xD
|
||||
int Config::getEditorCount() {
|
||||
return m_editors.size();
|
||||
int Config::getEditorCount ()
|
||||
{
|
||||
return m_editors.size ();
|
||||
}
|
||||
|
||||
std::shared_ptr<Config> Config::getInstance() {
|
||||
std::shared_ptr<Config> Config::getInstance ()
|
||||
{
|
||||
if (m_instance == nullptr)
|
||||
m_instance = std::make_shared<Config>();
|
||||
m_instance = std::make_shared<Config> ();
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
int Config::getFps() const {
|
||||
int Config::getFps () const
|
||||
{
|
||||
return m_fps;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,42 +10,30 @@
|
|||
#include "../GUI/Theme/Theme.h"
|
||||
#include <memory>
|
||||
|
||||
class Config {
|
||||
class Config
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<PropertiesFile> m_config = nullptr;
|
||||
std::shared_ptr<Theme> m_theme = nullptr;
|
||||
static std::shared_ptr<Config> m_instance;
|
||||
int m_currentLook = 0; //nah move the bitch logic from current to next
|
||||
std::unordered_map<std::string, AudioProcessorEditor *> m_editors;
|
||||
std::unordered_map<std::string, AudioProcessorEditor*> m_editors;
|
||||
int m_fps = 60;
|
||||
public:
|
||||
static std::shared_ptr<Config> getInstance();
|
||||
|
||||
void saveAll();
|
||||
|
||||
int getCurrentLook();
|
||||
|
||||
void setColourForIndex(Colour *colour, ThemeColour index);
|
||||
|
||||
std::shared_ptr<Theme> getCurrentTheme();
|
||||
|
||||
double getScale();
|
||||
|
||||
static std::shared_ptr<Config> getInstance ();
|
||||
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();
|
||||
|
||||
int getFps() const;
|
||||
|
||||
Config ();
|
||||
~Config ();
|
||||
void registerEditor (AudioProcessorEditor* editor, const std::string& name);
|
||||
void removeEditor (const std::string& name);
|
||||
int getEditorCount ();
|
||||
int getFps () const;
|
||||
protected:
|
||||
void initConfig();
|
||||
void initConfig ();
|
||||
};
|
||||
|
||||
#endif //VENO_CONFIG_H
|
||||
|
|
|
|||
|
|
@ -4,11 +4,8 @@
|
|||
|
||||
#ifndef VENO_PRESETMANAGER_H
|
||||
#define VENO_PRESETMANAGER_H
|
||||
|
||||
|
||||
class PresetManager {
|
||||
class PresetManager
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //VENO_PRESETMANAGER_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue