MCPcopy Create free account
hub / github.com/christophhart/HISE / replaceContentAsync

Method replaceContentAsync

hi_scripting/scripting/ScriptProcessor.cpp:800–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798{ return numArgs; }
799
800void JavascriptProcessor::SnippetDocument::replaceContentAsync(String s, bool shouldBeAsync)
801{
802
803#if USE_FRONTEND
804 // Not important when using compiled plugins because there will be no editor component
805 // being resized...
806 replaceAllContent(s);
807#else
808 {
809 // Makes sure that this won't be accessed during replacement...
810 SpinLock::ScopedLockType sl(pendingLock);
811 pendingNewContent.swapWith(s);
812 }
813
814 if(shouldBeAsync)
815 {
816 notifier.notify();
817 }
818 else
819 {
820 notifier.handleAsyncUpdate();
821 }
822#endif
823}
824
825JavascriptProcessor::SnippetDocument::Notifier::Notifier(SnippetDocument& parent_):
826 parent(parent_)

Callers 2

createInterfaceMethod · 0.80

Calls 3

swapWithMethod · 0.45
notifyMethod · 0.45
handleAsyncUpdateMethod · 0.45

Tested by

no test coverage detected