static void set_cv_value_generic(Channel* ch, Device_states* dstates, const Value* value) { rassert(ch != NULL); rassert(dstates != NULL); rassert(value != NULL); if (!try_update_cv(ch, value)) return; const char* var_name = Active_names_get(ch->parent.active_names, ACTIVE_CAT_CONTROL_VAR); rassert(var_name != NULL); const Audio_unit* au = Module_get_au_from_input(ch->parent.module, ch->au_input); if (au == NULL) return; const Device* dev = (const Device*)au; Device_set_control_var_generic( dev, dstates, DEVICE_CONTROL_VAR_MODE_VOICE, Channel_get_random_source(ch), ch, var_name, value); return; }
bool Event_au_slide_stream_target_process( const Audio_unit* au, const Au_params* au_params, Au_state* au_state, Master_params* master_params, Channel* channel, Device_states* dstates, const Event_params* params) { rassert(au != NULL); rassert(au_params != NULL); rassert(au_state != NULL); rassert(master_params != NULL); rassert(channel != NULL); rassert(dstates != NULL); rassert(params != NULL); rassert(params->arg != NULL); rassert(params->arg->type == VALUE_TYPE_FLOAT); const char* stream_name = Active_names_get(channel->parent.active_names, ACTIVE_CAT_STREAM); if ((stream_name == NULL) || !is_valid_var_name(stream_name)) return false; Device_state* dstate = get_target_dstate(au, dstates, stream_name); if (dstate == NULL) return true; Stream_pstate_slide_target(dstate, params->arg->value.float_type); return true; }
static void set_cv_carry(Channel* ch, Device_states* dstates, bool enabled) { rassert(ch != NULL); rassert(dstates != NULL); const char* var_name = Active_names_get(ch->parent.active_names, ACTIVE_CAT_CONTROL_VAR); if (var_name == NULL) return; Channel_cv_state_set_carrying_enabled(ch->cvstate, var_name, enabled); return; }
static bool try_update_cv(Channel* ch, const Value* value) { rassert(ch != NULL); rassert(value != NULL); const char* var_name = Active_names_get(ch->parent.active_names, ACTIVE_CAT_CONTROL_VAR); if (var_name == NULL) return false; const bool was_value_set = Channel_cv_state_set_value(ch->cvstate, var_name, value); return was_value_set; }
bool Event_control_env_set_var_process( General_state* global_state, Channel* channel, const Value* value) { rassert(global_state != NULL); rassert(channel != NULL); rassert(value != NULL); Env_var* var = Env_state_get_var( global_state->estate, Active_names_get(channel->parent.active_names, ACTIVE_CAT_ENV)); if (var == NULL) return false; Value* converted = VALUE_AUTO; if (!Value_convert(converted, value, Env_var_get_type(var))) return false; Env_var_set_value(var, converted); return true; }