if-else(buffer1)

awgrover/buffer1/if-else(buffer1)

Outputs either input value depending on condition
if-else(buffer1)
@/if-else(buffer1)
Outputs either input value depending on condition
CONDboolean
Condition value
T@/buffer1
Value to be output if condition is true
F@/buffer1
Value to be output if condition is false
if-else(buffer1)
R
COND
T
F
R@/buffer1
Outputs value of `T` if `COND` is true, and `F` otherwise
To use the node in your project you should have the awgrover/buffer1 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx) {
    auto cond = getValue<input_COND>(ctx);
    auto trueVal = getValue<input_T>(ctx);
    auto falseVal = getValue<input_F>(ctx);
    emitValue<output_R>(ctx, cond ? trueVal : falseVal);
}