reVeno/Source/Veno/Core/AudioConfig.h

38 lines
1.1 KiB
C
Raw Permalink Normal View History

2020-04-03 13:23:19 +02:00
//
// 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
{
2020-04-03 13:23:19 +02:00
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
2020-07-09 16:31:33 +02:00
static std::unordered_map<std::string, std::string> m_instances;
2020-04-03 13:23:19 +02:00
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 ();
2020-07-09 16:31:33 +02:00
AudioConfig();
~AudioConfig ();
2020-07-09 16:31:33 +02:00
static void registerInstance (std::string id);
static void deleteInstance (std::string id);
2020-04-03 13:23:19 +02:00
protected:
2020-07-09 16:31:33 +02:00
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioConfig);
2020-04-03 13:23:19 +02:00
};
#endif //VENO_AUDIOCONFIG_H