Mute audio output if bypassed
This commit is contained in:
parent
1cb5fa39d3
commit
879d0862d8
2 changed files with 9 additions and 4 deletions
|
@ -157,7 +157,7 @@ struct HostAudio2 : HostAudio<2> {
|
|||
|
||||
void processTerminalOutput(const ProcessArgs&) override
|
||||
{
|
||||
if (!in1connected && !in2connected)
|
||||
if (pcontext->bypassed || (!in1connected && !in2connected))
|
||||
{
|
||||
#ifndef HEADLESS
|
||||
if (resetMeters)
|
||||
|
@ -258,6 +258,9 @@ struct HostAudio8 : HostAudio<8> {
|
|||
|
||||
void processTerminalOutput(const ProcessArgs&) override
|
||||
{
|
||||
if (pcontext->bypassed)
|
||||
return;
|
||||
|
||||
const uint32_t bufferSize = pcontext->bufferSize;
|
||||
|
||||
// only incremented on output
|
||||
|
|
|
@ -26,6 +26,7 @@ USE_NAMESPACE_DISTRHO;
|
|||
|
||||
struct HostCV : TerminalModule {
|
||||
CardinalPluginContext* const pcontext;
|
||||
bool bypassed = false;
|
||||
int dataFrame = 0;
|
||||
uint32_t lastProcessCounter = 0;
|
||||
|
||||
|
@ -70,6 +71,7 @@ struct HostCV : TerminalModule {
|
|||
// only checked on input
|
||||
if (lastProcessCounter != processCounter)
|
||||
{
|
||||
bypassed = isBypassed();
|
||||
dataFrame = 0;
|
||||
lastProcessCounter = processCounter;
|
||||
}
|
||||
|
@ -78,7 +80,7 @@ struct HostCV : TerminalModule {
|
|||
const uint32_t k = dataFrame;
|
||||
DISTRHO_SAFE_ASSERT_RETURN(k < bufferSize,);
|
||||
|
||||
if (isBypassed())
|
||||
if (bypassed)
|
||||
{
|
||||
for (int i=0; i<10; ++i)
|
||||
outputs[i].setVoltage(0.0f);
|
||||
|
@ -100,7 +102,7 @@ struct HostCV : TerminalModule {
|
|||
|
||||
void processTerminalOutput(const ProcessArgs&) override
|
||||
{
|
||||
if (pcontext->variant != kCardinalVariantMain)
|
||||
if (pcontext->variant != kCardinalVariantMain || pcontext->bypassed)
|
||||
return;
|
||||
|
||||
const uint32_t bufferSize = pcontext->bufferSize;
|
||||
|
@ -109,7 +111,7 @@ struct HostCV : TerminalModule {
|
|||
const uint32_t k = dataFrame++;
|
||||
DISTRHO_SAFE_ASSERT_RETURN(k < bufferSize,);
|
||||
|
||||
if (isBypassed())
|
||||
if (bypassed)
|
||||
return;
|
||||
|
||||
float** const dataOuts = pcontext->dataOuts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue