WIP
This commit is contained in:
parent
3fda15966c
commit
61482e8d4c
36 changed files with 325 additions and 122 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "../Audio/WaveTable/WaveTableGenerator.h"
|
||||
|
||||
std::shared_ptr<AudioConfig> AudioConfig::m_instance;
|
||||
std::unordered_map<std::string, std::string> AudioConfig::m_instances;
|
||||
|
||||
float AudioConfig::getSampleRate ()
|
||||
{
|
||||
|
|
@ -43,16 +44,35 @@ void AudioConfig::setNeedToReInit (bool _needToReInit)
|
|||
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();
|
||||
WaveTableGenerator::getInstance ().init ();
|
||||
}
|
||||
|
||||
AudioConfig::~AudioConfig ()
|
||||
{
|
||||
WaveTableGenerator::getInstance().cleanTables();
|
||||
WaveTableGenerator::getInstance ().cleanTables ();
|
||||
}
|
||||
|
||||
AudioConfig::AudioConfig ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void AudioConfig::registerInstance (std::string id)
|
||||
{
|
||||
m_instances[id] = id;
|
||||
}
|
||||
|
||||
void AudioConfig::deleteInstance (std::string id)
|
||||
{
|
||||
m_instances.erase (id);
|
||||
if (m_instances.size () == 0)
|
||||
{
|
||||
m_instance.reset ();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ private:
|
|||
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
|
||||
static std::unordered_map<std::string, std::string> m_instances;
|
||||
public:
|
||||
static std::shared_ptr<AudioConfig> getInstance ();
|
||||
float getSampleRate ();
|
||||
|
|
@ -26,7 +27,11 @@ public:
|
|||
bool isNeedToReInit () const;
|
||||
void setNeedToReInit (bool _needToReInit);
|
||||
static void initWaveTables ();
|
||||
AudioConfig();
|
||||
~AudioConfig ();
|
||||
static void registerInstance (std::string id);
|
||||
static void deleteInstance (std::string id);
|
||||
protected:
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioConfig);
|
||||
};
|
||||
#endif //VENO_AUDIOCONFIG_H
|
||||
|
|
|
|||
|
|
@ -41,5 +41,6 @@ public:
|
|||
void repaintAll();
|
||||
protected:
|
||||
void initConfig ();
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Config);
|
||||
};
|
||||
#endif //VENO_CONFIG_H
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class VeNoState
|
|||
{
|
||||
protected:
|
||||
std::string m_pid = "";
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VeNoState);
|
||||
public:
|
||||
VeNoState(std::string pid);
|
||||
~VeNoState();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue