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

Method Poll

Source/ModularSynth.cpp:320–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319static int sFrameCount = 0;
320void ModularSynth::Poll()
321{
322 if (mFatalError == "")
323 {
324 if (!mInitialized && sFrameCount > 3) //let some frames render before blocking for a load
325 {
326 mUserPrefsEditor->CreatePrefsFileIfNonexistent();
327
328 if (!mStartupSaveStateFile.empty())
329 LoadState(mStartupSaveStateFile);
330 else
331 LoadLayoutFromFile(ofToDataPath(UserPrefs.layout.Get()));
332 mInitialized = true;
333 }
334
335 if (mWantReloadInitialLayout)
336 {
337 LoadLayoutFromFile(ofToDataPath(UserPrefs.layout.Get()));
338 mWantReloadInitialLayout = false;
339 }
340 }
341
342 mZoomer.Update();
343
344 if (!mIsLoadingState)
345 {
346 for (auto p : mExtraPollers)
347 p->Poll();
348 mUILayerModuleContainer.Poll();
349 mModuleContainer.Poll();
350 }
351
352 if (mShowLoadStatePopup)
353 {
354 mShowLoadStatePopup = false;
355 LoadStatePopupImp();
356 }
357
358 if (mScheduledEnvelopeEditorSpawnDisplay != nullptr)
359 {
360 mScheduledEnvelopeEditorSpawnDisplay->SpawnEnvelopeEditor();
361 mScheduledEnvelopeEditorSpawnDisplay = nullptr;
362 }
363
364 {
365 static MouseCursor sCurrentCursor = MouseCursor::NormalCursor;
366 MouseCursor desiredCursor;
367
368 if (mIsLoadingState)
369 {
370 desiredCursor = MouseCursor::WaitCursor;
371 }
372 else if (gHoveredUIControl != nullptr && gHoveredUIControl->IsMouseDown())
373 {
374 if (GetKeyModifiers() == kModifier_Shift)
375 desiredCursor = MouseCursor::CrosshairCursor;
376 else if (dynamic_cast<FloatSlider*>(gHoveredUIControl) != nullptr && dynamic_cast<FloatSlider*>(gHoveredUIControl)->GetModulator() != nullptr && dynamic_cast<FloatSlider*>(gHoveredUIControl)->GetModulator()->Active())
377 desiredCursor = MouseCursor::UpDownLeftRightResizeCursor;

Callers

nothing calls this directly

Calls 14

ofToDataPathFunction · 0.85
GetKeyModifiersFunction · 0.85
emptyMethod · 0.80
GetMethod · 0.80
SpawnEnvelopeEditorMethod · 0.80
GetModulatorMethod · 0.80
GetMouseCursorTypeMethod · 0.80
distanceSquaredMethod · 0.80
IsShowingMethod · 0.80
UpdateMethod · 0.45
IsMouseDownMethod · 0.45

Tested by

no test coverage detected