Browse Source

Add an output to scope module

pull/5/head
Euphorbium 7 years ago
parent
commit
c98cca895f
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      src/Scope.cpp

+ 8
- 0
src/Scope.cpp View File

@@ -23,6 +23,7 @@ struct Scope : Module {
NUM_INPUTS NUM_INPUTS
}; };
enum OutputIds { enum OutputIds {
SUM_OUTPUT,
NUM_OUTPUTS NUM_OUTPUTS
}; };


@@ -127,6 +128,11 @@ void Scope::step() {
bufferIndex = 0; frameIndex = 0; return; 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<PJ301MPort>(Vec(63, 319), module, Scope::Y_INPUT)); addInput(createInput<PJ301MPort>(Vec(63, 319), module, Scope::Y_INPUT));
addInput(createInput<PJ301MPort>(Vec(154, 319), module, Scope::TRIG_INPUT)); addInput(createInput<PJ301MPort>(Vec(154, 319), module, Scope::TRIG_INPUT));


addOutput(createOutput<PJ301MPort>(Vec(107, 319), module, Scope::SUM_OUTPUT));

addChild(createValueLight<TinyLight<GreenValueLight>>(Vec(104, 251), &module->lights[0])); addChild(createValueLight<TinyLight<GreenValueLight>>(Vec(104, 251), &module->lights[0]));
addChild(createValueLight<TinyLight<GreenValueLight>>(Vec(104, 296), &module->lights[1])); addChild(createValueLight<TinyLight<GreenValueLight>>(Vec(104, 296), &module->lights[1]));
addChild(createValueLight<TinyLight<GreenValueLight>>(Vec(150, 251), &module->lights[2])); addChild(createValueLight<TinyLight<GreenValueLight>>(Vec(150, 251), &module->lights[2]));


Loading…
Cancel
Save