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

Method Setup

Source/ModularSynth.cpp:225–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void ModularSynth::Setup(juce::AudioDeviceManager* globalAudioDeviceManager, juce::AudioFormatManager* globalAudioFormatManager, juce::Component* mainComponent, juce::OpenGLContext* openGLContext)
226{
227 mGlobalAudioDeviceManager = globalAudioDeviceManager;
228 mGlobalAudioFormatManager = globalAudioFormatManager;
229 mMainComponent = mainComponent;
230 mOpenGLContext = openGLContext;
231
232 sShouldAutosave = UserPrefs.autosave.Get();
233
234 mIOBufferSize = gBufferSize;
235
236 mGlobalRecordBuffer = new RollingBuffer(UserPrefs.record_buffer_length_minutes.Get() * 60 * gSampleRate);
237 mGlobalRecordBuffer->SetNumChannels(2);
238
239 juce::File(ofToDataPath("savestate")).createDirectory();
240 juce::File(ofToDataPath("savestate/autosave")).createDirectory();
241 juce::File(ofToDataPath("recordings")).createDirectory();
242 juce::File(ofToSamplePath("")).createDirectory();
243 juce::File(ofToDataPath("scripts")).createDirectory();
244 juce::File(ofToDataPath("internal")).createDirectory();
245 juce::File(ofToDataPath("vst")).createDirectory();
246
247 SynthInit();
248
249 new Transport();
250 new Scale();
251 TheScale->CreateUIControls();
252 TheTransport->CreateUIControls();
253
254 TheScale->Init();
255 TheTransport->Init();
256
257 DrumPlayer::SetUpHitDirectories();
258
259 sBackgroundLissajousR = UserPrefs.lissajous_r.Get();
260 sBackgroundLissajousG = UserPrefs.lissajous_g.Get();
261 sBackgroundLissajousB = UserPrefs.lissajous_b.Get();
262 sBackgroundR = UserPrefs.background_r.Get();
263 sBackgroundG = UserPrefs.background_g.Get();
264 sBackgroundB = UserPrefs.background_b.Get();
265 sCableAlpha = UserPrefs.cable_alpha.Get();
266
267 Time time = Time::getCurrentTime();
268 if (fabsf(sBackgroundR - UserPrefs.background_r.GetDefault()) < .001f && fabsf(sBackgroundG - UserPrefs.background_g.GetDefault()) < .001f && fabsf(sBackgroundB - UserPrefs.background_b.GetDefault()) < .001f && time.getMonth() + 1 == 10 && time.getDayOfMonth() == 31)
269 {
270 sBackgroundLissajousR = 0.722f;
271 sBackgroundLissajousG = 0.328f;
272 sBackgroundLissajousB = 0.0f;
273 }
274
275 ResetLayout();
276
277 mConsoleListener = new ConsoleListener();
278 mConsoleEntry = new TextEntry(mConsoleListener, "console", 0, 20, 50, mConsoleText);
279 mConsoleEntry->SetRequireEnter(true);
280}
281
282void ModularSynth::LoadResources(void* nanoVG, void* fontBoundsNanoVG)

Callers

nothing calls this directly

Calls 9

ofToDataPathFunction · 0.85
ofToSamplePathFunction · 0.85
SynthInitFunction · 0.85
GetMethod · 0.80
SetNumChannelsMethod · 0.80
SetRequireEnterMethod · 0.80
CreateUIControlsMethod · 0.45
InitMethod · 0.45
GetDefaultMethod · 0.45

Tested by

no test coverage detected