pulse-switch-6

wkov/colony/pulse-switch-6

No description
pulse-switch-6
@/pulse-switch-6
SIGpulse
NUMnumber
pulse-switch-6
SIG
NUM
OUT1
OUT2
OUT3
OUT4
OUT5
OUT6
OUT6pulse
OUT5pulse
OUT4pulse
OUT3pulse
OUT2pulse
OUT1pulse
To use the node in your project you should have the wkov/colony 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

node {
    void evaluate(Context ctx) {
        if (!isInputDirty<input_SIG>(ctx)) {
            return;
        }

        switch ((uint8_t) getValue<input_NUM>(ctx)) {
            case 1:
                emitValue<output_OUT1>(ctx, 1);
                break;
            case 2:
                emitValue<output_OUT2>(ctx, 1);
                break;
            case 3:
                emitValue<output_OUT3>(ctx, 1);
                break;
            case 4:
                emitValue<output_OUT4>(ctx, 1);
                break;
            case 5:
                emitValue<output_OUT5>(ctx, 1);
                break;
            case 6:
                emitValue<output_OUT6>(ctx, 1);
                break;
        }
    }
}