loupedeck-commander 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -131
- package/VERSION.md +32 -32
- package/common/ApplicationConfig.mjs +84 -84
- package/common/BaseLoupeDeckHandler.mjs +326 -313
- package/common/cmd-executer.mjs +16 -16
- package/common/index.mjs +5 -5
- package/common/touchbuttons.mjs +534 -513
- package/common/utils.mjs +29 -29
- package/config.json +8 -8
- package/eslint.config.mjs +8 -8
- package/example/ExampleDeviceHandler.mjs +44 -44
- package/example/example.mjs +21 -21
- package/index.mjs +3 -3
- package/interfaces/baseif.mjs +69 -68
- package/interfaces/httpif.mjs +81 -81
- package/interfaces/opcuaif.mjs +291 -282
- package/interfaces/shellif.mjs +47 -47
- package/package.json +29 -29
- package/profile-1.json +280 -275
- package/test.mjs +22 -22
package/README.md
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
# loupedeck-commander
|
|
2
|
-
|
|
3
|
-
## Getting started
|
|
4
|
-
|
|
5
|
-
The loupedeck-commander is helping you using your Loupedeck device more easily, and connect it with custom commands you define with script files.
|
|
6
|
-
|
|
7
|
-
Features:
|
|
8
|
-
|
|
9
|
-
- Reference image files for every state of your button in the touch-display fields
|
|
10
|
-
- Connect commands to your state transitions
|
|
11
|
-
- Tested with following LoupeDeck devices:
|
|
12
|
-
- [LoupeDeck Live](https://loupedeck.com/products/loupedeck-live/)
|
|
13
|
-
- [LoupeDeck CT](https://loupedeck.com/products/loupedeck-ct/)
|
|
14
|
-
|
|
15
|
-
Runs on:
|
|
16
|
-
|
|
17
|
-
- Linux (Tested with Ubuntu 22.04 and Debian 11/12 on x64 & arm32/arm64)
|
|
18
|
-
- Windows (Tested with Windows 10/11 on x64)
|
|
19
|
-
|
|
20
|
-
Small footprint
|
|
21
|
-
|
|
22
|
-
- Raspberry PI Zero is suitable to run this
|
|
23
|
-
|
|
24
|
-
Please take care about the following:
|
|
25
|
-
|
|
26
|
-
- LoupeDeck devices after `version 0.2.x` use a serial interface instead of WebSocket.
|
|
27
|
-
When using this library please upgrade your firmware using the [LoupeDeck Software](https://loupedeck.com/downloads/)
|
|
28
|
-
Tested with Firmware version [`version 0.2.5`](https://support.loupedeck.com/f-a-q-support#firmware-connectivity-issues)
|
|
29
|
-
|
|
30
|
-
## Basic Usage
|
|
31
|
-
|
|
32
|
-
Do the following steps:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# init your new node package
|
|
36
|
-
npm init
|
|
37
|
-
|
|
38
|
-
# install the loupedeck-commander dependency
|
|
39
|
-
npm install -s loupedeck-commander
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Create a new configuration file with at least one profile or copy from here,
|
|
43
|
-
and replace the image references with your own icons (90x90px size):
|
|
44
|
-
|
|
45
|
-
- [config.json](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/config.json)
|
|
46
|
-
- [profile-1.json](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/profile-1.json)
|
|
47
|
-
|
|
48
|
-
Create a `index.mjs` file to open up your loupedeck connection:
|
|
49
|
-
|
|
50
|
-
```javascript
|
|
51
|
-
# save as index.mjs
|
|
52
|
-
import { BaseLoupeDeckHandler } from 'loupedeck-commander'
|
|
53
|
-
|
|
54
|
-
const handler = new BaseLoupeDeckHandler('config.json')
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Stop the handlers when a signal like SIGINT or SIGTERM arrive
|
|
58
|
-
* @param {*} signal
|
|
59
|
-
*/
|
|
60
|
-
const stopHandler = async(signal) => {
|
|
61
|
-
console.log(`Receiving ${signal} => Stopping processes.`)
|
|
62
|
-
await handler.stop()
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Initiating the signal handlers:
|
|
66
|
-
// see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
|
|
67
|
-
process.on('SIGINT', async (signal) => { stopHandler(signal) })
|
|
68
|
-
process.on('SIGTERM', async (signal) => { stopHandler(signal) })
|
|
69
|
-
|
|
70
|
-
// Start it
|
|
71
|
-
await handler.start()
|
|
72
|
-
|
|
73
|
-
// Take care of running background processes and stop them accordingly:
|
|
74
|
-
await new Promise((resolve) => process.once("SIGINT", resolve));
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Run the script using the following command:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
node index.mjs
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
If you end up with errors related to canvas module - please install the dependencies as mentioned below, and run `npm install -s` again
|
|
85
|
-
|
|
86
|
-
## Thanks
|
|
87
|
-
|
|
88
|
-
Big thanks go out to [foxxyz](https://github.com/foxxyz/loupedeck) and his team maintaining a great javascript loopdeck module
|
|
89
|
-
|
|
90
|
-
## Hints
|
|
91
|
-
|
|
92
|
-
### Cannot connect to Loupedeck device
|
|
93
|
-
|
|
94
|
-
You may need to add your user to the `dialout` group to allow access to the LoupeDeck device, you could do su using the `usermod` as shown below
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
# ls -la /dev/ttyACM0
|
|
98
|
-
crw-rw---- 1 root dialout 166, 0 Nov 30 12:59 /dev/ttyACM0
|
|
99
|
-
|
|
100
|
-
# add the current user to the dialout group:
|
|
101
|
-
# sudo usermod -a -G dialout $USER
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
After modifying users group you need to logout and login again to activate this change
|
|
105
|
-
|
|
106
|
-
### CANVAS Module - additional effort needed
|
|
107
|
-
|
|
108
|
-
The library is using [canvas](https://www.npmjs.com/package/canvas) to load images and render graphical content on the LoupeDeck devices.
|
|
109
|
-
Please follow the instructions to install the preconditions, to properly use canvas on your system.
|
|
110
|
-
|
|
111
|
-
Example for Ubuntu:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
# different build & graphic dev-libs are needed to use canvas module:
|
|
115
|
-
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Resizing of images
|
|
119
|
-
|
|
120
|
-
The buttons images shown on the different buttons should be prepared with specific resolutions:
|
|
121
|
-
|
|
122
|
-
- Main/Center Touch-Area: 90px x 90px per Button
|
|
123
|
-
- Left/Right Touch-Area: 90px x 270px per Button
|
|
124
|
-
- LoupeDeck CT Knob Touch-Area: 240px x 240px Button
|
|
125
|
-
|
|
126
|
-
if you already have suitable icons with the right aspect ratio, you could resize them with imagemagick/mogrify:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
mkdir resized
|
|
130
|
-
mogrify -resize 90x90 -quality 100 -path resized *.png
|
|
131
|
-
```
|
|
1
|
+
# loupedeck-commander
|
|
2
|
+
|
|
3
|
+
## Getting started
|
|
4
|
+
|
|
5
|
+
The loupedeck-commander is helping you using your Loupedeck device more easily, and connect it with custom commands you define with script files.
|
|
6
|
+
|
|
7
|
+
Features:
|
|
8
|
+
|
|
9
|
+
- Reference image files for every state of your button in the touch-display fields
|
|
10
|
+
- Connect commands to your state transitions
|
|
11
|
+
- Tested with following LoupeDeck devices:
|
|
12
|
+
- [LoupeDeck Live](https://loupedeck.com/products/loupedeck-live/)
|
|
13
|
+
- [LoupeDeck CT](https://loupedeck.com/products/loupedeck-ct/)
|
|
14
|
+
|
|
15
|
+
Runs on:
|
|
16
|
+
|
|
17
|
+
- Linux (Tested with Ubuntu 22.04 and Debian 11/12 on x64 & arm32/arm64)
|
|
18
|
+
- Windows (Tested with Windows 10/11 on x64)
|
|
19
|
+
|
|
20
|
+
Small footprint
|
|
21
|
+
|
|
22
|
+
- Raspberry PI Zero is suitable to run this
|
|
23
|
+
|
|
24
|
+
Please take care about the following:
|
|
25
|
+
|
|
26
|
+
- LoupeDeck devices after `version 0.2.x` use a serial interface instead of WebSocket.
|
|
27
|
+
When using this library please upgrade your firmware using the [LoupeDeck Software](https://loupedeck.com/downloads/)
|
|
28
|
+
Tested with Firmware version [`version 0.2.5`](https://support.loupedeck.com/f-a-q-support#firmware-connectivity-issues)
|
|
29
|
+
|
|
30
|
+
## Basic Usage
|
|
31
|
+
|
|
32
|
+
Do the following steps:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# init your new node package
|
|
36
|
+
npm init
|
|
37
|
+
|
|
38
|
+
# install the loupedeck-commander dependency
|
|
39
|
+
npm install -s loupedeck-commander
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Create a new configuration file with at least one profile or copy from here,
|
|
43
|
+
and replace the image references with your own icons (90x90px size):
|
|
44
|
+
|
|
45
|
+
- [config.json](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/config.json)
|
|
46
|
+
- [profile-1.json](https://gitlab.com/keckxde/loupedeck-commander/-/blob/main/profile-1.json)
|
|
47
|
+
|
|
48
|
+
Create a `index.mjs` file to open up your loupedeck connection:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
# save as index.mjs
|
|
52
|
+
import { BaseLoupeDeckHandler } from 'loupedeck-commander'
|
|
53
|
+
|
|
54
|
+
const handler = new BaseLoupeDeckHandler('config.json')
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Stop the handlers when a signal like SIGINT or SIGTERM arrive
|
|
58
|
+
* @param {*} signal
|
|
59
|
+
*/
|
|
60
|
+
const stopHandler = async(signal) => {
|
|
61
|
+
console.log(`Receiving ${signal} => Stopping processes.`)
|
|
62
|
+
await handler.stop()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Initiating the signal handlers:
|
|
66
|
+
// see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
|
|
67
|
+
process.on('SIGINT', async (signal) => { stopHandler(signal) })
|
|
68
|
+
process.on('SIGTERM', async (signal) => { stopHandler(signal) })
|
|
69
|
+
|
|
70
|
+
// Start it
|
|
71
|
+
await handler.start()
|
|
72
|
+
|
|
73
|
+
// Take care of running background processes and stop them accordingly:
|
|
74
|
+
await new Promise((resolve) => process.once("SIGINT", resolve));
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Run the script using the following command:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node index.mjs
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
If you end up with errors related to canvas module - please install the dependencies as mentioned below, and run `npm install -s` again
|
|
85
|
+
|
|
86
|
+
## Thanks
|
|
87
|
+
|
|
88
|
+
Big thanks go out to [foxxyz](https://github.com/foxxyz/loupedeck) and his team maintaining a great javascript loopdeck module
|
|
89
|
+
|
|
90
|
+
## Hints
|
|
91
|
+
|
|
92
|
+
### Cannot connect to Loupedeck device
|
|
93
|
+
|
|
94
|
+
You may need to add your user to the `dialout` group to allow access to the LoupeDeck device, you could do su using the `usermod` as shown below
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# ls -la /dev/ttyACM0
|
|
98
|
+
crw-rw---- 1 root dialout 166, 0 Nov 30 12:59 /dev/ttyACM0
|
|
99
|
+
|
|
100
|
+
# add the current user to the dialout group:
|
|
101
|
+
# sudo usermod -a -G dialout $USER
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
After modifying users group you need to logout and login again to activate this change
|
|
105
|
+
|
|
106
|
+
### CANVAS Module - additional effort needed
|
|
107
|
+
|
|
108
|
+
The library is using [canvas](https://www.npmjs.com/package/canvas) to load images and render graphical content on the LoupeDeck devices.
|
|
109
|
+
Please follow the instructions to install the preconditions, to properly use canvas on your system.
|
|
110
|
+
|
|
111
|
+
Example for Ubuntu:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# different build & graphic dev-libs are needed to use canvas module:
|
|
115
|
+
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Resizing of images
|
|
119
|
+
|
|
120
|
+
The buttons images shown on the different buttons should be prepared with specific resolutions:
|
|
121
|
+
|
|
122
|
+
- Main/Center Touch-Area: 90px x 90px per Button
|
|
123
|
+
- Left/Right Touch-Area: 90px x 270px per Button
|
|
124
|
+
- LoupeDeck CT Knob Touch-Area: 240px x 240px Button
|
|
125
|
+
|
|
126
|
+
if you already have suitable icons with the right aspect ratio, you could resize them with imagemagick/mogrify:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
mkdir resized
|
|
130
|
+
mogrify -resize 90x90 -quality 100 -path resized *.png
|
|
131
|
+
```
|
package/VERSION.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# Versions
|
|
2
|
-
|
|
3
|
-
## 1.0.2
|
|
4
|
-
|
|
5
|
-
1. Updated button rendering strategy:
|
|
6
|
-
- Render Background Color - per Button State
|
|
7
|
-
- Render Image on Top (if available), works well with transparent images
|
|
8
|
-
|
|
9
|
-
2. Updated configuration strategy:
|
|
10
|
-
- Keep all state related attributes per button-state also in config:
|
|
11
|
-
example:
|
|
12
|
-
|
|
13
|
-
```json
|
|
14
|
-
"states": {
|
|
15
|
-
"off": {
|
|
16
|
-
"color": "#aaaaaa",
|
|
17
|
-
"image": "icons/bulb.png",
|
|
18
|
-
"cmd": "echo \"{id} {state}\""
|
|
19
|
-
},
|
|
20
|
-
"on": {
|
|
21
|
-
"color": "#11ff11",
|
|
22
|
-
"image": "icons/bulb.png",
|
|
23
|
-
"cmd": "echo \"{id} {state}\""
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## 1.0.1
|
|
28
|
-
|
|
29
|
-
bugfixes and documentation
|
|
30
|
-
|
|
31
|
-
## 1.0.0
|
|
32
|
-
|
|
1
|
+
# Versions
|
|
2
|
+
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
1. Updated button rendering strategy:
|
|
6
|
+
- Render Background Color - per Button State
|
|
7
|
+
- Render Image on Top (if available), works well with transparent images
|
|
8
|
+
|
|
9
|
+
2. Updated configuration strategy:
|
|
10
|
+
- Keep all state related attributes per button-state also in config:
|
|
11
|
+
example:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
"states": {
|
|
15
|
+
"off": {
|
|
16
|
+
"color": "#aaaaaa",
|
|
17
|
+
"image": "icons/bulb.png",
|
|
18
|
+
"cmd": "echo \"{id} {state}\""
|
|
19
|
+
},
|
|
20
|
+
"on": {
|
|
21
|
+
"color": "#11ff11",
|
|
22
|
+
"image": "icons/bulb.png",
|
|
23
|
+
"cmd": "echo \"{id} {state}\""
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 1.0.1
|
|
28
|
+
|
|
29
|
+
bugfixes and documentation
|
|
30
|
+
|
|
31
|
+
## 1.0.0
|
|
32
|
+
|
|
33
33
|
first public release
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
import { readJSONFile, writeJSONFile } from './utils.mjs'
|
|
2
|
-
|
|
3
|
-
export class ApplicationConfig {
|
|
4
|
-
application = 'undefined'
|
|
5
|
-
profiles = []
|
|
6
|
-
|
|
7
|
-
loadFromFile (fileName) {
|
|
8
|
-
console.info(`ApplicationConfig: Loading Config File ${fileName}`)
|
|
9
|
-
const config = readJSONFile(fileName)
|
|
10
|
-
|
|
11
|
-
this.application = config.application
|
|
12
|
-
for (let i = 0; i < config.profiles.length; i++) {
|
|
13
|
-
const profile = new Profile(config.profiles[i])
|
|
14
|
-
this.profiles.push(profile)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
class Profile {
|
|
20
|
-
name = ''
|
|
21
|
-
file = ''
|
|
22
|
-
description = ''
|
|
23
|
-
|
|
24
|
-
touch = {}
|
|
25
|
-
knobs = {}
|
|
26
|
-
buttons = {}
|
|
27
|
-
parameters = {}
|
|
28
|
-
#file = ''
|
|
29
|
-
#loaded = false
|
|
30
|
-
#error = false
|
|
31
|
-
|
|
32
|
-
constructor (data) {
|
|
33
|
-
this.name = data.name
|
|
34
|
-
this.#file = data.file
|
|
35
|
-
this.loadFromFile(this.#file)
|
|
36
|
-
if (this.#error) { this.saveToFile(`profile-${this.name}-sav.json`) }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
loadFromFile (fileName) {
|
|
40
|
-
console.info(`ProfileConfig: Loading Config File ${fileName}`)
|
|
41
|
-
const config = readJSONFile(fileName)
|
|
42
|
-
this.#error = (config === undefined)
|
|
43
|
-
this.#loaded = !this.#error
|
|
44
|
-
if (!this.#error && this.#loaded) {
|
|
45
|
-
this.profile = config.profile
|
|
46
|
-
this.description = config.description
|
|
47
|
-
|
|
48
|
-
// Load the Configurations for Touch-Displays
|
|
49
|
-
this.touch = new TouchConfig(config.touch)
|
|
50
|
-
// Load the Configurations for Button-Areas
|
|
51
|
-
this.buttons = config.buttons
|
|
52
|
-
// Load Parameters
|
|
53
|
-
this.parameters = config.parameters
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
saveToFile (fileName) {
|
|
58
|
-
fileName = fileName.toLowerCase()
|
|
59
|
-
|
|
60
|
-
console.info(`ProfileConfig: Save To Config File ${fileName}`)
|
|
61
|
-
writeJSONFile(fileName, this)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Class that handles the different configs for the touch displays of the device covering Loupedeck Live (without knob) and also CT (with knob)
|
|
67
|
-
*/
|
|
68
|
-
class TouchConfig {
|
|
69
|
-
center = {} // CENTER Display Config - Available in CT & LIVE
|
|
70
|
-
left = {} // LEFT Display Config - Available in CT & LIVE
|
|
71
|
-
right = {} // RIGHT Display Config - Available in CT & LIVE
|
|
72
|
-
knob = {} // KNOB Display Config - Available only in CT
|
|
73
|
-
|
|
74
|
-
constructor (data) {
|
|
75
|
-
this.loadFromJSON(data)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
loadFromJSON (data) {
|
|
79
|
-
this.center = data.center
|
|
80
|
-
this.left = data.left
|
|
81
|
-
this.right = data.right
|
|
82
|
-
this.knob = data.knob
|
|
83
|
-
}
|
|
84
|
-
}
|
|
1
|
+
import { readJSONFile, writeJSONFile } from './utils.mjs'
|
|
2
|
+
|
|
3
|
+
export class ApplicationConfig {
|
|
4
|
+
application = 'undefined'
|
|
5
|
+
profiles = []
|
|
6
|
+
|
|
7
|
+
loadFromFile (fileName) {
|
|
8
|
+
console.info(`ApplicationConfig: Loading Config File ${fileName}`)
|
|
9
|
+
const config = readJSONFile(fileName)
|
|
10
|
+
|
|
11
|
+
this.application = config.application
|
|
12
|
+
for (let i = 0; i < config.profiles.length; i++) {
|
|
13
|
+
const profile = new Profile(config.profiles[i])
|
|
14
|
+
this.profiles.push(profile)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class Profile {
|
|
20
|
+
name = ''
|
|
21
|
+
file = ''
|
|
22
|
+
description = ''
|
|
23
|
+
|
|
24
|
+
touch = {}
|
|
25
|
+
knobs = {}
|
|
26
|
+
buttons = {}
|
|
27
|
+
parameters = {}
|
|
28
|
+
#file = ''
|
|
29
|
+
#loaded = false
|
|
30
|
+
#error = false
|
|
31
|
+
|
|
32
|
+
constructor (data) {
|
|
33
|
+
this.name = data.name
|
|
34
|
+
this.#file = data.file
|
|
35
|
+
this.loadFromFile(this.#file)
|
|
36
|
+
if (this.#error) { this.saveToFile(`profile-${this.name}-sav.json`) }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
loadFromFile (fileName) {
|
|
40
|
+
console.info(`ProfileConfig: Loading Config File ${fileName}`)
|
|
41
|
+
const config = readJSONFile(fileName)
|
|
42
|
+
this.#error = (config === undefined)
|
|
43
|
+
this.#loaded = !this.#error
|
|
44
|
+
if (!this.#error && this.#loaded) {
|
|
45
|
+
this.profile = config.profile
|
|
46
|
+
this.description = config.description
|
|
47
|
+
|
|
48
|
+
// Load the Configurations for Touch-Displays
|
|
49
|
+
this.touch = new TouchConfig(config.touch)
|
|
50
|
+
// Load the Configurations for Button-Areas
|
|
51
|
+
this.buttons = config.buttons
|
|
52
|
+
// Load Parameters
|
|
53
|
+
this.parameters = config.parameters
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
saveToFile (fileName) {
|
|
58
|
+
fileName = fileName.toLowerCase()
|
|
59
|
+
|
|
60
|
+
console.info(`ProfileConfig: Save To Config File ${fileName}`)
|
|
61
|
+
writeJSONFile(fileName, this)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Class that handles the different configs for the touch displays of the device covering Loupedeck Live (without knob) and also CT (with knob)
|
|
67
|
+
*/
|
|
68
|
+
class TouchConfig {
|
|
69
|
+
center = {} // CENTER Display Config - Available in CT & LIVE
|
|
70
|
+
left = {} // LEFT Display Config - Available in CT & LIVE
|
|
71
|
+
right = {} // RIGHT Display Config - Available in CT & LIVE
|
|
72
|
+
knob = {} // KNOB Display Config - Available only in CT
|
|
73
|
+
|
|
74
|
+
constructor (data) {
|
|
75
|
+
this.loadFromJSON(data)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
loadFromJSON (data) {
|
|
79
|
+
this.center = data.center
|
|
80
|
+
this.left = data.left
|
|
81
|
+
this.right = data.right
|
|
82
|
+
this.knob = data.knob
|
|
83
|
+
}
|
|
84
|
+
}
|