Skip to content

Commit

Permalink
Merge branch 'fix/common-controller-scripts-es7' into temp/traktorS4m…
Browse files Browse the repository at this point in the history
…k3mapping
  • Loading branch information
Swiftb0y committed Jun 4, 2023
2 parents 5ced390 + 6fb61a6 commit c641c6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": [ "eslint:recommended",
"plugin:jsdoc/recommended",
"plugin:@typescript-eslint/recommended" ],
"plugin:jsdoc/recommended"],

"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down Expand Up @@ -99,6 +98,7 @@
"overrides": [
{
"files": [ "res/controllers/*.d.ts" ],
"extends": [ "plugin:@typescript-eslint/recommended" ],
"rules": {
"no-unused-vars": "off"
}
Expand Down
9 changes: 9 additions & 0 deletions res/controllers/common-controller-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ String.prototype.toInt = function() {
* @param {string} message - The log message.
* @deprecated Use console.log()/console.warn()/console.debug() instead.
*/

var print = function(message) {
console.log(message);
};
Expand All @@ -45,6 +46,7 @@ var printObject = function(obj, maxdepth) {
print(stringifyObject(obj, maxdepth));
};


var stringifyObject = function(obj, maxdepth, checked, prefix) {
if (!maxdepth) { maxdepth = 2; }
try {
Expand All @@ -69,6 +71,7 @@ var stringifyObject = function(obj, maxdepth, checked, prefix) {
return obj;
};


var arrayContains = function(array, elem) {
for (let i = 0; i < array.length; i++) {
if (array[i] === elem) { return true; }
Expand Down Expand Up @@ -491,6 +494,7 @@ script.softStart = function(channel, control, value, status, group, factor) {
};

// bpm - Used for tapping the desired BPM for a deck

var bpm = function() {
};

Expand Down Expand Up @@ -565,11 +569,13 @@ script.individualEffectRegEx = /^\[EffectRack1_EffectUnit(\d+)_Effect(\d+)\]$/;
// ----------------- Object definitions --------------------------



var ButtonState = {"released": 0x00, "pressed": 0x7F};
// eslint-disable-next-line no-unused-vars
var LedState = {"off": 0x00, "on": 0x7F};

// Controller

var Controller = function() {
this.group = "[Master]";
this.Controls = [];
Expand All @@ -593,6 +599,7 @@ Controller.prototype.setControlValue = function(control, value) {
};

// Button

var Button = function(controlId) {
this.controlId = controlId;
this.state = ButtonState.released;
Expand All @@ -602,6 +609,7 @@ Button.prototype.handleEvent = function(value) {
};

// Control

var Control = function(mappedFunction, softMode) {
// These defaults are for MIDI controllers
this.minInput = 0;
Expand Down Expand Up @@ -650,6 +658,7 @@ Control.prototype.setValue = function(group, inputValue) {
};

// Deck

var Deck = function(deckNumber, group) {
this.deckNumber = deckNumber;
this.group = group;
Expand Down

0 comments on commit c641c6d

Please sign in to comment.