Skip to content

Commit

Permalink
Cleanup and clarification in signal chains for data i/o with synchron…
Browse files Browse the repository at this point in the history
…ization
  • Loading branch information
hkhauke committed Jun 6, 2024
1 parent 063dcea commit 20ccbea
Show file tree
Hide file tree
Showing 27 changed files with 491 additions and 302 deletions.
39 changes: 30 additions & 9 deletions cmake/macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,40 @@ macro(jvx_genMatProperties targetname componenttype componentprefix localfilelis
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked})
foreach(PCGFILE ${localfilelist})
string(REPLACE ";" " " localoptionsstr "${localoptions}")

# Example how to set localoptions
# set(localoptionsstr a b)

if(JVX_MAX_PATH_PROP_MAT)
set(localoptionsstr "${localoptionsstr} -maxl ${JVX_MAX_PATH_PROP_MAT}")
set(localoptionsstr ${localoptionsstr} -maxl ${JVX_MAX_PATH_PROP_MAT})
endif()

message(" > PCG MAT Generator: ${PCGFILE} for component of type ${componenttype}, generator prefix ${componentprefix}, local options = ${localoptionsstr}")
# message("exec_program(\"${JVX_PCG_MATLAB} \\\"${PCGFILE}\\\" -o \\\"${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked}\\\" -ctp ${componenttype} -cpf ${componentprefix} ${localoptionsstr}\")")
# pcg_mat_opts "${localoptions}")
# message("--> 1 ${localoptions} 2")
# Added some quotes for systems with spaces in path
# install(CODE "exec_program(\"${JVX_PCG_MATLAB} \\\"${PCGFILE}\\\" -o \\\"${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked}\\\" -ctp ${componenttype} -cpf ${componentprefix} ${localoptionsstr}\")")
install(CODE "execute_process(COMMAND \"${JVX_PCG_MATLAB} \\\"${PCGFILE}\\\" -o \\\"${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked}\\\" -ctp ${componenttype} -cpf ${componentprefix} ${localoptionsstr}\")")

string(REPLACE ";" " " localoptionsstr "${localoptionsstr}")

message(" > PCG MAT Generator: ${PCGFILE} for component of type ${componenttype}, generator prefix ${componentprefix}, local options = ${localoptionsstr} to be installed in ${INSTALL_PATH_MATLAB_SUBPROJECT}/+${targetname_tweaked}")

# This is the old version with exec_programm - which works. I was not able to transform this into a version
# a) with exec_process
# b) with additional arguments in localoptionsstr
# c) in an INSTALL clause.
# In all attempts, CMake has done weird stuff. The problem is that in exec_process, we need to pass all
# arguments separately. This could not be achieved in this combination of a-c.
install(CODE "exec_program(\"${JVX_PCG_MATLAB} \\\"${PCGFILE}\\\" -o \\\"${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked}\\\" -ctp ${componenttype} -cpf ${componentprefix} ${localoptionsstr}\")")

# Here is my last attempt - which is close but not really functional
#install(CODE "string(REPLACE \";\" \" \" localoptionsstri \"${localoptionsstr}\")
# execute_process(COMMAND \"${JVX_PCG_MATLAB}\" \"${PCGFILE}\" \"-o\" \"${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked}\" \"-ctp\" \"${componenttype}\" \$\{localoptionsstri\}
# COMMAND_ECHO STDOUT RESULT_VARIABLE status)")

# The following command works but only if not in INSTALL clause!!
#execute_process(COMMAND "${JVX_PCG_MATLAB}" "${PCGFILE}" "-o" "${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked}" "-ctp" "${componenttype}" ${localoptionsstr}
# COMMAND_ECHO STDOUT RESULT_VARIABLE status)


endforeach()
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/m-files/+${targetname_tweaked} DESTINATION ${INSTALL_PATH_MATLAB_SUBPROJECT})
# message(FATAL_ERROR "Hier")

endif()
endmacro(jvx_genMatProperties)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ CjvxAuCPcmDecoder::set_configure_token(const char* tokenArg)
JVX_SIZE_DONTCARE,
JVX_DATAFORMAT_BYTE,
JVX_DATAFORMAT_GROUP_AUDIO_CODED_GENERIC,
JVX_DATAFLOW_NONE,
JVX_DATAFLOW_DONT_CARE,
JVX_SIZE_UNSELECTED, 1); // <- number_channels and segment are different arguments here

neg_output._set_parameters_fixed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ CjvxAuNConvert::accept_negotiate_output(jvxLinkDataTransferType tp, jvxLinkDataD
update_output_params_from_input_params();
adapt_output_parameters_forward();
test_set_output_parameters();

// This I need to find an example for
assert(0);

break;
case JVX_ERROR_COMPROMISE:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ SECTION PROPERTIES
SELECTION_LIST_SELECTED = {"yes", "no"};
SELECTION_LIST_EXCLUSIVE = {"no", "no"};
SELECTION_TRANSLATOR_TYPE = "jvxOperationMode";
SELECTION_LIST_TRANSLATORS = {"JVX_FORWARDBUFFER_BUFFER_INPUT", "JVX_FORWARDBUFFER_BUFFER_OUTPUT_ACTIVE", "JVX_FORWARDBUFFER_BUFFER_OUTPUT_PASSIVE"};
SELECTION_LIST_TRANSLATORS = {"JVX_FORWARDBUFFER_BUFFER_INPUT", "JVX_FORWARDBUFFER_BUFFER_OUTPUT"};
SELECTION_TRANSLATOR_ENUM_CLASS = "yes";
READ_WRITE_ACCESS = "JVX_PROPERTY_ACCESS_READ_AND_WRITE_CONTENT";
CONTENT_DECODER_TYPE = "JVX_PROPERTY_DECODER_SINGLE_SELECTION";
Expand Down
Loading

0 comments on commit 20ccbea

Please sign in to comment.