Bring Ildaeil fixes from the other side
This commit is contained in:
parent
e840ca05da
commit
3b3f155bb2
2 changed files with 47 additions and 14 deletions
2
carla
2
carla
|
@ -1 +1 @@
|
||||||
Subproject commit f78670e8483a529286a83e8bb989ed8bf7af8a9a
|
Subproject commit f8d7d9afcea4c01aaf502b5af884dde31dfb28a7
|
|
@ -663,6 +663,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
kIdleLoadSelectedPlugin,
|
kIdleLoadSelectedPlugin,
|
||||||
kIdlePluginLoadedFromDSP,
|
kIdlePluginLoadedFromDSP,
|
||||||
kIdleResetPlugin,
|
kIdleResetPlugin,
|
||||||
|
kIdleOpenFileUI,
|
||||||
kIdleShowCustomUI,
|
kIdleShowCustomUI,
|
||||||
kIdleHidePluginUI,
|
kIdleHidePluginUI,
|
||||||
kIdleGiveIdleToUI,
|
kIdleGiveIdleToUI,
|
||||||
|
@ -693,6 +694,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
int fPluginSelected = -1;
|
int fPluginSelected = -1;
|
||||||
bool fPluginScanningFinished = false;
|
bool fPluginScanningFinished = false;
|
||||||
bool fPluginHasCustomUI = false;
|
bool fPluginHasCustomUI = false;
|
||||||
|
bool fPluginHasFileOpen = false;
|
||||||
bool fPluginHasOutputParameters = false;
|
bool fPluginHasOutputParameters = false;
|
||||||
bool fPluginRunning = false;
|
bool fPluginRunning = false;
|
||||||
bool fPluginWillRunInBridgeMode = false;
|
bool fPluginWillRunInBridgeMode = false;
|
||||||
|
@ -762,16 +764,28 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
{
|
{
|
||||||
const CarlaHostHandle handle = module->fCarlaHostHandle;
|
const CarlaHostHandle handle = module->fCarlaHostHandle;
|
||||||
|
|
||||||
if (carla_get_current_plugin_count(handle) != 0)
|
if (carla_get_current_plugin_count(handle) == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const uint hints = carla_get_plugin_info(handle, 0)->hints;
|
||||||
|
updatePluginFlags(hints);
|
||||||
|
|
||||||
|
fPluginRunning = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void updatePluginFlags(const uint hints) noexcept
|
||||||
|
{
|
||||||
|
if (hints & PLUGIN_HAS_CUSTOM_UI_USING_FILE_OPEN)
|
||||||
{
|
{
|
||||||
const uint hints = carla_get_plugin_info(handle, 0)->hints;
|
fPluginHasCustomUI = false;
|
||||||
|
fPluginHasFileOpen = true;
|
||||||
fPluginRunning = true;
|
}
|
||||||
fPluginHasCustomUI = hints & PLUGIN_HAS_CUSTOM_UI;
|
else
|
||||||
return true;
|
{
|
||||||
|
fPluginHasCustomUI = hints & PLUGIN_HAS_CUSTOM_UI;
|
||||||
|
fPluginHasFileOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void projectLoadedFromDSP()
|
void projectLoadedFromDSP()
|
||||||
|
@ -828,7 +842,8 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
const CarlaPluginInfo* const info = carla_get_plugin_info(handle, 0);
|
const CarlaPluginInfo* const info = carla_get_plugin_info(handle, 0);
|
||||||
|
|
||||||
fDrawingState = kDrawingPluginGenericUI;
|
fDrawingState = kDrawingPluginGenericUI;
|
||||||
fPluginHasCustomUI = info->hints & PLUGIN_HAS_CUSTOM_UI;
|
updatePluginFlags(info->hints);
|
||||||
|
|
||||||
if (fPluginGenericUI == nullptr)
|
if (fPluginGenericUI == nullptr)
|
||||||
createPluginGenericUI(handle, info);
|
createPluginGenericUI(handle, info);
|
||||||
else
|
else
|
||||||
|
@ -1061,6 +1076,8 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
case kIdlePluginLoadedFromDSP:
|
case kIdlePluginLoadedFromDSP:
|
||||||
fIdleState = kIdleNothing;
|
fIdleState = kIdleNothing;
|
||||||
createOrUpdatePluginGenericUI(handle);
|
createOrUpdatePluginGenericUI(handle);
|
||||||
|
if (fRunnerData.needsReinit)
|
||||||
|
initAndStartRunner();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kIdleLoadSelectedPlugin:
|
case kIdleLoadSelectedPlugin:
|
||||||
|
@ -1073,6 +1090,11 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
loadPlugin(handle, carla_get_plugin_info(handle, 0)->label);
|
loadPlugin(handle, carla_get_plugin_info(handle, 0)->label);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kIdleOpenFileUI:
|
||||||
|
fIdleState = kIdleNothing;
|
||||||
|
carla_show_custom_ui(handle, 0, true);
|
||||||
|
break;
|
||||||
|
|
||||||
case kIdleShowCustomUI:
|
case kIdleShowCustomUI:
|
||||||
fIdleState = kIdleGiveIdleToUI;
|
fIdleState = kIdleGiveIdleToUI;
|
||||||
carla_show_custom_ui(handle, 0, true);
|
carla_show_custom_ui(handle, 0, true);
|
||||||
|
@ -1338,12 +1360,23 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Runner {
|
||||||
if (ImGui::Button("Reset"))
|
if (ImGui::Button("Reset"))
|
||||||
fIdleState = kIdleResetPlugin;
|
fIdleState = kIdleResetPlugin;
|
||||||
|
|
||||||
if (fDrawingState == kDrawingPluginGenericUI && fPluginHasCustomUI)
|
if (fDrawingState == kDrawingPluginGenericUI)
|
||||||
{
|
{
|
||||||
ImGui::SameLine();
|
if (fPluginHasCustomUI)
|
||||||
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
if (ImGui::Button("Show Custom GUI"))
|
if (ImGui::Button("Show Custom GUI"))
|
||||||
fIdleState = kIdleShowCustomUI;
|
fIdleState = kIdleShowCustomUI;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fPluginHasFileOpen)
|
||||||
|
{
|
||||||
|
ImGui::SameLine();
|
||||||
|
|
||||||
|
if (ImGui::Button("Open File..."))
|
||||||
|
fIdleState = kIdleOpenFileUI;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue