cwIoFlow.h/cpp : Added version of 'apply_preset()' with built in call to 'begin_cross_fade()'

This commit is contained in:
kevin 2021-12-27 20:24:43 -05:00
parent ff43a6a9ca
commit 015f345dd6
2 changed files with 15 additions and 0 deletions

View File

@ -405,6 +405,15 @@ cw::rc_t cw::io_flow::exec( handle_t h, const io::msg_t& msg )
return rc; return rc;
} }
cw::rc_t cw::io_flow::apply_preset( handle_t h, unsigned crossFadeMs, const char* presetLabel )
{
rc_t rc;
if((rc = apply_preset( h, flow_cross::kNextDestId, presetLabel )) == kOkRC )
rc = begin_cross_fade( h, crossFadeMs );
return rc;
}
cw::rc_t cw::io_flow::apply_preset( handle_t h, flow_cross::destId_t destId, const char* presetLabel ) 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 ); } { return apply_preset( _handleToPtr(h)->crossFlowH, destId, presetLabel ); }

View File

@ -13,6 +13,12 @@ namespace cw
rc_t exec( handle_t h, const io::msg_t& msg ); rc_t exec( handle_t h, const io::msg_t& msg );
// Apply a preset to the 'next' network instance and activate it immediately.
rc_t apply_preset( handle_t h, unsigned crossFadeMs, const char* presetLabel );
// Apply a preset to the selected network instance (current or next).
// If the preset is applied to the 'next' network instance then use 'begin_cross_fade()' to
// 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 char* presetLabel );
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, bool value );