- cleanup vars

- added LICENSE.txt
- added LabelComponent.cpp
- renamed some variables
- moved instance id to processor
This commit is contained in:
Maurice Grönwoldt 2020-06-08 21:27:17 +02:00
commit d735c1d076
19 changed files with 948 additions and 180 deletions

View file

@ -6,25 +6,25 @@
#include "ThemePresets.cpp"
Theme::Theme(std::shared_ptr<PropertiesFile> file) {
configFile = file;
m_configFile = file;
}
Theme::~Theme() {
colours.clear();
configFile.reset();
m_colours.clear();
m_configFile.reset();
}
void Theme::setColour(ThemeColour index, Colour *colour) {
auto c = colours[index];
auto c = m_colours[index];
if (c) {
delete c;
colours[index] = colour;
m_colours[index] = colour;
} else {
colours[index] = colour;
m_colours[index] = colour;
}
configFile->setValue(ThemeColourToString(index), colour->toString());
configFile->save();
m_configFile->setValue(ThemeColourToString(index), colour->toString());
m_configFile->save();
}
@ -42,8 +42,8 @@ void Theme::init() {
void Theme::getColourFromConfig(ThemeColour index) {
std::string key = ThemeColourToString(index);
if (configFile->containsKey(key)) {
auto baseColour = Colour::fromString(configFile->getValue(key));
if (m_configFile->containsKey(key)) {
auto baseColour = Colour::fromString(m_configFile->getValue(key));
auto *colour = new Colour(baseColour.getRed(), baseColour.getGreen(), baseColour.getBlue());
setColour(index, colour);
}

View file

@ -22,8 +22,8 @@ public:
void init();
void getColourFromConfig(ThemeColour index);
protected:
std::map<ThemeColour, Colour*> colours;
std::shared_ptr<PropertiesFile> configFile;
std::map<ThemeColour, Colour*> m_colours;
std::shared_ptr<PropertiesFile> m_configFile;
};

View file

@ -4,9 +4,9 @@
* 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
* also good on this is that the user can slightly change the preset m_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
* maybe i want a double m_look and feel... that's make it easier to implement different knob styles, slider styles and co
*/
void setLEDTheme(Theme *theme) {