-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintcache
1 lines (1 loc) · 122 KB
/
.eslintcache
1
[{"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\index.js":"1","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\serviceWorker.js":"2","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\App.jsx":"3","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\deviceConfigs.js":"4","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\config.js":"5","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\projectFile.js":"6","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\ProjectFileReader.jsx":"7","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\Canvas.jsx":"8","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\AutoplayControl.jsx":"9","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\autoPlay.js":"10","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\keySound.js":"11","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\keyLED.js":"12","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\palette.js":"13","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\Button.jsx":"14","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\buttonConfigs.js":"15","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\index.js":"16","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\serviceWorker.js":"17","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\App.jsx":"18","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\config.js":"19","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\deviceConfigs.js":"20","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\projectFile.js":"21","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\ProjectFileReader.jsx":"22","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\Canvas.jsx":"23","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\AutoplayControl.jsx":"24","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\buttonConfigs.js":"25","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\keyLED.js":"26","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\keySound.js":"27","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\autoPlay.js":"28","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\palette.js":"29","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\Button.jsx":"30"},{"size":480,"mtime":1610853349565,"results":"31","hashOfConfig":"32"},{"size":5227,"mtime":1602971545249,"results":"33","hashOfConfig":"32"},{"size":13897,"mtime":1610960783557,"results":"34","hashOfConfig":"32"},{"size":24658,"mtime":1610960234201,"results":"35","hashOfConfig":"32"},{"size":80,"mtime":1610410124460,"results":"36","hashOfConfig":"32"},{"size":7628,"mtime":1610837773151,"results":"37","hashOfConfig":"32"},{"size":427,"mtime":1610006627608,"results":"38","hashOfConfig":"32"},{"size":16127,"mtime":1610959882025,"results":"39","hashOfConfig":"32"},{"size":2840,"mtime":1610670351205,"results":"40","hashOfConfig":"32"},{"size":3819,"mtime":1610750506540,"results":"41","hashOfConfig":"32"},{"size":1721,"mtime":1610764846376,"results":"42","hashOfConfig":"32"},{"size":4891,"mtime":1610837845925,"results":"43","hashOfConfig":"32"},{"size":5072,"mtime":1610440533168,"results":"44","hashOfConfig":"32"},{"size":1316,"mtime":1610854742148,"results":"45","hashOfConfig":"32"},{"size":1328,"mtime":1610959408074,"results":"46","hashOfConfig":"32"},{"size":480,"mtime":1624503294589,"results":"47","hashOfConfig":"48"},{"size":5227,"mtime":1624503294590,"results":"49","hashOfConfig":"48"},{"size":13897,"mtime":1624503294583,"results":"50","hashOfConfig":"48"},{"size":80,"mtime":1624503294588,"results":"51","hashOfConfig":"48"},{"size":24713,"mtime":1627536775832,"results":"52","hashOfConfig":"48"},{"size":7968,"mtime":1627260309993,"results":"53","hashOfConfig":"48"},{"size":427,"mtime":1624503294585,"results":"54","hashOfConfig":"48"},{"size":16127,"mtime":1627536805549,"results":"55","hashOfConfig":"48"},{"size":2840,"mtime":1624503294583,"results":"56","hashOfConfig":"48"},{"size":1328,"mtime":1624503294587,"results":"57","hashOfConfig":"48"},{"size":4891,"mtime":1624503294586,"results":"58","hashOfConfig":"48"},{"size":1721,"mtime":1624503294586,"results":"59","hashOfConfig":"48"},{"size":3819,"mtime":1624503294586,"results":"60","hashOfConfig":"48"},{"size":5072,"mtime":1624503294589,"results":"61","hashOfConfig":"48"},{"size":1316,"mtime":1624503294584,"results":"62","hashOfConfig":"48"},{"filePath":"63","messages":"64","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},"1l62myl",{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"68","messages":"69","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":1,"source":null},{"filePath":"70","messages":"71","errorCount":0,"warningCount":43,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"72","messages":"73","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"74","messages":"75","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"76","usedDeprecatedRules":"65"},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":15,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"81","messages":"82","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"83","usedDeprecatedRules":"65"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"86","usedDeprecatedRules":"65"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"89","messages":"90","errorCount":0,"warningCount":16,"fixableErrorCount":0,"fixableWarningCount":0,"source":"91","usedDeprecatedRules":"65"},{"filePath":"92","messages":"93","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"65"},{"filePath":"96","messages":"97","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},"11jymx8",{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":1,"source":"105","usedDeprecatedRules":"100"},{"filePath":"106","messages":"107","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"108","messages":"109","errorCount":0,"warningCount":43,"fixableErrorCount":0,"fixableWarningCount":0,"source":"110","usedDeprecatedRules":"100"},{"filePath":"111","messages":"112","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"113","usedDeprecatedRules":"100"},{"filePath":"114","messages":"115","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"116","messages":"117","errorCount":0,"warningCount":15,"fixableErrorCount":0,"fixableWarningCount":0,"source":"118","usedDeprecatedRules":"100"},{"filePath":"119","messages":"120","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"83","usedDeprecatedRules":"100"},{"filePath":"121","messages":"122","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"123","messages":"124","errorCount":0,"warningCount":16,"fixableErrorCount":0,"fixableWarningCount":0,"source":"91","usedDeprecatedRules":"100"},{"filePath":"125","messages":"126","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"127","messages":"128","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"86","usedDeprecatedRules":"100"},{"filePath":"129","messages":"130","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"100"},{"filePath":"131","messages":"132","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\index.js",[],["133","134"],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\serviceWorker.js",[],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\App.jsx",["135","136","137","138"],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\deviceConfigs.js",["139","140","141","142","143","144","145","146","147","148","149","150","151","152","153","154","155","156","157","158","159","160","161","162","163","164","165","166","167","168","169","170","171","172","173","174","175","176","177","178","179","180","181"],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\config.js",[],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\projectFile.js",["182","183","184"],"import KeyLED from \"./keyLED\"\r\nimport AutoPlay from \"./autoPlay\"\r\nimport keySound from './keySound';\r\nimport { Howler } from \"howler\";\r\n\r\nclass ProjectFile {\r\n info = {};\r\n soundFiles = {};\r\n keySound = undefined;\r\n autoplay = undefined;\r\n keyLED = undefined;\r\n canvas = undefined\r\n activeKeyLED = {}\r\n\r\n constructor(file, canvas) {\r\n this.canvas = canvas.current;\r\n return this.unpack(file);\r\n }\r\n\r\n unpack(projectFile) {\r\n return new Promise(async (resolve, reject) => {\r\n try{\r\n console.log(this.info)\r\n let JSZip = require(\"jszip\");\r\n let files = await JSZip.loadAsync(projectFile).then(function (zip) {\r\n return Object.values(zip.files)\r\n }, function (e) {\r\n reject(\"Failed to extract selected file\");\r\n console.log(e);\r\n return;\r\n });\r\n let projectRoot = undefined;\r\n let keySoundFile = undefined;\r\n let autoplayFile = undefined;\r\n let keyLEDFiles = {};\r\n\r\n //Load info and categorize files\r\n for (let file of files) {\r\n let filename = file.name.toLowerCase()\r\n if (!filename.endsWith(\"/\")) //Ignore folder\r\n {\r\n if (filename.includes(\"sounds/\")) //Audio\r\n {\r\n console.log(\"Sound file: \" + filename);\r\n this.soundFiles[filename.split(\"/\").pop()] = await file.async(\"blob\").then(function (blob) {\r\n return new keySound(blob, filename.split(\"/\").pop())\r\n });\r\n }\r\n else {\r\n let text = await file.async(\"text\").then((text) => { return text = text.split(/\\r?\\n/); });\r\n if (filename.endsWith(\"info\")) //Text\r\n {\r\n console.log(\"Info file: \" + filename);\r\n projectRoot = filename.slice(0, -4);\r\n console.log(\" project root: \" + projectRoot);\r\n text.forEach(info => this.info[info.split('=')[0]] = info.split('=')[1]);\r\n this.info[\"buttonX\"] = parseInt(this.info[\"buttonX\"]);\r\n this.info[\"buttonY\"] = parseInt(this.info[\"buttonY\"]);\r\n this.info[\"chain\"] = parseInt(this.info[\"chain\"]);\r\n this.info[\"squareButton\"] = this.info[\"squareButton\"] === \"true\";\r\n this.info[\"landscape\"] = this.info[\"landscape\"] === \"true\";\r\n console.log(\" title: \" + this.info[\"title\"])\r\n console.log(\" producerName: \" + this.info[\"producerName\"])\r\n console.log(\" buttonX: \" + this.info[\"buttonX\"])\r\n console.log(\" buttonY: \" + this.info[\"buttonY\"])\r\n console.log(\" chain: \" + this.info[\"chain\"])\r\n console.log(\" squareButton: \" + this.info[\"squareButton\"])\r\n console.log(\" landscape: \" + this.info[\"landscape\"])\r\n if (this.info[\"buttonX\"] !== 8 || this.info[\"buttonY\"] !== 8) {\r\n reject(\"Only 8x8 Unipad project are supported\");\r\n return;\r\n }\r\n if (this.info[\"chain\"] > 8) {\r\n // reject(\"Only Unipad project that has within 8 chains are supported\");\r\n // alert(`This Unipad Project has ${this.info[\"chain\"]} chains. Projects that has more than 8 chains are limited supported`)\r\n // return;\r\n }\r\n }\r\n else if (filename.endsWith(\"keysound\")) {\r\n console.log(\"KeySound file: \" + filename);\r\n keySoundFile = text;\r\n }\r\n else if (filename.endsWith(\"autoplay\")) {\r\n console.log(\"AutoPlay file: \" + filename);\r\n autoplayFile = text;\r\n }\r\n else if (filename.includes(\"keyled/\")) {\r\n console.log(\"KeyLED file: \" + filename);\r\n keyLEDFiles[filename] = text;\r\n }\r\n else {\r\n console.log(\"Unknown file: \" + filename);\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Initialize 4D arraies\r\n this.keySound = new Array(this.info.chain).fill(null).map(\r\n () => new Array(this.info.buttonX).fill(null).map(\r\n () => new Array(this.info.buttonY).fill(null).map(\r\n () => new Array())));\r\n\r\n this.keyLED = new Array(this.info.chain).fill(null).map(\r\n () => new Array(this.info.buttonX).fill(null).map(\r\n () => new Array(this.info.buttonY).fill(null).map(\r\n () => new Array())));\r\n\r\n // Load KeyLED\r\n for (var [name, text] of Object.entries(keyLEDFiles)) {\r\n let fileInfo = name.split(\"/\").pop().split(\" \");\r\n // if (fileInfo.length === 5) {\r\n // this.keyLED[parseInt(fileInfo[0]) - 1][parseInt(fileInfo[2]) - 1][parseInt(fileInfo[1]) - 1][fileInfo[4].charCodeAt(0) - 97] = new KeyLED(text, parseInt(fileInfo[3]), this.canvas)\r\n // // console.log(name)\r\n // // console.log([parseInt(fileInfo[0]) - 1, parseInt(fileInfo[2]) - 1, parseInt(fileInfo[1]) - 1, fileInfo[4].charCodeAt(0) - 97])\r\n // // console.log(this.keyLED[parseInt(fileInfo[0]) - 1][parseInt(fileInfo[2]) - 1][parseInt(fileInfo[1]) - 1][fileInfo[4].charCodeAt(0) - 97])\r\n // }\r\n // else if (fileInfo.length === 4) {\r\n let index = fileInfo[4] !== undefined ? fileInfo[4].charCodeAt(0) - 97 : 0 //97 is 'a' \r\n // console.log([parseInt(fileInfo[0]) - 1, parseInt(fileInfo[2]) - 1, parseInt(fileInfo[1]) - 1, index])\r\n let [chain, x, y, repeat] = [parseInt(fileInfo[0]) - 1, parseInt(fileInfo[2]) - 1, parseInt(fileInfo[1]) - 1, parseInt(fileInfo[3])]\r\n this.keyLED[chain][x][y][index] = new KeyLED(text, repeat, this.canvas, [chain, x, y, index], this.activeKeyLED)\r\n // }\r\n // else {\r\n // console.warn(\"Unknown keyLED file name: \" + name);\r\n // }\r\n }\r\n\r\n //Load KeySound\r\n for (var line of keySoundFile) {\r\n line = line.trim()\r\n\r\n if (line == \"\") //For empty lines\r\n continue;\r\n\r\n let command = line.split(\" \");\r\n\r\n // console.log(command);\r\n let [chain, x, y, filename] = [parseInt(command[0]) - 1, parseInt(command[2]) - 1, parseInt(command[1]) - 1, command[3].toLowerCase()]\r\n this.keySound[chain][x][y].push([this.soundFiles[filename], command.slice(4)]);\r\n }\r\n\r\n //Load AutoPlay\r\n if(autoplayFile !== undefined)\r\n this.autoplay = new AutoPlay(autoplayFile, this.canvas);\r\n\r\n resolve(this)\r\n }\r\n catch(e)\r\n {\r\n reject(e)\r\n }\r\n });\r\n }\r\n\r\n stopKeySound() {\r\n Howler.stop()\r\n }\r\n\r\n stopKeyLED() {\r\n // console.log(this.activeKeyLED)\r\n for(var id_str in this.activeKeyLED)\r\n {\r\n var[chain, x, y, index] = this.activeKeyLED[id_str]\r\n this.keyLED[chain][x][y][index].stop(false)\r\n delete this.activeKeyLED[id_str]\r\n }\r\n setTimeout(this.canvas.clearCanvas(), 200)\r\n // new KeyLED().stopAll()\r\n // for (var chain = 0; chain < this.info.chain; chain++) {\r\n // for (\r\n // var x = 0;\r\n // chain < this.keyLED[chain].length;\r\n // x++\r\n // ) {\r\n // for (\r\n // var y = 0;\r\n // chain < this.keyLED[chain][x].length;\r\n // y++\r\n // ) {\r\n // for (\r\n // var index = 0;\r\n // chain < this.keyLED[chain][x][y].length;\r\n // index++\r\n // ) {\r\n // if (\r\n // this.keyLED[chain][x][y][index] !== undefined\r\n // ) {\r\n // this.keyLED[chain][x][y][index].stop();\r\n // }\r\n // }\r\n // }\r\n // }\r\n // }\r\n }\r\n\r\n stopAll() {\r\n this.stopKeyLED()\r\n this.stopKeySound()\r\n }\r\n}\r\n\r\nexport default ProjectFile;","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\ProjectFileReader.jsx",[],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\Canvas.jsx",["185","186","187","188","189","190","191","192","193","194","195","196","197","198","199"],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\AutoplayControl.jsx",["200","201","202"],"import React, { Component } from \"react\";\r\n\r\nclass AutoplayControl extends Component {\r\n constructor(props) {\r\n super(props);\r\n setInterval(() => {\r\n if (this.props.project !== undefined && this.props.project.autoplay !== undefined) {\r\n this.forceUpdate();\r\n }\r\n }, 1000 / 60);\r\n }\r\n\r\n render() {\r\n var playButton = (\r\n <button\r\n style={{ width: \"50px\", marginRight: \"10px\" }}\r\n onClick={this.playAutoplay}\r\n >\r\n Play\r\n </button>\r\n );\r\n var pauseButton = (\r\n <button\r\n style={{ width: \"50px\", marginRight: \"10px\" }}\r\n onClick={this.pauseAutoplay}\r\n >\r\n Pause\r\n </button>\r\n );\r\n var stopButton = (\r\n <button\r\n style={{ width: \"50px\", marginRight: \"10px\" }}\r\n onClick={this.stopAutoplay}\r\n >\r\n Stop\r\n </button>\r\n );\r\n var buttons = [];\r\n\r\n var statusText = \"\";\r\n if (this.props.project == undefined || this.props.project.autoplay == undefined || this.props.project.autoplay.total === 0)\r\n return null;\r\n switch (this.props.project.autoplay.status) {\r\n case \"PLAYING\":\r\n statusText = ` - ${(\r\n (this.props.project.autoplay.progress / this.props.project.autoplay.total) *\r\n 100\r\n ).toFixed(2)}% completed (${this.props.project.autoplay.progress}/${\r\n this.props.project.autoplay.total\r\n })`;\r\n buttons.push(pauseButton);\r\n break;\r\n case \"PAUSED\":\r\n statusText = ` - ${(\r\n (this.props.project.autoplay.progress / this.props.project.autoplay.total) *\r\n 100\r\n ).toFixed(2)}% completed (${this.props.project.autoplay.progress}/${\r\n this.props.project.autoplay.total\r\n }) - Paused`;\r\n buttons.push(playButton, stopButton);\r\n break;\r\n case \"STOPPED\":\r\n buttons.push(playButton);\r\n break;\r\n }\r\n return (\r\n <div>\r\n <text>{\"Autoplay\" + statusText}</text>\r\n <div />\r\n {buttons}\r\n </div>\r\n );\r\n }\r\n\r\n playAutoplay = () => {\r\n if (this.props.project.autoplay !== undefined) {\r\n this.props.project.autoplay.play(\r\n // this.props.canvas.current,\r\n // this.props.layoutConfig.canvas_origin\r\n );\r\n } else {\r\n alert(\"No project loaded!\");\r\n }\r\n };\r\n\r\n stopAutoplay = () => {\r\n if (this.props.project.autoplay !== undefined) {\r\n this.props.project.autoplay.stop();\r\n this.props.canvas.current.initlalizeCanvas();\r\n } else {\r\n alert(\"No project loaded!\");\r\n }\r\n };\r\n\r\n pauseAutoplay = () => {\r\n if (this.props.project.autoplay !== undefined) {\r\n this.props.project.autoplay.pause();\r\n this.props.project.stopAll();\r\n } else {\r\n alert(\"No project loaded!\");\r\n }\r\n };\r\n}\r\n\r\nexport default AutoplayControl;\r\n","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\autoPlay.js",["203"],"class AutoPlay {\r\n autoplay = undefined;\r\n status = \"STOPPED\"\r\n progress = 0\r\n total = 0\r\n led = true;\r\n currentChain = 0\r\n canvas = undefined;\r\n lastEventTime = undefined;\r\n\r\n constructor(text, canvas) {\r\n this.autoplay = text;\r\n this.total = text === undefined ? 0 : text.length;\r\n this.canvas = canvas;\r\n }\r\n\r\n play = async (callback) => {\r\n // console.time(\"Autoplay\")\r\n if (this.progress === 0) {\r\n this.canvas.initlalizeCanvas();\r\n // this.currentChain = parseInt(0);\r\n }\r\n this.status = \"PLAYING\"\r\n this.lastEventTime = Date.now()\r\n for (this.progress; this.progress < this.autoplay.length; this.progress++) {\r\n // console.timeEnd(\"Autoplay\");\r\n // console.time(\"Autoplay\")\r\n\r\n if (this.status === \"STOPPED\" || this.status === \"PAUSED\") {\r\n return;\r\n }\r\n\r\n console.log(this.autoplay[this.progress])\r\n let command = this.autoplay[this.progress].split(\" \");\r\n\r\n if(callback !== undefined)\r\n callback([this.progress, this.autoplay.length])\r\n\r\n if (command.length < 2)\r\n continue;\r\n\r\n if (this.canvas.currentChain != this.currentChain) {\r\n this.canvas.chainChange(this.currentChain);\r\n }\r\n\r\n switch (command[0]) {\r\n case 'o':\r\n case 'on':\r\n if(this.led)\r\n {\r\n this.canvas.keyOn(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true);\r\n }\r\n else\r\n {\r\n this.canvas.keyOn(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true, true, false);\r\n this.canvas.setColor(parseInt(command[2]) - 1, parseInt(command[1]) - 1, 127)\r\n }\r\n break;\r\n case 'f':\r\n case 'off':\r\n if(this.led)\r\n {\r\n this.canvas.keyOff(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true);\r\n }\r\n else\r\n {\r\n this.canvas.keyOff(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true);\r\n this.canvas.setColor(parseInt(command[2]) - 1, parseInt(command[1]) - 1, 0)\r\n }\r\n break;\r\n case 't':\r\n case 'touch':\r\n if(this.led)\r\n {\r\n this.canvas.keyOn(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true);\r\n this.canvas.keyOff(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true);\r\n }\r\n else\r\n {\r\n this.canvas.keyOn(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true, true, false);\r\n this.canvas.keyOff(parseInt(command[2]) - 1, parseInt(command[1]) - 1, undefined, true);\r\n this.canvas.setColor(parseInt(command[2]) - 1, parseInt(command[1]) - 1, 3)\r\n setTimeout(() => {this.canvas.setColor(parseInt(command[2]) - 1, parseInt(command[1]) - 1, 0)}, 200)\r\n }\r\n break;\r\n case 'd':\r\n case 'delay':\r\n var ms = parseInt(command[1])\r\n if(ms < 10)\r\n break;\r\n await this.wait(parseInt(command[1]));\r\n break;\r\n case 'c':\r\n case 'chain':\r\n this.canvas.chainChange(parseInt(command[1]) - 1);\r\n this.currentChain = parseInt(command[1]) - 1;\r\n break;\r\n default:\r\n }\r\n }\r\n this.status = \"STOPPED\"\r\n this.progress = 0\r\n }\r\n\r\n pause() {\r\n this.status = \"PAUSED\"\r\n }\r\n\r\n stop() {\r\n this.status = \"STOPPED\"\r\n this.progress = 0\r\n }\r\n\r\n wait(ms) {\r\n var adjusted_ms = this.lastEventTime + ms - Date.now()\r\n this.lastEventTime += ms\r\n if(adjusted_ms > 5)\r\n {\r\n return new Promise(resolve => setTimeout(resolve, adjusted_ms))\r\n }\r\n else\r\n {\r\n return \r\n }\r\n }\r\n}\r\n\r\nexport default AutoPlay;","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\keySound.js",[],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Engine\\keyLED.js",["204","205","206","207","208","209","210","211","212","213","214","215","216","217","218","219"],"class KeyLED\r\n{\r\n keyLED = undefined\r\n id = undefined\r\n id_str = undefined\r\n repeat = 1;\r\n end = false;\r\n activeThread = -1\r\n nextID = 0\r\n canvas = undefined\r\n currentOn=[]\r\n lastEventTime = undefined;\r\n activeList = undefined //Global, refence to the activeKeyLED object in the projectFile\r\n\r\n constructor(text, repeat, canvas, id, activeList)\r\n {\r\n this.keyLED = text;\r\n this.repeat = repeat;\r\n this.canvas = canvas;\r\n this.id = id;\r\n this.id_str = `${id[0]} ${id[1]} ${id[2]} ${id[3]}` \r\n this.activeList = activeList\r\n }\r\n\r\n play = async() =>\r\n {\r\n if(this.activeList[this.id_str] === undefined)\r\n {\r\n this.activeList[this.id_str] = this.id\r\n // console.log(\"Active List added\")\r\n // console.log(this.activeList)\r\n }\r\n var threadID = this.getID()\r\n this.activeThread = threadID\r\n this.currentOn = []\r\n var currentLoop = 0\r\n this.end = false;\r\n this.lastEventTime = Date.now()\r\n // console.log(\"KeyLED\")\r\n // console.timeLog(\"KeyOn\")\r\n while(this.repeat === 0 || currentLoop++ < this.repeat)\r\n {\r\n for(var line of this.keyLED)\r\n {\r\n line = line.trim()\r\n if(this.activeThread != threadID)\r\n return\r\n\r\n if(line == \"\")\r\n continue;\r\n \r\n let command = line.split(\" \");\r\n // console.log(line)\r\n\r\n switch(command[0])\r\n {\r\n case 'o': //set color\r\n case 'on': //set color\r\n if(command[1] === \"*\")\r\n {\r\n command[1] = \"mc\"\r\n }\r\n if(command[1] === \"mc\" || command[1] === \"l\") //For \"l\", the y is garbage but it won't be read for the setColor functions so just gonna let it be\r\n {\r\n [x, y] = [command[1], parseInt(command[2] - 1)]\r\n }\r\n else if(parseInt(command[1]) !== NaN)\r\n {\r\n [x, y] = [parseInt(command[2] - 1), parseInt(command[1] - 1)]\r\n }\r\n\r\n var color\r\n if(command[command.length - 2] === \"a\" || command[command.length - 2] === \"auto\")\r\n {\r\n color = parseInt(command[command.length - 1])\r\n }\r\n else\r\n {\r\n color = \"#\" + command[command.length - 1]\r\n }\r\n\r\n this.canvas.setColor(x, y, color)\r\n\r\n var id = x + \"-\" + y\r\n if(this.currentOn[id] === undefined) \r\n {\r\n this.currentOn[id] = [x, y]\r\n }\r\n else if(color === 0)\r\n {\r\n delete this.currentOn[id]\r\n }\r\n break;\r\n case 'f': //color off\r\n case 'off': //color off\r\n var [x, y] = [undefined, undefined]\r\n if(command[1] === \"*\")\r\n {\r\n command[1] = \"mc\"\r\n }\r\n if(command[1] === \"mc\" || command[1] === \"l\")\r\n {\r\n [x, y] = [command[1], parseInt(command[2] - 1)]\r\n }\r\n else if(parseInt(command[1]) !== NaN)\r\n {\r\n [x, y] = [parseInt(command[2] - 1), parseInt(command[1] - 1)]\r\n }\r\n\r\n this.canvas.setColor(x, y, 0)\r\n var id = x + \"-\" + y\r\n delete this.currentOn[id]\r\n break;\r\n case 'd': //wait\r\n case 'delay': \r\n await this.wait(parseInt(command[1]));\r\n break;\r\n default:\r\n }\r\n }\r\n if(this.end)\r\n {\r\n this.stop()\r\n break;\r\n }\r\n }\r\n if(this.activeThread == threadID) //Added due to current thread on the last wait then the next thread started. This will result in the next thread to be stuck\r\n {\r\n this.activeThread = -1\r\n this.removeFromActiveList()\r\n }\r\n }\r\n\r\n wait(ms)\r\n {\r\n var adjusted_ms = this.lastEventTime + ms - Date.now()\r\n this.lastEventTime += ms\r\n if(adjusted_ms > 5)\r\n {\r\n return new Promise(resolve => setTimeout(resolve, adjusted_ms))\r\n }\r\n else\r\n {\r\n return \r\n }\r\n }\r\n\r\n getID()\r\n {\r\n return this.nextID++;\r\n }\r\n\r\n stop(clearLight = true)\r\n { \r\n //Threading System (Light 1 in delay then we set it to stop and create a Light 2 so it can start right away, set )\r\n if(this.activeThread === -1)\r\n return\r\n this.activeThread = -1\r\n if(clearLight)\r\n {\r\n for(var id in this.currentOn)\r\n {\r\n var [x,y] = this.currentOn[id]\r\n this.canvas.setColor(x, y, 0)\r\n }\r\n }\r\n this.currentOn = []\r\n this.removeFromActiveList()\r\n }\r\n\r\n endLoop()\r\n {\r\n this.end = true\r\n }\r\n\r\n removeFromActiveList()\r\n {\r\n // console.log(\"Try to delete \" + this.id_str)\r\n // console.log(this.activeList)\r\n delete this.activeList[this.id_str]\r\n // console.log(this.activeList)\r\n }\r\n}\r\n\r\nexport default KeyLED;","C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\palette.js",[],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\Components\\Button.jsx",[],"C:\\Users\\caine\\Documents\\GitHub\\prismatic\\src\\buttonConfigs.js",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\index.js",[],["220","221"],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\serviceWorker.js",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\App.jsx",["222","223","224","225"],"import React, { Component } from \"react\";\r\nimport ProjectFileReader from \"./ProjectFileReader\";\r\nimport ProjectFile from \"../Engine/projectFile\";\r\nimport Canvas from \"./Canvas\";\r\nimport config from \"../config\";\r\nimport deviceConfigs from \"../deviceConfigs\";\r\nimport Select from \"react-select\";\r\nimport AutoplayControl from \"./AutoplayControl\";\r\nimport WebMidi from \"webmidi\";\r\nimport preval from 'preval.macro'\r\n\r\nclass App extends Component {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n componentDidMount()\r\n {\r\n console.log(\"%c203 | Prismatic \\nBuild \" + preval`module.exports = new Date().toLocaleString();`, \"color: cyan;font-size:24px;\")\r\n this.loadUserConfigPerfences()\r\n setTimeout((this.initlization).bind(this), 0) //Hacky way to get initlization done after first render\r\n }\r\n\r\n initlization()\r\n {\r\n WebMidi.enable(err => {\r\n if (err) {\r\n this.onMIDIFailure()\r\n } else {\r\n this.onMIDISuccess();\r\n }},\r\n true\r\n );\r\n\r\n const urlParams = new URLSearchParams(window.location.search);\r\n if (urlParams.get(\"unipack\")) {\r\n var unipack_url = urlParams.get(\"unipack\");\r\n this.downloadProjectFile(unipack_url);\r\n }\r\n }\r\n\r\n state = {\r\n projectFile: undefined,\r\n statusMessage: \"No project loaded\",\r\n\r\n midiInput: {},\r\n midiOutput: {},\r\n\r\n layoutConfigName: config.defaultLayout,\r\n layoutConfig: deviceConfigs[config.defaultLayout],\r\n\r\n inputDevice: undefined,\r\n inputConfigName: undefined,\r\n inputConfig: undefined,\r\n\r\n outputDevice: undefined,\r\n outputConfigName: undefined,\r\n outputConfig: undefined,\r\n };\r\n\r\n canvas = React.createRef();\r\n\r\n downloadProjectFile = (url) => {\r\n alert(\"Download Unipack from \" + url)\r\n fetch(\"https://cors-anywhere.herokuapp.com/\" + url).then\r\n ((r => \r\n {var file = r.blob();\r\n console.log(file);\r\n this.loadProjectFile(file);\r\n }).bind(this));\r\n };\r\n\r\n loadProjectFile = (projectPack) => {\r\n if(projectPack == null)\r\n return\r\n this.setState({statusMessage: \"Loading Unipack\"});\r\n new ProjectFile(projectPack, this.canvas)\r\n .then((projectFile) => {\r\n this.setState({ projectFile: projectFile });\r\n console.log(projectFile);\r\n this.setState({statusMessage: `Current Project: ${this.state.projectFile.info[\"title\"]} by ${this.state.projectFile.info[\"producerName\"]}`});\r\n })\r\n .catch((message) => {\r\n this.setState({statusMessage: \"Error Loading Unipack\"});\r\n alert(\"Error Loading Unipack: \" + projectPack.name)\r\n console.error(\"Error Loading Unipack\")\r\n console.error(message);\r\n });\r\n };\r\n\r\n onMIDISuccess(){\r\n console.log(\"Got access your MIDI devices.\");\r\n\r\n this.updateMidiList();\r\n\r\n WebMidi.addListener(\"connected\", this.onMidiStateChange.bind(this))\r\n WebMidi.addListener(\"disconnected\", this.onMidiStateChange.bind(this))\r\n\r\n this.loadUserDevicePerfences()\r\n };\r\n\r\n onMidiStateChange(e) {\r\n console.log(e);\r\n console.log(e.port.name, e.port.type, e.port.state);\r\n if (e.port.state === \"disconnected\") {\r\n if (e.port.type === \"input\") {\r\n if (\r\n this.state.inputDevice !== undefined &&\r\n this.state.inputDevice.name === e.port.name\r\n ) {\r\n this.setState({ inputDevice: undefined });\r\n this.setState({ inputDeviceConfig: undefined });\r\n this.setState({ inputDeviceName: undefined });\r\n }\r\n } else if (e.port.type === \"output\") {\r\n if (\r\n this.state.outputDevice !== undefined &&\r\n this.state.outputDevice.name === e.port.name\r\n ) {\r\n this.setState({ outputDevice: undefined });\r\n this.setState({ outputDeviceConfig: undefined });\r\n this.setState({ outputDeviceName: undefined });\r\n }\r\n }\r\n }\r\n this.updateMidiList();\r\n }\r\n \r\n updateMidiList() {\r\n var midiInput = {};\r\n console.log(\"Input\");\r\n for (var input of WebMidi.inputs) {\r\n console.log(input.name);\r\n midiInput[input.name] = input\r\n }\r\n this.setState({ midiInput: midiInput });\r\n\r\n var midiOutput = {};\r\n console.log();\r\n console.log(\"Output\");\r\n for (var output of WebMidi.outputs) {\r\n console.log(output.name);\r\n midiOutput[output.name] = output\r\n }\r\n this.setState({ midiOutput: midiOutput });\r\n }\r\n\r\n\r\n onMIDIFailure() {\r\n console.log(\"Could not access your MIDI devices.\");\r\n alert(\r\n \"Could not access your MIDI devices. Try use another web browser or hardware platform.\"\r\n );\r\n }\r\n\r\n autoConfigPicker(deviceName, mode) {\r\n if (deviceName !== undefined) {\r\n for (var key in deviceConfigs) {\r\n if (deviceConfigs[key].midiNameRegex !== undefined && deviceName.match(deviceConfigs[key].midiNameRegex) !== null) {\r\n var config = deviceConfigs[key];\r\n console.log(\r\n `${\r\n mode ? \"Output\" : \"input\"\r\n } config has been auto assigned to ${key}`\r\n );\r\n switch (mode) {\r\n case \"Input\":\r\n this.setInputConfig({label: key, value: config})\r\n return true;\r\n case \"Output\":\r\n this.setOutputConfig({label: key, value: config})\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n alert(\r\n `Unable to find matching ${\r\n mode ? \"output\" : \"input\"\r\n } config for device ${deviceName}`\r\n );\r\n return false\r\n }\r\n\r\n render() {\r\n return (\r\n <React.Fragment>\r\n <div className=\"main\">\r\n <div className=\"sidebar\">\r\n <text>203 | Prismatic (Tech Preview Demo)</text>\r\n <div className=\"sidebarItem\" />\r\n <text className=\"sidebarItem\">\r\n {this.state.statusMessage}\r\n </text>\r\n <ProjectFileReader\r\n loadProjectFile={this.loadProjectFile}\r\n ></ProjectFileReader>\r\n <div className=\"sidebarItem\" />\r\n <text>UI Layout</text>\r\n <Select\r\n className=\"sidebarItem\"\r\n options={this.prepSelectConfig(deviceConfigs, \"layout\")}\r\n autosize={true}\r\n value={\r\n this.state.layoutConfigName !== undefined\r\n ? {\r\n label: this.state.layoutConfigName,\r\n value: this.state.layoutConfig,\r\n }\r\n : { label: \"Layout Config\", value: undefined }\r\n }\r\n onChange={this.setLayoutConfig.bind(this)}\r\n />\r\n <text>Midi Input Device</text>\r\n <Select\r\n className=\"sidebarItem\"\r\n options={this.prepSelectConfig(this.state.midiInput)}\r\n autosize={true}\r\n value={\r\n this.state.inputDevice !== undefined\r\n ? {\r\n label: this.state.inputDevice.name,\r\n value: this.state.inputDevice,\r\n }\r\n : { label: \"Input Device\", value: undefined }\r\n }\r\n onChange={this.setInputDevice.bind(this)}\r\n />\r\n <text>Midi Input Device Config</text>\r\n <Select\r\n className=\"sidebarItem\"\r\n options={this.prepSelectConfig(deviceConfigs, \"keymap\")}\r\n autosize={true}\r\n value={\r\n this.state.inputConfigName !== undefined\r\n ? {\r\n label: this.state.inputConfigName,\r\n value: this.state.inputConfig,\r\n }\r\n : { label: \"Input Device Config\", value: undefined }\r\n }\r\n onChange={this.setInputConfig.bind(this)}\r\n />\r\n <text>Midi Output Device</text>\r\n <Select\r\n className=\"sidebarItem\"\r\n options={this.prepSelectConfig(this.state.midiOutput)}\r\n autosize={true}\r\n value={\r\n this.state.outputDevice !== undefined\r\n ? {\r\n label: this.state.outputDevice.name,\r\n value: this.state.outputDevice,\r\n }\r\n : { label: \"Output Device\", value: undefined }\r\n }\r\n onChange={this.setOutputDevice.bind(this)}\r\n />\r\n <text>Midi Output Device Config</text>\r\n <Select\r\n className=\"sidebarItem\"\r\n options={this.prepSelectConfig(deviceConfigs, \"keymap\")}\r\n autosize={true}\r\n value={\r\n this.state.outputConfigName !== undefined\r\n ? {\r\n label: this.state.outputConfigName,\r\n value: this.state.outputConfig,\r\n }\r\n : { label: \"Output Device Config\", value: undefined }\r\n }\r\n onChange={this.setOutputConfig.bind(this)}\r\n />\r\n <div />\r\n <AutoplayControl project={this.state.projectFile} canvas={this.canvas} layoutConfig={this.state.layoutConfig}/>\r\n </div>\r\n <Canvas\r\n ref={this.canvas}\r\n projectFile={this.state.projectFile}\r\n layoutConfig={this.state.layoutConfig}\r\n inputDevice={this.state.inputDevice}\r\n inputConfig={this.state.inputConfig}\r\n outputDevice={this.state.outputDevice}\r\n outputConfig={this.state.outputConfig}\r\n />\r\n </div>\r\n </React.Fragment>\r\n );\r\n }\r\n\r\n setLayoutConfig(config) {\r\n // console.log(config)\r\n this.setState({ layoutConfigName: config.label });\r\n this.setState({ layoutConfig: config.value });\r\n localStorage.setItem('perferedLayoutConfig', config.label);\r\n }\r\n\r\n setInputConfig(config) {\r\n // console.log(config)\r\n this.setState({ inputConfigName: config.label });\r\n this.setState({ inputConfig: config.value }, this.initlizateInputDevice.bind(this));\r\n localStorage.setItem('perferedInputConfig', config.label);\r\n }\r\n\r\n setOutputConfig(config) {\r\n // console.log(config)\r\n this.setState({ outputConfigName: config.label });\r\n this.setState({ outputConfig: config.value }, this.initlizateOutputDevice.bind(this));\r\n localStorage.setItem('perferedOutputConfig', config.label);\r\n }\r\n\r\n setInputDevice(device, autoPickConfig = true) {\r\n this.setState({ inputDevice: device.value });\r\n if(autoPickConfig) this.autoConfigPicker(device.value.name, \"Input\");\r\n localStorage.setItem('perferedInputDevice', device.value.name);\r\n }\r\n\r\n setOutputDevice(device, autoPickConfig = true) {\r\n // console.log(\"Output device set to \" + device.name);\r\n this.setState({ outputDevice: device.value });\r\n if(autoPickConfig) this.autoConfigPicker(device.value.name, \"Output\");\r\n localStorage.setItem('perferedOutputDevice', device.value.name);\r\n }\r\n\r\n initlizateInputDevice()\r\n {\r\n if(this.state.inputConfig !== undefined && this.state.inputDevice !== undefined)\r\n {\r\n if(this.state.inputConfig.inputInfoMessage !== undefined)\r\n {\r\n for(var i in this.state.inputConfig.infoMessage)\r\n {\r\n alert(this.state.inputConfig.inputInfoMessage[i])\r\n }\r\n }\r\n }\r\n }\r\n\r\n initlizateOutputDevice()\r\n {\r\n //Sysex\r\n if(this.state.outputConfig !== undefined && this.state.outputDevice !== undefined)\r\n {\r\n if(this.state.outputConfig.initializationSysex !== undefined)\r\n {\r\n for(var i in this.state.outputConfig.initializationSysex)\r\n {\r\n this.state.outputDevice.sendSysex([], this.state.outputConfig.initializationSysex[i])\r\n }\r\n }\r\n if(this.state.outputConfig.outputInfoMessage !== undefined)\r\n {\r\n for(var i in this.state.outputConfig.infoMessage)\r\n {\r\n alert(this.state.outputConfig.outputInfoMessage[i])\r\n }\r\n }\r\n }\r\n }\r\n\r\n prepSelectConfig(config, requiredKey = undefined) {\r\n var result = [];\r\n for (var key in config) {\r\n if (requiredKey === undefined || config[key][requiredKey] !== undefined) {\r\n result.push({\r\n label: key,\r\n value: config[key],\r\n });\r\n }\r\n }\r\n return result;\r\n }\r\n\r\n loadUserConfigPerfences() {\r\n const perferedLayoutConfig = localStorage.getItem('perferedLayoutConfig');\r\n if(perferedLayoutConfig !== null && deviceConfigs[perferedLayoutConfig] !== undefined)\r\n {\r\n this.setLayoutConfig({label: perferedLayoutConfig, value:deviceConfigs[perferedLayoutConfig]})\r\n }\r\n\r\n const perferedInputConfig = localStorage.getItem('perferedInputConfig');\r\n if(perferedInputConfig !== null && deviceConfigs[perferedInputConfig] !== undefined)\r\n {\r\n this.setInputConfig({label: perferedInputConfig, value:deviceConfigs[perferedInputConfig]})\r\n }\r\n\r\n const perferedOutputConfig = localStorage.getItem('perferedOutputConfig');\r\n if(perferedOutputConfig !== null && deviceConfigs[perferedOutputConfig] !== undefined)\r\n {\r\n this.setOutputConfig({label: perferedOutputConfig, value:deviceConfigs[perferedOutputConfig]})\r\n }\r\n }\r\n\r\n loadUserDevicePerfences() {\r\n const perferedInputDevice = localStorage.getItem('perferedInputDevice');\r\n if(perferedInputDevice !== null && this.state.midiInput[perferedInputDevice] !== undefined)\r\n {\r\n this.setInputDevice({label: perferedInputDevice, value:this.state.midiInput[perferedInputDevice]}, false)\r\n }\r\n\r\n const perferedOutputDevice = localStorage.getItem('perferedOutputDevice');\r\n if(perferedOutputDevice !== null && this.state.midiOutput[perferedOutputDevice] !== undefined)\r\n {\r\n this.setOutputDevice({label: perferedOutputDevice, value:this.state.midiOutput[perferedOutputDevice]}, false)\r\n }\r\n }\r\n}\r\n\r\nexport default App;\r\n","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\config.js",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\deviceConfigs.js",["226","227","228","229","230","231","232","233","234","235","236","237","238","239","240","241","242","243","244","245","246","247","248","249","250","251","252","253","254","255","256","257","258","259","260","261","262","263","264","265","266","267","268"],"const deviceConfigs = {\r\n \"Launchpad Pro\":\r\n {\r\n channel: 1,\r\n midiNameRegex: \"Launchpad Pro\", //For some reason mine shows up as \"3- Launchpad Pro\"\r\n\r\n initializationSysex:[\r\n [0, 32, 41, 2, 16, 33, 0], //Enter Live Mode\r\n [0, 32, 41, 2, 16, 14, 0], //Clear canvas\r\n [0, 32, 41, 2, 16, 10, 99, 0], //Turn off Mode light\r\n ],\r\n\r\n // inputInfoMessage:[\r\n // \"Hello\",\r\n // \"World\",\r\n // ],\r\n\r\n // outputInfoMessage:[\r\n // \"Hello\",\r\n // \"World\",\r\n // ],\r\n\r\n layout: [\r\n [\" \", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \" \"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◸\", \"◹\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◺\", \"⊿\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"⬤\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\" \", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \" \"]],\r\n\r\n keymap: [\r\n [null, 91, 92, 93, 94, 95, 96, 97, 98, null],\r\n [80, 81, 82, 83, 84, 85, 86, 87, 88, 89],\r\n [70, 71, 72, 73, 74, 75, 76, 77, 78, 79],\r\n [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],\r\n [50, 51, 52, 53, 54, 55, 56, 57, 58, 59],\r\n [40, 41, 42, 43, 44, 45, 46, 47, 48, 49],\r\n [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],\r\n [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],\r\n [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],\r\n [null, 1, 2, 3, 4, 5, 6, 7, 8, \"X99\"]],\r\n\r\n //Size of LED since sometimes Key can come without LED. We don't really need them since we can load the size of layout array\r\n width: 10,\r\n height: 10,\r\n\r\n //UI related\r\n padding: 25,\r\n radius: 15,\r\n\r\n canvas_origin: [1, 1],\r\n\r\n chainKey: [[9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n mcTable: [\r\n [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0],\r\n [9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n lKey: [9, 9],\r\n\r\n noteToXY(note)\r\n {\r\n if(note >= 1 && note <= 99 /* && note != 9 && note != 90 */)\r\n return [note % 10, 9 - Math.floor(note / 10)]\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 2 && arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n case 2: //ID\r\n var id = arguments[0]\r\n var hex = arguments[1]\r\n break;\r\n case 3: //XY\r\n var x = arguments[0] + 1\r\n var y = arguments[1] + 1\r\n var id = x * 10 + y\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return []\r\n }\r\n if (typeof (hex) === \"string\" && hex.charAt(0) === '#') {\r\n hex = parseInt(hex.substr(1), 16)\r\n }\r\n else {\r\n return []\r\n }\r\n var r = (hex >> 16) >> 2 //6 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 2\r\n var b = (hex & 0xFF) >> 2\r\n return [0, 32, 41, 2, 16, 11, id, r, g, b]\r\n }\r\n },\r\n \"Launchpad Pro (Phantom)\":\r\n {\r\n layout: [\r\n [\" \", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \" \"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◤\", \"◥\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◣\", \"◢\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\"⬤\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"⬤\"],\r\n [\" \", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \" \"]],\r\n\r\n //Size of LED since sometimes Key can come without LED. We don't really need them since we can load the size of layout array\r\n width: 10,\r\n height: 10,\r\n\r\n //UI related\r\n padding: 25,\r\n radius: 15,\r\n\r\n canvas_origin: [1, 1],\r\n\r\n chainKey: [[9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n mcTable: [\r\n [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0],\r\n [9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n lKey: [9, 9],\r\n },\r\n \"Launchpad Pro (CFW)\":\r\n {\r\n channel: 16,\r\n midiNameRegex: \"Launchpad Open\", //For some reason mine shows up as \"3- Launchpad Pro\"\r\n\r\n initializationSysex:[\r\n [0, 32, 41, 2, 16, 33, 1], //Enter Performance Mode\r\n [0, 32, 41, 2, 16, 14, 0], //Clear canvas\r\n ],\r\n\r\n keymap: [\r\n [null, 28, 29, 30, 31, 32, 33, 34, 35, null],\r\n [108, 64, 65, 66, 67, 96, 97, 98, 99, 100],\r\n [109, 60, 61, 62, 63, 92, 93, 94, 95, 101],\r\n [110, 56, 57, 58, 59, 88, 89, 90, 91, 102],\r\n [111, 52, 53, 54, 55, 84, 85, 86, 87, 103],\r\n [112, 48, 49, 50, 51, 80, 81, 82, 83, 104],\r\n [113, 44, 45, 46, 47, 76, 77, 78, 79, 105],\r\n [114, 40, 41, 42, 43, 72, 73, 74, 75, 106],\r\n [115, 36, 37, 38, 39, 68, 69, 70, 71, 107],\r\n [null, 116, 117, 118, 119, 120, 121, 122, 123, 27]],\r\n\r\n //Size of LED since sometimes Key can come without LED. We don't really need them since we can load the size of layout array\r\n width: 10,\r\n height: 10,\r\n\r\n //UI related\r\n padding: 30,\r\n radius: 15,\r\n\r\n canvas_origin: [1, 1],\r\n\r\n chainKey: [[9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n mcTable: [\r\n [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0],\r\n [9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n lKey: [9, 9],\r\n\r\n noteToXY(note)\r\n {\r\n if(note >= 36 && note <= 99) // grid\r\n {\r\n var keymap_lut = [[1,8],[2,8],[3,8],[4,8],[1,7],[2,7],[3,7],[4,7],[1,6],[2,6],[3,6],[4,6],[1,5],[2,5],[3,5],[4,5],[1,4],[2,4],[3,4],[4,4],[1,3],[2,3],[3,3],[4,3],[1,2],[2,2],[3,2],[4,2],[1,1],[2,1],[3,1],[4,1],[5,8],[6,8],[7,8],[8,8],[5,7],[6,7],[7,7],[8,7],[5,6],[6,6],[7,6],[8,6],[5,5],[6,5],[7,5],[8,5],[5,4],[6,4],[7,4],[8,4],[5,3],[6,3],[7,3],[8,3],[5,2],[6,2],[7,2],[8,2],[5,1],[6,1],[7,1],[8,1]]\r\n return keymap_lut[note - 36]\r\n }\r\n else if(note >= 100 && note <= 107)\r\n {\r\n return this.mcTable[note - 100 + 8] //note - 100 is the raw index, +8 is the offset\r\n }\r\n else if(note >= 116 && note <= 123)\r\n {\r\n return this.mcTable[7 - (note - 116) + 16] //7 - as reverse the direction\r\n }\r\n else if(note >= 108 && note <= 115)\r\n {\r\n return this.mcTable[7 - (note - 108) + 24]\r\n }\r\n else if(note >= 28 && note <= 35)\r\n {\r\n return this.mcTable[note - 28]\r\n }\r\n else if(note == 27)\r\n {\r\n return this.lKey\r\n }\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 2 && arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n case 2: //ID\r\n var id = arguments[0]\r\n var hex = arguments[1]\r\n break;\r\n case 3: //XY\r\n var x = arguments[0] + 1\r\n var y = arguments[1] + 1\r\n var id = x * 10 + y\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return []\r\n }\r\n if (typeof (hex) === \"string\" && hex.charAt(0) === '#') {\r\n hex = parseInt(hex.substr(1), 16)\r\n }\r\n else {\r\n return []\r\n }\r\n var r = (hex >> 16) >> 2 //6 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 2\r\n var b = (hex & 0xFF) >> 2\r\n return [0, 32, 41, 2, 16, 11, id, r, g, b]\r\n }\r\n },\r\n \"Launchpad MK2\":\r\n {\r\n channel: 1,\r\n midiNameRegex: \"Launchpad MK2\",\r\n\r\n layout: [\r\n [\"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \"⬤\", \" \"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◸\", \"◹\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◺\", \"⊿\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"⬤\"]],\r\n\r\n keymap: [\r\n [\"C104\", \"C105\", \"C106\", \"C107\", \"C108\", \"C109\", \"C110\", \"C111\", null],\r\n [81, 82, 83, 84, 85, 86, 87, 88, 89],\r\n [71, 72, 73, 74, 75, 76, 77, 78, 79],\r\n [61, 62, 63, 64, 65, 66, 67, 68, 69],\r\n [51, 52, 53, 54, 55, 56, 57, 58, 59],\r\n [41, 42, 43, 44, 45, 46, 47, 48, 49],\r\n [31, 32, 33, 34, 35, 36, 37, 38, 39],\r\n [21, 22, 23, 24, 25, 26, 27, 28, 29],\r\n [11, 12, 13, 14, 15, 16, 17, 18, 19]],\r\n\r\n width: 9,\r\n height: 9,\r\n\r\n //UI related\r\n padding: 30,\r\n radius: 15,\r\n\r\n canvas_origin: [0, 1],\r\n\r\n chainKey: [[8, 1], [8, 2], [8, 3], [8, 4], [8, 5], [8, 6], [8, 7], [8, 8]],\r\n\r\n mcTable: [\r\n [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0],\r\n [8, 1], [8, 2], [8, 3], [8, 4], [8, 5], [8, 6], [8, 7], [8, 8],\r\n null, null, null, null, null, null, null, null,\r\n null, null, null, null, null, null, null, null,],\r\n\r\n noteToXY(note)\r\n {\r\n if(note >= 11 && note <= 89)\r\n {\r\n return [(note % 10) - 1, 9 - Math.floor(note / 10)]\r\n }\r\n else if(note >= 104 && note <= 111)\r\n {\r\n return this.mcTable[note - 104 + 24]\r\n }\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 2 && arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n case 2: //ID\r\n var id = arguments[0]\r\n var hex = arguments[1]\r\n break;\r\n case 3: //XY\r\n var x = arguments[0] + 1\r\n var y = arguments[1] + 1\r\n var id = x * 10 + y\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return []\r\n }\r\n if (typeof (hex) === \"string\" && hex.charAt(0) === '#') {\r\n hex = parseInt(hex.substr(1), 16)\r\n }\r\n else {\r\n return []\r\n }\r\n var r = (hex >> 16) >> 2 //6 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 2\r\n var b = (hex & 0xFF) >> 2\r\n return [0, 32, 41, 2, 24, 11, id, r, g, b]\r\n }\r\n },\r\n \"Launchpad X\":\r\n {\r\n channel: 1,\r\n midiNameRegex: \"Launchpad X|LPX MIDI\",\r\n\r\n initializationSysex:[\r\n [0, 32, 41, 2, 12, 14, 1], //Enter Programmer Mode\r\n ],\r\n\r\n layout: [\r\n [\"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \" \"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◸\", \"◹\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◺\", \"⊿\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"]],\r\n\r\n keymap: [\r\n [91, 92, 93, 94, 95, 96, 97, 98, 99],\r\n [81, 82, 83, 84, 85, 86, 87, 88, 89],\r\n [71, 72, 73, 74, 75, 76, 77, 78, 79],\r\n [61, 62, 63, 64, 65, 66, 67, 68, 69],\r\n [51, 52, 53, 54, 55, 56, 57, 58, 59],\r\n [41, 42, 43, 44, 45, 46, 47, 48, 49],\r\n [31, 32, 33, 34, 35, 36, 37, 38, 39],\r\n [21, 22, 23, 24, 25, 26, 27, 28, 29],\r\n [11, 12, 13, 14, 15, 16, 17, 18, 19]],\r\n\r\n width: 9,\r\n height: 9,\r\n\r\n //UI related\r\n padding: 30,\r\n radius: 5,\r\n\r\n canvas_origin: [0, 1],\r\n\r\n chainKey: [[8, 1], [8, 2], [8, 3], [8, 4], [8, 5], [8, 6], [8, 7], [8, 8]],\r\n\r\n mcTable: [\r\n [0, 0], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0],\r\n [8, 1], [8, 2], [8, 3], [8, 4], [8, 5], [8, 6], [8, 7], [8, 8],\r\n null, null, null, null, null, null, null, null,\r\n null, null, null, null, null, null, null, null,],\r\n\r\n lKey: [9, 0],\r\n\r\n noteToXY(note)\r\n {\r\n if(note >= 11 && note <= 99) // grid\r\n {\r\n return [(note % 10) - 1, 9 - (Math.floor(note / 10))]\r\n }\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 2 && arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n case 2: //MC\r\n var mc = arguments[0]\r\n if (this.mcTable[mc] == null)\r\n return []\r\n var x, y = this.mcTable[mc]\r\n var hex = arguments[1]\r\n break;\r\n case 3: //XY\r\n var x = arguments[0] + 1\r\n var y = arguments[1] + 1\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return []\r\n }\r\n var xy = x * 10 + y\r\n var r = (hex >> 16) >> 1 //7 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 1\r\n var b = (hex & 0xFF) >> 1\r\n return [0, 32, 41, 2, 12, 3, 3, xy, r, g, b]\r\n }\r\n },\r\n \"Launchpad Pro MK3\":\r\n {\r\n channel: 1,\r\n midiNameRegex: \"Launchpad Pro MK3\",\r\n\r\n initializationSysex:[\r\n [0, 32, 41, 2, 12, 14, 0, 17, 0], //Enter Programmer Mode\r\n ],\r\n\r\n layout: [\r\n [\" \", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \" \"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◸\", \"◹\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◺\", \"⊿\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\"◼️\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◼️\"],\r\n [\" \", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \"◼️\", \" \"]],\r\n\r\n keymap: [\r\n [null, 91, 92, 93, 94, 95, 96, 97, 98, 99],\r\n [80, 81, 82, 83, 84, 85, 86, 87, 88, 89],\r\n [70, 71, 72, 73, 74, 75, 76, 77, 78, 79],\r\n [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],\r\n [50, 51, 52, 53, 54, 55, 56, 57, 58, 59],\r\n [40, 41, 42, 43, 44, 45, 46, 47, 48, 49],\r\n [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],\r\n [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],\r\n [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],\r\n [null, 1, 2, 3, 4, 5, 6, 7, 8, null]],\r\n\r\n //Size of LED since sometimes Key can come without LED. We don't really need them since we can load the size of layout array\r\n width: 10,\r\n height: 10,\r\n\r\n //UI related\r\n padding: 25,\r\n radius: 5,\r\n\r\n canvas_origin: [1, 1],\r\n\r\n chainKey: [[9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8]],\r\n\r\n mcTable: [\r\n [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0],\r\n [9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n lKey: [9, 0],\r\n\r\n noteToXY(note)\r\n {\r\n if(note >= 1 && note <= 99)\r\n {\r\n return [(note % 10), 9 - (Math.floor(note / 10))]\r\n }\r\n else if(note >= 101 && note <= 108)\r\n {\r\n return [note - 100, 9]\r\n }\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 2 && arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n case 2: //MC\r\n var mc = arguments[0]\r\n // if (this.mcTable[mc] == null)\r\n // return []\r\n var x, y = this.mcTable[mc]\r\n var hex = arguments[1]\r\n break;\r\n case 3: //XY\r\n var x = arguments[0] + 1\r\n var y = arguments[1] + 1\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return []\r\n }\r\n var xy = x * 10 + y\r\n var r = (hex >> 16) >> 1 //7 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 1\r\n var b = (hex & 0xFF) >> 1\r\n return [0, 32, 41, 2, 14, 3, 3, xy, r, g, b]\r\n }\r\n },\r\n \"Matrix\":\r\n {\r\n channel: 2,\r\n midiNameRegex: \"^Matrix\",\r\n\r\n layout: [\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◸\", \"◹\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◺\", \"⊿\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\"],\r\n [\"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\", \"◻\"]],\r\n\r\n keymap: [\r\n [64, 65, 66, 67, 96, 97, 98, 99],\r\n [60, 61, 62, 63, 92, 93, 94, 95],\r\n [56, 57, 58, 59, 88, 89, 90, 91],\r\n [52, 53, 54, 55, 84, 85, 86, 87],\r\n [48, 49, 50, 51, 80, 81, 82, 83],\r\n [44, 45, 46, 47, 76, 77, 78, 79],\r\n [40, 41, 42, 43, 72, 73, 74, 75],\r\n [36, 37, 38, 39, 68, 69, 70, 71],\r\n [100, 101, 102, 103, 104, 105, 106, 107]],\r\n\r\n width: 8,\r\n height: 8,\r\n\r\n //UI related\r\n padding: 20,\r\n radius: 15,\r\n\r\n canvas_origin: [0, 0],\r\n\r\n chainKey: [[0, 8], [1, 8], [2, 8], [3, 8], [4, 8], [5, 8], [6, 8], [7, 8]],\r\n\r\n // mcTable: [\r\n // null, null, null, null, null, null, null, null,\r\n // null, null, null, null, null, null, null, null,\r\n // null, null, null, null, null, null, null, null,\r\n // null, null, null, null, null, null, null, null,],\r\n\r\n noteToXY(note)\r\n {\r\n if(note > 35 && note < 100) // grid\r\n {\r\n var keymap_lut = [[0,7],[1,7],[2,7],[3,7],[0,6],[1,6],[2,6],[3,6],[0,5],[1,5],[2,5],[3,5],[0,4],[1,4],[2,4],[3,4],[0,3],[1,3],[2,3],[3,3],[0,2],[1,2],[2,2],[3,2],[0,1],[1,1],[2,1],[3,1],[0,0],[1,0],[2,0],[3,0],[4,7],[5,7],[6,7],[7,7],[4,6],[5,6],[6,6],[7,6],[4,5],[5,5],[6,5],[7,5],[4,4],[5,4],[6,4],[7,4],[4,3],[5,3],[6,3],[7,3],[4,2],[5,2],[6,2],[7,2],[4,1],[5,1],[6,1],[7,1],[4,0],[5,0],[6,0],[7,0]]\r\n return keymap_lut[note - 36]\r\n }\r\n else if(note > 99 && note < 108)\r\n {\r\n return this.chainKey[note - 100]\r\n }\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n // case 2: //MC\r\n // var mc = arguments[0]\r\n // if(this.mcTable[mc] == null)\r\n // return\r\n // var x,y = this.mcTable[mc]\r\n // var hex = arguments[1]\r\n case 3: //XY\r\n var x = arguments[0]\r\n var y = arguments[1]\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return;\r\n }\r\n var r = (hex >> 16) >> 1 //7 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 1\r\n var b = (hex & 0xFF) >> 1\r\n return [240, 0, 2, 3, 1, 0, 18, 32, 0, 3, r, g, b, 247]\r\n }\r\n },\r\n \"Midi Fighter 64\":\r\n {\r\n channel: 1,\r\n midiNameRegex: \"^Midi Fighter 64\",\r\n\r\n layout: [\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"],\r\n [\"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\", \"⦿\"]],\r\n\r\n keymap: [\r\n [64, 65, 66, 67, 96, 97, 98, 99],\r\n [60, 61, 62, 63, 92, 93, 94, 95],\r\n [56, 57, 58, 59, 88, 89, 90, 91],\r\n [52, 53, 54, 55, 84, 85, 86, 87],\r\n [48, 49, 50, 51, 80, 81, 82, 83],\r\n [44, 45, 46, 47, 76, 77, 78, 79],\r\n [40, 41, 42, 43, 72, 73, 74, 75],\r\n [36, 37, 38, 39, 68, 69, 70, 71]],\r\n\r\n width: 8,\r\n height: 8,\r\n\r\n //UI related\r\n padding: 20,\r\n radius: 50,\r\n\r\n canvas_origin: [0, 0],\r\n\r\n noteToXY(note)\r\n {\r\n if(note > 35 && note < 100) // grid\r\n {\r\n var keymap_lut = [[0,7],[1,7],[2,7],[3,7],[0,6],[1,6],[2,6],[3,6],[0,5],[1,5],[2,5],[3,5],[0,4],[1,4],[2,4],[3,4],[0,3],[1,3],[2,3],[3,3],[0,2],[1,2],[2,2],[3,2],[0,1],[1,1],[2,1],[3,1],[0,0],[1,0],[2,0],[3,0],[4,7],[5,7],[6,7],[7,7],[4,6],[5,6],[6,6],[7,6],[4,5],[5,5],[6,5],[7,5],[4,4],[5,4],[6,4],[7,4],[4,3],[5,3],[6,3],[7,3],[4,2],[5,2],[6,2],[7,2],[4,1],[5,1],[6,1],[7,1],[4,0],[5,0],[6,0],[7,0]]\r\n return keymap_lut[note - 36]\r\n }\r\n },\r\n\r\n hexSysexGen: function () {\r\n if (arguments.length != 3)\r\n return [] //Error\r\n switch (arguments.length) {\r\n // case 2: //MC\r\n // var mc = arguments[0]\r\n // if(this.mcTable[mc] == null)\r\n // return\r\n // var x,y = this.mcTable[mc]\r\n // var hex = arguments[1]\r\n case 3: //XY\r\n var x = arguments[0]\r\n var y = arguments[1]\r\n var hex = arguments[2]\r\n break;\r\n default:\r\n return;\r\n }\r\n var r = (hex >> 16) >> 1 //7 bit color\r\n var g = (hex & 0xFF00 >> 8) >> 1\r\n var b = (hex & 0xFF) >> 1\r\n return [240, 0, 2, 3, 1, 0, 18, 32, 0, 3, r, g, b, 247]\r\n }\r\n },\r\n // \"Debug\":\r\n // {\r\n // layout: [\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"],\r\n // [\"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\", \"⌗\"]],\r\n\r\n // //Size of LED since sometimes Key can come without LED. We don't really need them since we can load the size of layout array\r\n // width: 10,\r\n // height: 10,\r\n\r\n // //UI related\r\n // padding: 25,\r\n // radius: 15,\r\n\r\n // canvas_origin: [1, 1],\r\n\r\n // chainKey: [[9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n // [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n // [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n // mcTable: [\r\n // [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], [7, 0], [8, 0],\r\n // [9, 1], [9, 2], [9, 3], [9, 4], [9, 5], [9, 6], [9, 7], [9, 8],\r\n // [8, 9], [7, 9], [6, 9], [5, 9], [4, 9], [3, 9], [2, 9], [1, 9],\r\n // [0, 8], [0, 7], [0, 6], [0, 5], [0, 4], [0, 3], [0, 2], [0, 1]],\r\n\r\n // lKey: [9, 0],\r\n // },\r\n}\r\n\r\nexport default deviceConfigs;","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\projectFile.js",["269","270","271"],"import KeyLED from \"./keyLED\"\r\nimport AutoPlay from \"./autoPlay\"\r\nimport keySound from './keySound';\r\nimport { Howler } from \"howler\";\r\n\r\nclass ProjectFile {\r\n info = {};\r\n soundFiles = {};\r\n keySound = undefined;\r\n autoplay = undefined;\r\n keyLED = undefined;\r\n canvas = undefined\r\n activeKeyLED = {}\r\n\r\n constructor(file, canvas) {\r\n this.canvas = canvas.current;\r\n return this.unpack(file);\r\n }\r\n\r\n unpack(projectFile) {\r\n return new Promise(async (resolve, reject) => {\r\n try{\r\n console.log(this.info)\r\n let JSZip = require(\"jszip\");\r\n let files = await JSZip.loadAsync(projectFile).then(function (zip) {\r\n return Object.values(zip.files)\r\n }, function (e) {\r\n reject(\"Failed to extract selected file\");\r\n console.log(e);\r\n return;\r\n });\r\n let projectRoot = undefined;\r\n let keySoundFile = undefined;\r\n let autoplayFile = undefined;\r\n let keyLEDFiles = {};\r\n\r\n //Load info and categorize files\r\n for (let file of files) {\r\n let filename = file.name.toLowerCase()\r\n if (!filename.endsWith(\"/\")) //Ignore folder\r\n {\r\n if (filename.includes(\"sounds/\")) //Audio\r\n {\r\n console.log(\"Sound file: \" + filename);\r\n this.soundFiles[filename.split(\"/\").pop()] = await file.async(\"blob\").then(function (blob) {\r\n return new keySound(blob, filename.split(\"/\").pop())\r\n });\r\n }\r\n else {\r\n let text = await file.async(\"text\").then((text) => { return text = text.split(/\\r?\\n/); });\r\n if (filename.endsWith(\"info\")) //Text\r\n {\r\n console.log(\"Info file: \" + filename);\r\n projectRoot = filename.slice(0, -4);\r\n console.log(\" project root: \" + projectRoot);\r\n text.forEach(info => this.info[info.split('=')[0]] = info.split('=')[1]);\r\n this.info[\"buttonX\"] = parseInt(this.info[\"buttonX\"]);\r\n this.info[\"buttonY\"] = parseInt(this.info[\"buttonY\"]);\r\n this.info[\"chain\"] = parseInt(this.info[\"chain\"]);\r\n this.info[\"squareButton\"] = this.info[\"squareButton\"] === \"true\";\r\n this.info[\"landscape\"] = this.info[\"landscape\"] === \"true\";\r\n console.log(\" title: \" + this.info[\"title\"])\r\n console.log(\" producerName: \" + this.info[\"producerName\"])\r\n console.log(\" buttonX: \" + this.info[\"buttonX\"])\r\n console.log(\" buttonY: \" + this.info[\"buttonY\"])\r\n console.log(\" chain: \" + this.info[\"chain\"])\r\n console.log(\" squareButton: \" + this.info[\"squareButton\"])\r\n console.log(\" landscape: \" + this.info[\"landscape\"])\r\n if (this.info[\"buttonX\"] !== 8 || this.info[\"buttonY\"] !== 8) {\r\n reject(\"Only 8x8 Unipad project are supported\");\r\n return;\r\n }\r\n if (this.info[\"chain\"] > 8) {\r\n // reject(\"Only Unipad project that has within 8 chains are supported\");\r\n // alert(`This Unipad Project has ${this.info[\"chain\"]} chains. Projects that has more than 8 chains are limited supported`)\r\n // return;\r\n }\r\n }\r\n else if (filename.endsWith(\"keysound\")) {\r\n console.log(\"KeySound file: \" + filename);\r\n keySoundFile = text;\r\n }\r\n else if (filename.endsWith(\"autoplay\")) {\r\n console.log(\"AutoPlay file: \" + filename);\r\n autoplayFile = text;\r\n }\r\n else if (filename.includes(\"keyled/\")) {\r\n console.log(\"KeyLED file: \" + filename);\r\n keyLEDFiles[filename] = text;\r\n }\r\n else {\r\n console.log(\"Unknown file: \" + filename);\r\n }\r\n }\r\n }\r\n }\r\n\r\n //Initialize 4D arraies\r\n this.keySound = new Array(this.info.chain).fill(null).map(\r\n () => new Array(this.info.buttonX).fill(null).map(\r\n () => new Array(this.info.buttonY).fill(null).map(\r\n () => new Array())));\r\n\r\n this.keyLED = new Array(this.info.chain).fill(null).map(\r\n () => new Array(this.info.buttonX).fill(null).map(\r\n () => new Array(this.info.buttonY).fill(null).map(\r\n () => new Array())));\r\n\r\n // Load KeyLED\r\n for (var [name, text] of Object.entries(keyLEDFiles)) {\r\n let fileInfo = name.split(\"/\").pop().split(\" \");\r\n try\r\n {\r\n // if (fileInfo.length === 5) {\r\n // this.keyLED[parseInt(fileInfo[0]) - 1][parseInt(fileInfo[2]) - 1][parseInt(fileInfo[1]) - 1][fileInfo[4].charCodeAt(0) - 97] = new KeyLED(text, parseInt(fileInfo[3]), this.canvas)\r\n // // console.log(name)\r\n // // console.log([parseInt(fileInfo[0]) - 1, parseInt(fileInfo[2]) - 1, parseInt(fileInfo[1]) - 1, fileInfo[4].charCodeAt(0) - 97])\r\n // // console.log(this.keyLED[parseInt(fileInfo[0]) - 1][parseInt(fileInfo[2]) - 1][parseInt(fileInfo[1]) - 1][fileInfo[4].charCodeAt(0) - 97])\r\n // }\r\n // else if (fileInfo.length === 4) {\r\n let index = fileInfo[4] !== undefined ? fileInfo[4].charCodeAt(0) - 97 : 0 //97 is 'a' \r\n // console.log([parseInt(fileInfo[0]) - 1, parseInt(fileInfo[2]) - 1, parseInt(fileInfo[1]) - 1, index])\r\n let [chain, x, y, repeat] = [parseInt(fileInfo[0]) - 1, parseInt(fileInfo[2]) - 1, parseInt(fileInfo[1]) - 1, parseInt(fileInfo[3])]\r\n this.keyLED[chain][x][y][index] = new KeyLED(text, repeat, this.canvas, [chain, x, y, index], this.activeKeyLED)\r\n // }\r\n // else {\r\n // console.warn(\"Unknown keyLED file name: \" + name);\r\n // }\r\n }\r\n catch\r\n {\r\n console.warn(\"Unable to parse file name - \" + name.split(\"/\").pop())\r\n }\r\n }\r\n\r\n //Load KeySound\r\n for (var line of keySoundFile) {\r\n line = line.trim()\r\n try\r\n {\r\n if (line == \"\") //For empty lines\r\n continue;\r\n\r\n let command = line.split(\" \");\r\n\r\n // console.log(command);\r\n let [chain, x, y, filename] = [parseInt(command[0]) - 1, parseInt(command[2]) - 1, parseInt(command[1]) - 1, command[3].toLowerCase()]\r\n console.log([chain, x, y, filename])\r\n this.keySound[chain][x][y].push([this.soundFiles[filename], command.slice(4)]);\r\n }\r\n catch\r\n {\r\n console.warn(\"Unable to parse line - \" + line)\r\n }\r\n }\r\n\r\n //Load AutoPlay\r\n if(autoplayFile !== undefined)\r\n this.autoplay = new AutoPlay(autoplayFile, this.canvas);\r\n\r\n resolve(this)\r\n }\r\n catch(e)\r\n {\r\n reject(e)\r\n }\r\n });\r\n }\r\n\r\n stopKeySound() {\r\n Howler.stop()\r\n }\r\n\r\n stopKeyLED() {\r\n // console.log(this.activeKeyLED)\r\n for(var id_str in this.activeKeyLED)\r\n {\r\n var[chain, x, y, index] = this.activeKeyLED[id_str]\r\n this.keyLED[chain][x][y][index].stop(false)\r\n delete this.activeKeyLED[id_str]\r\n }\r\n setTimeout(this.canvas.clearCanvas(), 200)\r\n // new KeyLED().stopAll()\r\n // for (var chain = 0; chain < this.info.chain; chain++) {\r\n // for (\r\n // var x = 0;\r\n // chain < this.keyLED[chain].length;\r\n // x++\r\n // ) {\r\n // for (\r\n // var y = 0;\r\n // chain < this.keyLED[chain][x].length;\r\n // y++\r\n // ) {\r\n // for (\r\n // var index = 0;\r\n // chain < this.keyLED[chain][x][y].length;\r\n // index++\r\n // ) {\r\n // if (\r\n // this.keyLED[chain][x][y][index] !== undefined\r\n // ) {\r\n // this.keyLED[chain][x][y][index].stop();\r\n // }\r\n // }\r\n // }\r\n // }\r\n // }\r\n }\r\n\r\n stopAll() {\r\n this.stopKeyLED()\r\n this.stopKeySound()\r\n }\r\n}\r\n\r\nexport default ProjectFile;","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\ProjectFileReader.jsx",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\Canvas.jsx",["272","273","274","275","276","277","278","279","280","281","282","283","284","285","286"],"import React, { Component } from \"react\";\r\n// import ProjectFileReader from './Components/projectFileReader';\r\nimport Button from \"./Button\";\r\nimport { palette, rawPalette } from \"../palette\";\r\nimport buttonConfigs from \"../buttonConfigs.js\";\r\n\r\nclass Canvas extends Component {\r\n constructor(props) {\r\n super(props);\r\n setInterval(() => {\r\n this.setState({ colormap: this.state.colormap });\r\n }, 1000 / 60);\r\n }\r\n\r\n state = {\r\n colormap: new Array(this.props.layoutConfig.width).fill(null).map(() => new Array(this.props.layoutConfig.height).fill(palette[0])),\r\n };\r\n\r\n keypressHistory = new Array(this.props.layoutConfig.width).fill(null).map(() => new Array(this.props.layoutConfig.height).fill(0));\r\n currentChain = 0;\r\n // overlay = \"#808080\";\r\n\r\n // shouldUpdate = (nextProps) => !Object.is(this.props.layoutConfig, nextProps.layoutConfig);\r\n\r\n shouldComponentUpdate(nextProps) {\r\n if (nextProps.projectFile !== this.props.projectFile) {\r\n console.log(\"Project File Loaded\");\r\n this.initlalizeCanvas();\r\n }\r\n\r\n if (nextProps.layoutConfig !== this.props.layoutConfig) {\r\n this.initlalizeCanvas(nextProps.layoutConfig);\r\n }\r\n\r\n if (nextProps.inputDevice !== this.props.inputDevice /* || prevProps.inputConfig !== this.props.inputConfig */) {\r\n this.setupMidiInput(nextProps.inputDevice, this.props.inputDevice);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n initlalizeCanvas(config = this.props.layoutConfig) {\r\n this.clearCanvas(config);\r\n this.clearKeypressHistory();\r\n this.currentChain = 0;\r\n }\r\n\r\n clearCanvas(config = this.props.layoutConfig) {\r\n this.state.colormap = new Array(config.width).fill(null).map(() => new Array(config.height).fill(palette[0])); //I write directly into state because that takes so long it will be complete by the time render is over and throw an error already. Since shouldComponentUpdate will enforce update I will give it a pass\r\n }\r\n\r\n clearKeypressHistory() {\r\n this.keypressHistory = new Array(8).fill(null).map(() => new Array(8).fill(0));\r\n }\r\n\r\n setupMidiInput(newInput, oldInput) {\r\n // console.log([newInput, oldInput])\r\n if (oldInput !== undefined) oldInput.removeListener();\r\n if (newInput !== undefined) newInput.addListener(\"midimessage\", \"all\", this.midiInputHandler.bind(this));\r\n }\r\n\r\n midiInputHandler = (midiEvent) => {\r\n console.log(midiEvent.data)\r\n var [event, note, velocity] = midiEvent.data\r\n var [x, y] = [undefined, undefined]\r\n if(this.props.inputConfig.noteToXY !== undefined)\r\n { \r\n var xy = this.props.inputConfig.noteToXY(note)\r\n if(xy == undefined) return\r\n [x, y] = xy\r\n }\r\n else\r\n {\r\n [x, y] = this.indexOf2dArray(note, this.props.inputConfig.keymap); \r\n }\r\n console.log([x, y]);\r\n if (x !== undefined && y !== undefined) {\r\n // let [canvas_x, canvas_y] = this.arrayCalculation([x, y], this.props.inputConfig.canvas_origin, \"-\");\r\n switch (event >> 4) {\r\n case 9: //Note On\r\n case 11: //Control Change\r\n if (velocity != 0) {\r\n //Fall back to Note Off\r\n this.keyOn(x, y, this.props.inputConfig);\r\n break;\r\n }\r\n case 8: //Note Off\r\n this.keyOff(x, y, this.props.inputConfig);\r\n break;\r\n }\r\n }\r\n };\r\n\r\n keyOn = (x, y, config = this.props.layoutConfig, reverseOffset = false, sound = true, led = true) => {\r\n let soundLoop = 1;\r\n let [canvas_x, canvas_y] = [x, y]; //canvas_XY means the grid scope XY (Square), Raw XY will be the source XY (Including the chain keys)\r\n if (!reverseOffset) {\r\n [canvas_x, canvas_y] = this.arrayCalculation([x, y], config.canvas_origin, \"-\");\r\n } else {\r\n [x, y] = this.arrayCalculation([x, y], config.canvas_origin, \"+\");\r\n }\r\n console.log(\"Note On - \" + x.toString() + \" \" + y.toString());\r\n // console.log([x, y, canvas_x, canvas_y])\r\n\r\n if (this.props.projectFile !== undefined) {\r\n if (canvas_x >= 0 && canvas_x < 8 && canvas_y >= 0 && canvas_y < 8) {\r\n //LED\r\n if (led && this.props.projectFile.keyLED !== undefined && this.props.projectFile.keyLED[this.currentChain] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y].length > 0) {\r\n let ledIndex = this.keypressHistory[canvas_x][canvas_y] % this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y].length;\r\n this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y][ledIndex].stop();\r\n this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y][ledIndex].play();\r\n }\r\n\r\n if (sound && this.props.projectFile.keySound !== undefined && this.props.projectFile.keySound[this.currentChain] !== undefined && this.props.projectFile.keySound[this.currentChain][canvas_x] !== undefined && this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y] !== undefined && this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y].length > 0) {\r\n //Sound\r\n let soundIndex = this.keypressHistory[canvas_x][canvas_y] % this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y].length;\r\n // console.log('Play sound ${this.currentChain} ${canvas_x}')\r\n if (this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1] !== undefined) {\r\n //Has special data\r\n if (\r\n this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1][0] !== undefined // Loop\r\n ) {\r\n soundLoop = parseInt(this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1][0]);\r\n }\r\n }\r\n this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][0].stop();\r\n this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][0].play(soundLoop);\r\n }\r\n }\r\n }\r\n };\r\n\r\n checkChain = (x, y, config) => {\r\n if(config.chainKey !== undefined)\r\n {\r\n for (var i = 0; i < Math.min(config.chainKey.length, this.props.projectFile.info.chain); i++) {\r\n if (config.chainKey[i][0] === x && config.chainKey[i][1] === y) this.chainChange(i);\r\n }\r\n }\r\n };\r\n\r\n keyOff = (x, y, config = this.props.layoutConfig, reverseOffset = false, sound = true, led = true) => {\r\n let [canvas_x, canvas_y] = [x, y]; //canvas_XY means the grid scope XY (Square), Raw XY will be the source XY (Including the chain keys)\r\n if (!reverseOffset) {\r\n [canvas_x, canvas_y] = this.arrayCalculation([x, y], config.canvas_origin, \"-\");\r\n } else {\r\n [x, y] = this.arrayCalculation([x, y], config.canvas_origin, \"+\");\r\n }\r\n console.log(\"Note Off - \" + x.toString() + \" \" + y.toString());\r\n\r\n if (this.props.projectFile !== undefined) {\r\n if (canvas_x >= 0 && canvas_x < 8 && canvas_y >= 0 && canvas_y < 8) {\r\n //LED\r\n if (led && this.props.projectFile.keyLED !== undefined && this.props.projectFile.keyLED[this.currentChain] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y].length > 0) {\r\n let ledIndex = this.keypressHistory[canvas_x][canvas_y] % this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y].length;\r\n if (this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y][ledIndex] !== undefined && this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y][ledIndex].repeat === 0) {\r\n //Page might have changed\r\n this.props.projectFile.keyLED[this.currentChain][canvas_x][canvas_y][ledIndex].endLoop();\r\n }\r\n }\r\n\r\n if (sound && this.props.projectFile.keySound !== undefined && this.props.projectFile.keySound[this.currentChain] !== undefined && this.props.projectFile.keySound[this.currentChain][canvas_x] !== undefined && this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y] !== undefined && this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y].length > 0) {\r\n //Sound\r\n let soundIndex = this.keypressHistory[canvas_x][canvas_y] % this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y].length;\r\n // console.log('Play sound ${this.currentChain} ${canvas_x}')\r\n if (this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1] !== undefined) {\r\n if (\r\n this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1][0] == \"0\" // Inf Loop\r\n ) {\r\n this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][0].endLoop();\r\n }\r\n\r\n if (this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1][1] !== undefined) {\r\n //Wormhole\r\n let targetChain = parseInt(this.props.projectFile.keySound[this.currentChain][canvas_x][canvas_y][soundIndex][1][1]) - 1;\r\n console.log(`Wormhole to Chain ${targetChain + 1}`);\r\n this.chainChange(targetChain);\r\n }\r\n }\r\n }\r\n\r\n //Update History\r\n if (this.keypressHistory[canvas_x] != undefined && this.keypressHistory[canvas_x][canvas_y] != undefined) \r\n this.keypressHistory[canvas_x][canvas_y]++;\r\n }\r\n else\r\n {\r\n //Chain Change\r\n this.checkChain(x, y, config);\r\n }\r\n }\r\n };\r\n\r\n chainChange = (chain) => {\r\n console.log(\"Chain Changed to \" + (chain + 1));\r\n if (chain !== this.currentChain) this.clearKeypressHistory();\r\n this.currentChain = chain;\r\n };\r\n\r\n setColor = (x, y, color) => {\r\n // console.log(`Set Color ${x} ${y} ${color}`)\r\n this.setColorCanvas(x, y, color);\r\n this.setColorOutput(x, y, color);\r\n };\r\n\r\n setColorCanvas(x, y, color) {\r\n var [canvas_x, canvas_y] = [undefined, undefined];\r\n if (x === \"l\") {\r\n if (this.props.layoutConfig.lKey == undefined) return;\r\n [canvas_x, canvas_y] = this.props.layoutConfig.lKey;\r\n } else if (x === \"mc\") {\r\n if (this.props.layoutConfig.mcTable === undefined || this.props.layoutConfig.mcTable[y] == null) return;\r\n [canvas_x, canvas_y] = this.props.layoutConfig.mcTable[y];\r\n } else {\r\n [canvas_x, canvas_y] = this.arrayCalculation([x, y], this.props.layoutConfig.canvas_origin, \"+\");\r\n }\r\n\r\n try {\r\n if (/^#[0-9A-F]{6}$/i.test(color)) {\r\n //Check if it is a Hex String\r\n this.state.colormap[canvas_x][canvas_y] = color;\r\n } else {\r\n this.state.colormap[canvas_x][canvas_y] = palette[color];\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n console.error([x, y, color, canvas_x, canvas_y]);\r\n }\r\n }\r\n\r\n setColorOutput(x, y, color) {\r\n if (this.props.outputDevice !== undefined && this.props.outputConfig !== undefined) {\r\n var [output_x, output_y] = [undefined, undefined];\r\n if (x === \"l\") {\r\n if (this.props.outputConfig.lKey == undefined) return;\r\n [output_x, output_y] = this.props.outputConfig.lKey;\r\n } else if (x === \"mc\") {\r\n if (this.props.outputConfig.mcTable === undefined || this.props.outputConfig.mcTable[y] == null) return\r\n [output_x, output_y] = this.props.outputConfig.mcTable[y];\r\n } else {\r\n [output_x, output_y] = this.arrayCalculation([x, y], this.props.outputConfig.canvas_origin, \"+\");\r\n }\r\n try {\r\n if (/^#[0-9A-F]{6}$/i.test(color)) {\r\n //Check if it is a Hex String\r\n this.sendSysex(this.props.outputConfig.hexSysexGen(output_y, output_x, color));\r\n } else {\r\n this.sendMidi(\"NoteOn\", this.props.outputConfig.channel, this.props.outputConfig.keymap[output_y][output_x], color);\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n console.error([x, y, color, output_x, output_y]);\r\n }\r\n }\r\n }\r\n\r\n sendMidi(mode, channel, note, value = 0) {\r\n if (typeof note === \"string\") {\r\n let modeKey = note.charAt(0);\r\n note = parseInt(note.substr(1));\r\n switch (modeKey) {\r\n case \"C\":\r\n mode = \"CC\";\r\n break;\r\n case \"X\":\r\n mode = \"HEX\";\r\n break;\r\n default:\r\n return;\r\n }\r\n }\r\n switch (mode) {\r\n case \"NoteOn\":\r\n this.props.outputDevice.send(0x90 + channel - 1, [note, value]);\r\n break;\r\n case \"NoteOff\":\r\n this.props.outputDevice.send(0x80 + channel - 1, [note, value]);\r\n break;\r\n case \"CC\":\r\n this.props.outputDevice.send(0xb0 + channel - 1, [note, value]);\r\n break;\r\n case \"HEX\":\r\n this.sendSysex(this.props.outputConfig.hexSysexGen(note, rawPalette[value]));\r\n break;\r\n }\r\n }\r\n\r\n sendSysex(message) {\r\n // console.log(message)\r\n this.props.outputDevice.sendSysex([], message);\r\n }\r\n\r\n // // Overlays a color\r\n // colorOverlay = (hex, overlay) => {\r\n // let [r, g, b] = this.toRGB(hex)\r\n // let [r0, g0, b0] = this.toRGB(overlay)\r\n // r = Math.round(r * (255 - r0) / 255 + r0);\r\n // g = Math.round(g * (255 - g0) / 255 + g0);\r\n // b = Math.round(b * (255 - b0) / 255 + b0);\r\n // return this.toHEX(r, g, b)\r\n // }\r\n\r\n // // Converts a CHAD HEX color to a beta RGB color\r\n // toRGB = (hex) => {\r\n // const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex)\r\n // return [parseInt(result[1], 16),\r\n // parseInt(result[2], 16),\r\n // parseInt(result[3], 16)]\r\n // }\r\n\r\n // // Converts a beta RGB color to a CHAD HEX color\r\n // toHEX = (r, g, b) => '#' + this.componentToHex(r) + this.componentToHex(g) + this.componentToHex(b)\r\n\r\n // // Converts the value of a given component to CHAD HEX\r\n // componentToHex = (component) => {\r\n // const hex = component.toString(16)\r\n // return hex.length === 1 ? '0' + hex : hex\r\n // }\r\n\r\n arrayCalculation = (array1, array2, operation) => {\r\n let newArray = [];\r\n if (array1.length === array2.length) {\r\n switch (operation) {\r\n case \"+\":\r\n for (var i = 0; i < array1.length; i++) {\r\n newArray.push(array1[i] + array2[i]);\r\n }\r\n return newArray;\r\n case \"-\":\r\n for (var i = 0; i < array1.length; i++) {\r\n newArray.push(array1[i] - array2[i]);\r\n }\r\n return newArray;\r\n }\r\n }\r\n };\r\n\r\n indexOf2dArray(id, matrix) {\r\n for (var y = 0, len = matrix.length; y < len; y++) {\r\n for (var x = 0, len2 = matrix[y].length; x < len2; x++) {\r\n if (matrix[y][x] === id) {\r\n return [x, y];\r\n }\r\n }\r\n }\r\n return [undefined, undefined];\r\n }\r\n\r\n render() {\r\n return (\r\n <div\r\n className=\"canvas\"\r\n style={{\r\n padding: this.props.layoutConfig.padding,\r\n borderRadius: this.props.layoutConfig.radius,\r\n }}\r\n >\r\n {this.props.layoutConfig.layout.map((value, y) => {\r\n return (\r\n <div className=\"button-row\">\r\n {this.props.layoutConfig.layout[y].map((value, x) => {\r\n if(Object.keys(buttonConfigs).includes(value))\r\n {\r\n return <Button x={x} y={y} class={buttonConfigs[value].class} overlayClass={buttonConfigs[value].overlayClass} color={this.state.colormap[x][y]} on={this.keyOn} off={this.keyOff} />;\r\n }\r\n else\r\n {\r\n return <div key={\"Spacer \" + x.toString() + \"-\" + y.toString()} style={{width: \"96px\"}}/>\r\n }\r\n }\r\n )}\r\n </div>\r\n );\r\n })}\r\n {/* <button onClick={this.playAutoplay}>Auto Play</button> */}\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default Canvas;\r\n","C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\AutoplayControl.jsx",["287","288","289"],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\buttonConfigs.js",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\keyLED.js",["290","291","292","293","294","295","296","297","298","299","300","301","302","303","304","305"],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\keySound.js",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Engine\\autoPlay.js",["306"],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\palette.js",[],"C:\\Users\\caine\\Documents\\GitHub\\Prismatic\\src\\Components\\Button.jsx",[],{"ruleId":"307","replacedBy":"308"},{"ruleId":"309","replacedBy":"310"},{"ruleId":"311","severity":1,"message":"312","line":13,"column":3,"nodeType":"313","messageId":"314","endLine":15,"endColumn":4},{"ruleId":"315","severity":1,"message":"316","line":70,"column":10,"nodeType":"317","messageId":"318","endLine":70,"endColumn":14,"fix":"319"},{"ruleId":"320","severity":1,"message":"321","line":166,"column":11,"nodeType":"322","messageId":"323","endLine":173,"endColumn":12},{"ruleId":"324","severity":1,"message":"325","line":353,"column":17,"nodeType":"326","messageId":"327","endLine":353,"endColumn":18},{"ruleId":"328","severity":1,"message":"329","line":76,"column":28,"nodeType":"330","messageId":"318","endLine":76,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":76,"column":53,"nodeType":"330","messageId":"318","endLine":76,"endColumn":55},{"ruleId":"324","severity":1,"message":"331","line":86,"column":15,"nodeType":"326","messageId":"327","endLine":86,"endColumn":17},{"ruleId":"324","severity":1,"message":"332","line":87,"column":15,"nodeType":"326","messageId":"327","endLine":87,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":99,"column":20,"nodeType":"330","messageId":"335","endLine":99,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":99,"column":29,"nodeType":"330","messageId":"335","endLine":99,"endColumn":31},{"ruleId":"328","severity":1,"message":"336","line":207,"column":20,"nodeType":"330","messageId":"318","endLine":207,"endColumn":22},{"ruleId":"328","severity":1,"message":"329","line":214,"column":28,"nodeType":"330","messageId":"318","endLine":214,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":214,"column":53,"nodeType":"330","messageId":"318","endLine":214,"endColumn":55},{"ruleId":"324","severity":1,"message":"331","line":224,"column":15,"nodeType":"326","messageId":"327","endLine":224,"endColumn":17},{"ruleId":"324","severity":1,"message":"332","line":225,"column":15,"nodeType":"326","messageId":"327","endLine":225,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":237,"column":20,"nodeType":"330","messageId":"335","endLine":237,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":237,"column":29,"nodeType":"330","messageId":"335","endLine":237,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":299,"column":28,"nodeType":"330","messageId":"318","endLine":299,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":299,"column":53,"nodeType":"330","messageId":"318","endLine":299,"endColumn":55},{"ruleId":"324","severity":1,"message":"331","line":309,"column":15,"nodeType":"326","messageId":"327","endLine":309,"endColumn":17},{"ruleId":"324","severity":1,"message":"332","line":310,"column":15,"nodeType":"326","messageId":"327","endLine":310,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":322,"column":20,"nodeType":"330","messageId":"335","endLine":322,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":322,"column":29,"nodeType":"330","messageId":"335","endLine":322,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":386,"column":28,"nodeType":"330","messageId":"318","endLine":386,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":386,"column":53,"nodeType":"330","messageId":"318","endLine":386,"endColumn":55},{"ruleId":"324","severity":1,"message":"337","line":397,"column":15,"nodeType":"326","messageId":"327","endLine":397,"endColumn":16},{"ruleId":"324","severity":1,"message":"338","line":398,"column":15,"nodeType":"326","messageId":"327","endLine":398,"endColumn":16},{"ruleId":"324","severity":1,"message":"332","line":399,"column":15,"nodeType":"326","messageId":"327","endLine":399,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":406,"column":20,"nodeType":"330","messageId":"335","endLine":406,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":406,"column":29,"nodeType":"330","messageId":"335","endLine":406,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":477,"column":28,"nodeType":"330","messageId":"318","endLine":477,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":477,"column":53,"nodeType":"330","messageId":"318","endLine":477,"endColumn":55},{"ruleId":"324","severity":1,"message":"337","line":488,"column":15,"nodeType":"326","messageId":"327","endLine":488,"endColumn":16},{"ruleId":"324","severity":1,"message":"338","line":489,"column":15,"nodeType":"326","messageId":"327","endLine":489,"endColumn":16},{"ruleId":"324","severity":1,"message":"332","line":490,"column":15,"nodeType":"326","messageId":"327","endLine":490,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":497,"column":20,"nodeType":"330","messageId":"335","endLine":497,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":497,"column":29,"nodeType":"330","messageId":"335","endLine":497,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":559,"column":28,"nodeType":"330","messageId":"318","endLine":559,"endColumn":30},{"ruleId":"339","severity":1,"message":"340","line":569,"column":15,"nodeType":"326","messageId":"341","endLine":569,"endColumn":16},{"ruleId":"339","severity":1,"message":"342","line":570,"column":15,"nodeType":"326","messageId":"341","endLine":570,"endColumn":16},{"ruleId":"333","severity":1,"message":"334","line":577,"column":20,"nodeType":"330","messageId":"335","endLine":577,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":577,"column":29,"nodeType":"330","messageId":"335","endLine":577,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":626,"column":28,"nodeType":"330","messageId":"318","endLine":626,"endColumn":30},{"ruleId":"339","severity":1,"message":"340","line":636,"column":15,"nodeType":"326","messageId":"341","endLine":636,"endColumn":16},{"ruleId":"339","severity":1,"message":"342","line":637,"column":15,"nodeType":"326","messageId":"341","endLine":637,"endColumn":16},{"ruleId":"333","severity":1,"message":"334","line":644,"column":20,"nodeType":"330","messageId":"335","endLine":644,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":644,"column":29,"nodeType":"330","messageId":"335","endLine":644,"endColumn":31},{"ruleId":"343","severity":1,"message":"344","line":102,"column":19,"nodeType":"345","messageId":"346","endLine":102,"endColumn":30},{"ruleId":"343","severity":1,"message":"344","line":107,"column":19,"nodeType":"345","messageId":"346","endLine":107,"endColumn":30},{"ruleId":"328","severity":1,"message":"336","line":133,"column":18,"nodeType":"330","messageId":"318","endLine":133,"endColumn":20},{"ruleId":"347","severity":1,"message":"348","line":49,"column":5,"nodeType":"349","endLine":49,"endColumn":15},{"ruleId":"328","severity":1,"message":"336","line":69,"column":13,"nodeType":"330","messageId":"318","endLine":69,"endColumn":15},{"ruleId":"320","severity":1,"message":"321","line":79,"column":7,"nodeType":"322","messageId":"323","endLine":90,"endColumn":8},{"ruleId":"328","severity":1,"message":"329","line":82,"column":24,"nodeType":"330","messageId":"318","endLine":82,"endColumn":26},{"ruleId":"350","severity":1,"message":"351","line":87,"column":9,"nodeType":"352","messageId":"353","endLine":89,"endColumn":17},{"ruleId":"328","severity":1,"message":"336","line":168,"column":104,"nodeType":"330","messageId":"318","endLine":168,"endColumn":106},{"ruleId":"328","severity":1,"message":"329","line":183,"column":44,"nodeType":"330","messageId":"318","endLine":183,"endColumn":46},{"ruleId":"328","severity":1,"message":"329","line":183,"column":101,"nodeType":"330","messageId":"318","endLine":183,"endColumn":103},{"ruleId":"328","severity":1,"message":"336","line":209,"column":40,"nodeType":"330","messageId":"318","endLine":209,"endColumn":42},{"ruleId":"347","severity":1,"message":"348","line":221,"column":9,"nodeType":"349","endLine":221,"endColumn":38},{"ruleId":"347","severity":1,"message":"348","line":223,"column":9,"nodeType":"349","endLine":223,"endColumn":38},{"ruleId":"328","severity":1,"message":"336","line":235,"column":42,"nodeType":"330","messageId":"318","endLine":235,"endColumn":44},{"ruleId":"320","severity":1,"message":"321","line":272,"column":5,"nodeType":"322","messageId":"323","endLine":285,"endColumn":6},{"ruleId":"320","severity":1,"message":"321","line":323,"column":7,"nodeType":"322","messageId":"323","endLine":334,"endColumn":8},{"ruleId":"324","severity":1,"message":"325","line":330,"column":20,"nodeType":"326","messageId":"327","endLine":330,"endColumn":21},{"ruleId":"328","severity":1,"message":"336","line":41,"column":28,"nodeType":"330","messageId":"318","endLine":41,"endColumn":30},{"ruleId":"328","severity":1,"message":"336","line":41,"column":72,"nodeType":"330","messageId":"318","endLine":41,"endColumn":74},{"ruleId":"320","severity":1,"message":"321","line":43,"column":5,"nodeType":"322","messageId":"323","endLine":65,"endColumn":6},{"ruleId":"328","severity":1,"message":"329","line":42,"column":36,"nodeType":"330","messageId":"318","endLine":42,"endColumn":38},{"ruleId":"328","severity":1,"message":"329","line":46,"column":30,"nodeType":"330","messageId":"318","endLine":46,"endColumn":32},{"ruleId":"328","severity":1,"message":"336","line":49,"column":17,"nodeType":"330","messageId":"318","endLine":49,"endColumn":19},{"ruleId":"354","severity":1,"message":"355","line":65,"column":18,"nodeType":"326","messageId":"356","endLine":65,"endColumn":19},{"ruleId":"354","severity":1,"message":"357","line":65,"column":21,"nodeType":"326","messageId":"356","endLine":65,"endColumn":22},{"ruleId":"358","severity":1,"message":"359","line":67,"column":23,"nodeType":"330","messageId":"360","endLine":67,"endColumn":51},{"ruleId":"354","severity":1,"message":"355","line":69,"column":18,"nodeType":"326","messageId":"356","endLine":69,"endColumn":19},{"ruleId":"354","severity":1,"message":"357","line":69,"column":21,"nodeType":"326","messageId":"356","endLine":69,"endColumn":22},{"ruleId":"354","severity":1,"message":"355","line":82,"column":36,"nodeType":"326","messageId":"356","endLine":82,"endColumn":37},{"ruleId":"354","severity":1,"message":"357","line":82,"column":39,"nodeType":"326","messageId":"356","endLine":82,"endColumn":40},{"ruleId":"354","severity":1,"message":"355","line":84,"column":24,"nodeType":"326","messageId":"356","endLine":84,"endColumn":25},{"ruleId":"354","severity":1,"message":"357","line":84,"column":34,"nodeType":"326","messageId":"356","endLine":84,"endColumn":35},{"ruleId":"354","severity":1,"message":"355","line":87,"column":39,"nodeType":"326","messageId":"356","endLine":87,"endColumn":40},{"ruleId":"354","severity":1,"message":"357","line":87,"column":42,"nodeType":"326","messageId":"356","endLine":87,"endColumn":43},{"ruleId":"358","severity":1,"message":"359","line":105,"column":21,"nodeType":"330","messageId":"360","endLine":105,"endColumn":49},{"ruleId":"324","severity":1,"message":"331","line":111,"column":17,"nodeType":"326","messageId":"327","endLine":111,"endColumn":19},{"ruleId":"328","severity":1,"message":"336","line":127,"column":26,"nodeType":"330","messageId":"318","endLine":127,"endColumn":28},{"ruleId":"307","replacedBy":"361"},{"ruleId":"309","replacedBy":"362"},{"ruleId":"311","severity":1,"message":"312","line":13,"column":3,"nodeType":"313","messageId":"314","endLine":15,"endColumn":4},{"ruleId":"315","severity":1,"message":"316","line":70,"column":10,"nodeType":"317","messageId":"318","endLine":70,"endColumn":14,"fix":"363"},{"ruleId":"320","severity":1,"message":"321","line":166,"column":11,"nodeType":"322","messageId":"323","endLine":173,"endColumn":12},{"ruleId":"324","severity":1,"message":"325","line":353,"column":17,"nodeType":"326","messageId":"327","endLine":353,"endColumn":18},{"ruleId":"328","severity":1,"message":"329","line":76,"column":28,"nodeType":"330","messageId":"318","endLine":76,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":76,"column":53,"nodeType":"330","messageId":"318","endLine":76,"endColumn":55},{"ruleId":"324","severity":1,"message":"331","line":86,"column":15,"nodeType":"326","messageId":"327","endLine":86,"endColumn":17},{"ruleId":"324","severity":1,"message":"332","line":87,"column":15,"nodeType":"326","messageId":"327","endLine":87,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":99,"column":20,"nodeType":"330","messageId":"335","endLine":99,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":99,"column":29,"nodeType":"330","messageId":"335","endLine":99,"endColumn":31},{"ruleId":"328","severity":1,"message":"336","line":207,"column":20,"nodeType":"330","messageId":"318","endLine":207,"endColumn":22},{"ruleId":"328","severity":1,"message":"329","line":214,"column":28,"nodeType":"330","messageId":"318","endLine":214,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":214,"column":53,"nodeType":"330","messageId":"318","endLine":214,"endColumn":55},{"ruleId":"324","severity":1,"message":"331","line":224,"column":15,"nodeType":"326","messageId":"327","endLine":224,"endColumn":17},{"ruleId":"324","severity":1,"message":"332","line":225,"column":15,"nodeType":"326","messageId":"327","endLine":225,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":237,"column":20,"nodeType":"330","messageId":"335","endLine":237,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":237,"column":29,"nodeType":"330","messageId":"335","endLine":237,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":299,"column":28,"nodeType":"330","messageId":"318","endLine":299,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":299,"column":53,"nodeType":"330","messageId":"318","endLine":299,"endColumn":55},{"ruleId":"324","severity":1,"message":"331","line":309,"column":15,"nodeType":"326","messageId":"327","endLine":309,"endColumn":17},{"ruleId":"324","severity":1,"message":"332","line":310,"column":15,"nodeType":"326","messageId":"327","endLine":310,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":322,"column":20,"nodeType":"330","messageId":"335","endLine":322,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":322,"column":29,"nodeType":"330","messageId":"335","endLine":322,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":386,"column":28,"nodeType":"330","messageId":"318","endLine":386,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":386,"column":53,"nodeType":"330","messageId":"318","endLine":386,"endColumn":55},{"ruleId":"324","severity":1,"message":"337","line":397,"column":15,"nodeType":"326","messageId":"327","endLine":397,"endColumn":16},{"ruleId":"324","severity":1,"message":"338","line":398,"column":15,"nodeType":"326","messageId":"327","endLine":398,"endColumn":16},{"ruleId":"324","severity":1,"message":"332","line":399,"column":15,"nodeType":"326","messageId":"327","endLine":399,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":406,"column":20,"nodeType":"330","messageId":"335","endLine":406,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":406,"column":29,"nodeType":"330","messageId":"335","endLine":406,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":477,"column":28,"nodeType":"330","messageId":"318","endLine":477,"endColumn":30},{"ruleId":"328","severity":1,"message":"329","line":477,"column":53,"nodeType":"330","messageId":"318","endLine":477,"endColumn":55},{"ruleId":"324","severity":1,"message":"337","line":488,"column":15,"nodeType":"326","messageId":"327","endLine":488,"endColumn":16},{"ruleId":"324","severity":1,"message":"338","line":489,"column":15,"nodeType":"326","messageId":"327","endLine":489,"endColumn":16},{"ruleId":"324","severity":1,"message":"332","line":490,"column":15,"nodeType":"326","messageId":"327","endLine":490,"endColumn":18},{"ruleId":"333","severity":1,"message":"334","line":497,"column":20,"nodeType":"330","messageId":"335","endLine":497,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":497,"column":29,"nodeType":"330","messageId":"335","endLine":497,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":559,"column":28,"nodeType":"330","messageId":"318","endLine":559,"endColumn":30},{"ruleId":"339","severity":1,"message":"340","line":569,"column":15,"nodeType":"326","messageId":"341","endLine":569,"endColumn":16},{"ruleId":"339","severity":1,"message":"342","line":570,"column":15,"nodeType":"326","messageId":"341","endLine":570,"endColumn":16},{"ruleId":"333","severity":1,"message":"334","line":577,"column":20,"nodeType":"330","messageId":"335","endLine":577,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":577,"column":29,"nodeType":"330","messageId":"335","endLine":577,"endColumn":31},{"ruleId":"328","severity":1,"message":"329","line":626,"column":28,"nodeType":"330","messageId":"318","endLine":626,"endColumn":30},{"ruleId":"339","severity":1,"message":"340","line":636,"column":15,"nodeType":"326","messageId":"341","endLine":636,"endColumn":16},{"ruleId":"339","severity":1,"message":"342","line":637,"column":15,"nodeType":"326","messageId":"341","endLine":637,"endColumn":16},{"ruleId":"333","severity":1,"message":"334","line":644,"column":20,"nodeType":"330","messageId":"335","endLine":644,"endColumn":21},{"ruleId":"333","severity":1,"message":"334","line":644,"column":29,"nodeType":"330","messageId":"335","endLine":644,"endColumn":31},{"ruleId":"343","severity":1,"message":"344","line":102,"column":19,"nodeType":"345","messageId":"346","endLine":102,"endColumn":30},{"ruleId":"343","severity":1,"message":"344","line":107,"column":19,"nodeType":"345","messageId":"346","endLine":107,"endColumn":30},{"ruleId":"328","severity":1,"message":"336","line":141,"column":20,"nodeType":"330","messageId":"318","endLine":141,"endColumn":22},{"ruleId":"347","severity":1,"message":"348","line":49,"column":5,"nodeType":"349","endLine":49,"endColumn":15},{"ruleId":"328","severity":1,"message":"336","line":69,"column":13,"nodeType":"330","messageId":"318","endLine":69,"endColumn":15},{"ruleId":"320","severity":1,"message":"321","line":79,"column":7,"nodeType":"322","messageId":"323","endLine":90,"endColumn":8},{"ruleId":"328","severity":1,"message":"329","line":82,"column":24,"nodeType":"330","messageId":"318","endLine":82,"endColumn":26},{"ruleId":"350","severity":1,"message":"351","line":87,"column":9,"nodeType":"352","messageId":"353","endLine":89,"endColumn":17},{"ruleId":"328","severity":1,"message":"336","line":168,"column":104,"nodeType":"330","messageId":"318","endLine":168,"endColumn":106},{"ruleId":"328","severity":1,"message":"329","line":183,"column":44,"nodeType":"330","messageId":"318","endLine":183,"endColumn":46},{"ruleId":"328","severity":1,"message":"329","line":183,"column":101,"nodeType":"330","messageId":"318","endLine":183,"endColumn":103},{"ruleId":"328","severity":1,"message":"336","line":209,"column":40,"nodeType":"330","messageId":"318","endLine":209,"endColumn":42},{"ruleId":"347","severity":1,"message":"348","line":221,"column":9,"nodeType":"349","endLine":221,"endColumn":38},{"ruleId":"347","severity":1,"message":"348","line":223,"column":9,"nodeType":"349","endLine":223,"endColumn":38},{"ruleId":"328","severity":1,"message":"336","line":235,"column":42,"nodeType":"330","messageId":"318","endLine":235,"endColumn":44},{"ruleId":"320","severity":1,"message":"321","line":272,"column":5,"nodeType":"322","messageId":"323","endLine":285,"endColumn":6},{"ruleId":"320","severity":1,"message":"321","line":323,"column":7,"nodeType":"322","messageId":"323","endLine":334,"endColumn":8},{"ruleId":"324","severity":1,"message":"325","line":330,"column":20,"nodeType":"326","messageId":"327","endLine":330,"endColumn":21},{"ruleId":"328","severity":1,"message":"336","line":41,"column":28,"nodeType":"330","messageId":"318","endLine":41,"endColumn":30},{"ruleId":"328","severity":1,"message":"336","line":41,"column":72,"nodeType":"330","messageId":"318","endLine":41,"endColumn":74},{"ruleId":"320","severity":1,"message":"321","line":43,"column":5,"nodeType":"322","messageId":"323","endLine":65,"endColumn":6},{"ruleId":"328","severity":1,"message":"329","line":46,"column":30,"nodeType":"330","messageId":"318","endLine":46,"endColumn":32},{"ruleId":"328","severity":1,"message":"336","line":49,"column":17,"nodeType":"330","messageId":"318","endLine":49,"endColumn":19},{"ruleId":"354","severity":1,"message":"355","line":65,"column":18,"nodeType":"326","messageId":"356","endLine":65,"endColumn":19},{"ruleId":"354","severity":1,"message":"357","line":65,"column":21,"nodeType":"326","messageId":"356","endLine":65,"endColumn":22},{"ruleId":"358","severity":1,"message":"359","line":67,"column":23,"nodeType":"330","messageId":"360","endLine":67,"endColumn":51},{"ruleId":"354","severity":1,"message":"355","line":69,"column":18,"nodeType":"326","messageId":"356","endLine":69,"endColumn":19},{"ruleId":"354","severity":1,"message":"357","line":69,"column":21,"nodeType":"326","messageId":"356","endLine":69,"endColumn":22},{"ruleId":"354","severity":1,"message":"355","line":82,"column":36,"nodeType":"326","messageId":"356","endLine":82,"endColumn":37},{"ruleId":"354","severity":1,"message":"357","line":82,"column":39,"nodeType":"326","messageId":"356","endLine":82,"endColumn":40},{"ruleId":"354","severity":1,"message":"355","line":84,"column":24,"nodeType":"326","messageId":"356","endLine":84,"endColumn":25},{"ruleId":"354","severity":1,"message":"357","line":84,"column":34,"nodeType":"326","messageId":"356","endLine":84,"endColumn":35},{"ruleId":"354","severity":1,"message":"355","line":87,"column":39,"nodeType":"326","messageId":"356","endLine":87,"endColumn":40},{"ruleId":"354","severity":1,"message":"357","line":87,"column":42,"nodeType":"326","messageId":"356","endLine":87,"endColumn":43},{"ruleId":"358","severity":1,"message":"359","line":105,"column":21,"nodeType":"330","messageId":"360","endLine":105,"endColumn":49},{"ruleId":"324","severity":1,"message":"331","line":111,"column":17,"nodeType":"326","messageId":"327","endLine":111,"endColumn":19},{"ruleId":"328","severity":1,"message":"336","line":127,"column":26,"nodeType":"330","messageId":"318","endLine":127,"endColumn":28},{"ruleId":"328","severity":1,"message":"329","line":42,"column":36,"nodeType":"330","messageId":"318","endLine":42,"endColumn":38},"no-native-reassign",["364"],"no-negated-in-lhs",["365"],"no-useless-constructor","Useless constructor.","MethodDefinition","noUselessConstructor","no-extra-bind","The function binding is unnecessary.","CallExpression","unexpected",{"range":"366","text":"367"},"default-case","Expected a default case.","SwitchStatement","missingDefaultCase","no-redeclare","'i' is already defined.","Identifier","redeclared","eqeqeq","Expected '!==' and instead saw '!='.","BinaryExpression","'id' is already defined.","'hex' is already defined.","no-mixed-operators","Unexpected mix of '&' and '>>'.","unexpectedMixedOperator","Expected '===' and instead saw '=='.","'x' is already defined.","'y' is already defined.","no-unused-vars","'x' is assigned a value but never used.","unusedVar","'y' is assigned a value but never used.","no-array-constructor","The array literal notation [] is preferable.","NewExpression","preferLiteral","react/no-direct-mutation-state","Do not mutate state directly. Use setState().","MemberExpression","no-fallthrough","Expected a 'break' statement before 'case'.","SwitchCase","case","no-use-before-define","'x' was used before it was defined.","usedBeforeDefined","'y' was used before it was defined.","use-isnan","Use the isNaN function to compare with NaN.","comparisonWithNaN",["364"],["365"],{"range":"368","text":"367"},"no-global-assign","no-unsafe-negation",[1918,1929],"",[1918,1929]]