From 67ab9e6bf0a1ac0c09be7f1098857fc429465087 Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Tue, 5 Mar 2019 20:34:20 +0100 Subject: [PATCH] added basic shutdown mechanic to components JS --- res/controllers/midi-components-0.0.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 4e16c80ccf10..762fc45476f3 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -209,6 +209,10 @@ outValueScale: function (value) { return (value > 0) ? this.on : this.off; }, + + shutdown: function () { + this.send(this.off); + }, }); var PlayButton = function (options) { @@ -557,6 +561,14 @@ }); } }, + shutdown: function () { + this.forEachComponent(function (component) { + if (component.shutdown !== undefined + && typeof component.shutdown === 'function') { + component.shutdown(); + } + }) + }, }; var Deck = function (deckNumbers) {