Skip to content

Commit

Permalink
Merge pull request #2052 from Swiftb0y/components_js_shutdown
Browse files Browse the repository at this point in the history
Make controller shutdown easier for components JS based mappings.
  • Loading branch information
Be-ing authored Sep 1, 2019
2 parents 85d165b + 67ab9e6 commit f3395e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions res/controllers/midi-components-0.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@
outValueScale: function (value) {
return (value > 0) ? this.on : this.off;
},

shutdown: function () {
this.send(this.off);
},
});

var PlayButton = function (options) {
Expand Down Expand Up @@ -607,6 +611,14 @@
});
}
},
shutdown: function () {
this.forEachComponent(function (component) {
if (component.shutdown !== undefined
&& typeof component.shutdown === 'function') {
component.shutdown();
}
})
},
};

var Deck = function (deckNumbers) {
Expand Down

0 comments on commit f3395e8

Please sign in to comment.