From c98cca895f6e57ac539699a823ebb01246e81db1 Mon Sep 17 00:00:00 2001 From: Euphorbium Date: Sat, 23 Sep 2017 16:55:29 +0300 Subject: [PATCH] Add an output to scope module --- src/Scope.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Scope.cpp b/src/Scope.cpp index 8db7754..d29696c 100644 --- a/src/Scope.cpp +++ b/src/Scope.cpp @@ -23,6 +23,7 @@ struct Scope : Module { NUM_INPUTS }; enum OutputIds { + SUM_OUTPUT, NUM_OUTPUTS }; @@ -127,6 +128,11 @@ void Scope::step() { bufferIndex = 0; frameIndex = 0; return; } } + + // Set the output + + setf(outputs[SUM_OUTPUT], getf(inputs[X_INPUT]) + getf(inputs[Y_INPUT])); + } @@ -312,6 +318,8 @@ ScopeWidget::ScopeWidget() { addInput(createInput(Vec(63, 319), module, Scope::Y_INPUT)); addInput(createInput(Vec(154, 319), module, Scope::TRIG_INPUT)); + addOutput(createOutput(Vec(107, 319), module, Scope::SUM_OUTPUT)); + addChild(createValueLight>(Vec(104, 251), &module->lights[0])); addChild(createValueLight>(Vec(104, 296), &module->lights[1])); addChild(createValueLight>(Vec(150, 251), &module->lights[2]));