Skip to content

Commit

Permalink
In generic wrapper technology, added a variable to remember if the us…
Browse files Browse the repository at this point in the history
…er changed the input or the output channels. Depending on the choice, the strategy is different
  • Loading branch information
hkbinaurics committed Mar 8, 2024
1 parent 327c412 commit 69f7262
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ CjvxGenericWrapperDevice::test_chain_master(JVX_CONNECTION_FEEDBACK_TYPE(fdb))
updateSWSamplerateAndBuffersize_nolock(NULL, NULL JVX_CONNECTION_FEEDBACK_CALL_A(fdb));
res = CjvxAudioDevice::test_chain_master(JVX_CONNECTION_FEEDBACK_CALL(fdb));
}

return res;
}

Expand Down Expand Up @@ -1342,6 +1343,7 @@ CjvxGenericWrapperDevice::test_connect_icon_core(JVX_CONNECTION_FEEDBACK_TYPE(fd
updateDependentVariables_lock(CjvxAudioDevice_genpcg::properties_active.outputchannelselection.globalIdx,
CjvxAudioDevice_genpcg::properties_active.outputchannelselection.category, false,
JVX_PROPERTY_CALL_PURPOSE_INTERNAL_PASS);

res = JVX_NO_ERROR;
}
else
Expand Down Expand Up @@ -1491,7 +1493,19 @@ CjvxGenericWrapperDevice::transfer_backward_ocon(jvxLinkDataTransferType tp, jvx
// Consider channels separately
if (theLocDescr->con_params.number_channels <= runtime.channelMappings.inputChannelMapper.size())
{
int delta = JVX_SIZE_INT32(params.chans_in) - JVX_SIZE_INT32(theLocDescr->con_params.number_channels);
if (lastOperationSetup == jvxLastOperationChannels::JVXLASTOPERATIONCHANNELS_INPUT)
{
std::string txt = __FUNCTION__;
txt += ": ";
txt += ": Not willing to allow ";
txt += jvx_size2String(theLocDescr->con_params.number_channels);
txt += " input channels. The value of ";
txt += jvx_size2String(runtime.channelMappings.inputChannelMapper.size());
txt += " channels has recently been specified.";
JVX_CONNECTION_FEEDBACK_SET_ERROR_STRING(fdb, txt.c_str(), JVX_ERROR_INVALID_SETTING);
return JVX_ERROR_COMPROMISE;
}
int delta = JVX_SIZE_INT32(params.chans_in) - JVX_SIZE_INT32(theLocDescr->con_params.number_channels);

while (delta < 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class CjvxGenericWrapperDevice: public JVX_MY_BASE_CLASS_D,
} oneDbgMeasureEvent;
#endif

enum class jvxLastOperationChannels
{
JVXLASTOPERATIONCHANNELS_OUTPUT,
JVXLASTOPERATIONCHANNELS_INPUT
};

enum class jvxStatePrepapration
{
JVX_GENERIC_WRAPPER_PREPARE_STATUS_INIT_BF = 0x1,
Expand Down Expand Up @@ -150,6 +156,8 @@ class CjvxGenericWrapperDevice: public JVX_MY_BASE_CLASS_D,
CjvxGenericWrapperDummyChannels theDummy;
} dummyRefs;

jvxLastOperationChannels lastOperationSetup = jvxLastOperationChannels::JVXLASTOPERATIONCHANNELS_OUTPUT;

struct
{
struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,14 +668,28 @@ jvxErrorType
CjvxGenericWrapperDevice::prepare_detectmode()
{
jvxErrorType res = JVX_NO_ERROR;

jvxCBool allowOperateZeroChannels = c_false;
if (onInit.connectedDevice)
{
IjvxProperties* props = reqInterface<IjvxProperties>(onInit.connectedDevice);
if (props)
{
jvxCallManagerProperties callGate;
jPAD ident("/allow_operate_zero_channels");
props->get_property(callGate, jPRIO<jvxCBool>(allowOperateZeroChannels), ident);
retInterface<IjvxProperties>(onInit.connectedDevice, props);
props = nullptr;
}
}
// =========================================================================
// Determine the operation modes
// =========================================================================
if(res == JVX_NO_ERROR)
{
// INPUT
if(processingControl.inProc.params_fixed_runtime.chanshw_in == 0)
if(
(processingControl.inProc.params_fixed_runtime.chanshw_in == 0) &&
!allowOperateZeroChannels)
{
proc_fields.seq_operation_in = NOTHING;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,7 @@ CjvxGenericWrapperDevice::set_property(jvxCallManagerProperties& callGate,
elm->lastModCnt = runtime.channelMappings.modifyWeightCnt++;
}
}
lastOperationSetup = jvxLastOperationChannels::JVXLASTOPERATIONCHANNELS_INPUT;
}
}

Expand All @@ -1657,6 +1658,7 @@ CjvxGenericWrapperDevice::set_property(jvxCallManagerProperties& callGate,
elm->lastModCnt = runtime.channelMappings.modifyWeightCnt++;
}
}
lastOperationSetup = jvxLastOperationChannels::JVXLASTOPERATIONCHANNELS_OUTPUT;
}
}

Expand Down

0 comments on commit 69f7262

Please sign in to comment.