Ildaeil: support read only params
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
da4eca8d20
commit
46c333a0fe
1 changed files with 26 additions and 7 deletions
|
|
@ -578,7 +578,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
char* name;
|
char* name;
|
||||||
char* format;
|
char* format;
|
||||||
uint32_t rindex;
|
uint32_t rindex;
|
||||||
bool boolean, bvalue, log;
|
bool boolean, bvalue, log, readonly;
|
||||||
float min, max, power;
|
float min, max, power;
|
||||||
Parameter()
|
Parameter()
|
||||||
: name(nullptr),
|
: name(nullptr),
|
||||||
|
|
@ -587,6 +587,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
boolean(false),
|
boolean(false),
|
||||||
bvalue(false),
|
bvalue(false),
|
||||||
log(false),
|
log(false),
|
||||||
|
readonly(false),
|
||||||
min(0.0f),
|
min(0.0f),
|
||||||
max(1.0f) {}
|
max(1.0f) {}
|
||||||
~Parameter()
|
~Parameter()
|
||||||
|
|
@ -639,6 +640,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
int fPluginSelected = -1;
|
int fPluginSelected = -1;
|
||||||
bool fPluginScanningFinished = false;
|
bool fPluginScanningFinished = false;
|
||||||
bool fPluginHasCustomUI = false;
|
bool fPluginHasCustomUI = false;
|
||||||
|
bool fPluginHasOutputParameters = false;
|
||||||
bool fPluginRunning = false;
|
bool fPluginRunning = false;
|
||||||
bool fPluginWillRunInBridgeMode = false;
|
bool fPluginWillRunInBridgeMode = false;
|
||||||
PluginInfoCache* fPlugins = nullptr;
|
PluginInfoCache* fPlugins = nullptr;
|
||||||
|
|
@ -785,6 +787,8 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
title += info->maker;
|
title += info->maker;
|
||||||
ui->title = title.getAndReleaseBuffer();
|
ui->title = title.getAndReleaseBuffer();
|
||||||
|
|
||||||
|
fPluginHasOutputParameters = false;
|
||||||
|
|
||||||
const uint32_t pcount = ui->parameterCount = carla_get_parameter_count(handle, 0);
|
const uint32_t pcount = ui->parameterCount = carla_get_parameter_count(handle, 0);
|
||||||
|
|
||||||
// make count of valid parameters
|
// make count of valid parameters
|
||||||
|
|
@ -792,13 +796,14 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
{
|
{
|
||||||
const ParameterData* const pdata = carla_get_parameter_data(handle, 0, i);
|
const ParameterData* const pdata = carla_get_parameter_data(handle, 0, i);
|
||||||
|
|
||||||
if (pdata->type != PARAMETER_INPUT ||
|
if ((pdata->hints & PARAMETER_IS_ENABLED) == 0x0)
|
||||||
(pdata->hints & PARAMETER_IS_ENABLED) == 0x0 ||
|
|
||||||
(pdata->hints & PARAMETER_IS_READ_ONLY) != 0x0)
|
|
||||||
{
|
{
|
||||||
--ui->parameterCount;
|
--ui->parameterCount;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pdata->type == PARAMETER_OUTPUT)
|
||||||
|
fPluginHasOutputParameters = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->parameters = new PluginGenericUI::Parameter[ui->parameterCount];
|
ui->parameters = new PluginGenericUI::Parameter[ui->parameterCount];
|
||||||
|
|
@ -809,9 +814,7 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
{
|
{
|
||||||
const ParameterData* const pdata = carla_get_parameter_data(handle, 0, i);
|
const ParameterData* const pdata = carla_get_parameter_data(handle, 0, i);
|
||||||
|
|
||||||
if (pdata->type != PARAMETER_INPUT ||
|
if ((pdata->hints & PARAMETER_IS_ENABLED) == 0x0)
|
||||||
(pdata->hints & PARAMETER_IS_ENABLED) == 0x0 ||
|
|
||||||
(pdata->hints & PARAMETER_IS_READ_ONLY) != 0x0)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const CarlaParameterInfo* const pinfo = carla_get_parameter_info(handle, 0, i);
|
const CarlaParameterInfo* const pinfo = carla_get_parameter_info(handle, 0, i);
|
||||||
|
|
@ -832,8 +835,10 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
param.rindex = i;
|
param.rindex = i;
|
||||||
param.boolean = pdata->hints & PARAMETER_IS_BOOLEAN;
|
param.boolean = pdata->hints & PARAMETER_IS_BOOLEAN;
|
||||||
param.log = pdata->hints & PARAMETER_IS_LOGARITHMIC;
|
param.log = pdata->hints & PARAMETER_IS_LOGARITHMIC;
|
||||||
|
param.readonly = pdata->type != PARAMETER_INPUT || (pdata->hints & PARAMETER_IS_READ_ONLY);
|
||||||
param.min = pranges->min;
|
param.min = pranges->min;
|
||||||
param.max = pranges->max;
|
param.max = pranges->max;
|
||||||
|
|
||||||
ui->values[j] = carla_get_current_parameter_value(handle, 0, i);
|
ui->values[j] = carla_get_current_parameter_value(handle, 0, i);
|
||||||
|
|
||||||
if (param.boolean)
|
if (param.boolean)
|
||||||
|
|
@ -971,6 +976,12 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
fileBrowserHandle = nullptr;
|
fileBrowserHandle = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fDrawingState == kDrawingPluginGenericUI && fPluginGenericUI != nullptr && fPluginHasOutputParameters)
|
||||||
|
{
|
||||||
|
updatePluginGenericUI(handle);
|
||||||
|
setDirty(true);
|
||||||
|
}
|
||||||
|
|
||||||
switch (fIdleState)
|
switch (fIdleState)
|
||||||
{
|
{
|
||||||
case kIdleInit:
|
case kIdleInit:
|
||||||
|
|
@ -1267,6 +1278,14 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread {
|
||||||
{
|
{
|
||||||
PluginGenericUI::Parameter& param(ui->parameters[i]);
|
PluginGenericUI::Parameter& param(ui->parameters[i]);
|
||||||
|
|
||||||
|
if (param.readonly)
|
||||||
|
{
|
||||||
|
ImGui::BeginDisabled();
|
||||||
|
ImGui::SliderFloat(param.name, &ui->values[i], param.min, param.max, param.format, ImGuiSliderFlags_NoInput);
|
||||||
|
ImGui::EndDisabled();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (param.boolean)
|
if (param.boolean)
|
||||||
{
|
{
|
||||||
if (ImGui::Checkbox(param.name, &ui->parameters[i].bvalue))
|
if (ImGui::Checkbox(param.name, &ui->parameters[i].bvalue))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue