MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / processTerminalInput

Method processTerminalInput

plugins/Cardinal/src/HostCV.cpp:73–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 void processTerminalInput(const ProcessArgs&) override
74 {
75 if (pcontext->variant != kCardinalVariantMain && pcontext->variant != kCardinalVariantMini)
76 return;
77
78 const uint8_t ioOffset = pcontext->variant == kCardinalVariantMini ? 2 : 8;
79 const uint32_t bufferSize = pcontext->bufferSize;
80 const uint32_t processCounter = pcontext->processCounter;
81
82 // only checked on input
83 if (lastProcessCounter != processCounter)
84 {
85 bypassed = isBypassed();
86 dataFrame = 0;
87 lastProcessCounter = processCounter;
88 }
89
90 // only incremented on output
91 const uint32_t k = dataFrame;
92 DISTRHO_SAFE_ASSERT_RETURN(k < bufferSize,);
93
94 if (bypassed)
95 {
96 for (int i=0; i<10; ++i)
97 outputs[i].setVoltage(0.0f);
98 }
99 else if (const float* const* const dataIns = pcontext->dataIns)
100 {
101 if (dataIns[ioOffset] == nullptr)
102 return;
103
104 float outputOffset;
105 outputOffset = params[BIPOLAR_OUTPUTS_1_5].getValue() > 0.1f ? 5.f : 0.f;
106
107 for (int i=0; i<5; ++i)
108 outputs[i].setVoltage(dataIns[i+ioOffset][k] - outputOffset);
109
110 if (pcontext->variant == kCardinalVariantMain)
111 {
112 outputOffset = params[BIPOLAR_OUTPUTS_6_10].getValue() > 0.1f ? 5.f : 0.f;
113
114 for (int i=5; i<10; ++i)
115 outputs[i].setVoltage(dataIns[i+ioOffset][k] - outputOffset);
116 }
117 else
118 {
119 for (int i=5; i<10; ++i)
120 outputs[i].setVoltage(0.f);
121 }
122 }
123 }
124
125 void processTerminalOutput(const ProcessArgs&) override
126 {

Callers 1

Calls 2

setVoltageMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected