session: reduce indentation to 2 spaces (#350)

This commit is contained in:
jean-emmanuel 2018-08-05 13:37:05 +02:00
parent f5d838f173
commit 204130c7a9
7 changed files with 6561 additions and 6492 deletions

View file

@ -8,6 +8,8 @@
- loading a state file doesn't replace the quick save slot anymore
- widgets
- **new** `script` widget
- misc
- reduced session file size (indentation set to 2 instead of 4)
## 0.34.4

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,146 +1,158 @@
[
{
"type": "root",
"tabs": [
{
"type": "tab",
"id": "tab_1",
"label": "auto",
"color": "auto",
"css": "",
"layout": "",
"spacing": 0,
"value": "",
"precision": 0,
"address": "/tab_1",
"preArgs": [],
"target": [],
"variables": "@{parent.variables}",
"widgets": [
{
"type": "keys",
"top": 300,
"left": 0,
"id": "keys_1",
"width": "auto",
"height": "auto",
"label": "auto",
"color": "auto",
"css": "",
"binding": [
"r",
"f"
],
"keydown": "# this is a comment\nx = key == \"r\" ? 0.1 : -0.1;\nvalue + x",
"repeat": true,
"widgetId": "fader_1",
"keyup": ""
},
{
"type": "fader",
"top": 0,
"left": 0,
"id": "fader_1",
"linkId": "",
"width": "auto",
"height": "auto",
"label": "auto",
"color": "auto",
"css": "",
"horizontal": false,
"alignRight": false,
"pips": true,
"input": true,
"meter": false,
"compact": false,
"dashed": false,
"snap": false,
"spring": false,
"doubleTap": false,
"range": {
"min": 0,
"max": 1
},
"logScale": false,
"unit": "",
"origin": "auto",
"value": "",
"precision": 2,
"address": "/fader_1",
"touchAddress": "",
"meterAddress": "",
"preArgs": [],
"target": []
},
{
"type": "xy",
"top": 50,
"left": 170,
"id": "xy_1",
"linkId": "",
"width": 210,
"height": 220,
"label": "auto",
"color": "auto",
"css": "",
"input": true,
"pips": true,
"pointSize": 20,
"snap": false,
"spring": false,
"doubleTap": false,
"rangeX": {
"min": 0,
"max": 1
},
"rangeY": {
"min": 0,
"max": 1
},
"logScaleX": false,
"logScaleY": false,
"value": "",
"precision": 2,
"address": "/xy_1",
"touchAddress": "",
"preArgs": [],
"split": false,
"target": []
},
{
"type": "keys",
"top": 270,
"left": 170,
"id": "keys_2",
"width": 210,
"height": "auto",
"label": "auto",
"color": "auto",
"css": "",
"binding": [
"g",
"t"
],
"widgetId": "xy_1",
"keydown": "x = key == \"t\" ? 0.1 : -0.1;\nvalue[0] + x\nvalue[1] + x\n# value + 0.1 works too",
"keyup": "",
"repeat": false
}
],
"tabs": [],
"scroll": true
}
],
{
"type": "root",
"tabs": [
{
"type": "tab",
"id": "tab_1",
"label": "auto",
"color": "auto",
"css": "",
"layout": "",
"spacing": 0,
"value": "",
"precision": 0,
"address": "/root",
"address": "/tab_1",
"preArgs": [],
"target": [],
"variables": {},
"id": "root",
"scroll": true,
"label": false
}
"variables": "@{parent.variables}",
"widgets": [
{
"type": "keys",
"top": 300,
"left": 0,
"id": "keys_1",
"width": "auto",
"height": "auto",
"label": "auto",
"color": "auto",
"css": "",
"binding": [
"r",
"f"
],
"keydown": "# this is a comment\nx = key == \"r\" ? 0.1 : -0.1;\nvalue + x",
"repeat": true,
"widgetId": "fader_1",
"keyup": "",
"linkId": ""
},
{
"type": "fader",
"top": 0,
"left": 0,
"id": "fader_1",
"linkId": "",
"width": "auto",
"height": "auto",
"label": "auto",
"color": "auto",
"css": "",
"horizontal": false,
"alignRight": false,
"pips": true,
"input": true,
"meter": false,
"compact": false,
"dashed": false,
"snap": false,
"spring": false,
"doubleTap": false,
"range": {
"min": 0,
"max": 1
},
"logScale": false,
"unit": "",
"origin": "auto",
"value": "",
"precision": 2,
"address": "/fader_1",
"touchAddress": "",
"meterAddress": "",
"preArgs": [],
"target": [],
"default": "",
"bypass": false
},
{
"type": "xy",
"top": 50,
"left": 170,
"id": "xy_1",
"linkId": "",
"width": 210,
"height": 220,
"label": "auto",
"color": "auto",
"css": "",
"input": true,
"pips": true,
"pointSize": 20,
"snap": false,
"spring": false,
"doubleTap": false,
"rangeX": {
"min": 0,
"max": 1
},
"rangeY": {
"min": 0,
"max": 1
},
"logScaleX": false,
"logScaleY": false,
"value": "",
"precision": 2,
"address": "/xy_1",
"touchAddress": "",
"preArgs": [],
"split": false,
"target": [],
"default": "",
"bypass": false
},
{
"type": "keys",
"top": 270,
"left": 170,
"id": "keys_2",
"width": 210,
"height": "auto",
"label": "auto",
"color": "auto",
"css": "",
"binding": [
"g",
"t"
],
"widgetId": "xy_1",
"keydown": "x = key == \"t\" ? 0.1 : -0.1;\nvalue[0] + x\nvalue[1] + x\n# value + 0.1 works too",
"keyup": "",
"repeat": false,
"linkId": ""
}
],
"tabs": [],
"linkId": "",
"default": "",
"bypass": false,
"scroll": true
}
],
"color": "auto",
"css": "",
"value": "",
"precision": 0,
"address": "/root",
"preArgs": [],
"target": [],
"variables": {},
"id": "root",
"linkId": "",
"default": "",
"bypass": false,
"scroll": true,
"label": false
}
]

View file

@ -1,89 +1,89 @@
[
{
"type": "root",
"tabs": [
{
"type": "tab",
"id": "tab_1",
"linkId": "",
"label": "Rgb Levels",
"color": "auto",
"css": "",
"layout": "",
"spacing": 0,
"default": "",
"value": "",
"precision": 0,
"address": "/tab_1",
"preArgs": [],
"target": [],
"bypass": false,
"variables": "@{parent.variables}",
"widgets": [
{
"type": "svg",
"top": 150,
"left": 0,
"id": "rgb_svg",
"linkId": "",
"width": "100%",
"height": 190,
"label": "auto",
"color": "auto",
"css": "path {\n fill:none;\n stroke-width:3rem\n}",
"svg": "#{\n\n# build the data array\n# [ [r,g,b], [r,g,b], [r,g,b], etc ]\ndata = @{rgb_matrix};\n\n# extract channels and convert to relative y-axis coordinates\n# assuming the y-range is 0-255\n# 96 - val * 94 for padding and y-axis reversal\n# we add a small offset to make sure the 3 lines are always visible\n\nred = 96 - flatten(data[0:end,0]) / 255 * 94 + 2;\ngreen = 96 - flatten(data[0:end,1]) / 255 * 94;\nblue = 96 - flatten(data[0:end,2]) / 255 * 94 - 2;\n\n# build the x-axis relative coordinates array\n\nlength = size(red)[0]\nxaxis = (0:length) / (length-1) * 100;\n\n\n# convert coords to svg path string\nsvgCoords(color) = map(color, f(c,i)=print(\"L$0%x $1%y\", [xaxis[i], c]));\n\n# svg path first command must be \"M\", not \"L\" \nsvgString(color) = concat(\"M\", unpack(svgCoords(color))[1:end]);\n\n}\n\n\n<path stroke=\"red\" d=\"#{svgString(red)}\" />\n<path stroke=\"lime\" d=\"#{svgString(green)}\" />\n<path stroke=\"blue\" d=\"#{svgString(blue)}\" />",
"preArgs": [],
"address": "/rgb_svg"
},
{
"type": "matrix",
"top": 0,
"left": 0,
"id": "rgb_matrix",
"width": "100.60%",
"height": 150,
"label": "auto",
"color": "auto",
"css": "",
"widgetType": "rgb",
"matrix": [
8,
1
],
"start": 0,
"spacing": 0,
"traversing": false,
"borders": false,
"props": {
"input": false,
"label": false
},
"default": "",
"value": "",
"precision": 2,
"address": "/matrix_1",
"preArgs": [],
"target": [],
"bypass": false
}
],
"tabs": [],
"scroll": true
}
],
"id": "root",
{
"type": "root",
"tabs": [
{
"type": "tab",
"id": "tab_1",
"linkId": "",
"label": "Rgb Levels",
"color": "auto",
"css": "",
"layout": "",
"spacing": 0,
"default": "",
"value": "",
"precision": 0,
"address": "/root",
"address": "/tab_1",
"preArgs": [],
"target": [],
"bypass": false,
"variables": {},
"scroll": true,
"label": false
}
"variables": "@{parent.variables}",
"widgets": [
{
"type": "svg",
"top": 150,
"left": 0,
"id": "rgb_svg",
"linkId": "",
"width": "100%",
"height": 190,
"label": "auto",
"color": "auto",
"css": "path {\n fill:none;\n stroke-width:3rem\n}",
"svg": "#{\n\n# build the data array\n# [ [r,g,b], [r,g,b], [r,g,b], etc ]\ndata = @{rgb_matrix};\n\n# extract channels and convert to relative y-axis coordinates\n# assuming the y-range is 0-255\n# 96 - val * 94 for padding and y-axis reversal\n# we add a small offset to make sure the 3 lines are always visible\n\nred = 96 - flatten(data[0:end,0]) / 255 * 94 + 2;\ngreen = 96 - flatten(data[0:end,1]) / 255 * 94;\nblue = 96 - flatten(data[0:end,2]) / 255 * 94 - 2;\n\n# build the x-axis relative coordinates array\n\nlength = size(red)[0]\nxaxis = (0:length) / (length-1) * 100;\n\n\n# convert coords to svg path string\nsvgCoords(color) = map(color, f(c,i)=print(\"L$0%x $1%y\", [xaxis[i], c]));\n\n# svg path first command must be \"M\", not \"L\" \nsvgString(color) = concat(\"M\", unpack(svgCoords(color))[1:end]);\n\n}\n\n\n<path stroke=\"red\" d=\"#{svgString(red)}\" />\n<path stroke=\"lime\" d=\"#{svgString(green)}\" />\n<path stroke=\"blue\" d=\"#{svgString(blue)}\" />",
"preArgs": [],
"address": "/rgb_svg"
},
{
"type": "matrix",
"top": 0,
"left": 0,
"id": "rgb_matrix",
"width": "100.60%",
"height": 150,
"label": "auto",
"color": "auto",
"css": "",
"widgetType": "rgb",
"matrix": [
8,
1
],
"start": 0,
"spacing": 0,
"traversing": false,
"borders": false,
"props": {
"input": false,
"label": false
},
"default": "",
"value": "",
"precision": 2,
"address": "/matrix_1",
"preArgs": [],
"target": [],
"bypass": false
}
],
"tabs": [],
"scroll": true
}
],
"id": "root",
"linkId": "",
"color": "auto",
"css": "",
"default": "",
"value": "",
"precision": 0,
"address": "/root",
"preArgs": [],
"target": [],
"bypass": false,
"variables": {},
"scroll": true,
"label": false
}
]

File diff suppressed because it is too large Load diff

View file

@ -86,7 +86,7 @@ var SessionManager = class SessionManager {
save() {
var sessionfile = JSON.stringify(this.session,null,' '),
var sessionfile = JSON.stringify(this.session,null,' '),
blob = new Blob([sessionfile],{type : 'application/json'})
saveAs(blob, new Date().toJSON().slice(0,10)+'_'+new Date().toJSON().slice(11,16) + '.json')