From b3e4a56132a90d8ab8f1d6877c6448a3f554c76c Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 12 Oct 2020 00:36:17 -0400 Subject: [PATCH] Add light names to AudioInterface. Fix output light indexing bug in AudioInterface. --- src/core/AudioInterface.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/core/AudioInterface.cpp b/src/core/AudioInterface.cpp index c8c334f2..594dfe3a 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -57,9 +57,13 @@ struct AudioInterface : Module, audio::Port { if (NUM_AUDIO_INPUTS == 2) configParam(GAIN_PARAM, 0.f, 2.f, 1.f, "Level", " dB", -10, 40); for (int i = 0; i < NUM_AUDIO_INPUTS; i++) - configInput(AUDIO_INPUTS + i, string::f("To device %d", i + 1)); + configInput(AUDIO_INPUTS + i, string::f("To \"device output %d\"", i + 1)); for (int i = 0; i < NUM_AUDIO_OUTPUTS; i++) - configOutput(AUDIO_OUTPUTS + i, string::f("From device %d", i + 1)); + configOutput(AUDIO_OUTPUTS + i, string::f("From \"device input %d\"", i + 1)); + for (int i = 0; i < NUM_INPUT_LIGHTS; i++) + configLight(INPUT_LIGHTS + 2 * i, string::f("Device output %d/%d status", 2 * i + 1, 2 * i + 2)); + for (int i = 0; i < NUM_OUTPUT_LIGHTS; i++) + configLight(OUTPUT_LIGHTS + 2 * i, string::f("Device input %d/%d status", 2 * i + 1, 2 * i + 2)); lightDivider.setDivision(512); maxChannels = std::max(NUM_AUDIO_INPUTS, NUM_AUDIO_OUTPUTS); @@ -337,10 +341,10 @@ struct AudioInterfaceWidget : ModuleWidget { addChild(createLight>(mm2px(Vec(35.725647, 54.577202)), module, TAudioInterface::INPUT_LIGHTS + 1 * 2)); addChild(createLight>(mm2px(Vec(12.524985, 69.158226)), module, TAudioInterface::INPUT_LIGHTS + 2 * 2)); addChild(createLight>(mm2px(Vec(35.725647, 69.158226)), module, TAudioInterface::INPUT_LIGHTS + 3 * 2)); - addChild(createLight>(mm2px(Vec(12.524985, 91.147583)), module, TAudioInterface::OUTPUT_LIGHTS + 0)); - addChild(createLight>(mm2px(Vec(35.725647, 91.147583)), module, TAudioInterface::OUTPUT_LIGHTS + 1)); - addChild(createLight>(mm2px(Vec(12.524985, 107.17003)), module, TAudioInterface::OUTPUT_LIGHTS + 2)); - addChild(createLight>(mm2px(Vec(35.725647, 107.17003)), module, TAudioInterface::OUTPUT_LIGHTS + 3)); + addChild(createLight>(mm2px(Vec(12.524985, 91.147583)), module, TAudioInterface::OUTPUT_LIGHTS + 0 * 2)); + addChild(createLight>(mm2px(Vec(35.725647, 91.147583)), module, TAudioInterface::OUTPUT_LIGHTS + 1 * 2)); + addChild(createLight>(mm2px(Vec(12.524985, 107.17003)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 2)); + addChild(createLight>(mm2px(Vec(35.725647, 107.17003)), module, TAudioInterface::OUTPUT_LIGHTS + 3 * 2)); AudioWidget* audioWidget = createWidget(mm2px(Vec(3.2122073, 14.837339))); audioWidget->box.size = mm2px(Vec(44, 28)); @@ -397,14 +401,14 @@ struct AudioInterfaceWidget : ModuleWidget { addChild(createLightCentered>(mm2px(Vec(36.661, 70.248)), module, TAudioInterface::INPUT_LIGHTS + 5 * 2)); addChild(createLightCentered>(mm2px(Vec(59.861, 70.248)), module, TAudioInterface::INPUT_LIGHTS + 6 * 2)); addChild(createLightCentered>(mm2px(Vec(83.061, 70.248)), module, TAudioInterface::INPUT_LIGHTS + 7 * 2)); - addChild(createLightCentered>(mm2px(Vec(13.46, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 0)); - addChild(createLightCentered>(mm2px(Vec(36.661, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 1)); - addChild(createLightCentered>(mm2px(Vec(59.861, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 2)); - addChild(createLightCentered>(mm2px(Vec(83.061, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 3)); - addChild(createLightCentered>(mm2px(Vec(13.46, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 4)); - addChild(createLightCentered>(mm2px(Vec(36.661, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 5)); - addChild(createLightCentered>(mm2px(Vec(59.861, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 6)); - addChild(createLightCentered>(mm2px(Vec(83.061, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 7)); + addChild(createLightCentered>(mm2px(Vec(13.46, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 0 * 2)); + addChild(createLightCentered>(mm2px(Vec(36.661, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 1 * 2)); + addChild(createLightCentered>(mm2px(Vec(59.861, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 2 * 2)); + addChild(createLightCentered>(mm2px(Vec(83.061, 92.238)), module, TAudioInterface::OUTPUT_LIGHTS + 3 * 2)); + addChild(createLightCentered>(mm2px(Vec(13.46, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 4 * 2)); + addChild(createLightCentered>(mm2px(Vec(36.661, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 5 * 2)); + addChild(createLightCentered>(mm2px(Vec(59.861, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 6 * 2)); + addChild(createLightCentered>(mm2px(Vec(83.061, 108.259)), module, TAudioInterface::OUTPUT_LIGHTS + 7 * 2)); AudioWidget* audioWidget = createWidget(mm2px(Vec(2.57, 14.839))); audioWidget->box.size = mm2px(Vec(91.382, 28.0));