diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..3a0cc0f
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "public/assets/icons"]
+ path = public/assets/icons
+ url = https://github.com/mamarguerat/behringer-icons.git
diff --git a/README.md b/README.md
index f66bcaf..57b72e3 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@
+
diff --git a/device-detail-preload.js b/device-detail-preload.js
deleted file mode 100644
index 0fd52f2..0000000
--- a/device-detail-preload.js
+++ /dev/null
@@ -1,32 +0,0 @@
-const { contextBridge, ipcRenderer } = require('electron')
-const path = require('path')
-
-const publicPath =
- process.env.NODE_ENV === 'development'
- ? './public'
- : path.join(process.resourcesPath, 'public');
-const imagesPath = path.join(publicPath, "assets", "images");
-
-function selectTopDiv(ele) {
- while (!ele.classList.contains('device') && ele.tagName != "INPUT") {
- ele = ele.parentElement;
- }
- return ele;
-}
-
-function enableDoubleClick(ele) {
- ele.ondblclick = function (ev) {
- current = selectTopDiv(ev.target);
- }
-}
-
-function enableRightClick(ele) {
- ele.oncontextmenu = function (ev) {
- current = selectTopDiv(ev.target);
- }
-}
-
-ipcRenderer.on('type', (event, arg) => {
- console.log(arg)
- document.getElementById("canvas").innerHTML += "
";
-});
\ No newline at end of file
diff --git a/device-detail.html b/device-detail.html
deleted file mode 100644
index cfb885c..0000000
--- a/device-detail.html
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
- Device detail
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/index.html b/index.html
deleted file mode 100644
index 00cc9b0..0000000
--- a/index.html
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
- Mixo
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/main.js b/main.js
deleted file mode 100644
index 1503027..0000000
--- a/main.js
+++ /dev/null
@@ -1,233 +0,0 @@
-const { dialog, app, BrowserWindow, ipcMain, Menu } = require('electron');
-const path = require('path');
-const fs = require('fs');
-let win
-let filePath = "";
-
-// Autoupdater from https://samuelmeuli.com/blog/2019-04-07-packaging-and-publishing-an-electron-app/
-const { autoUpdater } = require("electron-updater")
-
-app.on("ready", () => {
- autoUpdater.checkForUpdatesAndNotify();
-});
-
-const menuTemplate = [
- { role: 'appMenu' },
- {
- label: 'File',
- submenu: [
- {
- label: 'Load',
- accelerator: 'CmdOrCtrl+O',
- click: () => loadFile(),
- },
- {
- label: 'Save',
- accelerator: 'CmdOrCtrl+S',
- click: () => win.webContents.send('file', { function: 'save' }),
- },
- {
- label: 'Save as',
- click: () => win.webContents.send('file', { function: 'saveas' }),
- },
- {
- label: 'Export documentation',
- submenu: [
- {
- label: 'PDF',
- accelerator: 'Shift+CmdOrCtrl+E',
- }
- ]
- }
- ]
- },
- {
- label: 'Add',
- submenu: [
- {
- label: 'Behringer',
- submenu: [
- {
- label: 'X32',
- },
- {
- label: 'X32 Compact',
- accelerator: 'CmdOrCtrl+M',
- click: () => win.webContents.send('menu', 'x32c'),
- },
- {
- label: 'X32 Producer'
- },
- {
- label: 'X32 Rack'
- },
- {
- label: 'X32 Core'
- },
- { type: 'separator' },
- {
- label: 'SD8',
- click: () => win.webContents.send('menu', 'sd8'),
- },
- {
- label: 'SD16',
- click: () => win.webContents.send('menu', 'sd16'),
- },
- {
- label: 'S32'
- }
- ]
- },
- {
- label: 'Midas',
- submenu: [
- {
- label: 'M32 Live'
- },
- {
- label: 'M32R'
- },
- {
- label: 'M32R Live'
- },
- {
- label: 'M32C'
- },
- { type: 'separator' },
- {
- label: 'DL16'
- },
- {
- label: 'DL32'
- },
- {
- label: 'DL231'
- },
- {
- label: 'DL251'
- }
- ]
- }
- ]
- },
- { role: 'viewMenu' }
-];
-const menu = Menu.buildFromTemplate(menuTemplate)
-
-const createWindow = () => {
- win = new BrowserWindow({
- width: 1000,
- height: 700,
- webPreferences: {
- preload: path.join(__dirname, 'preload.js'),
- nodeIntegration: true,
- contextIsolation: false,
- },
- });
- ipcMain.handle('ping', () => 'pong')
- win.loadFile('index.html');
-};
-
-app.whenReady().then(() => {
- if (!app.isPackaged)
- {
- process.env.NODE_ENV = 'development';
- }
-
- Menu.setApplicationMenu(menu);
- createWindow();
-
- app.on('activate', () => {
- if (BrowserWindow.getAllWindows().length === 0) {
- Menu.setApplicationMenu(menu);
- createWindow();
- }
- });
-});
-
-app.on('window-all-closed', () => {
- if (process.platform !== 'darwin') {
- app.quit();
- }
-});
-
-var childWindow;
-
-ipcMain.on('window', (event, arg) => {
- createChildWindow("device-detail.html", "device-detail-preload.js")
- childWindow.webContents.send('type', arg)
-})
-
-ipcMain.on('file', (event, arg) => {
- if ('saveas' == arg.function || ('save' == arg.function && filePath == "")) {
- dialog.showSaveDialog({
- title: 'Save Mixo project',
- filters: [
- { name: 'Mixo project', extensions: ['mixo_prj'] },
- { name: 'All Files', extensions: ['*'] }
- ]
- }).then(result => {
- if (!result.canceled) {
- filePath = result.filePath;
- win.setTitle('Mixo • ' + filePath.replace(/^.*[\\\/]/, '').slice(0, -9));
- // Write the JSON to the chosen file
- fs.writeFile(result.filePath, arg.json, (err) => {
- if (err) throw err;
- });
- }
- }).catch(err => {
- console.log(err);
- });
- }
- else if ('save' == arg.function && filePath != "") {
- fs.writeFile(filePath, arg.json, (err) => {
- if (err) throw err;
- })
- }
-})
-function loadFile() {
- dialog.showOpenDialog({
- title: 'Open Mixo project',
- filters: [
- { name: 'Mixo project', extensions: ['mixo_prj'] },
- { name: 'All Files', extensions: ['*'] }
- ],
- properties: ['openFile']
- }).then(result => {
- if (!result.canceled) {
- filePath = result.filePaths[0];
- win.setTitle('Mixo • ' + filePath.replace(/^.*[\\\/]/, '').slice(0, -9));
- // Read the chosen file
- fs.readFile(result.filePaths[0], 'utf-8', (err, data) => {
- if (err) throw err;
- // Parse the JSON data
- let jsonData = JSON.parse(data);
- // Extract the arrays
- win.webContents.send('file', {
- function: 'load',
- devices: jsonData.devices,
- links: jsonData.links
- });
- });
- }
- }).catch(err => {
- console.log(err);
- });
-}
-
-// function to create a child window
-function createChildWindow(fileName, preloadFileName) {
- childWindow = new BrowserWindow({
- width: 700,
- height: 500,
- menuBarVisible: false,
- autoHideMenuBar: true,
- webPreferences: {
- preload: path.join(__dirname, preloadFileName),
- nodeIntegration: true,
- contextIsolation: false,
- enableRemoteModule: true,
- }
- })
- childWindow.loadFile(fileName)
-}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 49f8eea..a8914fa 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,19 +1,21 @@
{
"name": "Mixo",
- "version": "0.0.4",
+ "version": "0.0.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "Mixo",
- "version": "0.0.4",
+ "version": "0.0.5",
"license": "GPL-3.0",
"dependencies": {
"@electron/remote": "^2.1.2",
+ "about-window": "^1.15.2",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^6.1.8",
"fs": "^0.0.1-security",
- "jquery": "^3.7.0"
+ "jquery": "^3.7.0",
+ "serialize-javascript": "^6.0.2"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.5",
@@ -343,9 +345,9 @@
}
},
"node_modules/@electron/asar": {
- "version": "3.2.9",
- "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.9.tgz",
- "integrity": "sha512-Vu2P3X2gcZ3MY9W7yH72X9+AMXwUQZEJBrsPIbX0JsdllLtoh62/Q8Wg370/DawIEVKOyfD6KtTLo645ezqxUA==",
+ "version": "3.2.10",
+ "resolved": "https://registry.npmjs.org/@electron/asar/-/asar-3.2.10.tgz",
+ "integrity": "sha512-mvBSwIBUeiRscrCeJE1LwctAriBj65eUDm0Pc11iE5gRwzkmsdbS7FnZ1XUWjpSeQWL1L5g12Fc/SchPM9DUOw==",
"dev": true,
"dependencies": {
"commander": "^5.0.0",
@@ -981,9 +983,9 @@
"dev": true
},
"node_modules/@types/node": {
- "version": "20.11.25",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz",
- "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==",
+ "version": "20.12.12",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz",
+ "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==",
"dependencies": {
"undici-types": "~5.26.4"
}
@@ -1008,9 +1010,9 @@
}
},
"node_modules/@types/verror": {
- "version": "1.10.9",
- "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.9.tgz",
- "integrity": "sha512-MLx9Z+9lGzwEuW16ubGeNkpBDE84RpB/NyGgg6z2BTpWzKkGU451cAY3UkUzZEp72RHF585oJ3V8JVNqIplcAQ==",
+ "version": "1.10.10",
+ "resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.10.tgz",
+ "integrity": "sha512-l4MM0Jppn18hb9xmM6wwD1uTdShpf9Pn80aXTStnK1C94gtPvJcV2FrDmbOQUAQfJ1cKZHktkQUDwEqaAKXMMg==",
"dev": true,
"optional": true
},
@@ -1044,6 +1046,11 @@
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"dev": true
},
+ "node_modules/about-window": {
+ "version": "1.15.2",
+ "resolved": "https://registry.npmjs.org/about-window/-/about-window-1.15.2.tgz",
+ "integrity": "sha512-31mDAnLUfKm4uShfMzeEoS6a3nEto2tUt4zZn7qyAKedaTV4p0dGiW1n+YG8vtRh78mZiewghWJmoxDY+lHyYg=="
+ },
"node_modules/agent-base": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
@@ -1879,31 +1886,31 @@
}
},
"node_modules/config-file-ts/node_modules/glob": {
- "version": "10.3.10",
- "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz",
- "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==",
+ "version": "10.3.15",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.15.tgz",
+ "integrity": "sha512-0c6RlJt1TICLyvJYIApxb8GsXoai0KUP7AxKKAtsYXdgJR1mGEUa7DgwShbdk1nly0PYoZj01xd4hzbq3fsjpw==",
"dev": true,
"dependencies": {
"foreground-child": "^3.1.0",
- "jackspeak": "^2.3.5",
+ "jackspeak": "^2.3.6",
"minimatch": "^9.0.1",
- "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0",
- "path-scurry": "^1.10.1"
+ "minipass": "^7.0.4",
+ "path-scurry": "^1.11.0"
},
"bin": {
"glob": "dist/esm/bin.mjs"
},
"engines": {
- "node": ">=16 || 14 >=14.17"
+ "node": ">=16 || 14 >=14.18"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/config-file-ts/node_modules/minimatch": {
- "version": "9.0.3",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
- "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
+ "version": "9.0.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
+ "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
"dev": true,
"dependencies": {
"brace-expansion": "^2.0.1"
@@ -1916,9 +1923,9 @@
}
},
"node_modules/config-file-ts/node_modules/minipass": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
- "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz",
+ "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
@@ -2174,9 +2181,9 @@
"dev": true
},
"node_modules/detect-libc": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz",
- "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==",
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",
+ "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==",
"dev": true,
"engines": {
"node": ">=8"
@@ -2285,9 +2292,9 @@
"dev": true
},
"node_modules/ejs": {
- "version": "3.1.9",
- "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz",
- "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==",
+ "version": "3.1.10",
+ "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
+ "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
"dev": true,
"dependencies": {
"jake": "^10.8.5"
@@ -2300,9 +2307,9 @@
}
},
"node_modules/electron": {
- "version": "29.1.0",
- "resolved": "https://registry.npmjs.org/electron/-/electron-29.1.0.tgz",
- "integrity": "sha512-giJVIm0sWVp+8V1GXrKqKTb+h7no0P3ooYqEd34AD9wMJzGnAeL+usj+R0155/0pdvvP1mgydnA7lcaFA2M9lw==",
+ "version": "29.3.3",
+ "resolved": "https://registry.npmjs.org/electron/-/electron-29.3.3.tgz",
+ "integrity": "sha512-I/USTe9UsQUKb/iuiYnmt074vHxNHCJZWYiU4Xg6lNPKVBsPadAhZcc+g2gYLqC1rA7KT4AvKTmNsY8n7oEUCw==",
"hasInstallScript": true,
"dependencies": {
"@electron/get": "^2.0.0",
@@ -2729,9 +2736,9 @@
}
},
"node_modules/electron-squirrel-startup": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz",
- "integrity": "sha512-Oce8mvgGdFmwr+DsAcXBmFK8jFfN6yaFAP9IvyhTfupM3nFkBku/7VS/mdtJteWumImkC6P+BKGsxScoDDkv9Q==",
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.1.tgz",
+ "integrity": "sha512-sTfFIHGku+7PsHLJ7v0dRcZNkALrV+YEozINTW8X1nM//e5O3L+rfYuvSW00lmGHnYmUjARZulD8F2V8ISI9RA==",
"dependencies": {
"debug": "^2.2.0"
}
@@ -2777,9 +2784,9 @@
}
},
"node_modules/electron-winstaller": {
- "version": "5.3.0",
- "resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-5.3.0.tgz",
- "integrity": "sha512-ml77/OmeeLFFc+dk3YCwPQrl8rthwYcAea6mMZPFq7cGXlpWyRmmT0LY73XdCukPnevguXJFs+4Xu+aGHJwFDA==",
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-5.3.1.tgz",
+ "integrity": "sha512-oM8BW3a8NEqG0XW+Vx3xywhk0DyDV4T0jT0zZfWt0IczNT3jHAAvQWBorF8osQDplSsCyXXyxrsrQ8cY0Slb/A==",
"dev": true,
"hasInstallScript": true,
"optional": true,
@@ -2787,7 +2794,7 @@
"@electron/asar": "^3.2.1",
"debug": "^4.1.1",
"fs-extra": "^7.0.1",
- "lodash.template": "^4.2.2",
+ "lodash": "^4.17.21",
"temp": "^0.9.0"
},
"engines": {
@@ -3536,12 +3543,13 @@
}
},
"node_modules/globalthis": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz",
- "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz",
+ "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==",
"optional": true,
"dependencies": {
- "define-properties": "^1.1.3"
+ "define-properties": "^1.2.1",
+ "gopd": "^1.0.1"
},
"engines": {
"node": ">= 0.4"
@@ -3643,9 +3651,9 @@
"dev": true
},
"node_modules/hasown": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz",
- "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==",
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"devOptional": true,
"dependencies": {
"function-bind": "^1.1.2"
@@ -4033,9 +4041,9 @@
}
},
"node_modules/jake": {
- "version": "10.8.7",
- "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz",
- "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==",
+ "version": "10.9.1",
+ "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz",
+ "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==",
"dev": true,
"dependencies": {
"async": "^3.2.3",
@@ -4265,13 +4273,6 @@
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
- "node_modules/lodash._reinterpolate": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz",
- "integrity": "sha512-xYHt68QRoYGjeeM/XOE1uJtvXQAgvszfBhjV4yvsQH0u2i9I6cI6c6/eG4Hh3UAOVn0y/xAXwmTzEay49Q//HA==",
- "dev": true,
- "optional": true
- },
"node_modules/lodash.defaults": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz",
@@ -4316,27 +4317,6 @@
"dev": true,
"peer": true
},
- "node_modules/lodash.template": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz",
- "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==",
- "dev": true,
- "optional": true,
- "dependencies": {
- "lodash._reinterpolate": "^3.0.0",
- "lodash.templatesettings": "^4.0.0"
- }
- },
- "node_modules/lodash.templatesettings": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz",
- "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==",
- "dev": true,
- "optional": true,
- "dependencies": {
- "lodash._reinterpolate": "^3.0.0"
- }
- },
"node_modules/lodash.union": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
@@ -4421,6 +4401,7 @@
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
+ "dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
@@ -4718,9 +4699,9 @@
"dev": true
},
"node_modules/node-abi": {
- "version": "3.56.0",
- "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz",
- "integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==",
+ "version": "3.62.0",
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz",
+ "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==",
"dev": true,
"dependencies": {
"semver": "^7.3.5"
@@ -5100,34 +5081,34 @@
"dev": true
},
"node_modules/path-scurry": {
- "version": "1.10.1",
- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz",
- "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==",
+ "version": "1.11.1",
+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
"dev": true,
"dependencies": {
- "lru-cache": "^9.1.1 || ^10.0.0",
+ "lru-cache": "^10.2.0",
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
},
"engines": {
- "node": ">=16 || 14 >=14.17"
+ "node": ">=16 || 14 >=14.18"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/path-scurry/node_modules/lru-cache": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz",
- "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==",
+ "version": "10.2.2",
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz",
+ "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==",
"dev": true,
"engines": {
"node": "14 || >=16.14"
}
},
"node_modules/path-scurry/node_modules/minipass": {
- "version": "7.0.4",
- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
- "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.1.tgz",
+ "integrity": "sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==",
"dev": true,
"engines": {
"node": ">=16 || 14 >=14.17"
@@ -5358,6 +5339,14 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/randombytes": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
+ "dependencies": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
"node_modules/rcedit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/rcedit/-/rcedit-3.1.0.tgz",
@@ -5703,7 +5692,6 @@
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
- "dev": true,
"funding": [
{
"type": "github",
@@ -5740,12 +5728,9 @@
"integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA=="
},
"node_modules/semver": {
- "version": "7.6.0",
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
- "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
- "dependencies": {
- "lru-cache": "^6.0.0"
- },
+ "version": "7.6.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
+ "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
"bin": {
"semver": "bin/semver.js"
},
@@ -5786,6 +5771,14 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/serialize-javascript": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
+ "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
+ "dependencies": {
+ "randombytes": "^2.1.0"
+ }
+ },
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
@@ -5856,9 +5849,9 @@
}
},
"node_modules/socks": {
- "version": "2.8.1",
- "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz",
- "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==",
+ "version": "2.8.3",
+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz",
+ "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==",
"dev": true,
"dependencies": {
"ip-address": "^9.0.5",
@@ -6105,9 +6098,9 @@
}
},
"node_modules/tar": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz",
- "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==",
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz",
+ "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==",
"dev": true,
"dependencies": {
"chownr": "^2.0.0",
@@ -6300,9 +6293,9 @@
}
},
"node_modules/typescript": {
- "version": "5.4.2",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz",
- "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==",
+ "version": "5.4.5",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
+ "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -6528,7 +6521,8 @@
"node_modules/yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
- "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "dev": true
},
"node_modules/yargs": {
"version": "17.7.2",
diff --git a/package.json b/package.json
index 30b23af..cdc90f5 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
{
"name": "Mixo",
"version": "0.0.5",
- "description": "Routing tool for behringer x32 based on hardware availabilities instead of software capabilities. Aim to simplify routing and create automatic documentation. ",
- "main": "main.js",
+ "description": "Routing tool for behringer x32 based on hardware availabilities instead of software capabilities. Aim to simplify routing and create automatic documentation.",
+ "main": "src/js/main.js",
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
@@ -43,10 +43,12 @@
},
"dependencies": {
"@electron/remote": "^2.1.2",
+ "about-window": "^1.15.2",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^6.1.8",
"fs": "^0.0.1-security",
- "jquery": "^3.7.0"
+ "jquery": "^3.7.0",
+ "serialize-javascript": "^6.0.2"
},
"build": {
"extraResources": [
diff --git a/preload.js b/preload.js
deleted file mode 100644
index a81daa9..0000000
--- a/preload.js
+++ /dev/null
@@ -1,283 +0,0 @@
-const { contextBridge, ipcRenderer } = require('electron');
-const { fs } = require('fs');
-const path = require('path')
-
-// Uncomment for npm start command
-// process.env.NODE_ENV = 'development'
-
-const publicPath =
- process.env.NODE_ENV === 'development'
- ? './public'
- : path.join(process.resourcesPath, 'public');
-const imagesPath = path.join(publicPath, "assets", "images");
-
-const AES50 = {
- A: "A",
- B: "B"
-};
-
-class Device {
- constructor(x, y, type, id, name) {
- this.x = x;
- this.y = y;
- this.type = type;
- this.id = id;
- this.name = name;
- this.visible = true;
- }
-
- show() {
- if (this.visible)
- {
- return "" +
- "
A
" +
- "
B
" +
- "
";
- }
- else return "";
- }
-
- move(newX, newY) {
- this.x = newX;
- this.y = newY;
- }
-
- delete() {
- this.visible = false;
- links.forEach(link => {
- // if link on the device to delete
- if ((this.id == link.device1) || (this.id == link.device2)) {
- link.delete()
- }
- });
- }
-}
-
-class Link {
- constructor(dev1, aes50_1, dev2, aes50_2) {
- this.valid = true
- this.device1 = dev1;
- this.device2 = dev2;
- this.aes50_1 = aes50_1;
- this.aes50_2 = aes50_2;
- this.check();
- }
-
- /// Check if link is valable
- check() {
- links.forEach((link, index, fullArray) => {
- // if link already on aes50
- if ((this.device1 == link.device1 && this.aes50_1 == link.aes50_1) ||
- (this.device1 == link.device2 && this.aes50_1 == link.aes50_2) ||
- (this.device2 == link.device1 && this.aes50_2 == link.aes50_1) ||
- (this.device2 == link.device2 && this.aes50_2 == link.aes50_2)) {
- links.splice(index, 1);
- }
- });
- }
-
- delete() {
- this.valid = false;
- this.device1 = -1;
- this.aes50_1 = -1;
- this.device2 = -1;
- this.aes50_2 = -2;
- }
-
- show() {
- if (this.valid) {
- let x1offset = this.aes50_1 == AES50.A ? 58 : 78;
- let x2offset = this.aes50_2 == AES50.A ? 58 : 78;
- //return "";
- return "";
- }
- }
-}
-/*
-contextBridge.exposeInMainWorld('versions', {
- node: () => process.versions.node,
- chrome: () => process.versions.chrome,
- electron: () => process.versions.electron,
- ping: () => ipcRenderer.invoke('ping'),
- // we can also expose variables, not just functions
-})
-*/
-
-let devices = [];
-let links = [];
-let selectedElement = null;
-let originX, originY, mouseX, mouseY;
-let idCnt = 0;
-
-function id2index(id, list) {
- return list.findIndex((element) => Number(element.id) === Number(id));
-}
-
-function selectTopDiv(ele) {
- while (ele.tagName != "BODY" && !ele.classList.contains('device') && !ele.classList.contains('AES50') && ele.tagName != "INPUT") {
- ele = ele.parentElement;
- }
- return ele;
-}
-
-function draw() {
- document.getElementById("canvas").innerHTML = "";
- devices.forEach(device => {
- document.getElementById("canvas").innerHTML += device.show();
- })
- drawLine();
-
- var ele = document.getElementsByClassName("device");
- for (var i = 0; i < ele.length; i++) {
- enableClick(ele[i]);
- enableDoubleClick(ele[i]);
- enableRightClick(ele[i]);
- enableTextBox(ele[i], ele[i].children[3]);
- }
-}
-
-function drawLine() {
- document.getElementById("lines").innerHTML = "";
- links.forEach(link => {
- document.getElementById("lines").innerHTML += link.show();
- })
-}
-
-function enableClick(ele) {
- ele.addEventListener("mousedown", (ev) => {
- element = selectTopDiv(ev.target)
- if (element.classList.contains('AES50')) {
- selectedElement = element;
- fromID = selectedElement.parentElement.id
- fromAES50 = selectedElement.classList[1]
- links.forEach((link, index, fullArray) => {
- if ((link.device1 == fromID && link.aes50_1 == fromAES50) ||
- (link.device2 == fromID && link.aes50_2 == fromAES50)) {
- links.splice(index, 1);
- }
- });
- }
- else if (element.classList.contains('device')) {
- selectedElement = element; // Select element
- originX = selectedElement.offsetLeft;
- originY = selectedElement.offsetTop;
- mouseX = ev.clientX;
- mouseY = ev.clientY;
- }
- });
-}
-
-function enableTextBox(parent, ele) {
- ele.addEventListener("keyup", (ev) => {
- deviceId = ev.target.parentElement.id;
- console.log(deviceId)
- devices[id2index(deviceId, devices)].name = ev.target.value;
- console.log(devices)
- });
-}
-
-window.addEventListener("mousemove", (ev) => {
- drawLine()
- if (selectedElement == null) return;
- if (selectedElement.classList.contains('AES50')) {
- fromID = selectedElement.parentElement.id
- fromAES50 = selectedElement.classList[1]
- xoffset = fromAES50 == AES50.A ? 58 : 78;
- document.getElementById("lines").innerHTML = "";
- links.forEach(link => {
- document.getElementById("lines").innerHTML += link.show();
- })
- }
- else if (selectedElement.classList.contains('device')) {
- var Sx = ev.clientX - mouseX + originX,
- Sy = ev.clientY - mouseY + originY;
- if (Sx < 0) Sx = 0;
- if (Sy < 0) Sy = 0;
- selectedElement.style.top = Math.round(Sy / 10) * 10 + "px";
- selectedElement.style.left = Math.round(Sx / 10) * 10 + "px";
- index = id2index(selectedElement.id, devices);
- devices[index].move(parseInt(selectedElement.style.left, 10), parseInt(selectedElement.style.top, 10));
- drawLine()
- }
-});
-
-window.addEventListener("mouseup", (ev) => {
- if (selectedElement.classList.contains('AES50')) {
- target = selectTopDiv(ev.target)
- toID = target.parentElement.id
- if (fromID != toID)
- {
- links.push(new Link(devices[id2index(fromID, devices)].id, selectedElement.classList[1], devices[id2index(toID, devices)].id, target.classList[1]))
- }
- drawLine();
- }
- else if (selectedElement.classList.contains('device')) {
- index = id2index(selectedElement.id, devices);
- devices[index].move(parseInt(selectedElement.style.left, 10), parseInt(selectedElement.style.top, 10));
- drawLine()
- }
- selectedElement = null; // Unselect element
-});
-
-function enableDoubleClick(ele) {
- ele.ondblclick = function (ev) {
- current = selectTopDiv(ev.target);
- ipcRenderer.send('window', devices[current.id].type);
- }
-}
-
-function enableRightClick(ele) {
- ele.oncontextmenu = function (ev) {
- current = selectTopDiv(ev.target);
- devices[id2index(current.id, devices)].delete();
- devices.splice(id2index(current.id, devices), 1);
- draw();
- }
-}
-
-ipcRenderer.on('menu', (event, arg) => {
- devices.push(new Device(10, 10, arg, idCnt++, arg));
- // if (devices.length == 2) links.push(new Link(devices[0], AES50.A, devices[1], AES50.A));
- // if (devices.length == 3) links.push(new Link(devices[1], AES50.B, devices[2], AES50.A));
-
- draw();
-});
-
-ipcRenderer.on('file', (event, arg) => {
- if ('save' == arg.function || 'saveas' == arg.function) {
- // Combine the arrays into an object
- let data = {
- devices: devices,
- links: links
- };
- // Convert the object to JSON
- let json = JSON.stringify(data, null, 2);
- ipcRenderer.send('file', {
- function: arg.function,
- json: json
- });
- }
- else if ('load' == arg.function) {
- devices = [];
- links = [];
- arg.devices.forEach(device => {
- devices.push(new Device(device.x, device.y, device.type, device.id, device.name));
- });
- arg.links.forEach(link => {
- links.push(new Link(link.device1, link.aes50_1, link.device2, link.aes50_2));
- })
- draw();
- }
-})
\ No newline at end of file
diff --git a/public/assets/icon.png b/public/assets/icon.png
new file mode 100644
index 0000000..9aa4f9a
Binary files /dev/null and b/public/assets/icon.png differ
diff --git a/public/assets/icons b/public/assets/icons
new file mode 160000
index 0000000..5ffada4
--- /dev/null
+++ b/public/assets/icons
@@ -0,0 +1 @@
+Subproject commit 5ffada450486a88e236b773dad8d60ce3b3981d9
diff --git a/public/assets/images/SD16.svg b/public/assets/images/SD16.svg
index 1e133ee..c96a94e 100644
--- a/public/assets/images/SD16.svg
+++ b/public/assets/images/SD16.svg
@@ -1,319 +1,185 @@
-