Skip to content

Commit

Permalink
Added Engine.setPreloadMessage (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhealey authored Jan 19, 2025
1 parent 39b2fc3 commit 5795b42
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hi_core/hi_core/MainController.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ class MainController: public GlobalScriptCompileBroadcaster,
{
return currentPreloadMessage;
}

void setPreloadMessage(String message) const
{
currentPreloadMessage = message;
}

private:

Expand Down
7 changes: 7 additions & 0 deletions hi_scripting/scripting/api/ScriptingApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,7 @@ struct ScriptingApi::Engine::Wrapper
API_VOID_METHOD_WRAPPER_0(Engine, reloadAllSamples);
API_METHOD_WRAPPER_0(Engine, getPreloadProgress);
API_METHOD_WRAPPER_0(Engine, getPreloadMessage);
API_VOID_METHOD_WRAPPER_1(Engine, setPreloadMessage);
API_METHOD_WRAPPER_0(Engine, getDeviceType);
API_METHOD_WRAPPER_0(Engine, getDeviceResolution);
API_METHOD_WRAPPER_0(Engine, getZoomLevel);
Expand Down Expand Up @@ -1359,6 +1360,7 @@ parentMidiProcessor(dynamic_cast<ScriptBaseMidiProcessor*>(p))
ADD_API_METHOD_0(isPlugin);
ADD_API_METHOD_0(getPreloadProgress);
ADD_API_METHOD_0(getPreloadMessage);
ADD_API_METHOD_1(setPreloadMessage);
ADD_API_METHOD_0(getZoomLevel);
ADD_API_METHOD_1(setZoomLevel);
ADD_API_METHOD_1(setDiskMode);
Expand Down Expand Up @@ -1825,6 +1827,11 @@ String ScriptingApi::Engine::getPreloadMessage()
return getScriptProcessor()->getMainController_()->getSampleManager().getPreloadMessage();
}

void ScriptingApi::Engine::setPreloadMessage(String message)
{
getScriptProcessor()->getMainController_()->getSampleManager().setPreloadMessage(message);
}

var ScriptingApi::Engine::getZoomLevel() const
{
logSettingWarning("getZoomLevel");
Expand Down
3 changes: 3 additions & 0 deletions hi_scripting/scripting/api/ScriptingApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,9 @@ class ScriptingApi
/** Returns the current preload message if there is one. */
String getPreloadMessage();

/** Sets the preload message. */
void setPreloadMessage(String message);

/** Returns the current Zoom Level. */
var getZoomLevel() const;

Expand Down

0 comments on commit 5795b42

Please sign in to comment.