MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Init

Method Init

Source/UserPrefs.cpp:87–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void UserPrefsHolder::Init()
88{
89 mUserPrefsFile.open(TheSynth->GetUserPrefsPath());
90
91 // Look for overrides in command line options
92 for (int i = 0; i < juce::JUCEApplication::getCommandLineParameterArray().size(); ++i)
93 {
94 juce::String argument = juce::JUCEApplication::getCommandLineParameterArray()[i];
95 if (argument == "-o" || argument == "--option")
96 {
97 juce::String argJsonOption = juce::JUCEApplication::getCommandLineParameterArray()[i + 1];
98 auto value = juce::JUCEApplication::getCommandLineParameterArray()[i + 2].toStdString();
99 auto& element = mUserPrefsFile[argJsonOption.toStdString()];
100 try
101 {
102 setValueFromString(element, value);
103 }
104 catch (std::invalid_argument)
105 {
106 ofLog() << "Failed to convert argument " << value << " to the desired type";
107 }
108 }
109 }
110
111 for (auto* pref : mUserPrefs)
112 pref->Init();
113}
114
115std::string UserPrefsHolder::ToStringLeadingZeroes(int number)
116{

Callers

nothing calls this directly

Calls 6

setValueFromStringFunction · 0.85
ofLogClass · 0.85
openMethod · 0.80
GetUserPrefsPathMethod · 0.80
sizeMethod · 0.80
LogEventMethod · 0.80

Tested by

no test coverage detected