Send audio input and time values to mini GUI
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
73711f77a6
commit
919e21703b
7 changed files with 587 additions and 287 deletions
|
|
@ -63,8 +63,8 @@ struct HostParametersMap : TerminalModule {
|
|||
uint8_t learningId = UINT8_MAX;
|
||||
|
||||
CardinalPluginContext* const pcontext;
|
||||
bool parametersChanged[kModuleParameters] = {};
|
||||
float parameterValues[kModuleParameters];
|
||||
bool parametersChanged[kModuleParameterCount] = {};
|
||||
float parameterValues[kModuleParameterCount];
|
||||
bool bypassed = false;
|
||||
bool firstRun = true;
|
||||
uint32_t lastProcessCounter = 0;
|
||||
|
|
@ -135,7 +135,7 @@ struct HostParametersMap : TerminalModule {
|
|||
if (isBypassed())
|
||||
return;
|
||||
|
||||
for (uint32_t i = 0; i < kModuleParameters; ++i)
|
||||
for (uint32_t i = 0; i < kModuleParameterCount; ++i)
|
||||
{
|
||||
if (d_isEqual(pcontext->parameters[i], parameterValues[i]))
|
||||
continue;
|
||||
|
|
@ -161,7 +161,7 @@ struct HostParametersMap : TerminalModule {
|
|||
|
||||
// Validate hostParamId
|
||||
const uint8_t hostParamId = mappings[id].hostParamId;
|
||||
if (hostParamId >= kModuleParameters)
|
||||
if (hostParamId >= kModuleParameterCount)
|
||||
continue;
|
||||
|
||||
// Set filter from param value if filter is uninitialized
|
||||
|
|
@ -350,7 +350,7 @@ struct ParameterIndexQuantity : Quantity {
|
|||
return 0;
|
||||
}
|
||||
float getMaxValue() override {
|
||||
return kModuleParameters - 1;
|
||||
return kModuleParameterCount - 1;
|
||||
}
|
||||
float getDefaultValue() override {
|
||||
return 0;
|
||||
|
|
@ -360,7 +360,7 @@ struct ParameterIndexQuantity : Quantity {
|
|||
}
|
||||
void setValue(float value) override {
|
||||
v = math::clamp(value, getMinValue(), getMaxValue());
|
||||
mapping.hostParamId = math::clamp(static_cast<int>(v + 0.5f), 0, kModuleParameters - 1);
|
||||
mapping.hostParamId = math::clamp(static_cast<int>(v + 0.5f), 0, kModuleParameterCount - 1);
|
||||
}
|
||||
float getDisplayValue() override {
|
||||
return mapping.hostParamId + 1;
|
||||
|
|
@ -437,7 +437,7 @@ struct HostParametersMapChoice : CardinalLedDisplayChoice {
|
|||
if (ParamWidget* const touchedParam = APP->scene->rack->touchedParam)
|
||||
{
|
||||
APP->scene->rack->touchedParam = nullptr;
|
||||
DISTRHO_SAFE_ASSERT_RETURN(mapping.hostParamId < kModuleParameters,);
|
||||
DISTRHO_SAFE_ASSERT_RETURN(mapping.hostParamId < kModuleParameterCount,);
|
||||
|
||||
const int64_t moduleId = touchedParam->module->id;
|
||||
const int paramId = touchedParam->paramId;
|
||||
|
|
@ -453,7 +453,7 @@ struct HostParametersMapChoice : CardinalLedDisplayChoice {
|
|||
text.clear();
|
||||
|
||||
// mapped
|
||||
if (module->mappings[id].hostParamId < kModuleParameters)
|
||||
if (module->mappings[id].hostParamId < kModuleParameterCount)
|
||||
text += string::f("P%02d: ", module->mappings[id].hostParamId + 1);
|
||||
if (module->mappings[id].paramHandle.moduleId >= 0)
|
||||
text += getParamName();
|
||||
|
|
|
|||
|
|
@ -28,15 +28,15 @@ struct HostParameters : TerminalModule {
|
|||
NUM_INPUTS
|
||||
};
|
||||
enum OutputIds {
|
||||
NUM_OUTPUTS = 24
|
||||
NUM_OUTPUTS = kModuleParameterCount
|
||||
};
|
||||
enum LightIds {
|
||||
NUM_LIGHTS
|
||||
};
|
||||
|
||||
CardinalPluginContext* const pcontext;
|
||||
rack::dsp::SlewLimiter parameters[kModuleParameters];
|
||||
bool parametersConnected[kModuleParameters] = {};
|
||||
rack::dsp::SlewLimiter parameters[kModuleParameterCount];
|
||||
bool parametersConnected[kModuleParameterCount] = {};
|
||||
bool bypassed = false;
|
||||
bool smooth = true;
|
||||
uint32_t lastProcessCounter = 0;
|
||||
|
|
@ -59,7 +59,7 @@ struct HostParameters : TerminalModule {
|
|||
bypassed = isBypassed();
|
||||
lastProcessCounter = processCounter;
|
||||
|
||||
for (uint32_t i=0; i<kModuleParameters; ++i)
|
||||
for (uint32_t i=0; i<kModuleParameterCount; ++i)
|
||||
{
|
||||
const bool connected = outputs[i].isConnected();
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ struct HostParameters : TerminalModule {
|
|||
if (bypassed)
|
||||
return;
|
||||
|
||||
for (uint32_t i=0; i<kModuleParameters; ++i)
|
||||
for (uint32_t i=0; i<kModuleParameterCount; ++i)
|
||||
{
|
||||
if (parametersConnected[i])
|
||||
outputs[i].setVoltage(smooth ? parameters[i].process(args.sampleTime, pcontext->parameters[i])
|
||||
|
|
@ -89,7 +89,7 @@ struct HostParameters : TerminalModule {
|
|||
{
|
||||
const double fall = 1.0 / (double(pcontext->bufferSize) / e.sampleRate);
|
||||
|
||||
for (uint32_t i=0; i<kModuleParameters; ++i)
|
||||
for (uint32_t i=0; i<kModuleParameterCount; ++i)
|
||||
{
|
||||
parameters[i].reset();
|
||||
parameters[i].setRiseFall(fall, fall);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ END_NAMESPACE_DGL
|
|||
|
||||
START_NAMESPACE_DISTRHO
|
||||
|
||||
static constexpr const uint32_t kModuleParameters = 24;
|
||||
static constexpr const uint32_t kModuleParameterCount = 24;
|
||||
|
||||
enum CardinalVariant {
|
||||
kCardinalVariantMain,
|
||||
|
|
@ -57,7 +57,7 @@ struct MidiEvent {
|
|||
struct CardinalPluginContext : rack::Context {
|
||||
uint32_t bufferSize, processCounter;
|
||||
double sampleRate;
|
||||
float parameters[kModuleParameters];
|
||||
float parameters[kModuleParameterCount];
|
||||
CardinalVariant variant;
|
||||
bool bypassed, playing, reset, bbtValid;
|
||||
int32_t bar, beat, beatsPerBar, beatType;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue