From fe18110e22ea8e0399a6be729d4457a533cd4912 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 4 Jun 2019 04:04:41 -0400 Subject: [PATCH] Added Port::active alias for Port::channels. Set default Port channels to 0. --- include/engine/Port.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/engine/Port.hpp b/include/engine/Port.hpp index c4da6fd0..0a236bac 100644 --- a/include/engine/Port.hpp +++ b/include/engine/Port.hpp @@ -18,11 +18,15 @@ struct alignas(32) Port { /** DEPRECATED. Unstable API. Use getVoltage() and setVoltage() instead. */ float value; }; - /** Number of polyphonic channels - Unstable API. Use set/getChannels() instead. - May be 0 to PORT_MAX_CHANNELS. - */ - uint8_t channels = 1; + union { + /** Number of polyphonic channels + Unstable API. Use set/getChannels() instead. + May be 0 to PORT_MAX_CHANNELS. + */ + uint8_t channels = 0; + /** DEPRECATED. Unstable API. Use isConnected() instead. */ + uint8_t active; + }; /** For rendering plug lights on cables. Green for positive, red for negative, and blue for polyphonic. */