Пример #1
0
bool Event_channel_set_cv_value_process(
        Channel* ch,
        Device_states* dstates,
        const Master_params* master_params,
        const Value* value)
{
    rassert(ch != NULL);
    rassert(dstates != NULL);
    rassert(master_params != NULL);
    rassert(value != NULL);
    rassert(Value_type_is_realtime(value->type));

    set_cv_value_generic(ch, dstates, value);

    return true;
}
Пример #2
0
bool Channel_cv_state_set_value(
        Channel_cv_state* state, const char* var_name, const Value* value)
{
    rassert(state != NULL);
    rassert(var_name != NULL);
    rassert(strlen(var_name) < KQT_VAR_NAME_MAX);
    rassert(value != NULL);
    rassert(Value_type_is_realtime(value->type));

    const Entry* key = Entry_init(ENTRY_AUTO, var_name);

    Entry* entry = AAtree_get_exact(state->tree, key);
    if (entry == NULL)
        return false;

    Value_copy(&entry->value, value);
    entry->is_set = true;

    return true;
}
Пример #3
0
void Device_set_control_var_generic(
        const Device* device,
        Device_states* dstates,
        Device_control_var_mode mode,
        Random* random,
        Channel* channel,
        const char* var_name,
        const Value* value)
{
    assert(device != NULL);
    assert(dstates != NULL);
    assert(random != NULL);
    assert(implies(mode == DEVICE_CONTROL_VAR_MODE_VOICE, channel != NULL));
    assert(var_name != NULL);
    assert(value != NULL);
    assert(Value_type_is_realtime(value->type));

    if (device->set_control_var_generic != NULL)
        device->set_control_var_generic(
                device, dstates, mode, random, channel, var_name, value);

    return;
}