Skip to content

Commit

Permalink
1) Better support for property access function via chains
Browse files Browse the repository at this point in the history
2) Channel properties for mix chain enter/leave
  • Loading branch information
hkbinaurics committed Jun 13, 2024
1 parent cb5ea94 commit 7d2ed57
Show file tree
Hide file tree
Showing 13 changed files with 195 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ SECTION PROPERTIES
INIT_SET = 0;
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
};

SECTION enable_zero_delay_output
{
TYPE = "JVX_DATAFORMAT_BOOL";
INIT_SET = 0;
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
};
};

SECTION monitor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ CjvxGenericWrapperDevice::transfer_backward_ocon(jvxLinkDataTransferType tp, jvx
{
jvxErrorType res = JVX_NO_ERROR;
jvxLinkDataDescriptor* theLocDescr = NULL;
jvx::propertyCallCompactList* propCallCompact = nullptr;
jvx::propertyCallCompactRefList* propCallCompact = nullptr;
jvxSize idx = 0;
local_proc_params params;
switch (tp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,25 +742,25 @@ JVX_ASYNCIO_CLASSNAME::transfer_backward_ocon_ntask(jvxLinkDataTransferType tp,
{
jvxLinkDataDescriptor* ld = (jvxLinkDataDescriptor*)data;
jvxBool thereismismatch = false;
jvx::propertyCallCompactList* propCallCompact = nullptr;
jvx::propertyCallCompactRefList* propCallCompact = nullptr;
std::string txt;

switch (tp)
{
case JVX_LINKDATA_TRANSFER_REQUEST_GET_PROPERTIES:

propCallCompact = (jvx::propertyCallCompactList*)data;
propCallCompact = (jvx::propertyCallCompactRefList*)data;
if (propCallCompact)
{
jvxBool forwardChain = false;
for (auto& elm : propCallCompact->propReqs)
{
if (elm->resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
if (elm.resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
{
elm->resCall = this->get_property((elm->callMan), elm->rawPtr,
elm->ident, elm->detail);
elm.resCall = this->get_property((elm.callMan), elm.rawPtr,
elm.ident, elm.detail);
}
if (elm->resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
if (elm.resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
{
forwardChain = true;
}
Expand Down Expand Up @@ -892,24 +892,24 @@ JVX_ASYNCIO_CLASSNAME::transfer_forward_icon_ntask(jvxLinkDataTransferType tp, j
{
if (idCtxt == JVX_DEFAULT_CON_VAR_OFF)
{
jvx::propertyCallCompactList* propCallCompact = nullptr;
jvx::propertyCallCompactRefList* propCallCompact = nullptr;

switch (tp)
{
case JVX_LINKDATA_TRANSFER_REQUEST_GET_PROPERTIES:

propCallCompact = (jvx::propertyCallCompactList*)data;
propCallCompact = (jvx::propertyCallCompactRefList*)data;
if (propCallCompact)
{
jvxBool forwardChain = false;
for (auto& elm : propCallCompact->propReqs)
{
if (elm->resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
if (elm.resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
{
elm->resCall = this->get_property((elm->callMan), elm->rawPtr,
elm->ident, elm->detail);
elm.resCall = this->get_property((elm.callMan), elm.rawPtr,
elm.ident, elm.detail);
}
if (elm->resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
if (elm.resCall == JVX_ERROR_ELEMENT_NOT_FOUND)
{
forwardChain = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ SECTION PROPERTIES
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_FULL_READ_AND_WRITE";
ASSOCIATE_EXTERNAL = "yes";
};

};

SECTION sources_channel_routing
Expand Down Expand Up @@ -93,19 +94,27 @@ SECTION PROPERTIES
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_READ_ONLY";
};
};
SECTION display

SECTION display_input
{
GENERATE_ENTRIES_CONFIG_FILE = "no"; // Defaults to "no" if not present
ALLOWED_STATE_MASK = {"JVX_STATE_ACTIVE", "JVX_STATE_PREPARED", "JVX_STATE_PROCESSING"};

SECTION channel_names
{
TYPE = "JVX_DATAFORMAT_SELECTION_LIST";
CONTENT_DECODER_TYPE = "JVX_PROPERTY_DECODER_SINGLE_SELECTION";
ONLY_SELECTION_TO_CONFIG = "yes";
SELECTION_LIST_NAMES = {"to-be-filled"};
SELECTION_LIST_SELECTED = {"yes"};
SELECTION_LIST_EXCLUSIVE = {"yes"};
ID = "jvx_selection_output_channels_sellist";
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_READ_ONLY";
};
};

SECTION display_output
{
GENERATE_ENTRIES_CONFIG_FILE = "no"; // Defaults to "no" if not present
ALLOWED_STATE_MASK = {"JVX_STATE_ACTIVE", "JVX_STATE_PREPARED", "JVX_STATE_PROCESSING"};

SECTION channel_names
{
ID = "jvx_selection_input_channels_sellist";
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_READ_ONLY";
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ CjvxSpNMixChainEnterLeave::activate()
CjvxConnectorFactory::oneInputConnectorElement elmIn;
CjvxConnectorFactory::oneOutputConnectorElement elmOut;

genMixChain::init__display();
genMixChain::allocate__display();
genMixChain::register__display(this);

_update_property_access_type(JVX_PROPERTY_ACCESS_READ_ONLY, genMixChain::config.number_channels_side);
_update_property_access_type(JVX_PROPERTY_ACCESS_READ_ONLY, genMixChain::config.operation_mode);

Expand All @@ -87,6 +83,10 @@ CjvxSpNMixChainEnterLeave::activate()
switch (operationMode)
{
case jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_INPUT:
genMixChain::init__display_input();
genMixChain::allocate__display_input();
genMixChain::register__display_input(this);

CjvxConnectorCollection<CjvxSingleInputConnector, CjvxSingleInputConnectorMulti>::conName = "mix-in";
JVX_SAFE_ALLOCATE_OBJECT((CjvxConnectorCollection<CjvxSingleInputConnector, CjvxSingleInputConnectorMulti>::extra_iocon_gen),
CjvxSingleInputConnectorMulti(true));
Expand All @@ -98,6 +98,10 @@ CjvxSpNMixChainEnterLeave::activate()
_common_set_conn_factory.input_connectors[CjvxConnectorCollection<CjvxSingleInputConnector, CjvxSingleInputConnectorMulti>::extra_iocon_gen] = elmIn;
break;
case jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_OUTPUT:
genMixChain::init__display_output();
genMixChain::allocate__display_output();
genMixChain::register__display_output(this);

CjvxConnectorCollection < CjvxSingleOutputConnector, CjvxSingleOutputConnectorMulti>::conName = "mix-out";
JVX_SAFE_ALLOCATE_OBJECT((CjvxConnectorCollection<CjvxSingleOutputConnector, CjvxSingleOutputConnectorMulti>::extra_iocon_gen), CjvxSingleOutputConnectorMulti(true));
CjvxConnectorCollection<CjvxSingleOutputConnector, CjvxSingleOutputConnectorMulti>::extra_iocon_gen->activate(this, this,
Expand Down Expand Up @@ -132,6 +136,9 @@ CjvxSpNMixChainEnterLeave::deactivate()

CjvxConnectorCollection<CjvxSingleInputConnector, CjvxSingleInputConnectorMulti>::extra_iocon_gen->deactivate();
JVX_SAFE_DELETE_OBJECT((CjvxConnectorCollection<CjvxSingleInputConnector, CjvxSingleInputConnectorMulti>::extra_iocon_gen));

genMixChain::unregister__display_input(this);
genMixChain::deallocate__display_input();
break;

case jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_OUTPUT:
Expand All @@ -145,14 +152,14 @@ CjvxSpNMixChainEnterLeave::deactivate()

CjvxConnectorCollection<CjvxSingleOutputConnector, CjvxSingleOutputConnectorMulti>::extra_iocon_gen->deactivate();
JVX_SAFE_DELETE_OBJECT((CjvxConnectorCollection<CjvxSingleOutputConnector, CjvxSingleOutputConnectorMulti>::extra_iocon_gen));

genMixChain::unregister__display_output(this);
genMixChain::deallocate__display_output();
break;
}
_undo_update_property_access_type(genMixChain::config.number_channels_side);
_undo_update_property_access_type(genMixChain::config.operation_mode);

genMixChain::unregister__display(this);
genMixChain::deallocate__display();

res = CjvxBareNode1ioRearrange::deactivate();
}
return res;
Expand All @@ -169,6 +176,7 @@ CjvxSpNMixChainEnterLeave::test_connect_icon(JVX_CONNECTION_FEEDBACK_TYPE(fdb))
node_inout._common_set_node_params_a_1io.number_channels);
if (numChansMax != szChannelRoutes)
{
jvxSize cnt = 0;
jvxSize i;
jvxSize* fldNew = nullptr;
jvxSize fldNewSz = numChansMax;
Expand Down Expand Up @@ -229,50 +237,63 @@ CjvxSpNMixChainEnterLeave::test_connect_icon(JVX_CONNECTION_FEEDBACK_TYPE(fdb))
genMixChain::associate__config(this, ptrChannelRoutes, szChannelRoutes);


genMixChain::display.channel_names.value.entries.clear();
switch (operationMode)
{
case jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_INPUT:
genMixChain::display_input.channel_names.value.entries.clear();
jvx_bitFClear(genMixChain::display_input.channel_names.value.selection(0));
cnt = 0;
for (i = 0; i < node_inout._common_set_node_params_a_1io.number_channels; i++)
{
genMixChain::display.channel_names.value.entries.push_back("Primary Input #" + jvx_size2String(i));
genMixChain::display_input.channel_names.value.entries.push_back("Primary Input #" + jvx_size2String(i));
jvx_bitSet(genMixChain::display_input.channel_names.value.selection(0), cnt);
cnt++;
}

for (i = 0; i < genMixChain::config.number_channels_side.value; i++)
{
genMixChain::display.channel_names.value.entries.push_back("Secondary Input #" + jvx_size2String(i));
genMixChain::display_input.channel_names.value.entries.push_back("Secondary Input #" + jvx_size2String(i));
jvx_bitSet(genMixChain::display_input.channel_names.value.selection(0), cnt);
cnt++;
}

for (auto& elm : presets_channel_routing)
{
for (i = 0; i < elm.second.channel_num; i++)
{
jvxSize posi = node_inout._common_set_node_params_a_1io.number_channels + elm.second.idxOffset + i;
if (posi < genMixChain::display.channel_names.value.entries.size())
if (posi < genMixChain::display_input.channel_names.value.entries.size())
{
genMixChain::display.channel_names.value.entries[posi] = elm.second.deviceChannelPrefix + jvx_size2String(i);
genMixChain::display_input.channel_names.value.entries[posi] = elm.second.deviceChannelPrefix + jvx_size2String(i);
}
}
}
break;
case jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_OUTPUT:
genMixChain::display_output.channel_names.value.entries.clear();
jvx_bitFClear(genMixChain::display_output.channel_names.value.selection(0));
cnt = 0;
for (i = 0; i < node_output._common_set_node_params_a_1io.number_channels; i++)
{
genMixChain::display.channel_names.value.entries.push_back("Primary Output #" + jvx_size2String(i));
genMixChain::display_output.channel_names.value.entries.push_back("Primary Output #" + jvx_size2String(i));
jvx_bitSet(genMixChain::display_output.channel_names.value.selection(0), cnt);
cnt++;
}
for (i = 0; i < genMixChain::config.number_channels_side.value; i++)
{
genMixChain::display.channel_names.value.entries.push_back("Secondary Output #" + jvx_size2String(i));
genMixChain::display_output.channel_names.value.entries.push_back("Secondary Output #" + jvx_size2String(i));
jvx_bitSet(genMixChain::display_output.channel_names.value.selection(0), cnt);
cnt++;
}

for (auto& elm : presets_channel_routing)
{
for (i = 0; i < elm.second.channel_num; i++)
{
jvxSize posi = node_output._common_set_node_params_a_1io.number_channels + elm.second.idxOffset + i;
if (posi < genMixChain::display.channel_names.value.entries.size())
if (posi < genMixChain::display_output.channel_names.value.entries.size())
{
genMixChain::display.channel_names.value.entries[posi] = elm.second.deviceChannelPrefix + jvx_size2String(i);
genMixChain::display_output.channel_names.value.entries[posi] = elm.second.deviceChannelPrefix + jvx_size2String(i);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ class CjvxSpNMixChainEnterLeave : public CjvxBareNode1ioRearrange,

void offset_channels_to_property();
jvxErrorType check_preset_channels(CjvxConnectorOffsetAndMaxChans& conParams, jvxComponentIdentification cpId);

jvxErrorType transfer_backward_ocon(jvxLinkDataTransferType tp, jvxHandle* data, JVX_CONNECTION_FEEDBACK_TYPE(fdb))override;
jvxErrorType transfer_forward_icon(jvxLinkDataTransferType tp, jvxHandle* data JVX_CONNECTION_FEEDBACK_TYPE_A(fdb))override;

};

// ============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,34 @@ CjvxSpNMixChainEnterLeave::report_process_buffers(CjvxSingleOutputConnector* oco
// bufferPtrs: Target buffers as
memcpy(bufsOut[i], bufsIn[i + oconn->chanSetting.idxOffset], jvxDataFormat_getsize(datOutThisConnector.con_params.format) * datOutThisConnector.con_params.buffersize);
}
}
}

jvxErrorType
CjvxSpNMixChainEnterLeave::transfer_backward_ocon(jvxLinkDataTransferType tp, jvxHandle* data, JVX_CONNECTION_FEEDBACK_TYPE(fdb))
{
if (
(tp == JVX_LINKDATA_TRANSFER_REQUEST_GET_PROPERTIES) &&
(operationMode == jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_INPUT))
{
if (!jvx::helper::translate_transfer_chain_get_properties((jvx::propertyCallCompactRefList*)data, this))
{
return JVX_NO_ERROR;
}
}
return CjvxBareNode1ioRearrange::transfer_backward_ocon(tp, data JVX_CONNECTION_FEEDBACK_CALL_A(fdb));
}

jvxErrorType
CjvxSpNMixChainEnterLeave::transfer_forward_icon(jvxLinkDataTransferType tp, jvxHandle* data JVX_CONNECTION_FEEDBACK_TYPE_A(fdb))
{
if (
(tp == JVX_LINKDATA_TRANSFER_REQUEST_GET_PROPERTIES) &&
(operationMode == jvxOperationModeMixChain::JVX_OPERTION_MODE_MIX_CHAIN_OUTPUT))
{
if (!jvx::helper::translate_transfer_chain_get_properties((jvx::propertyCallCompactRefList*)data, this))
{
return JVX_NO_ERROR;
}
}
return CjvxBareNode1ioRearrange::transfer_forward_icon(tp, data JVX_CONNECTION_FEEDBACK_CALL_A(fdb));
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,7 @@ class CjvxSpNSynchronize : public CjvxBareNode1ioRearrange, public genSynchroniz
void fwd_report_process_buffers(jvxLinkDataDescriptor& datLink, jvxSize idx);

jvxErrorType prepare_connect_icon(JVX_CONNECTION_FEEDBACK_TYPE(fdb)) override;
/*

virtual void from_input_to_output() override;
jvxErrorType accept_negotiate_output(jvxLinkDataTransferType tp, jvxLinkDataDescriptor* preferredByOutput JVX_CONNECTION_FEEDBACK_TYPE_A(fdb));
// Processing
virtual jvxErrorType JVX_CALLINGCONVENTION prepare_connect_icon(JVX_CONNECTION_FEEDBACK_TYPE(fdb)) override;
virtual jvxErrorType JVX_CALLINGCONVENTION postprocess_connect_icon(JVX_CONNECTION_FEEDBACK_TYPE(fdb))override;
jvxErrorType set_manipulate_value(jvxSize id, jvxVariant* varray) override;
jvxErrorType get_manipulate_value(jvxSize id, jvxVariant* varray) override;
jvxErrorType request_hidden_interface(jvxInterfaceType tp, jvxHandle** hdl) override;
jvxErrorType return_hidden_interface(jvxInterfaceType tp, jvxHandle* hdl) override;
virtual jvxErrorType JVX_CALLINGCONVENTION put_configuration(jvxCallManagerConfiguration* callMan,
IjvxConfigProcessor* processor,
jvxHandle* sectionToContainAllSubsectionsForMe,
const char* filename,
jvxInt32 lineno)override;
virtual jvxErrorType JVX_CALLINGCONVENTION get_configuration(jvxCallManagerConfiguration* callMan,
IjvxConfigProcessor* processor,
jvxHandle* sectionWhereToAddAllSubsections)override;
JVX_PROPERTIES_FORWARD_C_CALLBACK_DECLARE(set_on_config);
jvxErrorType report_selected_connector(CjvxSingleInputConnector* iconn) override;
void request_unique_id_start(CjvxSingleInputConnector* iconn, jvxSize* uId) override;
void release_unique_id_stop(CjvxSingleInputConnector* iconn, jvxSize uId) override;
void report_process_buffers(CjvxSingleInputConnector* iconn, jvxHandle** bufferPtrs, const jvxLinkDataDescriptor_con_params& params) override;
// =============================================================================
jvxErrorType report_selected_connector(CjvxSingleOutputConnector* iconn) override;
void request_unique_id_start(CjvxSingleOutputConnector* iconn, jvxSize* uId) override;
void release_unique_id_stop(CjvxSingleOutputConnector* iconn, jvxSize uId) override;
virtual void report_process_buffers(CjvxSingleOutputConnector* oconn, jvxHandle** bufferPtrs, const jvxLinkDataDescriptor_con_params& params) override;
static void correct_order_channel_route(jvxSize* ptrChannelRoutes, jvxSize szChannelRoutes);
*/
};

// ============================================================================
Expand Down
Loading

0 comments on commit 7d2ed57

Please sign in to comment.