Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ildaeil: Add reload bridge button, in case it crashes or times out
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Sep 7, 2023
1 parent 1f5019a commit 991928e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion carla
22 changes: 21 additions & 1 deletion plugins/Cardinal/src/Ildaeil.cpp
Expand Up @@ -572,7 +572,7 @@ struct IldaeilModule : Module {
{
switch (opcode)
{
// cannnot be supported
// cannnot be supported?
case NATIVE_HOST_OPCODE_HOST_IDLE:
break;
// other stuff
Expand Down Expand Up @@ -955,6 +955,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
bool fPluginHasCustomUI = false;
bool fPluginHasFileOpen = false;
bool fPluginHasOutputParameters = false;
bool fPluginIsBridge = false;
bool fPluginRunning = false;
bool fPluginWillRunInBridgeMode = false;
Mutex fPluginsMutex;
Expand Down Expand Up @@ -1045,6 +1046,8 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
fPluginHasCustomUI = hints & PLUGIN_HAS_CUSTOM_UI;
fPluginHasFileOpen = false;
}

fPluginIsBridge = hints & PLUGIN_IS_BRIDGE;
}

void projectLoadedFromDSP()
Expand Down Expand Up @@ -1969,6 +1972,23 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
{
const CarlaHostHandle handle = module->fCarlaHostHandle;

if (fPluginIsBridge)
{
const bool active = carla_get_internal_parameter_value(handle, 0, PARAMETER_ACTIVE) > 0.5f;

if (active)
{
ImGui::BeginDisabled();
ImGui::Button("Reload bridge");
ImGui::EndDisabled();
}
else
{
if (ImGui::Button("Reload bridge"))
carla_set_active(handle, 0, true);
}
}

if (ui->presetCount != 0)
{
ImGui::Text("Preset:");
Expand Down

0 comments on commit 991928e

Please sign in to comment.