2020-04-03 13:23:19 +02:00
|
|
|
//
|
|
|
|
// 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>
|
|
|
|
|
2020-06-14 21:14:28 +02:00
|
|
|
class Config : public Timer
|
2020-06-13 16:52:16 +02:00
|
|
|
{
|
2020-04-03 13:23:19 +02:00
|
|
|
private:
|
2020-06-08 21:27:17 +02:00
|
|
|
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
|
2020-06-13 16:52:16 +02:00
|
|
|
std::unordered_map<std::string, AudioProcessorEditor*> m_editors;
|
2020-06-14 21:14:28 +02:00
|
|
|
std::shared_ptr<LookHandler> m_lookHandler;
|
2020-04-03 13:23:19 +02:00
|
|
|
public:
|
2020-06-14 21:14:28 +02:00
|
|
|
int m_fps = 60;
|
|
|
|
float m_scale = 1.0f;
|
2020-06-13 16:52:16 +02:00
|
|
|
static std::shared_ptr<Config> getInstance ();
|
|
|
|
void saveAll ();
|
|
|
|
int getCurrentLook ();
|
|
|
|
void setColourForIndex (Colour* colour, ThemeColour index);
|
|
|
|
std::shared_ptr<Theme> getCurrentTheme ();
|
2020-06-14 21:14:28 +02:00
|
|
|
double getScale () const;
|
2020-04-03 13:23:19 +02:00
|
|
|
// can be public but doesnt need!
|
2020-06-13 16:52:16 +02:00
|
|
|
Config ();
|
|
|
|
~Config ();
|
|
|
|
void registerEditor (AudioProcessorEditor* editor, const std::string& name);
|
|
|
|
void removeEditor (const std::string& name);
|
|
|
|
int getEditorCount ();
|
|
|
|
int getFps () const;
|
2020-06-14 21:14:28 +02:00
|
|
|
void setScale(float value);
|
|
|
|
void setFps(float value);
|
|
|
|
void timerCallback () override;
|
|
|
|
void repaintAll();
|
2020-04-03 13:23:19 +02:00
|
|
|
protected:
|
2020-06-13 16:52:16 +02:00
|
|
|
void initConfig ();
|
2020-07-09 16:31:33 +02:00
|
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Config);
|
2020-04-03 13:23:19 +02:00
|
|
|
};
|
|
|
|
#endif //VENO_CONFIG_H
|