diff --git a/cwFlowCross.cpp b/cwFlowCross.cpp index e11bfa5..7f29c1f 100644 --- a/cwFlowCross.cpp +++ b/cwFlowCross.cpp @@ -9,6 +9,7 @@ #include "cwMtx.h" #include "cwDspTypes.h" // real_t, sample_t #include "cwDspTransforms.h" +#include "cwFlowDecl.h" #include "cwFlow.h" #include "cwFlowTypes.h" #include "cwFlowProc.h" @@ -425,6 +426,18 @@ cw::rc_t cw::flow_cross::apply_preset( handle_t h, destId_t destId, const char* return rc; } +cw::rc_t cw::flow_cross::apply_preset( handle_t h, destId_t destId, const flow::multi_preset_selector_t& multi_preset_sel ) +{ + rc_t rc = kOkRC; + flow_cross_t* p = _handleToPtr(h); + unsigned flow_idx = _get_flow_index(p, destId ); + + if((rc = flow::apply_preset( p->netA[flow_idx].flowH, multi_preset_sel )) != kOkRC ) + rc = cwLogError(rc,"Muti-preset application failed."); + + return rc; +} + cw::rc_t cw::flow_cross::set_variable_value( handle_t h, destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, bool value ) { return _set_variable_value(h,destId,inst_label,var_label,chIdx,value); } diff --git a/cwFlowCross.h b/cwFlowCross.h index dc501bc..a9a24a4 100644 --- a/cwFlowCross.h +++ b/cwFlowCross.h @@ -29,6 +29,7 @@ namespace cw rc_t exec_cycle( handle_t h ); rc_t apply_preset( handle_t h, destId_t destId, const char* presetLabel ); + rc_t apply_preset( handle_t h, destId_t destId, const flow::multi_preset_selector_t& multi_preset_sel ); rc_t set_variable_value( handle_t h, destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, bool value ); rc_t set_variable_value( handle_t h, destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, int value ); diff --git a/cwIoFlow.cpp b/cwIoFlow.cpp index 878e09b..d036e6d 100644 --- a/cwIoFlow.cpp +++ b/cwIoFlow.cpp @@ -10,6 +10,7 @@ #include "cwMtx.h" #include "cwDspTypes.h" +#include "cwFlowDecl.h" #include "cwFlow.h" #include "cwFlowTypes.h" #include "cwFlowCross.h" @@ -419,6 +420,9 @@ cw::rc_t cw::io_flow::apply_preset( handle_t h, unsigned crossFadeMs, const char cw::rc_t cw::io_flow::apply_preset( handle_t h, flow_cross::destId_t destId, const char* presetLabel ) { return apply_preset( _handleToPtr(h)->crossFlowH, destId, presetLabel ); } +cw::rc_t cw::io_flow::apply_preset( handle_t h, flow_cross::destId_t destId, const flow::multi_preset_selector_t& multi_preset_sel ) +{ return apply_preset( _handleToPtr(h)->crossFlowH, destId, multi_preset_sel ); } + cw::rc_t cw::io_flow::set_variable_value( handle_t h, flow_cross::destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, bool value ) { return flow_cross::set_variable_value( _handleToPtr(h)->crossFlowH, destId, inst_label, var_label, chIdx, value ); } diff --git a/cwIoFlow.h b/cwIoFlow.h index a5266bf..e652fbf 100644 --- a/cwIoFlow.h +++ b/cwIoFlow.h @@ -21,6 +21,8 @@ namespace cw // activate the next network. rc_t apply_preset( handle_t h, flow_cross::destId_t destId, const char* presetLabel ); + rc_t apply_preset( handle_t h, flow_cross::destId_t destId, const flow::multi_preset_selector_t& multi_preset_sel ); + rc_t set_variable_value( handle_t h, flow_cross::destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, bool value ); rc_t set_variable_value( handle_t h, flow_cross::destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, int value ); rc_t set_variable_value( handle_t h, flow_cross::destId_t destId, const char* inst_label, const char* var_label, unsigned chIdx, unsigned value );