Skip to content

Commit

Permalink
- cherry picked logic server fix into master
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph-hart committed Aug 26, 2021
1 parent e4b8330 commit f816c4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hi_core/hi_core/MainController.cpp
Expand Up @@ -348,6 +348,8 @@ void MainController::loadPresetInternal(const ValueTree& v)
synth->setEditorState(Processor::EditorState::Folded, true);

changed = false;

getJavascriptThreadPool().getGlobalServer()->setInitialised();
#endif

auto f = [](Dispatchable* obj)
Expand Down
2 changes: 2 additions & 0 deletions hi_frontend/frontend/FrontEndProcessor.cpp
Expand Up @@ -415,6 +415,8 @@ void FrontendProcessor::createPreset(const ValueTree& synthData)
LOG_START("Initialising audio callback");
synthChain->prepareToPlay(getSampleRate(), getBlockSize());
}

getJavascriptThreadPool().getGlobalServer()->setInitialised();
}

const String FrontendProcessor::getName(void) const
Expand Down
2 changes: 1 addition & 1 deletion hi_scripting/scripting/api/GlobalServer.cpp
Expand Up @@ -106,7 +106,7 @@ void GlobalServer::WebThread::run()
{
while (!threadShouldExit())
{
if (parent.getMainController()->getKillStateHandler().initialised())
if (parent.initialised)
{
{
ReferenceCountedArray<ScriptingObjects::ScriptDownloadObject> thisList;
Expand Down
7 changes: 7 additions & 0 deletions hi_scripting/scripting/api/GlobalServer.h
Expand Up @@ -200,8 +200,15 @@ struct GlobalServer: public ControlledObject

juce::URL getWithParameters(String subURL, var parameters);

void setInitialised()
{
initialised = true;
}

private:

bool initialised = false;

struct WebThread : public Thread
{
WebThread(GlobalServer& p) :
Expand Down

0 comments on commit f816c4b

Please sign in to comment.