diff --git a/.babelrc b/.babelrc
index ed78db7e..38bd35ed 100644
--- a/.babelrc
+++ b/.babelrc
@@ -1,11 +1,11 @@
{
"presets": [
- ["env", {
+ ["@babel/env", {
"targets": {
"ios": "9.3",
"chrome": "50"
}
}]
],
- "plugins": ["transform-object-rest-spread"]
+ "plugins": ["@babel/plugin-proposal-object-rest-spread"]
}
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 00000000..e54938f4
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1 @@
+jquery.*.js
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 00000000..faf7c80e
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,62 @@
+{
+ "env": {
+ "es6": true,
+ "browser": true,
+ "node": true
+ },
+ "extends": "eslint:recommended",
+ "parserOptions": {
+ "sourceType": "module",
+ "ecmaFeatures": {
+ "experimentalObjectRestSpread": true
+ }
+ },
+ "rules": {
+ "no-console": "off",
+ "no-undef": "off",
+ "no-useless-escape": "off",
+ "no-self-assign": "off",
+ "no-empty": [
+ "error",
+ {
+ "allowEmptyCatch": true
+ }
+ ],
+ "no-unused-vars": [
+ "error",
+ {
+ "args": "none"
+ }
+ ],
+ "space-before-function-paren": [
+ "error",
+ "never"
+ ],
+ "indent": [
+ "error",
+ 4,
+ {
+ "SwitchCase": 1,
+ "ObjectExpression": 1,
+ "ArrayExpression": 1,
+ "MemberExpression": "off",
+ "ignoredNodes": ["ConditionalExpression"]
+ }
+ ],
+ "linebreak-style": [
+ "error",
+ "unix"
+ ],
+ "quotes": [
+ "error",
+ "single"
+ ],
+ "semi": [
+ "error",
+ "never"
+ ]
+ },
+ "globals": {
+ "module": true
+ }
+}
diff --git a/.gitignore b/.gitignore
index 42024fd2..fa09066c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,10 @@
node_modules
dist
-app/browser/styles.css
-app/browser/scripts.js
-app/browser/scripts.js.map
-app/browser/favicon.ico
+app/LICENSE
+app/assets/*.css*
+app/assets/*.png
+app/client/*.js*
+app/launcher/*.js*
+app/server/*.js*
+app/package.json
+package-lock.json
diff --git a/.travis.yml b/.travis.yml
index 15ebcf6e..c3e8a24b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,11 +2,11 @@ anHsudo: required
dist: trusty
language: node_js
node_js:
- - "6"
+ - "9"
before_install:
- sudo dpkg --add-architecture i386
- sudo apt-get update -qq
- - sudo apt-get install -qq wine fakeroot
+ - sudo apt-get install -qq wine fakeroot xvfb
install: npm install
before_deploy:
deploy:
@@ -20,7 +20,9 @@ deploy:
tags: true
before_deploy:
- export VERSION=$(sed -nE 's/^\s*"version":\ "(.*?)",$/\1/p' package.json)
- - npm run build
+ - npm run package -- --all
+ - npm run package -- --rpi
+ - npm run package-node
- npm run deb32
- npm run deb64
- npm run debarm
@@ -29,18 +31,20 @@ before_deploy:
- mv open-stage-control-linux-ia32/*.deb packages/open-stage-control-${VERSION}-i386.deb
- mv open-stage-control-linux-x64/*.deb packages/open-stage-control-${VERSION}-amd64.deb
- mv open-stage-control-linux-armv7l/*.deb packages/open-stage-control-${VERSION}-armv7l.deb
+ - mv open-stage-control-node open-stage-control-${VERSION}-node
- mv open-stage-control-win32-ia32 open-stage-control-${VERSION}-win32-ia32
- mv open-stage-control-win32-x64 open-stage-control-${VERSION}-win32-x64
- mv open-stage-control-linux-ia32 open-stage-control-${VERSION}-linux-ia32
- mv open-stage-control-linux-x64 open-stage-control-${VERSION}-linux-x64
- mv open-stage-control-linux-armv7l open-stage-control-${VERSION}-linux-armv7l
- - mv open-stage-control-linux-arm64 open-stage-control-${VERSION}-linux-arm64
+ # - mv open-stage-control-linux-arm64 open-stage-control-${VERSION}-linux-arm64
- zip -q -r --symlinks packages/open-stage-control-${VERSION}-osx.zip open-stage-control-darwin-x64/open-stage-control.app
+ - zip -q -r packages/open-stage-control-${VERSION}-node.zip open-stage-control-${VERSION}-node
- zip -q -r packages/open-stage-control-${VERSION}-win32-ia32.zip open-stage-control-${VERSION}-win32-ia32
- zip -q -r packages/open-stage-control-${VERSION}-win32-x64.zip open-stage-control-${VERSION}-win32-x64
- zip -q -r packages/open-stage-control-${VERSION}-linux-ia32.zip open-stage-control-${VERSION}-linux-ia32
- zip -q -r packages/open-stage-control-${VERSION}-linux-x64.zip open-stage-control-${VERSION}-linux-x64
- zip -q -r packages/open-stage-control-${VERSION}-linux-armv7l.zip open-stage-control-${VERSION}-linux-armv7l
- - zip -q -r packages/open-stage-control-${VERSION}-linux-arm64.zip open-stage-control-${VERSION}-linux-arm64
+ # - zip -q -r packages/open-stage-control-${VERSION}-linux-arm64.zip open-stage-control-${VERSION}-linux-arm64
- ls packages
- cd ..
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b843c1c..2e57eaa7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,593 @@
# Changelog
+## 0.39.3
+
+- bug fixes
+ - broken tabs color property
+ - broken `/TABS` command; this command doesn't makes panels send osc messages anymore
+
+## 0.39.2
+
+- bug fixes
+ - regresssion: broken --theme option
+ - regression: missing 'edit parent' action in editor's context menu
+
+## 0.39.1
+
+- bug fixes
+ - regression breaking icons in switches' labels
+
+## 0.39.0
+
+- performance
+ - rendering speed improved (session loading time reduced by about 30%)
+- widgets
+ - remove support for deprecated properties `path`, `noPip` and `noSync`
+ - sliders/pads: `precision` is no longer a dynamic property
+
+## 0.38.7
+
+- bug fixes
+ - launcher compatibility issues with electron v3
+
+## 0.38.6
+
+- bug fixes
+ - regression with dynamic property `color` in panels and matrices
+- packaging
+ - node-only package can be run with electron too
+
+## 0.38.5
+
+- packaging
+ - regression causing the client js bundle to be much bigger than needed
+ - added node-only package built without electron for unsupported platforms (armv6, etc)
+
+## 0.38.4
+
+- bug fixes
+ - `@{parent}` calls not working consistently in clone widgets
+ - `slider/pads`: inteverted ranges not working
+ - fix `doubleTap` for sliders with `snap` set to `true`
+ - undo/redo errors
+- widgets
+ - 1-level nested property inheritance calls (`@{id_@{id_2}}`) are now updated dynamically
+ - support special css property `class` for adding custom classes to widgets
+ - added "smart" traversing gestures mode that limits affected widgets by the type of the first touched widget
+ - root: added `traversing` property
+- editor
+ - major performance improvements (containers' children are reused whenever possible instead of being recreated)
+ - removed widget deletion confirmation popup
+ - properties categories can now be folded
+ - added keyboard shortcut `F2` for editing the label quickly
+ - added keyboard shortcut `mod + s` for saving the session
+ - added keyboard shortcut `mod + o` for opening a session
+ - use `backspace` instead of `delete` for deleting widgets on MacOs
+ - added keyboard shortcut `mod + e` for enabling / disabling the editor
+ - added keyboard shortcuts `mod + arrows` for selecting widgets
+ - added keyboard shortcut `mod + a` for selecting a widget's siblings and itself
+ - added keyboard shortcut `mod + shift + a` for cancelling selection
+ - added multi widget selection with mouse when `shift` is pressed
+ - right-click doesn't modify current selection when `mod` or `shift` is pressed
+- formulas
+ - added `extend(x, y)` function for merging two objects
+ - objects' closing brackets (`}`) don't need to be escaped with a backslash anymore
+ - show property's computed value in the help popup
+
+## 0.37.4
+
+- bug fixes
+ - osc receivers (`OSC{}`) not working in non-dynamic properties
+- remote control
+ - added `/GET/#` to get a widget's value without using `/GET` as reply address
+
+## 0.37.3
+
+- bug fixes
+ - gyroscope: osc sendings not properly triggered on value updates
+
+
+## 0.37.2
+
+- bug fixes
+ - osc: regression making empty `preArgs` count as one empty string argument
+
+## 0.37.1
+
+- bug fixes
+ - closing popups when clicking precisely on the "x"
+- translations
+ - fr: corrections
+ - ru: added russian translation
+
+## 0.37.0
+
+- bug fixes
+ - editor: opening the sidepanel doesn't select the root widget anymore
+ - ios: fix `doubleTap`
+- widgets
+ - **new** `gyroscope` widget
+ - **new** `frame` widget
+ - **breaking change** in `panel`: dropped Visual Format Language support (`layout` and `spacing` properties)
+ - maths: added `timestamp()` function
+- editor
+ - widget property names can be clicked to show documentation
+- misc
+ - the client app can be translated (https://github.com/jean-emmanuel/open-stage-control/issues/302)
+
+## 0.36.0
+
+- bug fixes
+ - `linkId` synchronizations now correctly trigger property updates
+ - widgets with multiple `linkId` are now properly handled
+ - synchronization issue between `visualizer` widgets
+- widgets
+ - `keys` (**breaking changes**): formulas in `keydown` and `keyup` must be explicitely written using the `#{}` syntax; variable `value` got removed from these formulas context (use `@{this}` instead); removed `widgetId` property, the value emitted by the widget on keypress events can be linked with other widgets via the `linkId` property or the property inheritance syntax;
+ - `visualizer`: update rate set to default canvas framerate
+- editor
+ - **new** keyboard shortcuts (undo, redo, copy, paste, etc)
+
+## 0.35.0
+
+- main
+ - added `--state` option for loading a state file with a session file
+- state
+ - 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
+
+- bug fixes
+ - widgets: dynamic `address` when `split` is `true`
+ - strip: missing osc properties (`address` and `preArgs`) for remote control
+ - switcher: update linked widgets' osc properties before sending if they depend on the switcher's value
+
+## 0.34.3
+
+- bug fixes
+ - launcher: regression breaking the `port` option
+
+## 0.34.2
+
+- bug fixes
+ - matrices: spacing issue when wrapped in strips
+ - launcher: regression preventing options to be applied
+
+## 0.34.1
+
+- bug fixes
+ - switch: display object-values properly when `showValues` is set to `true`
+ - prevent non-dynamic properties updates from breaking an osc sending event chain
+- deprecations
+ - `formula` has been removed from the editor's context menu
+- custom module
+ - expose `app` to the custom module's scope: an event emitter for monitoring the events sent by the different clients
+- misc
+ - fixed rpi build
+
+## 0.33.3
+
+- bug fixes
+ - matrix: recreation loop issue with matrices of clones
+ - multixy: glitch when some letters are used in the points' labels
+
+## 0.33.2
+
+- bug fixes
+ - matrix: set initial value at widget's creation; missing border under widget's label
+- widgets
+ - property math syntax: add `values()` and `keys()` functions
+
+## 0.33.1
+
+- bug fixes
+ - widgets: remove unnused properties to avoid having hidden properties laying around when the type changes (especially dangerous when those properties where linked to other widgets)
+
+## 0.33.0
+
+- bug fixes
+ - osc receivers: unregister properly when widgets are recreated (memory leak); allow non-string values (eg. objects)
+ - circular property update issues
+- widgets
+ - **new** generic `matrix` widget
+ - fader: restore right-click focusing the input in compact mode (mouse only)
+
+## 0.32.6
+
+- bug fixes
+ - css border-radius not applying correctly for some widgets
+- themes
+ - multiple adjustments
+
+## 0.32.5
+
+- bug fixes
+ - missing feedback support for widgets with typed preArgs
+- themes
+ - improved `dark` theme
+ - added `flat`
+
+## 0.32.4
+
+- bug fixes
+ - regression breaking typed osc args
+
+
+## 0.32.3
+
+- bug fixes
+ - regression in editor/resize function
+
+## 0.32.2
+
+- bug fixes
+ - sliders colors not displayed correctly on iOS
+- widgets
+ - xy: tiny knob style change
+- editor
+ - reallow editing disabled properties
+
+## 0.32.1
+
+- bug fixes
+ - error in osc receivers
+
+## 0.32.0
+
+- main
+ - add tcp support
+
+## 0.31.0
+
+- bug fixes
+ - regression breaking multitouch widgets
+- widgets
+ - fader/knob/pad: right-click / long tap doesn't give focus to the input anymore
+
+## 0.30.4
+
+- bug fixes
+ - regression breaking touch traversing gestures
+ - clone widgets becomming unselectable for edition
+ - `preArgs` property still being coerced to an array
+
+## 0.30.3
+
+- bug fixes
+ - big regression breaking many touch gestures
+
+## 0.30.2
+
+- bug fixes
+ - broken remote-control /TABS command
+ - disabled `spacing` property in strips
+ - disabled properties in modals
+ - broken arm build
+
+
+## 0.30.1
+
+- midi
+ - prevent the main process from exiting when MIDI setup fails
+
+## 0.30.0
+
+- widgets
+ - `target` and `preArgs` properties are no longer coerced to arrays and can be written as single string values
+ - `linkId` supports master and slave modes with `>>` and `<<` prefixes
+ - the special `target` token `null` can now be used in conjunction with regular targets, it disables the default global targets set via the `--send` option
+- editor
+ - disabled widget properties are now greyed out
+
+## 0.29.2
+
+- bug fixes
+ - launcher: parsing errors are not fatal anymore
+ - css parsing error on iOS
+
+## 0.29.1
+
+- bug fixes
+ - editor: "wrap" deleting the widget just before the one being wrapped
+ - regression breaking traversing gestures and high precision gestures (0.29.0)
+- server
+ - allow sending osc to broadcast ip addresses
+- widgets
+ - limited support for property inheritance nesting (`@{id_@{id_2}}`)
+ - support using property inheritance syntax in osc listeners' addresses
+
+## 0.29.0
+
+- beaking changes
+ - dropped supported for `.js` sessions (deprecated in 0.20.0)
+- bug fixes
+ - zeroconf: unpublish when shutting down
+ - ios 9.3 compatibility issue
+ - function mispelling in rgb widget
+- widgets
+ - modal: added `popupLeft` and `popupTop` properties
+ - faders/meter: add css variable `--gauge-opacity` to allow setting a fixed gauge opacity for meters and compact faders
+- custom module
+ - messages converted from midi inputs can be filtered
+
+
+## 0.28.3
+
+- bug fixes
+ - widgets not correctly drawn when hidden/shown with dynamic css
+ - iOS: file upload failing sometimes
+- widgets
+ - knob: small design improvements (pips don't take extra space anymore)
+
+## 0.28.2
+
+- bug fixes
+ - session list: fix "remove from history" always removing the first item in the list
+- custom module
+ - expose `setInterval`
+ - expose `clearTimeout` and `clearInterval`
+ - prevent errors when failing to run the module
+
+
+## 0.28.1
+
+- bug fixes
+ - regression in nested clones structures handling
+
+
+## 0.28.0
+
+- widgets
+ - matrices: support setting `split` property as a string to allow using children's indexes in their address (`$` is replaced with the index number)
+ - text: `wrap` property doesn't break words by default anymore
+ - rgb: added `range` property
+- launcher
+ - right-click context menu (copy, paste, clear console, toggle console autoscoll, relaunch app)
+ - better font for the console
+
+## 0.27.2
+
+- bug fixes
+ - session/state file upload sometimes failing silently
+ - regression breaking the app for iOS
+
+## 0.27.1
+
+- bug fixes
+ - error when resizing a widget and its clone(s) at the same time
+ - error with non string css property
+ - session list not reappearing when failing to load
+ - broken state file loading
+- misc
+ - added a loading indicator when uploading a session file or a state file
+
+## 0.27.0
+
+- bug fixes
+ - strip: nested strips were inheriting their parent's `spacing`
+ - modal: prevent error when retrieving a child's property
+ - modal: prevent touch event from affecting elements behind the popup when closing it
+ - clone: some properies in target widget were not applied to the clone
+ - clone: prevent clone from resetting its target value when created
+ - text: vertical centering issues in narrow widgets
+ - dynamic properties: when using a widget's own value to determine its osc settings, these are checked and updated if needed before sending the message
+ - prevent error when loading a session containing invalid property inheritance calls
+ - broken build for iOS 9.3
+- editor
+ - wrap in: insert wrapper at selected widget's index
+ - wrap in: set label to false by default when wrapping in a strip or a panel
+ - css property `pointer-events:none;` is now ignored when the editor is enabled
+ - preverve pecentages when dragging/resizing a widget that has its position/size written in percents
+- widgets
+ - **new** `OSC{/address, default_value}` syntax
+- ui
+ - sidepanel is now resizable
+- themes
+ - `responsive-fonts`: increase size for big screens
+- build
+ - dropped support for node < 4.8
+
+## 0.26.3
+
+- bug fixes
+ - ios: broken default accent color in clone Widgets
+ - ios/android: closing the sidepanel opened the tab next to the menu button
+- editor
+ - mac: use `shift` instead of `command` for multi widget selection to match native behaviour and prevent unwanted zoom with trackpads
+- widgets
+ - strip: `spacing` now accepts percents
+
+## 0.26.2
+
+- bug fixes
+ - regression preventing glass effect from using the widget's color
+ - missing last key in keyboard widget
+ - editor: select parent widget after deleting a widget
+ - regression letting user to scroll the main document
+ - editor: wrap/cut/delete multiple widget not working properly
+- widgets
+ - text: set line-height relative to font size
+ - meter: added `gradient` feature
+
+## 0.26.1
+
+- bug fixes
+ - ios: text input fields not editable
+- editor
+ - mac: use `command` instead of `ctrl` for multi widget selection
+
+## 0.26.0
+
+- bug fixes
+ - editor: when selecting another widget while editing a property, changes where applied to the newly selected widget
+ - widgets: css: @media queries parsing
+ - prevent some errors when synchronizing clients
+ - use command key instead of ctrl for zooming on mac
+ - clone: memory leak / freeze
+- default client
+ - mac: disabled unsupported pinch zoom
+- themes
+ - alt-buttons: modal font-weight & color fix; push button active state colored border
+ - added "responsive-fonts" theme
+- editor
+ - allow multi widget resizing/dragging
+ - tweaked ctrl+click/right-click selection behaviors
+ - **new** "Wrap in" context menu
+
+
+## 0.25.0
+
+- bug fixes
+ - launcher: parse array options correctly when an item contains spaces,
+ - launcher: the terminal now grows and scrolls to bottom automatically
+ - editor: broken children reordering; children
+ list display bug with long `id`s
+- main
+ - add `--fullscreen` switch (default gui only, bypasses the sidepanel fullscreen button)
+ - added/updated some themes: `orange`, `light`, `dark`, `alt-buttons` (the latter can be combined with other themes)
+- widgets
+ - knob: big knobs design tweaks
+ - **new** `default` property that sets a widgets initial/doubleTap/spring value. The `value` property does no longer serve this purpose.
+ - **new** `bypass` property that disable osc messages (except when requested via `/GET` and `/EDIT/GET`)
+ - panel: **removed** `noSync` property (backward compatible fallback to `bypass`)
+ - property inheritance: `@{widget_id.value}`, `@{widget_id}` and `@{widget_id._value}` now all refer to the widget's current value (the latter being kept for backward compatibility); If a property update triggers an osc message, it will now be sent after the other dynamic properties changes are resolved (such as osc `address`, `target`, etc)
+ - text: added `align` and `wrap` properties
+ - input: added `align` property
+ - sliders/xy: `doubleTap` can be an osc address to send a special message instead of resetting the widget's value
+- editor
+ - allow selecting multiple widgets (`ctrl + click`) if they share the same parent. Context-menu and sidepanel editing actions apply to all selected widgets
+
+## 0.24.3
+
+- bug fixes
+ - property maths: variables names declared in a formula were replaced by their associated value if found in the formula's result
+ - missing console logs on windows
+- ui
+ - add iOS fullscreen support via add-to-home feature
+- editor
+ - ask for confirmation when closing or refreshing the page if the editor has been enabled at least once
+ - prevent default widget interaction when selecting a widget for edition
+- widgets
+ - knob: small design tweaks
+- misc
+ - remove proprietary ffmepg codec from package
+
+## 0.24.2
+
+- bug fixes
+ - macOs app menu & shortcuts
+
+## 0.24.1
+
+- bug fixes
+ - server/client communication errors
+ - prevent error windows from spawning
+- main
+ - added some menu items on macOs (including "Quit" !)
+
+## 0.24.0
+
+:warning: **BREAKING CHANGES** :warning:
+
+Read the changelog carefully, old sessions files are likely to need some adjustements to work as they used to. Plots and input widgets had their `widgetId` option removed because it was redundant with the generic `linkId` property.
+
+- bug fixes
+ - regression preventing dropdown to display no option selected
+ - crossfaders display issue on iOS
+ - restored compatibility options for server-client communications
+ - xy: `doubleTap` option
+ - range: `spring` option
+ - plot: crash when drawing only one point
+ - widget css: fixed @media queries @keyframes parsings
+- main
+ - theme files changes are automatically applied
+ - server-client communication system rewritten -> HUGE latency reduction and stability improvement especially under stress conditions
+ - engine update (electron@1.8.2)
+- widgets
+ - **new** svg plot widget
+ - switch: wrap non-array `values` property in an array
+ - dropdown: wrap non-array `values` property in an array; always add a default empty value
+ - property inheritance: added shorthand default to `_value` when no property is specified (`@{widgetId}`); some properties can now be dynamically changed without recreating the widget entirely
+ - property maths: added support for math expressions everywhere via `#{}`
+ - input: add glass effect when `editable` is `false`
+ - `linkId` can now be set as an array of linkIds
+ - plot: added `dots` options; **removed** `points` options (use `value` and property inheritance instead)
+ - eq: **removed** `filters` options (use `value` and property inheritance instead)
+ - plot/meter/led/rgbled/text: **removed** `widgetId` option
+ - input: **removed** `widgetId` option
+ - math: **deprecated** `formula` widget
+
+## 0.23.1
+
+- bug fixes
+ - regression breaking modal's position in scrolled tab containers
+ - widget with a `touchAddress` set now send their touch-off message when removed or recreated while being interacted with
+ - broken windows builds (long path issue)
+
+## 0.23.0
+
+- bug fixes
+ - plots now send their value to other widget for synchronization as expected
+ - text widgets now apply their target widget's precision
+ - property inheritance accepts targetting a parent widget by its id
+ - multiple icons not displayed correctly
+ - broken `--blank` option
+- main
+ - added `--disable-gpu` option for disabling hardware acceleration (fixes rendering glitches and reduces input lag on some systems)
+- widgets
+ - inputs: **new** `keys` widget, for keyboard bindings
+ - property inheritance: new special property name `_value` (retrieve the widget's value, and update when it changes)
+ - switch: added `showValues` to display both values and labels in the buttons; array values can now be selected via osc
+ - range: both handles can be moved by holding `shift` while dragging
+ - rgb: **removed** `touchAddress` option
+ - labels/texts: multiple white spaces are no longer merged
+ - plot: can receive stringified arrays of coordinates or stringified objects for merging coordinates sets; added `bars` option for drawing barcharts;
+ - widgets' `precision` option allows setting a specific data type for numbers (sliders can send doubles !)
+- misc
+ - event system rewritten
+ - js build size reduced
+
+## 0.22.0
+
+- bug fixes
+ - sessions opened from command line with relative paths are now added to the history with their absolute path
+ - sending an empty message to a `text` widget resets it to its initial value and without ignoring its `value` property
+ - sending no value to a widget with `preArgs` is now possible : all the arguments found in incomming osc messages are now taken into account to match the widgets in the session
+ - regression breaking state quicksave from sidepanel
+- engine
+ - downgraded to the latest *stable* electron release
+- main
+ - added `zeroconf` / `bonjour` publishing for the app's http and osc input ports
+ - added `--instance-name` option to differenciate mulitple instances in zeroconf networks
+- widgets
+ - sliders/pads: holding `Ctrl` now enables high precision dragging with the mouse and bypasses the `snap` option
+ - inputs: renamed `input`'s property `horizontal` to `vertical` to match how the widget actually displays
+ - sliders: **new** `range` widget
+ - plots: **new** `image` widget
+- remote control
+ - **removed** deprecated `/EXEC`
+ - renamed `/EDIT_SOFT` to `/EDIT/MERGE`
+ - added `/EDIT/GET` (get a widget's data)
+ - added `/GET` (get a widget's value)
+ - added `/SET` (set a widget's value as if it was interacted with from the interface)
+
+
+## 0.21.3
+
+- bug fixes
+ - session/state: regression (0.21.2) breaking save-to-file function
+- ui
+ - FontAwesome 5 (icon font) !
+
## 0.21.2
- bug fixes
- cli: broken long flag `--no-gui`
- headless: when running with `node`, errors don't stop the server; when running with `electron` (default), errors are logged in the console instead of being showed in a dialog window
- - switcher widgets regression (broken)
+ - switcher widgets regression (broken)
- midi
- float values are now allowed and automatically rounded
- misc
diff --git a/README.md b/README.md
index bbd178ab..a51f68cc 100644
--- a/README.md
+++ b/README.md
@@ -21,31 +21,30 @@
The documentation is located at [osc.ammd.net](http://osc.ammd.net)
-## Features
-
-- multiplatform desktop server application with built-in client interface
-- mouse & multitouch interfaces compatible with **Chrome 50** or later
-- all the widgets you need !
-- built-in live editor
-- clients synchronization
-- deep customization possibilities such as theming and messages filtering
-- *true* control over what the widgets send
-- midi inputs/outputs
-
## Supported platforms
-The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/).
-The only supported client browsers are the one provided with the server and Chrome/Chromium version `50` or later. For iOS devices, the minimal version required is `9.3`.
+The server can run on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/). Clients just need to connect to the server with a compatible browser :
+
+- any system running Chrome/Chromium version `50` or later (Linux, MacOS, Windows, Android, etc)
+- iOS version `9.3` or later
+
+Firefox is *not* supported.
## License & credits
-Copyleft © Jean-Emmanuel @ [AMMD](http://ammd.net) 2017
+Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2018.
+This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license.
+### Dependencies
-This program is a free software released under the GNU/GPL3 license, it relies on the use of several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [socket.io](http://socket.io), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [source-map](https://github.com/mozilla/source-map), [mathjs](http://mathjs.org/)
+Open Stage Control relies on several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [babel](http://babeljs.io/), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [stacktracejs](stacktracejs.com), [mathjs](http://mathjs.org/). A comprehensive and up-to-date list can be found [here](https://github.com/jean-emmanuel/open-stage-control/network/dependencies).
+
+### Contributors
+
+https://github.com/jean-emmanuel/open-stage-control/graphs/contributors
----
-
+
-BrowserStack helps debugging Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows, how awesome is that ? *Quite very much indeed !*
+BrowserStack supports Open Stage Control by providing a complete suite of browser emulators for Android, iOS and Windows.
diff --git a/app/LICENSE b/app/LICENSE
deleted file mode 100644
index 94a9ed02..00000000
--- a/app/LICENSE
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- Copyright (C)
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-.
diff --git a/app/assets/fonts/fa-solid-900.woff b/app/assets/fonts/fa-solid-900.woff
new file mode 100644
index 00000000..4cf2a4fe
Binary files /dev/null and b/app/assets/fonts/fa-solid-900.woff differ
diff --git a/app/assets/fonts/fa-solid.css b/app/assets/fonts/fa-solid.css
new file mode 100644
index 00000000..28d2889f
--- /dev/null
+++ b/app/assets/fonts/fa-solid.css
@@ -0,0 +1,14 @@
+/*!
+ * Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+@font-face {
+ font-family: FontAwesome;
+ font-style: normal;
+ font-weight: 900;
+ src: url("./fa-solid-900.woff") format("woff")}
+
+.fa,
+.fas {
+ font-family: FontAwesome;
+ font-weight: 900; }
diff --git a/app/assets/fonts/fontawesome.min.css b/app/assets/fonts/fontawesome.min.css
new file mode 100644
index 00000000..2c97ea00
--- /dev/null
+++ b/app/assets/fonts/fontawesome.min.css
@@ -0,0 +1,5 @@
+/*!
+ * Font Awesome Free 5.0.8 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+.fa,.fab,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:.08em solid #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:a 2s infinite linear;animation:a 2s infinite linear}.fa-pulse{-webkit-animation:a 1s infinite steps(8);animation:a 1s infinite steps(8)}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-horizontal.fa-flip-vertical,.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"}.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-aws:before{content:"\f375"}.fa-backward:before{content:"\f04a"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bicycle:before{content:"\f206"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blind:before{content:"\f29d"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-briefcase:before{content:"\f0b1"}.fa-btc:before{content:"\f15a"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-car:before{content:"\f1b9"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-certificate:before{content:"\f0a3"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-square:before{content:"\f14a"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comments:before{content:"\f086"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-credit-card:before{content:"\f09d"}.fa-crop:before{content:"\f125"}.fa-crosshairs:before{content:"\f05b"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-deviantart:before{content:"\f1bd"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-dot-circle:before{content:"\f192"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drupal:before{content:"\f1a9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-excel:before{content:"\f1c3"}.fa-file-image:before{content:"\f1c5"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fire:before{content:"\f06d"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-firstdraft:before{content:"\f3a1"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frown:before{content:"\f119"}.fa-futbol:before{content:"\f1e3"}.fa-gamepad:before{content:"\f11b"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-gift:before{content:"\f06b"}.fa-git:before{content:"\f1d3"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-martini:before{content:"\f000"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-handshake:before{content:"\f2b5"}.fa-hashtag:before{content:"\f292"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-heart:before{content:"\f004"}.fa-heartbeat:before{content:"\f21e"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-houzz:before{content:"\f27c"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-internet-explorer:before{content:"\f26b"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-jenkins:before{content:"\f3b6"}.fa-joget:before{content:"\f3b7"}.fa-joomla:before{content:"\f1aa"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-key:before{content:"\f084"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-korvue:before{content:"\f42f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-male:before{content:"\f183"}.fa-map:before{content:"\f279"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-maxcdn:before{content:"\f136"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-meh:before{content:"\f11a"}.fa-mercury:before{content:"\f223"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-moon:before{content:"\f186"}.fa-motorcycle:before{content:"\f21c"}.fa-mouse-pointer:before{content:"\f245"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nintendo-switch:before{content:"\f418"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-osi:before{content:"\f41a"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-paint-brush:before{content:"\f1fc"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-paragraph:before{content:"\f1dd"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-percent:before{content:"\f295"}.fa-periscope:before{content:"\f3da"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phone:before{content:"\f095"}.fa-phone-square:before{content:"\f098"}.fa-phone-volume:before{content:"\f2a0"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-plane:before{content:"\f072"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-print:before{content:"\f02f"}.fa-product-hunt:before{content:"\f288"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-random:before{content:"\f074"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-rebel:before{content:"\f1d0"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-rendact:before{content:"\f3e4"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-resolving:before{content:"\f3e7"}.fa-retweet:before{content:"\f079"}.fa-road:before{content:"\f018"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-rupee-sign:before{content:"\f156"}.fa-safari:before{content:"\f267"}.fa-sass:before{content:"\f41e"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-scribd:before{content:"\f28a"}.fa-search:before{content:"\f002"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shower:before{content:"\f2cc"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowflake:before{content:"\f2dc"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-spinner:before{content:"\f110"}.fa-spotify:before{content:"\f1bc"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-star:before{content:"\f005"}.fa-star-half:before{content:"\f089"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-strava:before{content:"\f428"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-trademark:before{content:"\f25c"}.fa-train:before{content:"\f238"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-uikit:before{content:"\f403"}.fa-umbrella:before{content:"\f0e9"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-circle:before{content:"\f2bd"}.fa-user-md:before{content:"\f0f0"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vuejs:before{content:"\f41f"}.fa-warehouse:before{content:"\f494"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wrench:before{content:"\f0ad"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}
\ No newline at end of file
diff --git a/app/assets/fonts/roboto-medium.css b/app/assets/fonts/roboto-medium.css
new file mode 100644
index 00000000..bd223e5b
--- /dev/null
+++ b/app/assets/fonts/roboto-medium.css
@@ -0,0 +1,13 @@
+@font-face {
+ font-family: 'Roboto';
+ font-style: normal;
+ font-weight: 500;
+ src: url('roboto-medium.woff') format('woff');
+}
+
+@font-face {
+ font-family: 'RobotoMono';
+ font-style: normal;
+ font-weight: 500;
+ src: url('roboto-mono.woff') format('woff');
+}
diff --git a/app/browser/fonts/roboto-medium.woff b/app/assets/fonts/roboto-medium.woff
similarity index 100%
rename from app/browser/fonts/roboto-medium.woff
rename to app/assets/fonts/roboto-medium.woff
diff --git a/app/assets/fonts/roboto-mono.woff b/app/assets/fonts/roboto-mono.woff
new file mode 100644
index 00000000..40181277
Binary files /dev/null and b/app/assets/fonts/roboto-mono.woff differ
diff --git a/app/assets/themes/.gitignore b/app/assets/themes/.gitignore
new file mode 100644
index 00000000..d6b7ef32
--- /dev/null
+++ b/app/assets/themes/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/app/browser/fonts/font-awesome.min.css b/app/browser/fonts/font-awesome.min.css
deleted file mode 100644
index 4d9f65de..00000000
--- a/app/browser/fonts/font-awesome.min.css
+++ /dev/null
@@ -1,4 +0,0 @@
-/*!
- * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
- * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
- */@font-face{font-family:'FontAwesome'; src:url('fontawesome-webfont.woff') format('woff');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}
diff --git a/app/browser/fonts/fontawesome-webfont.woff b/app/browser/fonts/fontawesome-webfont.woff
deleted file mode 100644
index 400014a4..00000000
Binary files a/app/browser/fonts/fontawesome-webfont.woff and /dev/null differ
diff --git a/app/browser/fonts/roboto-medium.css b/app/browser/fonts/roboto-medium.css
deleted file mode 100644
index 70812545..00000000
--- a/app/browser/fonts/roboto-medium.css
+++ /dev/null
@@ -1,6 +0,0 @@
-@font-face {
- font-family: 'Roboto';
- font-style: normal;
- font-weight: 500;
- src: url('roboto-medium.woff') format('woff');
-}
diff --git a/app/browser/index.html b/app/browser/index.html
deleted file mode 100644
index 20917171..00000000
--- a/app/browser/index.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/client/index.html b/app/client/index.html
new file mode 100644
index 00000000..e37981d0
--- /dev/null
+++ b/app/client/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/examples/ardour.json b/app/examples/ardour.json
index 5ef44ab5..f62ca83d 100644
--- a/app/examples/ardour.json
+++ b/app/examples/ardour.json
@@ -1,2646 +1,3362 @@
[
- {
- "type": "root",
- "tabs": [
- {
- "label": "mixer",
- "widgets": [
- {
- "type": "panel",
- "top": 0,
- "left": 0,
- "id": "mixer_main",
- "label": false,
- "width": "100%",
- "height": "100%",
- "scroll": true,
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "variables": {},
- "widgets": [
- {
- "type": "strip",
- "top": 40,
- "left": 0,
- "id": "transport",
- "label": false,
- "width": "100%",
- "height": 40,
- "color": "auto",
- "widgets": [
- {
- "type": "fader",
- "id": "shttl",
- "label": false,
- "alignRight": false,
- "horizontal": true,
- "compact": true,
- "color": "auto",
- "snap": false,
- "spring": true,
- "range": {
- "min": -8,
- "max": 8
- },
- "origin": 0,
- "value": "",
- "logScale": false,
- "precision": 2,
- "meter": false,
- "address": "/set_transport_speed",
- "preArgs": [],
- "target": [],
- "touchAddress": "",
- "meterAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "unit": "",
- "width": 114,
- "css": "",
- "linkId": ""
- },
- {
- "type": "push",
- "id": "zero",
- "linkId": "",
- "label": "^step-backward",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "color": "auto",
- "norelease": true,
- "address": "/goto_start",
- "width": 55
- },
- {
- "type": "push",
- "id": "end",
- "linkId": "",
- "label": "^step-forward",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "color": "auto",
- "norelease": true,
- "address": "/goto_end",
- "width": 55
- },
- {
- "type": "push",
- "id": "play",
- "linkId": "",
- "label": "^play",
- "color": "lime",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "norelease": true,
- "address": "/transport_play",
- "width": 55
- },
- {
- "type": "push",
- "id": "transport_stop",
- "linkId": "",
- "label": "^stop",
- "color": "red",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "norelease": true,
- "address": "/transport_stop",
- "width": 55
- },
- {
- "type": "push",
- "id": "masterrec",
- "linkId": "",
- "label": "^circle",
- "color": "red",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "norelease": true,
- "address": "/rec_enable_toggle",
- "width": 55
- },
- {
- "type": "text",
- "id": "time",
- "label": false,
- "vertical": false,
- "css": "font-size:140%; flex:4",
- "preArgs": [],
- "value": "00:00:00:00",
- "address": "/position/smpte",
- "widgetId": "",
- "width": 100,
- "color": "auto"
- },
- {
- "type": "push",
- "id": "solocan",
- "linkId": "",
- "label": "Solo",
- "color": "red",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "norelease": true,
- "address": "/cancel_all_solos",
- "css": "",
- "width": 55
- },
- {
- "type": "push",
- "id": "connect",
- "label": "^plug",
- "css": "",
- "on": 0,
- "off": null,
- "precision": 0,
- "target": [],
- "color": "auto",
- "preArgs": [
- 6,
- 159,
- 8403,
- 0,
- 3
- ],
- "norelease": true,
- "address": "/set_surface",
- "linkId": "",
- "width": 55
- }
- ],
- "variables": {},
- "border": true,
- "css": "",
- "horizontal": true,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "spacing": 4,
- "scroll": false,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "text",
- "left": 0,
- "id": "sess_name",
- "label": false,
- "width": "100%",
- "height": 40,
- "vertical": false,
- "css": "",
- "preArgs": [],
- "top": 0,
- "value": " ",
- "address": "/session_name",
- "widgetId": "",
- "color": "auto"
- },
- {
- "type": "panel",
- "id": "strip_scroll_panel",
- "label": false,
- "color": "auto",
- "spacing": 0,
- "variables": {
- "n": 1
- },
- "widgets": [
- {
- "type": "strip",
- "id": "channel_strip",
- "label": false,
- "css": "",
- "widgets": [
- {
- "type": "text",
- "id": "chan_@{parent.variables.n}",
- "label": false,
- "height": 40,
- "css": "",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "vertical": false,
- "address": "/strip/name",
- "widgetId": "",
- "value": "@{parent.variables.n}",
- "color": "auto"
- },
- {
- "type": "strip",
- "id": "trim_@{parent.variables.n}",
- "label": false,
- "height": 50,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "strip",
- "id": "trim_meta_@{parent.variables.n}",
- "label": false,
- "width": "auto",
- "color": "auto",
- "css": "",
- "horizontal": false,
- "stretch": true,
- "border": false,
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "input",
- "id": "trim_label_@{parent.variables.n}",
- "label": false,
- "color": "auto",
- "css": "",
- "value": "Trim",
- "preArgs": [],
- "widgetId": "",
- "height": 20,
- "linkId": "",
- "unit": "",
- "horizontal": false,
- "editable": false,
- "precision": 2,
- "target": [],
- "address": "/trim_label_@{parent.variables.n}"
- },
- {
- "type": "input",
- "id": "trim_input_@{parent.variables.n}",
- "label": false,
- "color": "auto",
- "css": "",
- "preArgs": [],
- "widgetId": "trim_knob_@{parent.variables.n}",
- "height": 20,
- "linkId": "",
- "unit": "",
- "horizontal": false,
- "editable": true,
- "precision": 2,
- "target": [],
- "value": "",
- "address": "/trim_input_@{parent.variables.n}"
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "knob",
- "id": "trim_knob_@{parent.variables.n}",
- "linkId": "",
- "label": false,
- "unit": "",
- "range": {
- "min": -20,
- "max": 20
- },
- "logScale": false,
- "precision": 2,
- "target": [],
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "snap": false,
- "origin": 0,
- "spring": false,
- "value": "",
- "address": "/strip/trimdB",
- "touchAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "css": "",
- "color": "auto",
- "angle": 270,
- "width": "auto"
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "top_buttons_@{parent.variables.n}",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "record_@{parent.variables.n}",
- "linkId": "",
- "label": "^circle",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "red",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "value": "",
- "address": "/strip/recenable",
- "led": false,
- "css": "",
- "width": "auto",
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "mon_@{parent.variables.n}",
- "linkId": "",
- "label": "^microphone",
- "precision": 0,
- "target": [],
- "color": "orange",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "off": 0,
- "on": 1,
- "value": "",
- "address": "/strip/monitor_input",
- "led": false,
- "css": "",
- "width": "auto",
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "disk_@{parent.variables.n}",
- "linkId": "",
- "label": "^hdd-o",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 0,
- "target": [],
- "color": "orange",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "value": "",
- "address": "/strip/monitor_disk",
- "led": false,
- "width": "auto",
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "fader_strip_@{parent.variables.n}",
- "label": false,
- "color": "auto",
- "css": "flex:1",
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "meter",
- "id": "meter_@{parent.variables.n}",
- "label": false,
- "unit": "",
- "alignRight": false,
- "horizontal": false,
- "pips": false,
- "dashed": true,
- "color": "auto",
- "widgetId": "",
- "range": {
- "min": {
- "inf": -193
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 6
- },
- "logScale": false,
- "origin": "auto",
- "value": "",
- "address": "/strip/meter",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "css": "margin: 20rem 0 20rem 20rem;",
- "width": 10,
- "compact": true,
- "input": false
- },
- {
- "type": "fader",
- "id": "fader_@{parent.variables.n}",
- "linkId": "",
- "label": false,
- "unit": "dB",
- "horizontal": false,
- "css": "",
- "range": {
- "min": {
- "-∞": -193
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 6
- },
- "logScale": false,
- "precision": 2,
- "meter": false,
- "target": [],
- "color": "auto",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "snap": false,
- "compact": false,
- "alignRight": false,
- "origin": "auto",
- "spring": false,
- "value": "",
- "address": "/strip/gain",
- "touchAddress": "",
- "meterAddress": "/strip/meter",
- "pips": true,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "width": 80
- }
- ],
- "height": "auto",
- "border": true,
- "horizontal": true,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "scroll": false,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "input",
- "id": "fader_input_@{parent.variables.n}",
- "linkId": "",
- "label": false,
- "unit": "dB",
- "height": 30,
- "horizontal": false,
- "color": "auto",
- "css": "margin:5rem 5rem 0",
- "widgetId": "fader_@{parent.variables.n}",
- "editable": true,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/fader_input_@{parent.variables.n}"
- },
- {
- "type": "fader",
- "id": "pan_@{parent.variables.n}",
- "linkId": "",
- "label": false,
- "unit": "",
- "height": 30,
- "horizontal": true,
- "range": {
- "min": 0,
- "max": 1
- },
- "logScale": false,
- "precision": 2,
- "meter": false,
- "target": [],
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "snap": false,
- "compact": true,
- "alignRight": false,
- "origin": 0.5,
- "spring": false,
- "value": "",
- "address": "/strip/pan_stereo_position",
- "touchAddress": "",
- "meterAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": true,
- "color": "auto",
- "css": "margin:5rem"
- },
- {
- "type": "strip",
- "id": "bottom_buttons_@{parent.variables.n}",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "solo_@{parent.variables.n}",
- "linkId": "",
- "label": "S",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "lime",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "value": "",
- "address": "/strip/solo",
- "led": false,
- "width": "auto",
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "mute_@{parent.variables.n}",
- "linkId": "",
- "label": "M",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "yellow",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "value": "",
- "address": "/strip/mute",
- "led": false,
- "width": "auto",
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "bottom_buttons_@{parent.variables.n}",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "push",
- "id": "sel_@{parent.variables.n}",
- "linkId": "",
- "label": "Sel",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "white",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "norelease": false,
- "address": "/strip/select",
- "width": "auto"
- },
- {
- "type": "toggle",
- "id": "expand_@{parent.variables.n}",
- "linkId": "",
- "label": "Sel²",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 0,
- "target": [],
- "color": "pink",
- "preArgs": [
- "@{parent.variables.n}"
- ],
- "value": "",
- "address": "/strip/expand",
- "led": false,
- "width": "auto",
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "color": "auto",
- "spacing": 0,
- "border": true,
- "horizontal": false,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "width": 120,
- "height": "100%",
- "scroll": true,
- "top": "auto",
- "left": "auto",
- "variables": {
- "n": 1
- },
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "clone",
- "id": "clone_2",
- "width": 120,
- "height": "100%",
- "widgetId": "channel_strip",
- "left": "auto",
- "top": "auto",
- "css": "",
- "props": {
- "variables": {
- "n": 2
- },
- "id": "channel_strip_2"
- },
- "label": "",
- "variables": "@{parent.variables}"
- },
- {
- "type": "clone",
- "id": "clone_3",
- "width": 120,
- "height": "100%",
- "widgetId": "channel_strip",
- "css": "",
- "props": {
- "variables": {
- "n": 3
- },
- "id": "channel_strip_3"
- },
- "left": "auto",
- "top": "auto",
- "label": "",
- "variables": "@{parent.variables}"
- },
- {
- "type": "clone",
- "id": "clone_4",
- "width": 120,
- "height": "100%",
- "widgetId": "channel_strip",
- "css": "",
- "props": {
- "variables": {
- "n": 4
- },
- "id": "channel_strip_4"
- },
- "left": "auto",
- "top": "auto",
- "label": "",
- "variables": "@{parent.variables}"
- },
- {
- "type": "clone",
- "id": "clone_5",
- "width": 120,
- "height": "100%",
- "widgetId": "channel_strip",
- "css": "",
- "props": {
- "variables": {
- "n": 5
- },
- "id": "channel_strip_5"
- },
- "left": "auto",
- "top": "auto",
- "label": "",
- "variables": "@{parent.variables}"
- },
- {
- "type": "clone",
- "id": "clone_6",
- "width": 120,
- "height": "100%",
- "widgetId": "channel_strip",
- "css": "",
- "props": {
- "variables": {
- "n": 6
- },
- "id": "channel_strip_6"
- },
- "left": "auto",
- "top": "auto",
- "label": "",
- "variables": "@{parent.variables}"
- }
- ],
- "left": 0,
- "top": 80,
- "css": "width:calc(100% - 120rem); height:calc(100% - 80rem);",
- "height": "auto",
- "width": "auto",
- "border": true,
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "layout": "",
- "_osc": "osc",
- "value": "",
- "precision": 0,
- "address": "/strip_scroll_panel",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "ch_master",
- "label": false,
- "width": 120,
- "css": "right:0;\nheight:calc(100% - 80rem);",
- "widgets": [
- {
- "type": "text",
- "id": "master_label",
- "label": false,
- "height": 40,
- "css": "",
- "vertical": false,
- "value": "Master",
- "address": "/master_label",
- "color": "auto",
- "widgetId": "",
- "preArgs": []
- },
- {
- "type": "strip",
- "id": "master_trim_strip",
- "label": false,
- "height": 50,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "strip",
- "id": "trim_meta_@{parent.variables.n}",
- "label": false,
- "width": "auto",
- "color": "auto",
- "css": "",
- "horizontal": false,
- "stretch": true,
- "border": false,
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "input",
- "id": "mastertrim_label",
- "label": false,
- "color": "auto",
- "css": "",
- "value": "Trim",
- "preArgs": [],
- "widgetId": "",
- "height": 20,
- "linkId": "",
- "unit": "",
- "horizontal": false,
- "editable": false,
- "precision": 2,
- "target": [],
- "address": "/mastertrim_label"
- },
- {
- "type": "input",
- "id": "mastertrim_input",
- "label": false,
- "color": "auto",
- "css": "",
- "preArgs": [],
- "widgetId": "mastertrim",
- "height": 20,
- "linkId": "",
- "unit": "",
- "horizontal": false,
- "editable": true,
- "precision": 2,
- "target": [],
- "value": "",
- "address": "/mastertrim_input"
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "knob",
- "id": "mastertrim",
- "linkId": "",
- "label": false,
- "unit": "",
- "range": {
- "min": -20,
- "max": 20
- },
- "logScale": false,
- "precision": 2,
- "target": [],
- "snap": false,
- "origin": 0,
- "spring": false,
- "value": "",
- "address": "/master/trimdB",
- "touchAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "css": "",
- "color": "auto",
- "angle": 270,
- "width": "auto",
- "preArgs": []
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "master_mute_strip",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": true,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "mastermute",
- "linkId": "",
- "label": "Mute",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "yellow",
- "value": "",
- "address": "/master/mute",
- "led": false,
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "master_fader_strip",
- "label": false,
- "color": "auto",
- "css": "flex:1",
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "meter",
- "id": "Master_meter",
- "label": false,
- "unit": "",
- "alignRight": false,
- "horizontal": false,
- "pips": false,
- "dashed": true,
- "color": "auto",
- "range": {
- "min": {
- "inf": -193
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 6
- },
- "logScale": false,
- "origin": "auto",
- "value": "",
- "address": "/master/meter",
- "preArgs": [],
- "css": "margin: 20rem 0 20rem 20rem;",
- "width": 10,
- "widgetId": "",
- "compact": true,
- "input": false
- },
- {
- "type": "fader",
- "id": "Master",
- "linkId": "",
- "label": false,
- "unit": "dB",
- "horizontal": false,
- "css": "",
- "range": {
- "min": {
- "inf": -193
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 6
- },
- "logScale": false,
- "precision": 2,
- "meter": false,
- "target": [],
- "color": "auto",
- "snap": false,
- "compact": false,
- "alignRight": false,
- "origin": "auto",
- "spring": false,
- "value": "",
- "address": "/master/gain",
- "touchAddress": "",
- "pips": true,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "width": 80,
- "preArgs": [],
- "meterAddress": ""
- }
- ],
- "height": "auto",
- "border": true,
- "horizontal": true,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "scroll": false,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "input",
- "id": "master_input",
- "linkId": "",
- "label": false,
- "unit": "dB",
- "height": 30,
- "horizontal": false,
- "color": "auto",
- "css": "margin:5rem 5rem 0",
- "widgetId": "Master",
- "editable": true,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/master_input"
- },
- {
- "type": "fader",
- "id": "master_pan",
- "linkId": "",
- "label": false,
- "unit": "",
- "height": 30,
- "horizontal": true,
- "range": {
- "min": 0,
- "max": 1
- },
- "logScale": false,
- "precision": 2,
- "meter": false,
- "target": [],
- "snap": false,
- "compact": true,
- "alignRight": false,
- "origin": 0.5,
- "spring": false,
- "value": "",
- "address": "/master/pan_stereo_position",
- "touchAddress": "",
- "meterAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": true,
- "color": "auto",
- "css": "margin:5rem",
- "preArgs": []
- },
- {
- "type": "strip",
- "id": "settings_modal_strip",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": true,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "modal",
- "id": "monitor_modal",
- "label": "^headphones",
- "width": "auto",
- "color": "auto",
- "css": "",
- "doubleTap": false,
- "popupWidth": "140rem",
- "popupHeight": "80%",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/modal_1",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "strip",
- "id": "monitor_strip",
- "label": false,
- "height": "100%",
- "color": "auto",
- "css": "",
- "horizontal": false,
- "stretch": false,
- "border": true,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "fader",
- "id": "monitor",
- "linkId": "",
- "label": false,
- "color": "auto",
- "compact": false,
- "css": "flex:1",
- "snap": false,
- "range": {
- "min": {
- "inf": -200
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 10
- },
- "logScale": false,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "origin": "auto",
- "spring": false,
- "value": "",
- "address": "/monitor/gain",
- "touchAddress": "",
- "alignRight": false,
- "horizontal": false,
- "meter": false,
- "meterAddress": "",
- "unit": "",
- "pips": true,
- "input": true,
- "dashed": false,
- "doubleTap": false,
- "height": "auto"
- },
- {
- "type": "strip",
- "id": "monitor_buttons",
- "label": false,
- "color": "auto",
- "css": "font-size:10rem",
- "horizontal": true,
- "stretch": false,
- "border": false,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "monmute",
- "linkId": "",
- "label": "M",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "yellow",
- "value": "",
- "address": "/monitor/mute",
- "led": false,
- "css": "",
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "mondim",
- "linkId": "",
- "label": "Dim",
- "precision": 0,
- "target": [],
- "color": "orange",
- "off": 0,
- "on": 1,
- "value": "",
- "address": "/monitor/dim",
- "led": false,
- "css": "",
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "monmono",
- "linkId": "",
- "label": "Mono",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 0,
- "target": [],
- "color": "cyan",
- "value": "",
- "address": "/monitor/mono",
- "led": false,
- "preArgs": [],
- "width": "auto",
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "height": 50,
- "spacing": 4,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "_style": "style",
- "_children": "children",
- "width": "100%",
- "left": "auto",
- "top": "auto",
- "spacing": 0,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "popupLabel": "Monitor",
- "tabs": [],
- "scroll": true
- },
- {
- "type": "modal",
- "id": "settings_modal",
- "label": "^cog",
- "width": "auto",
- "color": "auto",
- "css": "",
- "doubleTap": false,
- "popupHeight": "80%",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "panel",
- "id": "settings_tabs",
- "label": false,
- "height": "100%",
- "scroll": true,
- "color": "auto",
- "css": "",
- "border": true,
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/panel_1",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [],
- "tabs": [
- {
- "type": "tab",
- "id": "strip_types",
- "label": "strips",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/tab_4",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "strip",
- "top": 0,
- "left": 0,
- "id": "strip_types_select",
- "label": "strip types",
- "width": 100,
- "height": "100%",
- "color": "auto",
- "css": ".widget {flex:1;min-height:auto}",
- "widgets": [
- {
- "type": "toggle",
- "id": "strip_type_1",
- "linkId": "",
- "label": "Audio",
- "color": "auto",
- "css": "",
- "on": 1,
- "off": 0,
- "value": 1,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_2",
- "label": "Midi",
- "color": "auto",
- "css": "",
- "on": 2,
- "off": 0,
- "value": 2,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_3",
- "label": "AudioBus",
- "color": "auto",
- "css": "",
- "on": 4,
- "off": 0,
- "value": 4,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_4",
- "label": "MidiBus",
- "color": "auto",
- "css": "",
- "on": 8,
- "off": 0,
- "value": 8,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_5",
- "label": "VCA",
- "color": "auto",
- "css": "",
- "on": 16,
- "off": 0,
- "value": 16,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_6",
- "label": "Master",
- "color": "auto",
- "css": "",
- "on": 32,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_7",
- "label": "Monitor",
- "color": "auto",
- "css": "",
- "on": 64,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_8",
- "label": "Aux",
- "color": "auto",
- "css": "",
- "on": 128,
- "off": 0,
- "value": 128,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_9",
- "label": "Selected",
- "color": "auto",
- "on": 256,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "css": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "strip_type_10",
- "label": "Hidden",
- "color": "auto",
- "css": "",
- "on": 512,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/null",
- "linkId": "",
- "height": "auto",
- "led": false,
- "doubleTap": false
- },
- {
- "type": "formula",
- "id": "trip_type_bitsum",
- "linkId": "",
- "formula": "${strip_type_1} + ${strip_type_2} + ${strip_type_3} + ${strip_type_4} + ${strip_type_5} + ${strip_type_6} + ${strip_type_7} + ${strip_type_8} + ${strip_type_9} + ${strip_type_10}",
- "condition": "",
- "label": false,
- "color": "auto",
- "css": "",
- "precision": 0,
- "address": "/set_surface/strip_types",
- "split": [],
- "preArgs": [],
- "target": [],
- "height": "auto",
- "unit": ""
- }
- ],
- "horizontal": false,
- "stretch": false,
- "spacing": 0,
- "variables": {},
- "border": true,
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "tabs": [],
- "scroll": true
- }
- ],
- "top": 0,
- "left": 0,
- "width": "100%"
- }
- ],
- "popupWidth": "80%",
- "address": "/settings_modal",
- "popupLabel": "Settings",
- "tabs": [],
- "scroll": true
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "monitor_modal_strip",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": true,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "push",
- "id": "bank_dn",
- "linkId": "",
- "label": "^angle-left",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "norelease": false,
- "address": "/bank_down",
- "css": "&:not(.on) {opacity:0.75}",
- "width": 50,
- "color": "auto"
- },
- {
- "type": "push",
- "id": "bank_up",
- "linkId": "",
- "label": "^angle-right",
- "on": 1,
- "off": 0,
- "precision": 2,
- "preArgs": [],
- "target": [],
- "norelease": false,
- "address": "/bank_up",
- "css": "&:not(.on) {opacity:0.75}",
- "width": 50,
- "color": "auto"
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "spacing": 0,
- "border": true,
- "horizontal": false,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "variables": "@{parent.variables}",
- "top": 80,
- "height": "auto",
- "left": "auto",
- "scroll": true,
- "color": "auto",
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "tabs": [],
- "value": "",
- "precision": 0,
- "address": "/mixer_main",
- "preArgs": [],
- "target": [],
- "border": true
- }
- ],
- "id": "mixer_tab",
- "type": "tab",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "preArgs": [],
- "target": [],
- "variables": {},
- "tabs": [],
- "color": "auto",
- "address": "/mixer_tab",
- "scroll": true
- },
- {
- "type": "tab",
- "id": "track_tab",
- "label": "Track",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "panel",
- "top": 0,
- "left": 0,
- "id": "mixer_main",
- "label": false,
- "width": "100%",
- "height": "100%",
- "scroll": true,
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "variables": {},
- "widgets": [
- {
- "type": "panel",
- "id": "strip_scroll_panel",
- "label": false,
- "color": "auto",
- "spacing": 0,
- "variables": {},
- "widgets": [
- {
- "type": "strip",
- "id": "select_chn",
- "label": false,
- "css": "",
- "widgets": [
- {
- "type": "text",
- "id": "select_name",
- "label": false,
- "height": 40,
- "css": "",
- "vertical": false,
- "address": "/select/name",
- "widgetId": "",
- "value": " sel",
- "preArgs": [],
- "color": "auto"
- },
- {
- "type": "strip",
- "id": "trim_select_strip",
- "label": false,
- "height": 50,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "strip",
- "id": "trim_meta_select",
- "label": false,
- "width": "auto",
- "color": "auto",
- "css": "",
- "horizontal": false,
- "stretch": true,
- "border": false,
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "input",
- "id": "select_trim_label",
- "label": false,
- "color": "auto",
- "css": "",
- "value": "Trim",
- "preArgs": [],
- "widgetId": "",
- "height": 20,
- "linkId": "",
- "unit": "",
- "horizontal": false,
- "editable": false,
- "precision": 2,
- "target": [],
- "address": "/select_trim_label"
- },
- {
- "type": "input",
- "id": "select_trim_input",
- "label": false,
- "color": "auto",
- "css": "",
- "preArgs": [],
- "widgetId": "select_trim_knob",
- "height": 20,
- "linkId": "",
- "unit": "",
- "horizontal": false,
- "editable": true,
- "precision": 2,
- "target": [],
- "value": "",
- "address": "/select_trim_input"
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "knob",
- "id": "select_trim_knob",
- "linkId": "",
- "label": false,
- "unit": "",
- "range": {
- "min": -20,
- "max": 20
- },
- "logScale": false,
- "precision": 2,
- "target": [],
- "snap": false,
- "origin": 0,
- "spring": false,
- "value": "",
- "address": "/select/trimdB",
- "touchAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "css": "",
- "color": "auto",
- "angle": 270,
- "width": "auto",
- "preArgs": []
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "top_buttons_select",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "record_select",
- "linkId": "",
- "label": "^circle",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "red",
- "value": "",
- "address": "/select/recenable",
- "led": false,
- "css": "",
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "mon_select",
- "linkId": "",
- "label": "^microphone",
- "precision": 0,
- "target": [],
- "color": "orange",
- "off": 0,
- "on": 1,
- "value": "",
- "address": "/select/monitor_input",
- "led": false,
- "css": "",
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "disk_select",
- "linkId": "",
- "label": "^hdd-o",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 0,
- "target": [],
- "color": "orange",
- "value": "",
- "address": "/select/monitor_disk",
- "led": false,
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "sends_receive_buttons_select",
- "label": false,
- "height": 80,
- "color": "auto",
- "css": "",
- "horizontal": false,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "modal",
- "id": "receives_panel",
- "label": "Receives",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "widgets": [
- {
- "type": "text",
- "label": false,
- "width": "100%",
- "height": "100%",
- "value": "No receive found",
- "id": "text_4",
- "left": "auto",
- "top": "auto",
- "color": "auto",
- "css": "",
- "widgetId": "",
- "vertical": false,
- "preArgs": [],
- "address": "/text_4"
- }
- ],
- "popupWidth": "75%",
- "popupHeight": "75%",
- "address": "/receives_panel",
- "variables": {},
- "value": "",
- "precision": 0,
- "preArgs": [],
- "target": [],
- "doubleTap": false,
- "height": "auto",
- "popupLabel": "",
- "tabs": [],
- "scroll": true
- },
- {
- "type": "modal",
- "id": "sends_panel",
- "label": "Sends",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "widgets": [
- {
- "type": "text",
- "label": false,
- "width": "100%",
- "height": "100%",
- "value": "No send found",
- "id": "text_3",
- "left": "auto",
- "top": "auto",
- "color": "auto",
- "css": "",
- "widgetId": "",
- "vertical": false,
- "preArgs": [],
- "address": "/text_3"
- }
- ],
- "popupWidth": "75%",
- "popupHeight": "75%",
- "address": "/sends_panel",
- "variables": {},
- "value": "",
- "precision": 0,
- "preArgs": [],
- "target": [],
- "doubleTap": false,
- "height": "auto",
- "popupLabel": "",
- "tabs": [],
- "scroll": true
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "fader_select_strip",
- "label": false,
- "color": "auto",
- "css": "flex:1",
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "meter",
- "id": "meter_select",
- "label": false,
- "unit": "",
- "alignRight": false,
- "horizontal": false,
- "pips": false,
- "dashed": true,
- "color": "auto",
- "range": {
- "min": {
- "inf": -193
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 6
- },
- "logScale": false,
- "origin": "auto",
- "value": "",
- "address": "/select/meter",
- "css": "margin: 20rem 0 20rem 20rem;",
- "width": 10,
- "preArgs": [],
- "widgetId": "",
- "compact": true,
- "input": false
- },
- {
- "type": "fader",
- "id": "fader_select",
- "linkId": "",
- "label": false,
- "unit": "dB",
- "horizontal": false,
- "css": "",
- "range": {
- "min": {
- "inf": -193
- },
- "6%": -60,
- "12%": -50,
- "20%": -40,
- "30%": -30,
- "42%": -20,
- "60%": -10,
- "80%": 0,
- "max": 6
- },
- "logScale": false,
- "precision": 2,
- "meter": false,
- "target": [],
- "color": "auto",
- "snap": false,
- "compact": false,
- "alignRight": false,
- "origin": "auto",
- "spring": false,
- "value": "",
- "address": "/select/gain",
- "touchAddress": "",
- "pips": true,
- "input": false,
- "dashed": false,
- "doubleTap": false,
- "width": 80,
- "meterAddress": "",
- "preArgs": []
- }
- ],
- "height": "auto",
- "border": true,
- "horizontal": true,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "scroll": false,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "input",
- "id": "fader_input_select",
- "linkId": "",
- "label": false,
- "unit": "dB",
- "height": 30,
- "horizontal": false,
- "color": "auto",
- "css": "margin:5rem 5rem 0",
- "widgetId": "fader_select",
- "editable": true,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "address": "/fader_input_select"
- },
- {
- "type": "fader",
- "id": "pan_select",
- "linkId": "",
- "label": false,
- "unit": "",
- "height": 30,
- "horizontal": true,
- "range": {
- "min": 0,
- "max": 1
- },
- "logScale": false,
- "precision": 2,
- "meter": false,
- "target": [],
- "snap": false,
- "compact": true,
- "alignRight": false,
- "origin": 0.5,
- "spring": false,
- "value": "",
- "address": "/select/pan_stereo_position",
- "touchAddress": "",
- "meterAddress": "",
- "pips": false,
- "input": false,
- "dashed": false,
- "doubleTap": true,
- "color": "auto",
- "css": "margin:5rem",
- "preArgs": []
- },
- {
- "type": "strip",
- "id": "bottom_buttons_select",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "solo_select",
- "linkId": "",
- "label": "S",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "lime",
- "value": "",
- "address": "/select/solo",
- "led": false,
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "mute_select",
- "linkId": "",
- "label": "M",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 2,
- "target": [],
- "color": "yellow",
- "value": "",
- "address": "/select/mute",
- "led": false,
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "bottom_buttons_select",
- "label": false,
- "height": 40,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": true,
- "border": true,
- "spacing": 4,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "expand_select",
- "linkId": "",
- "label": "Sel²",
- "css": "",
- "on": 1,
- "off": 0,
- "precision": 0,
- "target": [],
- "color": "pink",
- "value": "",
- "address": "/select/expand",
- "led": false,
- "width": "auto",
- "preArgs": [],
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "color": "auto",
- "spacing": 0,
- "border": true,
- "horizontal": false,
- "stretch": false,
- "_style": "style",
- "_children": "children",
- "width": 120,
- "left": "auto",
- "top": "auto",
- "height": "100%",
- "variables": "@{parent.variables}",
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "panel",
- "top": 0,
- "left": 120,
- "id": "plugins_panel",
- "label": false,
- "scroll": true,
- "color": "auto",
- "css": "width:calc(100% - 120rem);",
- "layout": "",
- "spacing": 0,
- "variables": {},
- "widgets": [
- {
- "type": "text",
- "label": false,
- "width": "100%",
- "height": "100%",
- "value": "No plugin found",
- "id": "text_1",
- "left": "auto",
- "top": "auto",
- "color": "auto",
- "css": "",
- "widgetId": "",
- "vertical": false,
- "preArgs": [],
- "address": "/text_1"
- }
- ],
- "tabs": [],
- "height": "100%",
- "width": "auto",
- "value": "",
- "precision": 0,
- "address": "/plugins_panel",
- "preArgs": [],
- "target": [],
- "border": true
- }
- ],
- "left": 0,
- "top": 80,
- "css": "width:calc(100% - 120rem); height:calc(100% - 80rem);",
- "height": "auto",
- "width": "auto",
- "border": true,
- "_style": "style",
- "_children": "children",
- "scroll": true,
- "layout": "",
- "_osc": "osc",
- "value": "",
- "precision": 0,
- "address": "/strip_scroll_panel",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "clone",
- "left": 0,
- "id": "sess_name_clone",
- "width": "100%",
- "height": 40,
- "css": "",
- "top": 0,
- "widgetId": "sess_name",
- "props": {},
- "label": "",
- "variables": "@{parent.variables}"
- },
- {
- "type": "clone",
- "top": 40,
- "left": 0,
- "id": "transport_clone",
- "width": "100%",
- "height": 40,
- "css": "",
- "_style": "style",
- "_geometry": "geometry",
- "widgetId": "transport",
- "props": {},
- "label": "",
- "variables": "@{parent.variables}"
- },
- {
- "type": "clone",
- "id": "master_clone",
- "width": 120,
- "css": "right:0;\nheight:calc(100% - 80rem);",
- "_style": "style",
- "top": 80,
- "height": "auto",
- "left": "auto",
- "_geometry": "geometry",
- "widgetId": "ch_master",
- "props": {},
- "label": "",
- "variables": "@{parent.variables}"
- }
- ],
- "tabs": [],
- "value": "",
- "precision": 0,
- "address": "/mixer_main",
- "preArgs": [],
- "target": [],
- "border": true
- }
- ],
- "tabs": [],
- "address": "/track_tab",
- "scroll": true
- }
- ],
+ {
+ "type": "root",
+ "tabs": [
+ {
+ "type": "tab",
+ "id": "settings_tab",
+ "linkId": "",
+ "label": "Settings",
+ "color": "auto",
+ "css": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "address": "/tab_1",
+ "preArgs": [],
+ "target": [],
+ "bypass": false,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "greeter",
+ "linkId": "",
+ "height": 40,
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "border": true,
+ "spacing": 0,
+ "address": "/panel_1",
+ "preArgs": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "svg",
+ "id": "logo",
+ "linkId": "",
+ "label": false,
+ "css": "--color-track:transparent",
+ "svg": "",
+ "preArgs": [],
+ "address": "/svg_1",
+ "width": 50,
+ "default": "",
+ "value": ""
+ },
+ {
+ "type": "text",
+ "id": "greeter_text",
+ "linkId": "",
+ "label": false,
+ "color": "auto",
+ "css": "flex:1",
+ "vertical": false,
+ "wrap": false,
+ "align": "",
+ "default": "",
+ "value": "Ardour Control",
+ "preArgs": [],
+ "address": "/text_4",
+ "width": "auto"
+ },
+ {
+ "type": "image",
+ "id": "osc_logo",
+ "linkId": "",
+ "width": 50,
+ "label": false,
+ "css": "",
+ "default": "",
+ "value": "/assets/favicon.png",
+ "address": "/fader_13",
+ "preArgs": [],
+ "size": "60%",
+ "position": "center",
+ "repeat": "no-repeat",
+ "border": true,
+ "cache": true
+ }
+ ],
+ "horizontal": true,
+ "stretch": false,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "strip_types_select",
+ "label": "strip types",
+ "height": 80,
+ "color": "auto",
+ "css": "",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "strip_type_1",
+ "linkId": "",
+ "label": "Audio",
+ "color": "auto",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "value": 1,
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_1",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_2",
+ "label": "Midi",
+ "color": "auto",
+ "css": "",
+ "on": 2,
+ "off": 0,
+ "value": 2,
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_2",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_3",
+ "label": "AudioBus",
+ "color": "auto",
+ "css": "",
+ "on": 4,
+ "off": 0,
+ "value": 4,
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_3",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_4",
+ "label": "MidiBus",
+ "color": "auto",
+ "css": "",
+ "on": 8,
+ "off": 0,
+ "value": 8,
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_4",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_5",
+ "label": "VCA",
+ "color": "auto",
+ "css": "",
+ "on": 16,
+ "off": 0,
+ "value": 16,
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_5",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_6",
+ "label": "Master",
+ "color": "auto",
+ "css": "",
+ "on": 32,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_6",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_7",
+ "label": "Monitor",
+ "color": "auto",
+ "css": "",
+ "on": 64,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_7",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_8",
+ "label": "Aux",
+ "color": "auto",
+ "css": "",
+ "on": 128,
+ "off": 0,
+ "value": 128,
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_8",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_9",
+ "label": "Selected",
+ "color": "auto",
+ "on": 256,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_9",
+ "linkId": "",
+ "css": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "strip_type_10",
+ "label": "Hidden",
+ "color": "auto",
+ "css": "",
+ "on": 512,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "address": "/strip_type_10",
+ "linkId": "",
+ "led": false,
+ "doubleTap": false,
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "input",
+ "id": "trip_type_bitsum",
+ "linkId": "",
+ "label": "bits",
+ "color": "auto",
+ "css": ".label{height:25rem}",
+ "precision": 0,
+ "address": "/set_surface/strip_types",
+ "preArgs": [],
+ "target": [],
+ "unit": "",
+ "vertical": false,
+ "editable": false,
+ "value": "#{\n@{strip_type_1} + \n@{strip_type_2} + \n@{strip_type_3} + \n@{strip_type_4} + \n@{strip_type_5} + \n@{strip_type_6} + \n@{strip_type_7} + \n@{strip_type_8} + \n@{strip_type_9} + \n@{strip_type_10}\n}",
+ "align": "",
+ "default": "",
+ "bypass": false,
+ "width": "auto"
+ }
+ ],
+ "horizontal": true,
+ "stretch": true,
+ "spacing": 0,
+ "variables": {},
+ "border": true,
+ "scroll": true,
+ "address": "/strip_types_select",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "widgets": [
+ {
+ "type": "switch",
+ "id": "bank_size",
+ "linkId": "",
+ "label": "Bank size",
+ "height": 80,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "address": "/set_surface/bank_size",
+ "default": 6,
+ "value": "",
+ "precision": 0,
+ "preArgs": [],
+ "target": [],
+ "bypass": false,
+ "showValues": false,
+ "values": [
+ 6,
+ 8,
+ 10,
+ 12
+ ]
+ }
+ ],
+ "label": false,
+ "id": "bank_size_wrapper",
+ "linkId": "",
+ "height": 80,
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": false,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "preArgs": [],
+ "address": "/bank_size_wrapper",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "display_layout",
+ "linkId": "",
+ "height": 80,
+ "label": "Layout options",
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "border": true,
+ "spacing": 0,
+ "address": "/panel_13",
+ "preArgs": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "display_session_name",
+ "linkId": "",
+ "label": "Session name",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_session_name",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_transport",
+ "linkId": "",
+ "label": "Transport",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_transport",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_monitor",
+ "linkId": "",
+ "label": "Monitor",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_monitor",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ }
+ ],
+ "horizontal": true,
+ "stretch": true,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "display_strip",
+ "linkId": "",
+ "height": 80,
+ "label": "Strip options",
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "border": true,
+ "spacing": 0,
+ "address": "/panel_13",
+ "preArgs": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "display_trim",
+ "linkId": "",
+ "label": "Trim",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_trim",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_recbar",
+ "linkId": "",
+ "label": "Rec / Mic / Disk",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_recbar",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": 100
+ },
+ {
+ "type": "toggle",
+ "id": "display_input",
+ "linkId": "",
+ "label": "Gain Input",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_pan",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_pan",
+ "linkId": "",
+ "label": "Pan",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_pan",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_expand",
+ "linkId": "",
+ "label": "Sel²",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_expand",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_compact_faders",
+ "linkId": "",
+ "label": "Compact",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": "",
+ "value": "",
+ "precision": 2,
+ "address": "/display_compact_faders",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ }
+ ],
+ "horizontal": true,
+ "stretch": true,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "display_selected",
+ "linkId": "",
+ "height": 80,
+ "label": "Select options",
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "border": true,
+ "spacing": 0,
+ "address": "/panel_13",
+ "preArgs": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "display_polarity_sel",
+ "linkId": "",
+ "label": "Polarity",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_polarity_sel",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_trim_sel",
+ "linkId": "",
+ "label": "Trim",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_trim_sel",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_recbar_sel",
+ "linkId": "",
+ "label": "Rec / Mic / Disk",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_recbar_sel",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ },
+ {
+ "type": "toggle",
+ "id": "display_pan_sel",
+ "linkId": "",
+ "label": "Pan",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": 1,
+ "value": "",
+ "precision": 2,
+ "address": "/display_pan_sel",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "bypass": false,
+ "width": "auto"
+ }
+ ],
+ "horizontal": true,
+ "stretch": true,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "panel",
+ "id": "spacer",
+ "linkId": "",
+ "height": "auto",
+ "label": false,
+ "color": "auto",
+ "css": "flex:1",
+ "scroll": true,
+ "border": true,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "address": "/panel_2",
+ "preArgs": [],
+ "target": [],
+ "bypass": false,
+ "variables": "@{parent.variables}",
+ "widgets": [],
+ "tabs": []
+ },
+ {
+ "type": "push",
+ "id": "connect",
+ "label": "Connect",
+ "css": "",
+ "on": null,
+ "off": 0,
+ "precision": 0,
+ "target": [],
+ "color": "auto",
+ "preArgs": "#{\nf = 1 + 2 + 16 + 128 + 8192 + 16384;\n@{display_transport}==1?f=f+64:\"\";\n}\n\n[\n @{bank_size},\n @{trip_type_bitsum},\n #{f},\n 0,\n 0,\n 1\n]",
+ "norelease": true,
+ "address": "/set_surface",
+ "linkId": "",
+ "bypass": false,
+ "height": 70
+ },
+ {
+ "type": "panel",
+ "id": "hidden_utils",
+ "linkId": "",
+ "height": "auto",
+ "label": false,
+ "color": "auto",
+ "css": "display:none;",
+ "default": "",
+ "value": "",
+ "precision": 2,
+ "address": "/fader_13",
+ "preArgs": [],
+ "target": [],
+ "bypass": false,
+ "scroll": true,
+ "border": true,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "loading",
+ "linkId": "",
+ "left": "auto",
+ "top": "auto",
+ "width": "auto",
+ "height": "auto",
+ "label": false,
+ "color": "transparent",
+ "css": "*{background:transparent}",
+ "default": "",
+ "value": "",
+ "address": "/fader_14",
+ "preArgs": [],
+ "vertical": false,
+ "wrap": false,
+ "align": ""
+ }
+ ],
+ "tabs": []
+ }
+ ],
+ "label": false,
+ "top": 0,
+ "left": "auto",
+ "id": "strip_2",
+ "linkId": "",
+ "width": "100%",
+ "height": "100%",
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": false,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "preArgs": [],
+ "address": "/strip_2",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "tabs": [],
+ "scroll": true
+ },
+ {
+ "label": "mixer",
+ "widgets": [
+ {
+ "type": "strip",
+ "top": 0,
+ "left": 0,
+ "id": "mixer_main",
+ "label": false,
+ "width": "100%",
+ "height": "100%",
+ "scroll": true,
+ "color": "auto",
+ "css": "",
+ "spacing": 0,
+ "variables": {},
+ "widgets": [
+ {
+ "type": "text",
+ "id": "sess_name",
+ "label": false,
+ "height": 40,
+ "vertical": false,
+ "css": "#{\n@{display_session_name}==0?\"display:none\":\"\"\n}",
+ "preArgs": [],
+ "value": " ",
+ "address": "/session_name",
+ "color": "auto",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "strip",
+ "id": "transport",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "widgets": [
+ {
+ "type": "fader",
+ "id": "shttl",
+ "label": false,
+ "alignRight": false,
+ "horizontal": true,
+ "compact": true,
+ "color": "auto",
+ "snap": false,
+ "spring": true,
+ "range": {
+ "min": -8,
+ "max": 8
+ },
+ "origin": 0,
+ "value": "",
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "address": "/set_transport_speed",
+ "preArgs": [],
+ "target": [],
+ "touchAddress": "",
+ "meterAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "unit": "",
+ "width": 114,
+ "css": "",
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "zero",
+ "linkId": "",
+ "label": "^step-backward",
+ "css": "margin: 3rem 2rem",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "color": "auto",
+ "norelease": true,
+ "address": "/goto_start",
+ "width": 55,
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "end",
+ "linkId": "",
+ "label": "^step-forward",
+ "css": "margin: 3rem 2rem",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "color": "auto",
+ "norelease": true,
+ "address": "/goto_end",
+ "width": 55,
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "play",
+ "linkId": "",
+ "label": "^play",
+ "color": "lime",
+ "css": "margin: 3rem 2rem",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "norelease": true,
+ "address": "/transport_play",
+ "width": 55,
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "transport_stop",
+ "linkId": "",
+ "label": "^stop",
+ "color": "red",
+ "css": "margin: 3rem 2rem",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "norelease": true,
+ "address": "/transport_stop",
+ "width": 55,
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "masterrec",
+ "linkId": "",
+ "label": "^circle",
+ "color": "red",
+ "css": "margin: 3rem 2rem",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "norelease": true,
+ "address": "/rec_enable_toggle",
+ "width": 55,
+ "bypass": false
+ },
+ {
+ "type": "text",
+ "id": "time",
+ "label": false,
+ "vertical": false,
+ "css": "font-size:120%; flex:4",
+ "preArgs": [],
+ "value": "00:00:00:00",
+ "address": "/position/smpte",
+ "width": 100,
+ "color": "auto",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ }
+ ],
+ "variables": {},
+ "border": false,
+ "css": "#{\n@{display_transport}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": false,
+ "spacing": 4,
+ "scroll": false,
+ "address": "/transport",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "strip_scroll_panel",
+ "label": false,
+ "color": "auto",
+ "spacing": 0,
+ "variables": {
+ "n": 1
+ },
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "channel_strip",
+ "label": false,
+ "css": "",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "chan_@{parent.variables.n}",
+ "label": false,
+ "height": 40,
+ "css": "",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "vertical": false,
+ "address": "/strip/name",
+ "value": "@{parent.variables.n}",
+ "color": "auto",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "strip",
+ "id": "trim_@{parent.variables.n}",
+ "label": false,
+ "height": 60,
+ "color": "auto",
+ "css": "#{\n@{display_trim}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "trim_meta_@{parent.variables.n}",
+ "label": false,
+ "width": 50,
+ "color": "auto",
+ "horizontal": false,
+ "stretch": true,
+ "border": false,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "trim_label_@{parent.variables.n}",
+ "label": false,
+ "color": "auto",
+ "value": "Trim",
+ "preArgs": [],
+ "address": "/trim_label_@{parent.variables.n}",
+ "vertical": false,
+ "css": "",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": "",
+ "height": "auto"
+ },
+ {
+ "type": "input",
+ "id": "trim_input_@{parent.variables.n}",
+ "label": false,
+ "color": "auto",
+ "preArgs": [],
+ "linkId": "trim_knob_@{parent.variables.n}",
+ "unit": "",
+ "editable": true,
+ "precision": 1,
+ "target": [],
+ "value": "",
+ "address": "/trim_input_@{parent.variables.n}",
+ "css": "",
+ "vertical": false,
+ "align": "",
+ "default": "",
+ "bypass": false,
+ "height": "auto"
+ }
+ ],
+ "scroll": true,
+ "css": "",
+ "address": "/trim_meta_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "knob",
+ "id": "trim_knob_@{parent.variables.n}",
+ "linkId": "trim_knob_@{parent.variables.n}",
+ "label": false,
+ "unit": "",
+ "range": {
+ "min": -20,
+ "max": 20
+ },
+ "logScale": false,
+ "precision": 2,
+ "target": [],
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "snap": false,
+ "origin": 0,
+ "spring": false,
+ "value": "",
+ "address": "/strip/trimdB",
+ "touchAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "css": "",
+ "color": "auto",
+ "angle": 270,
+ "width": "auto",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/trim_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "rec_buttons_@{parent.variables.n}",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "#{\n@{display_recbar}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "record_@{parent.variables.n}",
+ "linkId": "",
+ "label": "^circle",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "red",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "value": "",
+ "address": "/strip/recenable",
+ "led": false,
+ "css": "",
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "mon_@{parent.variables.n}",
+ "linkId": "",
+ "label": "^microphone",
+ "precision": 0,
+ "target": [],
+ "color": "orange",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "off": 0,
+ "on": 1,
+ "value": "",
+ "address": "/strip/monitor_input",
+ "led": false,
+ "css": "",
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "disk_@{parent.variables.n}",
+ "linkId": "",
+ "label": "^hdd",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 0,
+ "target": [],
+ "color": "orange",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "value": "",
+ "address": "/strip/monitor_disk",
+ "led": false,
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/top_buttons_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "fader_strip_@{parent.variables.n}",
+ "label": false,
+ "color": "auto",
+ "css": "flex:1;",
+ "spacing": 3,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "meter",
+ "id": "meter_@{parent.variables.n}",
+ "label": false,
+ "unit": "",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "dashed": true,
+ "color": "auto",
+ "range": {
+ "min": {
+ "inf": -193
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 6
+ },
+ "logScale": false,
+ "origin": "auto",
+ "value": "",
+ "address": "/strip/meter",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "css": "#{\n@{display_compact_faders} ? \n\"\" : \"margin: 20rem 0 20rem 20rem\"\n}",
+ "width": 10,
+ "linkId": "",
+ "default": "",
+ "compact": true,
+ "input": false,
+ "meter": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "precision": 2,
+ "target": "",
+ "bypass": false,
+ "touchAddress": "",
+ "meterAddress": ""
+ },
+ {
+ "type": "fader",
+ "id": "fader_@{parent.variables.n}",
+ "linkId": "fader_@{parent.variables.n}",
+ "label": false,
+ "unit": "dB",
+ "horizontal": false,
+ "css": "flex:1",
+ "range": {
+ "min": {
+ "-∞": -193
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 6
+ },
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "target": [],
+ "color": "auto",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "snap": false,
+ "compact": "#{@{display_compact_faders}}",
+ "alignRight": "#{@{display_compact_faders}}",
+ "origin": "auto",
+ "spring": false,
+ "value": "",
+ "address": "/strip/gain",
+ "touchAddress": "",
+ "meterAddress": "/strip/meter",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "width": 80,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "height": "auto",
+ "border": false,
+ "horizontal": true,
+ "stretch": false,
+ "scroll": false,
+ "address": "/fader_strip_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "input",
+ "id": "fader_input_@{parent.variables.n}",
+ "linkId": "fader_@{parent.variables.n}",
+ "label": false,
+ "unit": "dB",
+ "height": 30,
+ "color": "auto",
+ "css": "margin:3rem 3rem 0;\n#{\n@{display_input}==0?\"display:none\":\"\"\n}",
+ "editable": true,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "address": "/fader_input_@{parent.variables.n}",
+ "vertical": false,
+ "align": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "id": "pan_@{parent.variables.n}",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "height": 30,
+ "horizontal": true,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "target": [],
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "snap": false,
+ "compact": true,
+ "alignRight": false,
+ "origin": 0.5,
+ "spring": false,
+ "value": "",
+ "address": "/strip/pan_stereo_position",
+ "touchAddress": "",
+ "meterAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": true,
+ "color": "auto",
+ "css": "margin:3rem;\n#{\n@{display_pan}==0?\"display:none\":\"\"\n}",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "strip",
+ "id": "mute_buttons_@{parent.variables.n}",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "mute_@{parent.variables.n}",
+ "linkId": "",
+ "label": "Mute",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "yellow",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "value": "",
+ "address": "/strip/mute",
+ "led": false,
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "solo_@{parent.variables.n}",
+ "linkId": "",
+ "label": "Solo",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "lime",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "value": "",
+ "address": "/strip/solo",
+ "led": false,
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/bottom_buttons_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "sel_buttons_@{parent.variables.n}",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "stretch": true,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "push",
+ "id": "sel_@{parent.variables.n}",
+ "linkId": "",
+ "label": "#{\n@{display_expand}==0?\n\"Select\":\"Sel\"\n}",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "white",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "norelease": false,
+ "address": "/strip/select",
+ "width": "auto",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "expand_@{parent.variables.n}",
+ "linkId": "",
+ "label": "Sel²",
+ "css": "#{\n@{display_expand}==0?\"display:none\":\"\"\n}",
+ "on": 1,
+ "off": 0,
+ "precision": 0,
+ "target": [],
+ "color": "pink",
+ "preArgs": [
+ "@{parent.variables.n}"
+ ],
+ "value": "",
+ "address": "/strip/expand",
+ "led": false,
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/bottom_buttons_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "color": "auto",
+ "spacing": 0,
+ "border": false,
+ "horizontal": false,
+ "stretch": false,
+ "scroll": true,
+ "variables": {
+ "n": 1
+ },
+ "address": "/channel_strip",
+ "preArgs": [],
+ "linkId": "",
+ "width": 120,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "clone",
+ "id": "clone_2",
+ "widgetId": "channel_strip",
+ "css": "",
+ "props": {
+ "variables": {
+ "n": 2
+ },
+ "id": "channel_strip_2"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_3",
+ "widgetId": "channel_strip",
+ "css": "",
+ "props": {
+ "variables": {
+ "n": 3
+ },
+ "id": "channel_strip_3"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_4",
+ "widgetId": "channel_strip",
+ "css": "",
+ "props": {
+ "variables": {
+ "n": 4
+ },
+ "id": "channel_strip_4"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_5",
+ "widgetId": "channel_strip",
+ "css": "",
+ "props": {
+ "variables": {
+ "n": 5
+ },
+ "id": "channel_strip_5"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_6",
+ "widgetId": "channel_strip",
+ "css": "",
+ "props": {
+ "variables": {
+ "n": 6
+ },
+ "id": "channel_strip_6"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_7",
+ "widgetId": "#{\n@{bank_size}>6?\n\"channel_strip\" : \"\"\n}",
+ "css": "#{\n@{bank_size}<8?\n\"display:none\" : \"\"\n}",
+ "props": {
+ "variables": {
+ "n": 7
+ },
+ "id": "channel_strip_7"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_8",
+ "widgetId": "#{\n@{bank_size}>6?\n\"channel_strip\" : \"\"\n}",
+ "css": "#{\n@{bank_size}<8?\n\"display:none\" : \"\"\n}",
+ "props": {
+ "variables": {
+ "n": 8
+ },
+ "id": "channel_strip_8"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_9",
+ "widgetId": "#{\n@{bank_size}>8?\n\"channel_strip\" : \"\"\n}",
+ "css": "#{\n@{bank_size}<10?\n\"display:none\" : \"\"\n}",
+ "props": {
+ "variables": {
+ "n": 9
+ },
+ "id": "channel_strip_9"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_10",
+ "widgetId": "#{\n@{bank_size}>8?\n\"channel_strip\" : \"\"\n}",
+ "css": "#{\n@{bank_size}<10?\n\"display:none\" : \"\"\n}",
+ "props": {
+ "variables": {
+ "n": 10
+ },
+ "id": "channel_strip_10"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_11",
+ "widgetId": "#{\n@{bank_size}>10?\n\"channel_strip\" : \"\"\n}",
+ "css": "#{\n@{bank_size}<12?\n\"display:none\" : \"\"\n}",
+ "props": {
+ "variables": {
+ "n": 11
+ },
+ "id": "channel_strip_11"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "clone_12",
+ "widgetId": "#{\n@{bank_size}>10?\n\"channel_strip\" : \"\"\n}",
+ "css": "#{\n@{bank_size}<12?\n\"display:none\" : \"\"\n}",
+ "props": {
+ "variables": {
+ "n": 12
+ },
+ "id": "channel_strip_12"
+ },
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ }
+ ],
+ "css": "flex:1;\nmargin-right:1px;",
+ "border": true,
+ "scroll": true,
+ "address": "/strip_scroll_panel",
+ "preArgs": [],
+ "linkId": "",
+ "width": "auto",
+ "horizontal": true,
+ "stretch": false,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "ch_master",
+ "label": false,
+ "css": "",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "master_label",
+ "label": false,
+ "height": 40,
+ "css": "",
+ "vertical": false,
+ "value": "Master",
+ "address": "/master_label",
+ "color": "auto",
+ "preArgs": [],
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "strip",
+ "id": "master_trim_strip",
+ "label": false,
+ "height": 60,
+ "color": "auto",
+ "css": "#{\n@{display_trim}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "trim_meta_@{parent.variables.n}",
+ "label": false,
+ "width": 50,
+ "color": "auto",
+ "horizontal": false,
+ "stretch": true,
+ "border": false,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "mastertrim_label",
+ "label": false,
+ "color": "auto",
+ "css": "line-height:12rem",
+ "value": "Trim",
+ "preArgs": [],
+ "address": "/mastertrim_label",
+ "vertical": false,
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": "",
+ "height": "auto"
+ },
+ {
+ "type": "input",
+ "id": "mastertrim_input",
+ "label": false,
+ "color": "auto",
+ "preArgs": [],
+ "linkId": "mastertrim",
+ "unit": "",
+ "editable": true,
+ "precision": 1,
+ "target": [],
+ "value": "",
+ "address": "/mastertrim_input",
+ "css": "",
+ "vertical": false,
+ "align": "",
+ "default": "",
+ "bypass": false,
+ "height": "auto"
+ }
+ ],
+ "scroll": true,
+ "css": "",
+ "address": "/trim_meta_@{parent.variables.n}",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "knob",
+ "id": "mastertrim",
+ "linkId": "mastertrim",
+ "label": false,
+ "unit": "",
+ "range": {
+ "min": -20,
+ "max": 20
+ },
+ "logScale": false,
+ "precision": 2,
+ "target": [],
+ "snap": false,
+ "origin": 0,
+ "spring": false,
+ "value": "",
+ "address": "/master/trimdB",
+ "touchAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "css": "",
+ "color": "auto",
+ "angle": 270,
+ "width": "auto",
+ "preArgs": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/master_trim_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "monitor_modal_strip",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "#{\n@{display_monitor}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": true,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "modal",
+ "id": "monitor_modal",
+ "label": "^headphones",
+ "width": "auto",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "popupWidth": "140rem",
+ "popupHeight": "80%",
+ "value": "",
+ "precision": 0,
+ "address": "/modal_1",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "monitor_strip",
+ "label": false,
+ "height": "100%",
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "stretch": false,
+ "border": true,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "fader",
+ "id": "monitor",
+ "linkId": "",
+ "label": false,
+ "color": "auto",
+ "compact": false,
+ "css": "flex:1",
+ "snap": false,
+ "range": {
+ "min": {
+ "inf": -200
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 10
+ },
+ "logScale": false,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "origin": "auto",
+ "spring": false,
+ "value": "",
+ "address": "/monitor/gain",
+ "touchAddress": "",
+ "alignRight": false,
+ "horizontal": false,
+ "meter": false,
+ "meterAddress": "",
+ "unit": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "doubleTap": false,
+ "height": "auto",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "strip",
+ "id": "monitor_buttons",
+ "label": false,
+ "color": "auto",
+ "css": "font-size:10rem",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "monmute",
+ "linkId": "",
+ "label": "M",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "yellow",
+ "value": "",
+ "address": "/monitor/mute",
+ "led": false,
+ "css": "",
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "mondim",
+ "linkId": "",
+ "label": "Dim",
+ "precision": 0,
+ "target": [],
+ "color": "orange",
+ "off": 0,
+ "on": 1,
+ "value": "",
+ "address": "/monitor/dim",
+ "led": false,
+ "css": "",
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "monmono",
+ "linkId": "",
+ "label": "Mono",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 0,
+ "target": [],
+ "color": "cyan",
+ "value": "",
+ "address": "/monitor/mono",
+ "led": false,
+ "preArgs": [],
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "height": 50,
+ "spacing": 4,
+ "scroll": true,
+ "address": "/monitor_buttons",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "width": "100%",
+ "left": "auto",
+ "top": "auto",
+ "spacing": 0,
+ "scroll": true,
+ "address": "/monitor_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "popupLabel": "Monitor",
+ "linkId": "",
+ "popupLeft": "auto",
+ "popupTop": "auto",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ }
+ ],
+ "scroll": true,
+ "address": "/monitor_modal_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "master_fader_strip",
+ "label": false,
+ "color": "auto",
+ "css": "flex:1",
+ "spacing": 3,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "meter",
+ "id": "Master_meter",
+ "label": false,
+ "unit": "",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "dashed": true,
+ "color": "auto",
+ "range": {
+ "min": {
+ "inf": -193
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 6
+ },
+ "logScale": false,
+ "origin": "auto",
+ "value": "",
+ "address": "/master/meter",
+ "preArgs": [],
+ "css": "#{\n@{display_compact_faders} ? \n\"\" : \"margin: 20rem 0 20rem 20rem\"\n}",
+ "width": 10,
+ "linkId": "",
+ "default": "",
+ "compact": true,
+ "input": false,
+ "meter": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "precision": 2,
+ "target": "",
+ "bypass": false,
+ "touchAddress": "",
+ "meterAddress": ""
+ },
+ {
+ "type": "fader",
+ "id": "Master",
+ "linkId": "Master",
+ "label": false,
+ "unit": "dB",
+ "horizontal": false,
+ "css": "flex:1",
+ "range": {
+ "min": {
+ "inf": -193
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 6
+ },
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "target": [],
+ "color": "auto",
+ "snap": false,
+ "compact": "#{@{display_compact_faders}}",
+ "alignRight": "#{@{display_compact_faders}}",
+ "origin": "auto",
+ "spring": false,
+ "value": "",
+ "address": "/master/gain",
+ "touchAddress": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "width": 80,
+ "preArgs": [],
+ "meterAddress": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "height": "auto",
+ "border": false,
+ "horizontal": true,
+ "stretch": false,
+ "scroll": false,
+ "address": "/master_fader_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "input",
+ "id": "master_input",
+ "linkId": "Master",
+ "label": false,
+ "unit": "dB",
+ "height": 30,
+ "color": "auto",
+ "css": "margin:3rem 3rem 0;\n#{\n@{display_input}==0?\"display:none\":\"\"\n}",
+ "editable": true,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "address": "/master_input",
+ "vertical": false,
+ "align": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "id": "master_pan",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "height": 30,
+ "horizontal": true,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "target": [],
+ "snap": false,
+ "compact": true,
+ "alignRight": false,
+ "origin": 0.5,
+ "spring": false,
+ "value": "",
+ "address": "/master/pan_stereo_position",
+ "touchAddress": "",
+ "meterAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": true,
+ "color": "auto",
+ "css": "margin:3rem;\n#{\n@{display_pan}==0?\"display:none\":\"\"\n}",
+ "preArgs": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "strip",
+ "id": "master_mute_strip",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "stretch": true,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "mastermute",
+ "linkId": "",
+ "label": "Mute",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "yellow",
+ "value": "",
+ "address": "/master/mute",
+ "led": false,
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "solocan",
+ "linkId": "",
+ "label": "Solo",
+ "color": "red",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "norelease": true,
+ "address": "/cancel_all_solos",
+ "css": ":host:not(.on) {\n opacity:0.75;\n}",
+ "width": 55,
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/master_mute_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "bank_strip",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "stretch": true,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "push",
+ "id": "bank_dn",
+ "linkId": "",
+ "label": "^angle-left",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "norelease": false,
+ "address": "/bank_down",
+ "css": ":host:not(.on) {opacity:0.75}",
+ "width": 50,
+ "color": "auto",
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "id": "bank_up",
+ "linkId": "",
+ "label": "^angle-right",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "norelease": false,
+ "address": "/bank_up",
+ "css": ":host:not(.on) {opacity:0.75}",
+ "width": 50,
+ "color": "auto",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/monitor_modal_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "spacing": 0,
+ "border": false,
+ "horizontal": false,
+ "stretch": false,
+ "variables": "@{parent.variables}",
+ "scroll": false,
+ "color": "auto",
+ "address": "/ch_master",
+ "preArgs": [],
+ "linkId": "",
+ "width": 120,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "label": false,
+ "id": "strip_1",
+ "linkId": "",
+ "height": "auto",
+ "color": "auto",
+ "css": "flex:1",
+ "scroll": true,
+ "horizontal": true,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "preArgs": [],
+ "address": "/strip_1",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "address": "/mixer_main",
+ "preArgs": [],
+ "border": true,
+ "linkId": "",
+ "horizontal": false,
+ "stretch": false,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "id": "mixer_tab",
+ "type": "tab",
+ "css": "",
"value": "",
"precision": 0,
- "address": "/root",
"preArgs": [],
"target": [],
"variables": {},
+ "tabs": [],
+ "color": "auto",
+ "address": "/mixer_tab",
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "tab",
+ "id": "track_tab",
+ "label": "Track",
"color": "auto",
"css": "",
- "id": "root",
- "scroll": true,
- "label": false
- }
+ "value": "",
+ "precision": 0,
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "top": 0,
+ "left": 0,
+ "id": "mixer_main",
+ "label": false,
+ "width": "100%",
+ "height": "100%",
+ "scroll": true,
+ "color": "auto",
+ "css": "",
+ "spacing": 0,
+ "variables": {},
+ "widgets": [
+ {
+ "type": "clone",
+ "id": "sess_name_clone",
+ "height": 40,
+ "css": "#{\n@{display_session_name}==0?\"display:none\":\"\"\n}",
+ "widgetId": "sess_name",
+ "props": {},
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "clone",
+ "id": "transport_clone",
+ "height": 40,
+ "css": "#{\n@{display_transport}==0?\"display:none\":\"\"\n}",
+ "widgetId": "transport",
+ "props": {},
+ "label": "",
+ "variables": "@{parent.variables}"
+ },
+ {
+ "type": "strip",
+ "id": "track_panel",
+ "label": false,
+ "color": "auto",
+ "spacing": 0,
+ "variables": {},
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "select_chn",
+ "label": false,
+ "css": "",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "select_name",
+ "label": false,
+ "height": 40,
+ "css": "",
+ "vertical": false,
+ "address": "/select/name",
+ "value": " sel",
+ "preArgs": [],
+ "color": "auto",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "strip",
+ "id": "trim_select_strip",
+ "label": false,
+ "height": 60,
+ "color": "auto",
+ "css": "#{\n@{display_trim_sel}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "trim_meta_select",
+ "label": false,
+ "width": 50,
+ "color": "auto",
+ "horizontal": false,
+ "stretch": true,
+ "border": false,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "select_trim_label",
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "value": "Trim",
+ "preArgs": [],
+ "address": "/select_trim_label",
+ "vertical": false,
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": "",
+ "height": "auto"
+ },
+ {
+ "type": "input",
+ "id": "select_trim_input",
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "preArgs": [],
+ "linkId": "select_trim_knob",
+ "unit": "",
+ "editable": true,
+ "precision": 1,
+ "target": [],
+ "address": "/select_trim_input",
+ "value": "",
+ "vertical": false,
+ "align": "",
+ "default": "",
+ "bypass": false,
+ "height": "auto"
+ }
+ ],
+ "scroll": true,
+ "css": "",
+ "address": "/trim_meta_select",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "knob",
+ "id": "select_trim_knob",
+ "linkId": "select_trim_knob",
+ "label": false,
+ "unit": "",
+ "range": {
+ "min": -20,
+ "max": 20
+ },
+ "logScale": false,
+ "precision": 2,
+ "target": [],
+ "snap": false,
+ "origin": 0,
+ "spring": false,
+ "value": "",
+ "address": "/select/trimdB",
+ "touchAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "css": "",
+ "color": "auto",
+ "angle": 270,
+ "width": "auto",
+ "preArgs": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/trim_select_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "toggle",
+ "id": "polarity_select",
+ "linkId": "",
+ "height": 32,
+ "label": "∅",
+ "color": "auto",
+ "css": "margin:4rem;\nfont-weight:bold;\n#{\n@{display_polarity_sel}==0?\"display:none\":\"\"\n}",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "address": "/select/polarity",
+ "preArgs": [],
+ "target": [],
+ "bypass": false
+ },
+ {
+ "type": "strip",
+ "id": "top_buttons_select",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "#{\n@{display_recbar_sel}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "record_select",
+ "linkId": "",
+ "label": "^circle",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "red",
+ "value": "",
+ "address": "/select/recenable",
+ "led": false,
+ "css": "",
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "mon_select",
+ "linkId": "",
+ "label": "^microphone",
+ "precision": 0,
+ "target": [],
+ "color": "orange",
+ "off": 0,
+ "on": 1,
+ "value": "",
+ "address": "/select/monitor_input",
+ "led": false,
+ "css": "",
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "disk_select",
+ "linkId": "",
+ "label": "^hdd",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 0,
+ "target": [],
+ "color": "orange",
+ "value": "",
+ "address": "/select/monitor_disk",
+ "led": false,
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/top_buttons_select",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "sends_receive_buttons_select",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "modal",
+ "id": "receives_panel",
+ "label": "Receives",
+ "color": "auto",
+ "css": "display:none",
+ "widgets": [],
+ "popupWidth": "75%",
+ "popupHeight": "75%",
+ "address": "/receives_panel",
+ "variables": {},
+ "value": "",
+ "precision": 0,
+ "preArgs": [],
+ "target": [],
+ "doubleTap": false,
+ "height": "auto",
+ "popupLabel": "",
+ "linkId": "",
+ "popupLeft": "auto",
+ "popupTop": "auto",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "modal",
+ "id": "sends_panel",
+ "label": "Sends",
+ "color": "auto",
+ "css": "",
+ "widgets": [],
+ "popupWidth": "75%",
+ "popupHeight": "75%",
+ "address": "/sends_panel",
+ "variables": {},
+ "value": "",
+ "precision": 0,
+ "preArgs": [],
+ "target": [],
+ "doubleTap": false,
+ "height": "auto",
+ "popupLabel": "",
+ "linkId": "",
+ "popupLeft": "auto",
+ "popupTop": "auto",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ }
+ ],
+ "scroll": true,
+ "address": "/sends_receive_buttons_select",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "fader_select_strip",
+ "label": false,
+ "color": "auto",
+ "css": "flex:1",
+ "spacing": 3,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "meter",
+ "id": "meter_select",
+ "label": false,
+ "unit": "",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "dashed": true,
+ "color": "auto",
+ "range": {
+ "min": {
+ "inf": -193
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 6
+ },
+ "logScale": false,
+ "origin": "auto",
+ "value": "",
+ "address": "/select/meter",
+ "css": "#{\n@{display_compact_faders} ? \n\"\" : \"margin: 20rem 0 20rem 20rem\"\n}",
+ "width": 10,
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "compact": true,
+ "input": false,
+ "meter": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "precision": 2,
+ "target": "",
+ "bypass": false,
+ "touchAddress": "",
+ "meterAddress": ""
+ },
+ {
+ "type": "fader",
+ "id": "fader_select",
+ "linkId": "fader_select",
+ "label": false,
+ "unit": "dB",
+ "horizontal": false,
+ "css": "flex:1",
+ "range": {
+ "min": {
+ "inf": -193
+ },
+ "6%": -60,
+ "12%": -50,
+ "20%": -40,
+ "30%": -30,
+ "42%": -20,
+ "60%": -10,
+ "80%": 0,
+ "max": 6
+ },
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "target": [],
+ "color": "auto",
+ "snap": false,
+ "compact": "#{@{display_compact_faders}}",
+ "alignRight": "#{@{display_compact_faders}}",
+ "origin": "auto",
+ "spring": false,
+ "value": "",
+ "address": "/select/gain",
+ "touchAddress": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "doubleTap": false,
+ "width": 80,
+ "meterAddress": "",
+ "preArgs": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "height": "auto",
+ "border": false,
+ "horizontal": true,
+ "stretch": false,
+ "scroll": false,
+ "address": "/fader_select_strip",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "input",
+ "id": "fader_input_select",
+ "linkId": "fader_select",
+ "label": false,
+ "unit": "dB",
+ "height": 30,
+ "color": "auto",
+ "css": "margin:3rem 3rem 0;\n#{\n@{display_input}==0?\"display:none\":\"\"\n}",
+ "editable": true,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "address": "/fader_input_select",
+ "vertical": false,
+ "align": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "id": "pan_select",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "height": 30,
+ "horizontal": true,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "target": [],
+ "snap": false,
+ "compact": true,
+ "alignRight": false,
+ "origin": 0.5,
+ "spring": false,
+ "value": "",
+ "address": "/select/pan_stereo_position",
+ "touchAddress": "",
+ "meterAddress": "",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "doubleTap": true,
+ "color": "auto",
+ "css": "margin:3rem;\n#{\n@{display_pan_sel}==0?\"display:none\":\"\"\n}",
+ "preArgs": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "strip",
+ "id": "bottom_buttons_select",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "mute_select",
+ "linkId": "",
+ "label": "Mute",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "yellow",
+ "value": "",
+ "address": "/select/mute",
+ "led": false,
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "solo_select",
+ "linkId": "",
+ "label": "Solo",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "target": [],
+ "color": "lime",
+ "value": "",
+ "address": "/select/solo",
+ "led": false,
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/bottom_buttons_select",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "bottom_buttons_select",
+ "label": false,
+ "height": 40,
+ "color": "auto",
+ "css": "#{\n@{display_expand}==0?\"display:none\":\"\"\n}",
+ "horizontal": true,
+ "stretch": true,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "expand_select",
+ "linkId": "",
+ "label": "Sel²",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 0,
+ "target": [],
+ "color": "pink",
+ "value": "",
+ "address": "/select/expand",
+ "led": false,
+ "width": "auto",
+ "preArgs": [],
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "scroll": true,
+ "address": "/bottom_buttons_select",
+ "preArgs": [],
+ "linkId": "",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "color": "auto",
+ "spacing": 0,
+ "border": false,
+ "horizontal": false,
+ "stretch": false,
+ "variables": "@{parent.variables}",
+ "scroll": true,
+ "address": "/select_chn",
+ "preArgs": [],
+ "linkId": "",
+ "width": 120,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "plugins_panel_wrapper",
+ "label": false,
+ "scroll": true,
+ "color": "auto",
+ "css": "flex:1",
+ "spacing": 0,
+ "variables": {},
+ "widgets": [
+ {
+ "type": "text",
+ "label": false,
+ "height": 40,
+ "value": "Plugins",
+ "id": "text_1",
+ "color": "auto",
+ "css": "",
+ "vertical": false,
+ "preArgs": [],
+ "address": "/text_1",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "strip",
+ "id": "plugins_panel",
+ "linkId": "",
+ "label": false,
+ "height": "auto",
+ "color": "auto",
+ "css": "flex:1;margin:0rem",
+ "scroll": true,
+ "horizontal": false,
+ "stretch": false,
+ "border": false,
+ "spacing": 4,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "push",
+ "height": 60,
+ "label": "^sync-alt",
+ "address": "/refresh_plugin_list",
+ "norelease": true,
+ "id": "push_6",
+ "linkId": "",
+ "color": "auto",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "bypass": false
+ }
+ ],
+ "preArgs": [],
+ "address": "/plugins_panel",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "address": "/plugins_panel",
+ "preArgs": [],
+ "border": false,
+ "linkId": "",
+ "horizontal": false,
+ "stretch": false,
+ "width": "auto",
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ },
+ {
+ "type": "clone",
+ "id": "master_clone",
+ "css": "",
+ "widgetId": "ch_master",
+ "props": {},
+ "width": 120,
+ "label": "",
+ "variables": "@{parent.variables}"
+ }
+ ],
+ "css": "flex:1",
+ "height": "auto",
+ "border": true,
+ "scroll": true,
+ "address": "/strip_scroll_panel",
+ "preArgs": [],
+ "linkId": "",
+ "horizontal": true,
+ "stretch": false,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "address": "/mixer_main",
+ "preArgs": [],
+ "border": true,
+ "linkId": "",
+ "horizontal": false,
+ "stretch": false,
+ "default": "",
+ "value": "",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "tabs": []
+ }
+ ],
+ "tabs": [],
+ "address": "/track_tab",
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ }
+ ],
+ "value": "",
+ "precision": 0,
+ "address": "/root",
+ "preArgs": [],
+ "target": [
+ null
+ ],
+ "variables": {},
+ "color": "auto",
+ "css": "",
+ "id": "root",
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "traversing": false,
+ "scroll": true,
+ "label": false
+ }
]
\ No newline at end of file
diff --git a/app/examples/demo.json b/app/examples/demo.json
index 524903a4..dc076022 100644
--- a/app/examples/demo.json
+++ b/app/examples/demo.json
@@ -1,811 +1,892 @@
[
- {
- "type": "root",
- "tabs": [
- {
+ {
+ "type": "root",
+ "tabs": [
+ {
+ "type": "tab",
+ "id": "tab_2",
+ "label": "Open Stage Control",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_2",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "top": 10,
+ "left": 10,
+ "id": "strip_4",
+ "label": "Strips",
+ "width": 100,
+ "height": 450,
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "stretch": false,
+ "spacing": 5,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "text",
+ "id": "text_1",
+ "label": false,
+ "height": 30,
+ "vertical": false,
+ "color": "auto",
+ "css": "",
+ "value": 1,
+ "preArgs": [],
+ "address": "/text_1",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "strip",
+ "id": "strip_5",
+ "label": false,
+ "height": 30,
+ "color": "auto",
+ "horizontal": true,
+ "stretch": true,
+ "spacing": 5,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "toggle_1",
+ "linkId": "",
+ "label": false,
+ "led": false,
+ "color": "auto",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "width": "auto",
+ "address": "/toggle_1",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "linkId": "",
+ "label": false,
+ "led": false,
+ "color": "auto",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "width": "auto",
+ "id": "toggle_2",
+ "address": "/toggle_2",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "toggle_3",
+ "label": false,
+ "led": false,
+ "color": "auto",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/toggle_3",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "css": "",
+ "border": true,
+ "scroll": true,
+ "address": "/strip_5",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "strip_6",
+ "label": false,
+ "height": 50,
+ "color": "auto",
+ "css": "margin-bottom:-10rem",
+ "horizontal": true,
+ "stretch": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "knob",
+ "id": "knob_1",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "width": "auto",
+ "color": "auto",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": "auto",
+ "value": "",
+ "logScale": false,
+ "precision": 2,
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "address": "/knob_1",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "id": "knob_2",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "width": "auto",
+ "color": "auto",
+ "pips": false,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": "auto",
+ "value": "",
+ "logScale": false,
+ "precision": 2,
+ "address": "/knob_2",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "border": false,
+ "scroll": true,
+ "address": "/strip_6",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "strip_1",
+ "label": false,
+ "color": "auto",
+ "css": "flex:1",
+ "horizontal": true,
+ "stretch": false,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "meter",
+ "id": "meter_1",
+ "label": false,
+ "unit": "",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "dashed": true,
+ "color": "auto",
+ "css": "margin: 20rem 0 20rem 10rem;",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "origin": "auto",
+ "value": "@{knob_1}",
+ "address": "/meter_1",
+ "preArgs": [],
+ "width": 10,
+ "linkId": "",
+ "gradient": [],
+ "default": "",
+ "compact": true,
+ "input": false
+ },
+ {
+ "type": "meter",
+ "id": "meter_2",
+ "label": false,
+ "unit": "",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "dashed": true,
+ "color": "auto",
+ "css": "margin: 20rem 0",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "origin": "auto",
+ "value": "@{knob_2}",
+ "address": "/meter_1",
+ "preArgs": [],
+ "width": 10,
+ "linkId": "",
+ "gradient": [],
+ "default": "",
+ "compact": true,
+ "input": false
+ },
+ {
+ "type": "fader",
+ "id": "fader_1",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "width": "auto",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": true,
+ "input": false,
+ "compact": false,
+ "dashed": false,
+ "color": "auto",
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": "auto",
+ "value": "",
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "address": "/fader_1",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "height": "auto",
+ "border": false,
+ "scroll": true,
+ "address": "/strip_1",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "fader",
+ "id": "fader_2",
+ "linkId": "",
+ "label": false,
+ "unit": "",
+ "height": 30,
+ "alignRight": false,
+ "horizontal": true,
+ "pips": false,
+ "input": false,
+ "compact": true,
+ "dashed": false,
+ "color": "auto",
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": 0.5,
+ "value": 0.5,
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "address": "/fader_2",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "strip",
+ "id": "strip_3",
+ "label": false,
+ "height": 30,
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "stretch": false,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "id": "toggle_4",
+ "linkId": "",
+ "label": "M",
+ "led": false,
+ "color": "yellow",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "preArgs": [],
+ "target": [],
+ "width": "auto",
+ "address": "/toggle_4",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "id": "toggle_5",
+ "linkId": "",
+ "label": "S",
+ "led": false,
+ "color": "lime",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/toggle_5",
+ "preArgs": [],
+ "target": [],
+ "width": "auto",
+ "doubleTap": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "spacing": 0,
+ "border": true,
+ "scroll": true,
+ "address": "/strip_3",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ }
+ ],
+ "border": true,
+ "scroll": true,
+ "address": "/strip_4",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "panel",
+ "top": 10,
+ "left": 120,
+ "id": "panel_1",
+ "label": "Pads",
+ "width": 350,
+ "height": 350,
+ "scroll": true,
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/panel_1",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [],
+ "tabs": [
+ {
"type": "tab",
- "id": "tab_2",
- "label": "Open Stage Control",
+ "id": "tab_3",
+ "label": "Xy",
"color": "auto",
"css": "",
"layout": "",
"spacing": 0,
"value": "",
"precision": 0,
- "address": "/tab_2",
+ "address": "/tab_3",
"preArgs": [],
"target": [],
"variables": "@{parent.variables}",
"widgets": [
- {
- "type": "strip",
- "top": 10,
- "left": 10,
- "id": "strip_4",
- "label": "Strips",
- "width": 100,
- "height": 450,
- "color": "auto",
- "css": "",
- "horizontal": false,
- "stretch": false,
- "spacing": 5,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "text",
- "id": "text_1",
- "label": false,
- "height": 30,
- "vertical": false,
- "color": "auto",
- "css": "",
- "widgetId": "",
- "value": 1,
- "preArgs": [],
- "address": "/text_1"
- },
- {
- "type": "strip",
- "id": "strip_5",
- "label": false,
- "height": 30,
- "color": "auto",
- "horizontal": true,
- "stretch": true,
- "spacing": 5,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "toggle_1",
- "linkId": "",
- "label": false,
- "led": false,
- "color": "auto",
- "css": "",
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "width": "auto",
- "address": "/toggle_1",
- "doubleTap": false
- },
- {
- "type": "toggle",
- "linkId": "",
- "label": false,
- "led": false,
- "color": "auto",
- "css": "",
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "width": "auto",
- "id": "toggle_2",
- "address": "/toggle_2",
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "toggle_3",
- "label": false,
- "led": false,
- "color": "auto",
- "css": "",
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "address": "/toggle_3",
- "preArgs": [],
- "target": [],
- "linkId": "",
- "width": "auto",
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "css": "",
- "border": true,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "strip_6",
- "label": false,
- "height": 50,
- "color": "auto",
- "css": "margin-bottom:-10rem",
- "horizontal": true,
- "stretch": true,
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "knob",
- "id": "knob_1",
- "linkId": "",
- "label": false,
- "unit": "",
- "width": "auto",
- "color": "auto",
- "pips": false,
- "input": false,
- "dashed": false,
- "angle": 270,
- "css": "",
- "snap": false,
- "spring": false,
- "doubleTap": false,
- "range": {
- "min": 0,
- "max": 1
- },
- "origin": "auto",
- "value": "",
- "logScale": false,
- "precision": 2,
- "touchAddress": "",
- "preArgs": [],
- "target": [],
- "address": "/knob_1"
- },
- {
- "type": "knob",
- "id": "knob_2",
- "linkId": "",
- "label": false,
- "unit": "",
- "width": "auto",
- "color": "auto",
- "pips": false,
- "input": false,
- "dashed": false,
- "angle": 270,
- "css": "",
- "snap": false,
- "spring": false,
- "doubleTap": false,
- "range": {
- "min": 0,
- "max": 1
- },
- "origin": "auto",
- "value": "",
- "logScale": false,
- "precision": 2,
- "address": "/knob_2",
- "touchAddress": "",
- "preArgs": [],
- "target": []
- }
- ],
- "_style": "style",
- "_children": "children",
- "border": false,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "strip",
- "id": "strip_1",
- "label": false,
- "color": "auto",
- "css": "flex:1",
- "horizontal": true,
- "stretch": false,
- "spacing": 0,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "meter",
- "id": "meter_1",
- "label": false,
- "unit": "",
- "alignRight": false,
- "horizontal": false,
- "pips": false,
- "dashed": true,
- "color": "auto",
- "css": "margin: 20rem 0 20rem 10rem;",
- "widgetId": "knob_1",
- "range": {
- "min": 0,
- "max": 1
- },
- "logScale": false,
- "origin": "auto",
- "value": "",
- "address": "/meter_1",
- "preArgs": [],
- "width": 10,
- "compact": true,
- "input": false
- },
- {
- "type": "meter",
- "id": "meter_2",
- "label": false,
- "unit": "",
- "alignRight": false,
- "horizontal": false,
- "pips": false,
- "dashed": true,
- "color": "auto",
- "css": "margin: 20rem 0",
- "widgetId": "knob_2",
- "range": {
- "min": 0,
- "max": 1
- },
- "logScale": false,
- "origin": "auto",
- "value": "",
- "address": "/meter_1",
- "preArgs": [],
- "width": 10,
- "compact": true,
- "input": false
- },
- {
- "type": "fader",
- "id": "fader_1",
- "linkId": "",
- "label": false,
- "unit": "",
- "width": "auto",
- "alignRight": false,
- "horizontal": false,
- "pips": true,
- "input": false,
- "compact": false,
- "dashed": false,
- "color": "auto",
- "css": "",
- "snap": false,
- "spring": false,
- "doubleTap": false,
- "range": {
- "min": 0,
- "max": 1
- },
- "origin": "auto",
- "value": "",
- "logScale": false,
- "precision": 2,
- "meter": false,
- "address": "/fader_1",
- "touchAddress": "",
- "meterAddress": "",
- "preArgs": [],
- "target": []
- }
- ],
- "_style": "style",
- "_children": "children",
- "height": "auto",
- "border": false,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- },
- {
- "type": "fader",
- "id": "fader_2",
- "linkId": "",
- "label": false,
- "unit": "",
- "height": 30,
- "alignRight": false,
- "horizontal": true,
- "pips": false,
- "input": false,
- "compact": true,
- "dashed": false,
- "color": "auto",
- "css": "",
- "snap": false,
- "spring": false,
- "doubleTap": false,
- "range": {
- "min": 0,
- "max": 1
- },
- "origin": 0.5,
- "value": 0.5,
- "logScale": false,
- "precision": 2,
- "meter": false,
- "address": "/fader_2",
- "touchAddress": "",
- "meterAddress": "",
- "preArgs": [],
- "target": []
- },
- {
- "type": "strip",
- "id": "strip_3",
- "label": false,
- "height": 30,
- "color": "auto",
- "css": "",
- "horizontal": true,
- "stretch": false,
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "toggle",
- "id": "toggle_4",
- "linkId": "",
- "label": "M",
- "led": false,
- "color": "yellow",
- "css": "",
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "preArgs": [],
- "target": [],
- "width": "auto",
- "address": "/toggle_4",
- "doubleTap": false
- },
- {
- "type": "toggle",
- "id": "toggle_5",
- "linkId": "",
- "label": "S",
- "led": false,
- "color": "lime",
- "css": "",
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "address": "/toggle_5",
- "preArgs": [],
- "target": [],
- "width": "auto",
- "doubleTap": false
- }
- ],
- "_style": "style",
- "_children": "children",
- "spacing": 0,
- "border": true,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
- }
- ],
- "_style": "style",
- "_children": "children",
- "border": true,
- "scroll": true,
- "_geometry": "geometry",
- "_panel": "panel",
- "layout": "",
- "value": "",
- "_osc": "osc",
- "precision": 0,
- "address": "auto",
- "preArgs": [],
- "target": [],
- "tabs": []
+ {
+ "type": "xy",
+ "top": 0,
+ "left": 0,
+ "id": "xy_1",
+ "linkId": "",
+ "label": false,
+ "width": "100%",
+ "height": "100%",
+ "input": true,
+ "pips": true,
+ "color": "auto",
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "rangeX": {
+ "min": 0,
+ "25%": 0.25,
+ "50%": 0.5,
+ "75%": 0.75,
+ "max": 1
},
- {
- "type": "panel",
- "top": 10,
- "left": 120,
- "id": "panel_1",
- "label": "Pads",
- "width": 350,
- "height": 350,
- "scroll": true,
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/panel_1",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [],
- "tabs": [
- {
- "type": "tab",
- "id": "tab_3",
- "label": "Xy",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/tab_3",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "xy",
- "top": 0,
- "left": 0,
- "id": "xy_1",
- "linkId": "",
- "label": false,
- "width": "100%",
- "height": "100%",
- "input": true,
- "pips": true,
- "color": "auto",
- "css": "",
- "snap": false,
- "spring": false,
- "doubleTap": false,
- "rangeX": {
- "min": 0,
- "25%": 0.25,
- "50%": 0.5,
- "75%": 0.75,
- "max": 1
- },
- "rangeY": {
- "min": 0,
- "25%": 0.25,
- "50%": 0.5,
- "75%": 0.75,
- "max": 1
- },
- "logScaleX": false,
- "logScaleY": false,
- "value": [
- 0.5,
- 0.5
- ],
- "precision": 2,
- "address": "/xy_1",
- "touchAddress": "",
- "preArgs": [],
- "split": false,
- "target": [],
- "pointSize": 20
- }
- ],
- "tabs": [],
- "scroll": true
- },
- {
- "type": "tab",
- "id": "tab_5",
- "label": "rgb",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/tab_5",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "rgb",
- "id": "rgb_1",
- "linkId": "",
- "label": false,
- "left": 0,
- "top": 0,
- "width": "100%",
- "height": "100%",
- "input": true,
- "css": "",
- "snap": false,
- "spring": false,
- "value": "",
- "precision": 0,
- "address": "/rgb_1",
- "touchAddress": "",
- "preArgs": [],
- "split": false,
- "target": [],
- "pointSize": 10
- }
- ],
- "tabs": [],
- "scroll": true
- },
- {
- "type": "tab",
- "id": "tab_4",
- "label": "MultiXy",
- "color": "auto",
- "css": "",
- "layout": "",
- "spacing": 0,
- "value": "",
- "precision": 0,
- "address": "/tab_4",
- "preArgs": [],
- "target": [],
- "variables": "@{parent.variables}",
- "widgets": [
- {
- "type": "multixy",
- "id": "xy_2",
- "label": false,
- "width": "100%",
- "height": "100%",
- "pips": true,
- "color": "auto",
- "css": "",
- "snap": false,
- "spring": false,
- "rangeX": {
- "min": 0,
- "25%": 0.25,
- "50%": 0.5,
- "75%": 0.75,
- "max": 1
- },
- "rangeY": {
- "min": 0,
- "25%": 0.25,
- "50%": 0.5,
- "75%": 0.75,
- "max": 1
- },
- "logScaleX": false,
- "logScaleY": false,
- "value": [
- 0.25,
- 0.5,
- 0.75,
- 0.5
- ],
- "precision": 2,
- "address": "/xy_2",
- "touchAddress": "",
- "preArgs": [],
- "split": false,
- "target": [],
- "linkId": "",
- "left": "auto",
- "top": "auto",
- "points": 2,
- "pointSize": 20
- }
- ],
- "tabs": [],
- "scroll": true
- }
- ],
- "border": true
+ "rangeY": {
+ "min": 0,
+ "25%": 0.25,
+ "50%": 0.5,
+ "75%": 0.75,
+ "max": 1
},
- {
- "type": "dropdown",
- "top": 10,
- "left": 480,
- "id": "dropdown_1",
- "linkId": "",
- "label": "Color",
- "width": 130,
- "height": "auto",
- "color": "auto",
- "css": "",
- "precision": 2,
- "address": "/EDIT",
- "preArgs": [
- "root"
- ],
- "target": [
- "self"
- ],
- "value": "{ \"color\": \"auto\" }",
- "values": {
- "Default": "{ \"color\": \"auto\" }",
- "Orange": "{ \"color\": \"orange\" }"
- }
- },
- {
- "type": "keyboard",
- "top": 370,
- "left": 120,
- "id": "keyboard",
- "keys": 36,
- "start": 60,
- "label": "auto",
- "width": 350,
- "height": 90,
- "color": "auto",
- "css": "",
- "traversing": true,
- "on": 1,
- "off": 0,
- "precision": 2,
- "address": "/keyboard_1",
- "preArgs": [],
- "split": false,
- "target": []
- },
- {
- "type": "multifader",
- "top": 80,
- "left": 480,
- "id": "multifader",
- "strips": 16,
- "start": 0,
- "label": "auto",
- "unit": "",
- "width": 130,
- "height": 380,
- "alignRight": false,
- "horizontal": true,
- "pips": false,
- "input": false,
- "compact": true,
- "dashed": false,
- "color": "auto",
- "css": "",
- "traversing": true,
- "snap": true,
- "range": {
- "min": 0,
- "max": 1
- },
- "value": "",
- "origin": "auto",
- "logScale": false,
- "precision": 2,
- "meter": false,
- "address": "/multifader_1",
- "preArgs": [],
- "split": false,
- "target": []
- },
- {
- "type": "multipush",
- "top": 10,
- "left": 620,
- "id": "multipush",
- "matrix": [
- 2,
- 4
- ],
- "start": 0,
- "spacing": 5,
- "label": "auto",
- "width": 130,
- "height": 220,
- "color": "auto",
- "css": "",
- "traversing": true,
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "address": "/multipush",
- "preArgs": [],
- "split": false,
- "target": [],
- "norelease": false
- },
- {
- "type": "multitoggle",
- "top": 240,
- "left": 620,
- "matrix": [
- 2,
- 4
- ],
- "start": 0,
- "spacing": 5,
- "label": "auto",
- "width": 130,
- "height": 220,
- "color": "auto",
- "css": "",
- "traversing": true,
- "on": 1,
- "off": 0,
- "value": "",
- "precision": 2,
- "address": "/multitoggle",
- "preArgs": [],
- "split": false,
- "target": [],
- "led": true,
- "id": "multitoggle"
- },
- {
- "type": "plot",
- "top": 470,
- "left": 10,
- "id": "plot_1",
- "width": 740,
- "height": 140,
- "label": "Plot (multifader)",
- "color": "auto",
- "css": "",
- "points": "multifader",
- "rangeX": {
- "min": 0,
- "max": 1
- },
- "rangeY": {
- "min": 0,
- "max": 1
- },
- "origin": "auto",
- "logScaleX": false,
- "logScaleY": false,
- "pips": false,
- "address": "/plot_1",
- "preArgs": [],
- "smooth": true
- }
+ "logScaleX": false,
+ "logScaleY": false,
+ "value": [
+ 0.5,
+ 0.5
+ ],
+ "precision": 2,
+ "address": "/xy_1",
+ "touchAddress": "",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "pointSize": 20,
+ "default": "",
+ "bypass": false
+ }
],
"tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
"scroll": true
- }
+ },
+ {
+ "type": "tab",
+ "id": "tab_5",
+ "label": "rgb",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_5",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "rgb",
+ "id": "rgb_1",
+ "linkId": "",
+ "label": false,
+ "left": 0,
+ "top": 0,
+ "width": "100%",
+ "height": "100%",
+ "input": true,
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "value": "",
+ "precision": 0,
+ "address": "/rgb_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "range": {
+ "min": 0,
+ "max": 255
+ },
+ "default": "",
+ "bypass": false,
+ "pointSize": 10
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "tab",
+ "id": "tab_4",
+ "label": "MultiXy",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_4",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "multixy",
+ "id": "xy_2",
+ "label": false,
+ "width": "100%",
+ "height": "100%",
+ "pips": true,
+ "color": "auto",
+ "css": "",
+ "snap": false,
+ "spring": false,
+ "rangeX": {
+ "min": 0,
+ "25%": 0.25,
+ "50%": 0.5,
+ "75%": 0.75,
+ "max": 1
+ },
+ "rangeY": {
+ "min": 0,
+ "25%": 0.25,
+ "50%": 0.5,
+ "75%": 0.75,
+ "max": 1
+ },
+ "logScaleX": false,
+ "logScaleY": false,
+ "value": [
+ 0.25,
+ 0.5,
+ 0.75,
+ 0.5
+ ],
+ "precision": 2,
+ "address": "/xy_2",
+ "touchAddress": "",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "linkId": "",
+ "left": "auto",
+ "top": "auto",
+ "points": 2,
+ "pointSize": 20,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ }
+ ],
+ "border": true,
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "dropdown",
+ "top": 10,
+ "left": 480,
+ "id": "color_picker",
+ "linkId": "",
+ "label": "Color",
+ "width": 130,
+ "height": 60,
+ "color": "auto",
+ "css": "",
+ "precision": 2,
+ "value": "auto",
+ "values": {
+ "Default": "auto",
+ "Orange": "orange"
+ },
+ "address": "/dropdown_1",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "keyboard",
+ "top": 370,
+ "left": 120,
+ "id": "keyboard",
+ "keys": 36,
+ "start": 60,
+ "label": "auto",
+ "width": 350,
+ "height": 90,
+ "color": "auto",
+ "css": "",
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "address": "/keyboard_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "bypass": false
+ },
+ {
+ "type": "multifader",
+ "top": 80,
+ "left": 480,
+ "id": "multifader",
+ "strips": 16,
+ "start": 0,
+ "label": "auto",
+ "unit": "",
+ "width": 130,
+ "height": 380,
+ "alignRight": false,
+ "horizontal": true,
+ "pips": false,
+ "input": false,
+ "compact": true,
+ "dashed": false,
+ "color": "auto",
+ "css": "",
+ "traversing": true,
+ "snap": true,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "value": "",
+ "origin": "auto",
+ "logScale": false,
+ "precision": 2,
+ "meter": false,
+ "address": "/multifader_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multipush",
+ "top": 10,
+ "left": 620,
+ "id": "multipush",
+ "matrix": [
+ 2,
+ 4
+ ],
+ "start": 0,
+ "spacing": 5,
+ "label": "auto",
+ "width": 130,
+ "height": 220,
+ "color": "auto",
+ "css": "",
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/multipush",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "norelease": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multitoggle",
+ "top": 240,
+ "left": 620,
+ "matrix": [
+ 2,
+ 4
+ ],
+ "start": 0,
+ "spacing": 5,
+ "label": "auto",
+ "width": 130,
+ "height": 220,
+ "color": "auto",
+ "css": "",
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/multitoggle",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "led": true,
+ "id": "multitoggle",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "plot",
+ "top": 470,
+ "left": 10,
+ "id": "plot_1",
+ "width": 740,
+ "height": 140,
+ "label": "Plot (multifader)",
+ "color": "auto",
+ "css": "",
+ "rangeX": {
+ "min": 0,
+ "max": 1
+ },
+ "rangeY": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": "auto",
+ "logScaleX": false,
+ "logScaleY": false,
+ "pips": false,
+ "address": "/plot_1",
+ "preArgs": [],
+ "smooth": true,
+ "linkId": "",
+ "dots": true,
+ "bars": false,
+ "value": "@{multifader}",
+ "default": ""
+ }
],
- "color": "auto",
- "css": "",
- "value": "",
- "precision": 0,
- "address": "/root",
- "preArgs": [],
- "target": [],
- "variables": {},
- "id": "root",
- "scroll": true,
- "label": false
- }
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ }
+ ],
+ "color": "@{color_picker}",
+ "css": "",
+ "value": "",
+ "precision": 0,
+ "address": "/root",
+ "preArgs": [],
+ "target": [],
+ "variables": {},
+ "id": "root",
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true,
+ "label": false
+ }
]
\ No newline at end of file
diff --git a/app/examples/keys.json b/app/examples/keys.json
new file mode 100644
index 00000000..d5584586
--- /dev/null
+++ b/app/examples/keys.json
@@ -0,0 +1,156 @@
+[
+ {
+ "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": "#{\nx = key == \"r\" ? 0.1 : -0.1;\n@{fader_1} + x\n}",
+ "repeat": true,
+ "keyup": "",
+ "linkId": ">> A"
+ },
+ {
+ "type": "fader",
+ "top": 0,
+ "left": 0,
+ "id": "fader_1",
+ "linkId": "<< A",
+ "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": "<< B",
+ "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"
+ ],
+ "keydown": "#{\nx = key == \"t\" ? 0.1 : -0.1;\n@{xy_1}[0] + x\n@{xy_1}[1] + x\n}",
+ "keyup": "",
+ "repeat": false,
+ "linkId": ">> B"
+ }
+ ],
+ "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
+ }
+]
\ No newline at end of file
diff --git a/app/examples/svg.json b/app/examples/svg.json
new file mode 100644
index 00000000..1cca103c
--- /dev/null
+++ b/app/examples/svg.json
@@ -0,0 +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\n\n",
+ "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
+ }
+]
\ No newline at end of file
diff --git a/app/examples/widgets.json b/app/examples/widgets.json
new file mode 100644
index 00000000..2f307a94
--- /dev/null
+++ b/app/examples/widgets.json
@@ -0,0 +1,1970 @@
+[
+ {
+ "type": "root",
+ "tabs": [
+ {
+ "type": "tab",
+ "id": "tab_1",
+ "label": "Sliders",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_1",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "fader",
+ "top": 0,
+ "left": 0,
+ "id": "fader_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "alignRight": false,
+ "pips": false,
+ "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": "fader",
+ "top": 0,
+ "left": 100,
+ "id": "fader_2",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "alignRight": false,
+ "pips": true,
+ "input": true,
+ "meter": true,
+ "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_2",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "top": 0,
+ "left": 200,
+ "id": "fader_3",
+ "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_3",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "top": 300,
+ "left": 0,
+ "id": "knob_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_1",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "top": 0,
+ "left": 300,
+ "id": "fader_4",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "alignRight": false,
+ "pips": true,
+ "input": true,
+ "meter": false,
+ "compact": true,
+ "dashed": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/fader_4",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "top": 300,
+ "left": 100,
+ "id": "knob_2",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_2",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "top": 300,
+ "left": 200,
+ "id": "knob_3",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_3",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "encoder",
+ "top": 300,
+ "left": 300,
+ "id": "encoder_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "ticks": 360,
+ "back": -1,
+ "forth": 1,
+ "release": "",
+ "snap": false,
+ "doubleTap": false,
+ "precision": 2,
+ "address": "/encoder_1",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "top": 0,
+ "left": 410,
+ "id": "fader_5",
+ "linkId": "",
+ "width": "auto",
+ "height": 80,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "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_5",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "range",
+ "top": 180,
+ "left": 410,
+ "id": "range_1",
+ "linkId": "",
+ "width": "auto",
+ "height": 80,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "alignRight": false,
+ "input": true,
+ "compact": false,
+ "pips": true,
+ "snap": false,
+ "spring": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "value": "",
+ "precision": 2,
+ "address": "/range_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "touchAddress": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "range",
+ "top": 270,
+ "left": 410,
+ "id": "range_2",
+ "linkId": "",
+ "width": "auto",
+ "height": 80,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "alignRight": false,
+ "input": true,
+ "compact": true,
+ "pips": true,
+ "snap": false,
+ "spring": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "value": "",
+ "precision": 2,
+ "address": "/range_2",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "touchAddress": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "fader",
+ "top": 90,
+ "left": 410,
+ "id": "fader_6",
+ "width": "auto",
+ "height": 80,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "alignRight": false,
+ "pips": true,
+ "input": true,
+ "meter": false,
+ "compact": true,
+ "dashed": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/fader_6",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "tab",
+ "id": "tab_2",
+ "label": "Buttons",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_2",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "toggle",
+ "top": 10,
+ "left": 10,
+ "id": "toggle_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/toggle_1",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "push",
+ "top": 10,
+ "left": 120,
+ "id": "push_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "on": 1,
+ "off": 0,
+ "norelease": false,
+ "precision": 2,
+ "address": "/push_1",
+ "preArgs": [],
+ "target": [],
+ "bypass": false
+ },
+ {
+ "type": "switch",
+ "top": 150,
+ "left": 10,
+ "id": "switch_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "values": {
+ "Value 1": 1,
+ "Value 2": 2
+ },
+ "value": "",
+ "precision": 2,
+ "address": "/switch_1",
+ "preArgs": [],
+ "target": [],
+ "showValues": false,
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "dropdown",
+ "top": 10,
+ "left": 230,
+ "id": "dropdown_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "values": {
+ "Value 1": 1,
+ "Value 2": 2
+ },
+ "value": "",
+ "precision": 2,
+ "address": "/dropdown_1",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "toggle",
+ "top": 80,
+ "left": 10,
+ "id": "toggle_2",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "doubleTap": false,
+ "led": true,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/toggle_2",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "switch",
+ "top": 80,
+ "left": 120,
+ "id": "switch_2",
+ "width": 210,
+ "height": 60,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "horizontal": true,
+ "values": {
+ "Value 1": 1,
+ "Value 2": 2
+ },
+ "value": "",
+ "precision": 2,
+ "address": "/switch_2",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "showValues": false,
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "tab",
+ "id": "tab_3",
+ "label": "Pads",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_3",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "xy",
+ "top": 10,
+ "left": 10,
+ "id": "xy_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "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": "rgb",
+ "top": 10,
+ "left": 220,
+ "id": "rgb_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "css": "",
+ "input": true,
+ "snap": false,
+ "spring": false,
+ "value": "",
+ "precision": 0,
+ "address": "/rgb_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "range": {
+ "min": 0,
+ "max": 255
+ },
+ "default": "",
+ "bypass": false,
+ "pointSize": 10
+ },
+ {
+ "type": "multixy",
+ "top": 250,
+ "left": 10,
+ "id": "multixy_1",
+ "linkId": "",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "points": 2,
+ "pointSize": 20,
+ "snap": false,
+ "spring": false,
+ "pips": true,
+ "rangeX": {
+ "min": 0,
+ "max": 1
+ },
+ "rangeY": {
+ "min": 0,
+ "max": 1
+ },
+ "logScaleX": false,
+ "logScaleY": false,
+ "value": "",
+ "precision": 2,
+ "address": "/multixy_1",
+ "touchAddress": "",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "tab",
+ "id": "tab_4",
+ "label": "Matrices",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_4",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "multifader",
+ "top": 10,
+ "left": 10,
+ "id": "multifader_1",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "strips": 2,
+ "start": 0,
+ "traversing": true,
+ "value": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "snap": true,
+ "meter": false,
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "input": true,
+ "compact": false,
+ "dashed": false,
+ "precision": 2,
+ "address": "/multifader_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multifader",
+ "top": 10,
+ "left": 220,
+ "id": "multifader_2",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "strips": 2,
+ "start": 0,
+ "traversing": true,
+ "value": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "snap": true,
+ "meter": false,
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "input": true,
+ "compact": true,
+ "dashed": false,
+ "precision": 2,
+ "address": "/multifader_2",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multifader",
+ "top": 10,
+ "left": 430,
+ "id": "multifader_3",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "strips": 2,
+ "start": 0,
+ "traversing": true,
+ "value": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "snap": true,
+ "meter": false,
+ "alignRight": false,
+ "horizontal": true,
+ "pips": false,
+ "input": true,
+ "compact": false,
+ "dashed": false,
+ "precision": 2,
+ "address": "/multifader_3",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multitoggle",
+ "top": 220,
+ "left": 10,
+ "id": "multitoggle_1",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "matrix": [
+ 2,
+ 2
+ ],
+ "start": 0,
+ "spacing": 0,
+ "traversing": true,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/multitoggle_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multitoggle",
+ "top": 220,
+ "left": 220,
+ "id": "multitoggle_2",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "matrix": [
+ 2,
+ 2
+ ],
+ "start": 0,
+ "spacing": 0,
+ "traversing": true,
+ "led": true,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/multitoggle_2",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multitoggle",
+ "top": 220,
+ "left": 430,
+ "id": "multitoggle_3",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "matrix": [
+ 2,
+ 2
+ ],
+ "start": 0,
+ "spacing": 10,
+ "traversing": true,
+ "led": false,
+ "on": 1,
+ "off": 0,
+ "value": "",
+ "precision": 2,
+ "address": "/multitoggle_3",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multipush",
+ "top": 430,
+ "left": 10,
+ "id": "multipush_1",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "matrix": [
+ 2,
+ 2
+ ],
+ "start": 0,
+ "spacing": 0,
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "norelease": false,
+ "value": "",
+ "precision": 2,
+ "address": "/multipush_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multipush",
+ "top": 430,
+ "left": 220,
+ "id": "multipush_2",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "matrix": [
+ 2,
+ 2
+ ],
+ "start": 0,
+ "spacing": 0,
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "norelease": false,
+ "value": "",
+ "precision": 2,
+ "address": "/multipush_2",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "multipush",
+ "top": 430,
+ "left": 430,
+ "id": "multipush_3",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "matrix": [
+ 2,
+ 2
+ ],
+ "start": 0,
+ "spacing": 10,
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "norelease": false,
+ "value": "",
+ "precision": 2,
+ "address": "/multipush_3",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "keyboard",
+ "top": 640,
+ "left": 10,
+ "id": "keyboard_1",
+ "width": 620,
+ "height": 100,
+ "label": "auto",
+ "color": "auto",
+ "css": "margin-bottom:10rem",
+ "keys": 64,
+ "start": 36,
+ "traversing": true,
+ "on": 1,
+ "off": 0,
+ "precision": 2,
+ "address": "/keyboard_1",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "bypass": false
+ },
+ {
+ "type": "multifader",
+ "top": 10,
+ "left": 640,
+ "id": "multifader_4",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "strips": 2,
+ "start": 0,
+ "traversing": true,
+ "value": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "snap": true,
+ "meter": false,
+ "alignRight": false,
+ "horizontal": true,
+ "pips": false,
+ "input": true,
+ "compact": true,
+ "dashed": false,
+ "precision": 2,
+ "address": "/multifader_4",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false,
+ "scroll": true
+ },
+ {
+ "type": "tab",
+ "id": "tab_5",
+ "label": "Plots",
+ "color": "auto",
+ "css": "",
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/tab_5",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "plot",
+ "top": 10,
+ "left": 10,
+ "id": "plot_1",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "rangeX": {
+ "min": 0,
+ "max": 1
+ },
+ "rangeY": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": "auto",
+ "logScaleX": false,
+ "logScaleY": false,
+ "smooth": false,
+ "pips": true,
+ "address": "/plot_1",
+ "preArgs": [],
+ "linkId": "",
+ "dots": true,
+ "bars": false,
+ "value": [
+ [
+ "@{x1}",
+ "@{y1}"
+ ],
+ [
+ "@{x2}",
+ "@{y2}"
+ ],
+ [
+ "@{x3}",
+ "@{y3}"
+ ]
+ ],
+ "default": ""
+ },
+ {
+ "type": "eq",
+ "top": 10,
+ "left": 220,
+ "id": "eq_1",
+ "width": 200,
+ "height": 200,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "rangeY": {
+ "min": -20,
+ "max": 20
+ },
+ "origin": "auto",
+ "logScaleX": false,
+ "smooth": false,
+ "address": "/eq_1",
+ "preArgs": [],
+ "resolution": 128,
+ "linkId": "",
+ "value": [
+ {
+ "type": "peak",
+ "freq": "@{freq1}",
+ "q": "@{q1}",
+ "gain": "@{gain1}",
+ "on": 1
+ }
+ ],
+ "default": ""
+ },
+ {
+ "type": "visualizer",
+ "top": 10,
+ "left": 430,
+ "id": "visualizer_1",
+ "width": "auto",
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "duration": 1,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "origin": "auto",
+ "logScale": false,
+ "smooth": false,
+ "pips": true,
+ "value": "@{viz_fad}",
+ "address": "/visualizer_1",
+ "preArgs": [],
+ "linkId": "",
+ "default": ""
+ },
+ {
+ "type": "led",
+ "top": 220,
+ "left": 10,
+ "id": "led_1",
+ "width": 80,
+ "height": 90,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "value": "@{led_fad}",
+ "preArgs": [],
+ "address": "/led_1",
+ "linkId": "",
+ "default": ""
+ },
+ {
+ "type": "rgbled",
+ "top": 220,
+ "left": 100,
+ "id": "rgbled_1",
+ "width": 80,
+ "height": 90,
+ "label": "auto",
+ "css": "",
+ "value": "@{led_rgb}",
+ "preArgs": [],
+ "address": "/rgbled_1",
+ "linkId": "",
+ "default": ""
+ },
+ {
+ "type": "meter",
+ "top": 220,
+ "left": 190,
+ "id": "meter_1",
+ "width": 70,
+ "height": 160,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "origin": "auto",
+ "unit": "",
+ "alignRight": false,
+ "horizontal": false,
+ "pips": false,
+ "dashed": false,
+ "value": "@{led_fad}",
+ "address": "/meter_1",
+ "preArgs": [],
+ "linkId": "",
+ "gradient": [],
+ "default": "",
+ "compact": true,
+ "input": false
+ },
+ {
+ "type": "image",
+ "top": 220,
+ "left": 460,
+ "id": "image_1",
+ "width": 170,
+ "height": 80,
+ "label": "auto",
+ "css": "",
+ "size": "cover",
+ "position": "center",
+ "repeat": "no-repeat",
+ "border": true,
+ "cache": true,
+ "value": "",
+ "preArgs": [],
+ "address": "/image_1",
+ "linkId": "",
+ "stream": "",
+ "default": ""
+ },
+ {
+ "type": "meter",
+ "top": 220,
+ "left": 270,
+ "id": "meter_2",
+ "width": 180,
+ "height": 80,
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "origin": "auto",
+ "unit": "",
+ "alignRight": false,
+ "horizontal": true,
+ "pips": false,
+ "dashed": false,
+ "value": "@{led_fad}",
+ "address": "/meter_2",
+ "preArgs": [],
+ "linkId": "",
+ "gradient": [],
+ "default": "",
+ "compact": true,
+ "input": false
+ },
+ {
+ "type": "text",
+ "top": 320,
+ "left": 10,
+ "id": "text_1",
+ "width": 170,
+ "height": "auto",
+ "label": "auto",
+ "color": "auto",
+ "css": "",
+ "vertical": false,
+ "value": "@{text_input}",
+ "preArgs": [],
+ "address": "/text_1",
+ "linkId": "",
+ "wrap": false,
+ "align": "",
+ "default": ""
+ },
+ {
+ "type": "panel",
+ "top": 400,
+ "left": 50,
+ "id": "panel_1",
+ "width": 550,
+ "height": 250,
+ "label": "Controls",
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "border": true,
+ "layout": "",
+ "spacing": 0,
+ "value": "",
+ "precision": 0,
+ "address": "/panel_1",
+ "preArgs": [],
+ "target": [],
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "top": 0,
+ "left": 0,
+ "id": "strip_1",
+ "label": "PLOT",
+ "width": 90,
+ "height": "auto",
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": false,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "strip",
+ "id": "strip_2",
+ "label": false,
+ "height": 80,
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": true,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "knob",
+ "id": "x1",
+ "linkId": "",
+ "width": "auto",
+ "label": "x",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": 0,
+ "precision": 2,
+ "address": "/knob_5",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "id": "y1",
+ "width": "auto",
+ "label": "y",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_6",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "address": "/strip_2",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "strip_3",
+ "label": false,
+ "height": 50,
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": true,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "knob",
+ "id": "x2",
+ "width": "auto",
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": 0.5,
+ "precision": 2,
+ "address": "/knob_5",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "id": "y2",
+ "width": "auto",
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_6",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "address": "/strip_3",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "id": "strip_4",
+ "label": false,
+ "height": 50,
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": true,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "knob",
+ "id": "x3",
+ "width": "auto",
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": 1,
+ "precision": 2,
+ "address": "/knob_5",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "id": "y3",
+ "width": "auto",
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": false,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_6",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "address": "/strip_4",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ }
+ ],
+ "address": "/strip_1",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "strip",
+ "top": 10,
+ "left": 100,
+ "id": "strip_5",
+ "label": "Eq",
+ "width": 210,
+ "height": 130,
+ "color": "auto",
+ "css": "",
+ "scroll": true,
+ "horizontal": true,
+ "stretch": false,
+ "border": true,
+ "spacing": 0,
+ "variables": "@{parent.variables}",
+ "widgets": [
+ {
+ "type": "knob",
+ "id": "freq1",
+ "linkId": "",
+ "width": 70,
+ "label": "Freq",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 20,
+ "max": 22000
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_6",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "id": "q1",
+ "width": 70,
+ "label": "Q",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0.25,
+ "max": 8
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/knob_6",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "knob",
+ "id": "gain1",
+ "width": 70,
+ "label": "Gain",
+ "color": "auto",
+ "css": "",
+ "pips": true,
+ "input": true,
+ "dashed": false,
+ "angle": 270,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": -20,
+ "max": 20
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": 0,
+ "value": 0,
+ "precision": 2,
+ "address": "/knob_6",
+ "touchAddress": "",
+ "preArgs": [],
+ "target": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "address": "/strip_5",
+ "preArgs": [],
+ "linkId": "",
+ "_geometry": "geometry",
+ "_style": "style",
+ "_panel": "panel",
+ "layout": "",
+ "_value": "value (tab selection)",
+ "default": "",
+ "value": "",
+ "_osc": "osc (tab selection)",
+ "precision": 0,
+ "target": [],
+ "bypass": false,
+ "_children": "children",
+ "tabs": []
+ },
+ {
+ "type": "fader",
+ "top": 10,
+ "left": 360,
+ "id": "led_fad",
+ "linkId": "",
+ "width": 30,
+ "height": 190,
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "alignRight": false,
+ "pips": false,
+ "input": true,
+ "meter": false,
+ "compact": true,
+ "dashed": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/fader_7",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "rgb",
+ "top": 10,
+ "left": 410,
+ "id": "led_rgb",
+ "linkId": "",
+ "width": 110,
+ "height": 180,
+ "label": "auto",
+ "css": "",
+ "input": true,
+ "snap": false,
+ "spring": false,
+ "value": "",
+ "precision": 0,
+ "address": "/rgb_2",
+ "preArgs": [],
+ "split": false,
+ "target": [],
+ "range": {
+ "min": 0,
+ "max": 255
+ },
+ "default": "",
+ "bypass": false,
+ "pointSize": 10
+ },
+ {
+ "type": "fader",
+ "top": 10,
+ "left": 320,
+ "id": "viz_fad",
+ "linkId": "",
+ "width": 30,
+ "height": 190,
+ "label": false,
+ "color": "auto",
+ "css": "",
+ "horizontal": false,
+ "alignRight": false,
+ "pips": false,
+ "input": true,
+ "meter": false,
+ "compact": true,
+ "dashed": false,
+ "snap": false,
+ "spring": false,
+ "doubleTap": false,
+ "range": {
+ "min": 0,
+ "max": 1
+ },
+ "logScale": false,
+ "unit": "",
+ "origin": "auto",
+ "value": "",
+ "precision": 2,
+ "address": "/fader_7",
+ "touchAddress": "",
+ "meterAddress": "",
+ "preArgs": [],
+ "target": [],
+ "default": "",
+ "bypass": false
+ },
+ {
+ "type": "input",
+ "top": 150,
+ "left": 100,
+ "id": "text_input",
+ "linkId": "",
+ "width": 210,
+ "height": 60,
+ "label": "Text",
+ "color": "auto",
+ "css": "",
+ "vertical": false,
+ "unit": "",
+ "editable": true,
+ "value": "",
+ "precision": 2,
+ "address": "/input_1",
+ "preArgs": [],
+ "target": [],
+ "align": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "tabs": [],
+ "linkId": "",
+ "default": "",
+ "bypass": false
+ }
+ ],
+ "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
+ }
+]
\ No newline at end of file
diff --git a/app/index.js b/app/index.js
index e281f69a..cb716413 100644
--- a/app/index.js
+++ b/app/index.js
@@ -1 +1 @@
-require('./main/main')
+require('./server/open-stage-control-server')
diff --git a/app/launcher/index.html b/app/launcher/index.html
new file mode 100644
index 00000000..9ec8299a
--- /dev/null
+++ b/app/launcher/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/main/electron-app.js b/app/main/electron-app.js
deleted file mode 100644
index 5486fa82..00000000
--- a/app/main/electron-app.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var {app, Menu} = require('electron'),
- settings = require('./settings'),
- path = require('path')
-
-app.commandLine.appendSwitch('--touch-events')
-
-
-if (settings.read('noVsync') || (!settings.cli && settings.read('argv')['disable-vsync'])) {
- app.commandLine.appendSwitch('--disable-gpu-vsync')
-}
-
-
-app.on('window-all-closed', function() {
- if (process.platform != 'darwin') {
- app.quit()
- }
-})
-
-module.exports = app
diff --git a/app/main/electron-window.js b/app/main/electron-window.js
deleted file mode 100644
index 6221185f..00000000
--- a/app/main/electron-window.js
+++ /dev/null
@@ -1,52 +0,0 @@
-var path = require('path'),
- {BrowserWindow} = require('electron'),
- shortcut = require('electron-localshortcut'),
- settings = require('./settings')
-
-var bgColor = settings.read('theme') && settings.read('theme').indexOf('--color-bg:') != -1 ?
- settings.read('theme').match(/--color-bg:([^;]*);/)[1].trim()
- : '#191f2a'
-
-module.exports = function(options={}) {
-
- var window
-
- window = new BrowserWindow({
- width: options.width || 800,
- height: options.height || 600,
- title: options.title || settings.read('appName'),
- backgroundColor: options.color || bgColor,
- type:options.type
- })
-
- window.loadURL(options.address)
-
- window.on('closed', function() {
- window = null
- })
-
- window.setMenuBarVisibility(false)
-
- if (options.shortcuts) {
-
- shortcut.register(window,'CmdOrCtrl+R',function(){
- window.reload()
- })
-
- shortcut.register(window,'F11',function(){
- window.setFullScreen(!window.isFullScreen())
- })
-
- shortcut.register(window,'F12',function(){
- window.toggleDevTools()
- })
-
- } else {
- shortcut.register(window,'CmdOrCtrl+R',function(e){
- return false
- })
- }
-
- return window
-
-}
diff --git a/app/main/launcher/index.html b/app/main/launcher/index.html
deleted file mode 100644
index 1a591c98..00000000
--- a/app/main/launcher/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/main/launcher/launcher.js b/app/main/launcher/launcher.js
deleted file mode 100644
index 470f5581..00000000
--- a/app/main/launcher/launcher.js
+++ /dev/null
@@ -1,236 +0,0 @@
-var {remote, ipcRenderer, shell} = require('electron'),
- {dialog, webContents} = remote.require('electron'),
- settings = remote.require('./main/settings'),
- packageInfos = remote.require('./package.json')
- packageVersion = packageInfos.version,
- packageUrl = packageInfos.repository.url,
- argv_remote = settings.read('argv'),
- argv = {},
- $ = require('jquery/dist/jquery.slim.min.js')
-
-for (i in argv_remote) {
- argv[i] = argv_remote[i]
-}
-
-$(document).ready(()=>{
-
- var form = $(`
-
', false)
- },
- icon: function(i) {
- return ``
- },
- iconify:function(string){
- return String(string).replace(/\^[^\s]*/g,(x)=>{return module.exports.icon(x.substring(1))})
- }
-
-}
diff --git a/src/browser/js/app/widgets/buttons/dropdown.js b/src/browser/js/app/widgets/buttons/dropdown.js
deleted file mode 100644
index 8068a21a..00000000
--- a/src/browser/js/app/widgets/buttons/dropdown.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- {iconify} = require('../../utils')
-
-module.exports = class Dropdown extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'dropdown',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style: 'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _dropdown:'dropdown',
-
- values:{"Value 1":1,"Value 2":2},
- value:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super({...options, html: ''})
-
- this.select = $(``).appendTo(this.widget)
-
- this.values = []
-
- var i = 0
- for (var k in this.getProp('values')) {
- this.values[i] = this.getProp('values')[k]
- this.select.append(``)
- i++
- }
-
- this.select.change(()=>{
- this.setValue(this.values[this.select[0].selectedIndex], {sync:true, send:true, fromLocal:true})
- })
-
- this.value = undefined
- this.select[0].selectedIndex = -1
- this.container.addClass('noselect')
-
- }
-
- setValue(v,options={}) {
-
- var i = this.values.indexOf(v)
-
- if (i != -1) {
- this.value = this.values[i]
- if (!options.fromLocal) this.select[0].selectedIndex = i
- if (options.send) this.sendValue()
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
- this.container.removeClass('noselect')
- } else {
- this.value = undefined
- this.select[0].selectedIndex = -1
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
- this.container.addClass('noselect')
- }
-
- }}
diff --git a/src/browser/js/app/widgets/buttons/push.js b/src/browser/js/app/widgets/buttons/push.js
deleted file mode 100644
index be6c0b53..00000000
--- a/src/browser/js/app/widgets/buttons/push.js
+++ /dev/null
@@ -1,149 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- osc = require('../../osc')
-
-module.exports = class Push extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'push',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _push: 'push',
-
- on:1,
- off:0,
- norelease:false,
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super({...options, html: ''})
-
- this.state = 0
- this.active = 0
- this.lastChanged = 'state'
-
- this.widget.on('drag',function(e){e.stopPropagation()})
- this.widget.on('draginit.push',()=>{
- this.widget.off('draginit.push')
- this.fakeclick()
- })
- this.classHolders = this.widget.add(this.container)
-
- this.value = this.getProp('off')
-
-
- }
-
- updateValue(){
-
- this.value = this[this.lastChanged] ?
- this.getProp('on') != null && this.getProp('on').value !== undefined ? this.getProp('on').value : this.getProp('on')
- :
- this.getProp('off') != null && this.getProp('off').value !== undefined ? this.getProp('off').value : this.getProp('off')
-
- }
-
- fakeclick(){
-
- if (!this.active) this.setValuePrivate(this.getProp('on'),{send:true,sync:true})
- this.widget.on('dragend.push',()=>{
- this.setValuePrivate(this.getProp('off'),{send:true,sync:true})
- this.widget.off('dragend.push')
- this.widget.on('draginit.push',()=>{
- this.widget.off('draginit.push')
- this.fakeclick()
- })
- })
-
- }
-
- setValuePrivate(v,options={}) {
-
- if (typeof v == 'object' && v !== null) v = v.value
- if (v===this.getProp('on') || (this.getProp('on') != null && v === this.getProp('on').value && v !== undefined)) {
- this.widget.addClass('active')
- this.active = 1
- this.lastChanged = 'active'
- this.updateValue()
- if (options.send) this.sendValue(v)
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
- } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) {
- this.widget.removeClass('active')
- this.active = 0
- this.lastChanged = 'active'
- this.updateValue()
- if (options.send) this.sendValue(v, this.getProp('norelease'))
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
- }
-
- }
-
- setValue(v,options={}) {
-
- if (!options.fromExternal) {
- this.setValuePrivate(v,options)
- return
- }
- if (typeof v == 'object' && v !== null) v = v.value
- if (v===this.getProp('on') || (this.getProp('on') != null && v === this.getProp('on').value && v !== undefined)) {
- this.classHolders.addClass('on')
- this.state = 1
- if (options.send) this.sendValue(v)
- this.lastChanged = 'state'
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'),options:options})
- } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) {
- this.classHolders.removeClass('on')
- this.state = 0
- if (options.send) this.sendValue(v)
- this.lastChanged = 'state'
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'),options:options})
- }
-
- }
-
- sendValue(v, norelease) {
-
- if (!norelease) {
-
- osc.send({
- h: this.hash,
- v: this.value
- })
-
- } else {
-
- osc.sync({
- h: this.hash,
- v: this.value
- })
-
- }
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/buttons/switch.js b/src/browser/js/app/widgets/buttons/switch.js
deleted file mode 100644
index b10a51cc..00000000
--- a/src/browser/js/app/widgets/buttons/switch.js
+++ /dev/null
@@ -1,92 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- {iconify} = require('../../utils'),
- $document = $(document)
-
-module.exports = class Switch extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'switch',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _switch:'switch',
-
- horizontal:false,
- values:{"Value 1":1,"Value 2":2},
- value:'',
-
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super({...options, html: ''})
-
-
- if (this.getProp('horizontal')) this.widget.addClass('horizontal')
-
- this.values = []
-
- for (var k in this.getProp('values')) {
- this.values.push(this.getProp('values')[k])
- $(`${iconify(parseFloat(k) != k ? k : this.getProp("values")[k])}
`).data({value:this.getProp('values')[k]}).appendTo(this.widget)
- }
-
- this.value = undefined
-
- this.widget.find('.value').on('draginit',(e,dd)=>{
- var index = 0,
- node = e.target
-
- while ( (node = node.previousSibling) ) {
- if (node.nodeType != 3 || !/^\s*$/.test(node.data)) {
- index++;
- }
- }
-
- var value = this.values[index]
-
- if (value!=this.value || this.value===undefined) this.setValue(value,{sync:true,send:true})
- })
-
- }
-
- setValue(v,options={}) {
-
- var i = this.values.indexOf(v)
- if (i!=-1) {
- this.value = this.values[i]
- this.widget.find('.on').removeClass('on')
- this.widget.find('.value').eq(i).addClass('on')
- if (options.send) this.sendValue(this.value)
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
- } else {
- this.widget.find('.on').removeClass('on')
- this.value = undefined
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
- }
-
- }}
diff --git a/src/browser/js/app/widgets/buttons/toggle.js b/src/browser/js/app/widgets/buttons/toggle.js
deleted file mode 100644
index 9a7f4580..00000000
--- a/src/browser/js/app/widgets/buttons/toggle.js
+++ /dev/null
@@ -1,109 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- doubletab = require('../mixins/double_tap')
-
-
-module.exports = class Toggle extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'toggle',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _toggle: 'toggle',
-
- doubleTap: false,
- led: false,
- on:1,
- off:0,
- value:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super({...options, html: ''})
-
- this.widget.value = this.widget.find('span')
- this.widget.state = 0
-
- if (this.getProp('led')) this.container.addClass('led')
-
- if (this.getProp('doubleTap')) {
-
- doubletab(this.widget, ()=>{
- var newVal = this.widget.state?this.getProp('off'):this.getProp('on')
- this.setValue(newVal,{sync:true,send:true})
- })
-
- } else {
-
- this.widget.on('draginit.toggle',()=>{
- this.widget.off('draginit.toggle')
- this.fakeclick()
- })
-
- }
-
- this.classHolders = this.widget.add(this.container)
-
- this.value = this.getProp('off')
-
- }
-
- fakeclick() {
-
- var newVal = this.widget.state?this.getProp('off'):this.getProp('on')
- this.setValue(newVal,{sync:true,send:true})
- this.widget.on('dragend.toggle',()=>{
- this.widget.off('dragend.toggle')
- this.widget.on('draginit.toggle',()=>{
- this.widget.off('draginit.toggle')
- this.fakeclick()
- })
- })
-
- }
-
-
- setValue(v,options={}) {
-
- if (v===this.getProp('on') || (this.getProp('on') != null && v.value === this.getProp('on').value && v.value !== undefined)) {
- this.classHolders.addClass('on')
- this.widget.state = 1
- this.value = this.getProp('on')
- if (options.send) this.sendValue()
- } else if (v===this.getProp('off') || (this.getProp('off') != null && v.value === this.getProp('off').value && v.value !== undefined)) {
- this.classHolders.removeClass('on')
- this.widget.state = 0
- this.value = this.getProp('off')
- if (options.send) this.sendValue()
- }
-
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/common/_canvas_base.js b/src/browser/js/app/widgets/common/_canvas_base.js
deleted file mode 100644
index 19564cbf..00000000
--- a/src/browser/js/app/widgets/common/_canvas_base.js
+++ /dev/null
@@ -1,109 +0,0 @@
-var _widgets_base = require('./_widgets_base')
-
-module.exports = class _canvas_base extends _widgets_base {
-
- constructor(options) {
-
- super(options)
-
- this.canvas = this.widget.find('canvas')
- this.ctx = this.canvas[0].getContext('2d')
-
- this.height = undefined
- this.width = undefined
- this.scaling = 1
-
- this.clearRect = []
-
- this.visible = false
-
- this.colors = {}
- this.textColor = getComputedStyle(document.documentElement).getPropertyValue('--color-text-fade')
-
- this.canvas.on('resize',this.resizeHandleProxy.bind(this))
-
- this.ctx.arc = (x, y, r, s, e, c)=>{
-
- CanvasRenderingContext2D.prototype.arc.call(this.ctx, x, y, Math.max(0,r), s, e, c)
-
- }
-
- }
-
- resizeHandleProxy() {
-
- this.resizeHandle(...arguments)
-
- }
-
- resizeHandle(e, width, height, checkColors){
-
- var width = width,
- height = height,
- ratio = CANVAS_SCALING * this.scaling
-
- if (width && height) {
-
- this.height=height
- this.width=width
-
- this.canvas[0].setAttribute('width',width * ratio)
- this.canvas[0].setAttribute('height',height * ratio)
-
- this.clearRect = []
-
- if (ratio != 1) {
- this.ctx.setTransform(1, 0, 0, 1, 0, 0)
- this.ctx.scale(ratio, ratio)
- }
-
- }
-
- var style = getComputedStyle(this.widget[0])
-
- if (!this.visible || checkColors) {
- this.visible = true
- this.colors.custom = style.getPropertyValue('--color-custom')
- this.colors.text = style.getPropertyValue('--color-text')
- this.colors.raised = style.getPropertyValue('--color-raised')
- this.colors.bg = style.getPropertyValue('--color-bg')
- this.colors.fg = style.getPropertyValue('--color-fg')
- this.colors.faded = style.getPropertyValue('--color-faded')
- this.colors.light = style.getPropertyValue('--color-light')
- this.fontFamily = style.getPropertyValue("font-family")
- this.textAlign = style.getPropertyValue("text-align")
- }
-
- this.fontSize = parseFloat(style.getPropertyValue("font-size"))
- this.fontWeight = parseFloat(style.getPropertyValue("font-weight"))
- this.ctx.font = this.fontWeight + ' ' + this.fontSize + 'px ' + this.fontFamily
- this.ctx.textBaseline = "middle"
- this.ctx.textAlign = this.textAlign
-
- requestAnimationFrame(this.draw.bind(this))
-
- }
-
- clear() {
-
- if (!this.clearRect.length) {
- this.ctx.clearRect(0, 0, this.width, this.height)
- return
- }
-
- if (typeof this.clearRect[0] == 'object') {
- for (let i in this.clearRect) {
- this.ctx.clearRect(...this.clearRect[i])
- }
- return
- }
-
- this.ctx.clearRect(...this.clearRect)
-
- }
-
- draw(){
- throw 'Calling unimplemented draw() method'
- }
-
-}
diff --git a/src/browser/js/app/widgets/common/_widgets_base.js b/src/browser/js/app/widgets/common/_widgets_base.js
deleted file mode 100644
index 7b14d709..00000000
--- a/src/browser/js/app/widgets/common/_widgets_base.js
+++ /dev/null
@@ -1,203 +0,0 @@
-var osc = require('../../osc'),
- shortid = require('shortid'),
- widgetManager = require('../../managers/widgets'),
- updateDom = function(){ updateDom = require('../../editor/data-workers').updateDom; updateDom(...arguments)}
-
-
-module.exports = class _widgets_base {
-
- static defaults() {
-
- throw 'Calling unimplemented static defaults() method'
-
- }
-
- static createHash() {
-
- return shortid.generate()
- }
-
- constructor(options={}) {
-
- this.container = options.container
- this.widget = $(options.html)
- this.props = options.props
- this.parent = options.parent
- this.parentNode = options.parentNode
- this.hash = _widgets_base.createHash()
-
- // Turn preArgs into array
- if (this.props.preArgs !== undefined && !Array.isArray(this.resolveProp('preArgs', undefined, false))) {
- this.props.preArgs = [this.props.preArgs]
- }
-
- // Turn preArgs into array
- if (this.props.target !== undefined && !Array.isArray(this.resolveProp('target', undefined, false))) {
- this.props.target = [this.props.target]
- }
-
- // strip parent ? no position
- if (this.parent && this.parent.props.type == 'strip') {
- delete this.props.top
- delete this.props.left
- delete this.props[this.parent.getProp('horizontal') ? 'height' : 'width']
- }
-
-
- // @{props} links lists
- this.linkedPropsWidgets = []
- this.linkedProps = []
-
-
- // cache props (resolve @{props})
- this.cachedProps = {}
-
- for (var k in this.props) {
- if (k != 'widgets' && k != 'tabs') {
- this.cachedProps[k] = this.resolveProp(k, undefined, true)
- } else {
- this.cachedProps[k] = this.props[k]
- }
- }
-
- $('body').on(`widget-created.${this.hash}`, (e)=>{
- var {id} = e
- if (this.linkedPropsWidgets.indexOf(id) != -1 && id != this.getProp('id')) {
- this.checkPropsChanged()
- }
- })
-
- $('body').trigger({type: 'widget-created', id: this.getProp('id'), widget:this})
-
- // cache precision
- if (this.props.precision != undefined) {
- this.precision = Math.min(20,Math.max(this.getProp('precision', undefined, false),0))
- }
-
- }
-
- sendValue(overrides) {
-
- var data = {
- h:this.hash,
- v:this.value
- }
-
- if (overrides) {
- for (var k in overrides) {
- data[k] = overrides[k]
- }
- }
-
- osc.send(data)
-
- }
-
- getValue() {
-
- return _widgets_base.deepCopy(this.value)
-
- }
-
- static deepCopy(obj){
-
- var copy = obj,
- key
-
- if (obj === null) {
- return obj
- }
-
- if (typeof obj === 'object') {
- copy = Array.isArray(obj) ? [] : {}
- for (let key in obj) {
- copy[key] = _widgets_base.deepCopy(obj[key])
- }
- }
-
- return copy
-
- }
-
- resolveProp(key, opt, storeLinks=true, originalWidget, originalKey) {
-
- var opt = opt !== undefined ? opt : _widgets_base.deepCopy(this.props[key]),
- originalWidget = originalWidget || this,
- originalKey = originalKey || key,
- obj
-
- if (typeof opt == 'string' && opt.indexOf('@{') != -1) {
- opt = opt.replace(/@\{([^\}]+)\}/g, (m)=>{
- let id = m.substr(2, m.length - 3).split('.'),
- k = id.pop(),
- subk = undefined
-
- if (id.length > 1) {
- subk = k
- k = id.pop()
- }
-
- id = id.join('.')
-
- var widgets = id == 'parent' && this.parent ?
- [this.parent] : id == 'this' ? [this] :
- widgetManager.getWidgetById(id)
-
-
- for (var i in widgets) {
- if (widgets[i].props.hasOwnProperty(k)) {
-
- if (originalKey == k && widgets[i].props.id == originalWidget.props.id) {
- throw `Circular property reference for ${originalWidget.props.id}.${originalKey}`
- }
-
- if (id != 'this' && id != 'parent' && storeLinks) {
- this.linkedProps.push(key)
- this.linkedPropsWidgets.push(id)
- }
-
- var r = widgets[i].resolveProp(k, undefined, storeLinks, originalWidget, originalKey)
- if (subk !== undefined) r = r[subk]
- if (typeof r != 'string') r = JSON.stringify(r)
- return r
-
- }
- }
- })
-
- try {
- opt = JSON.parse(opt)
- } catch (err) {}
-
- } else if (opt != null && typeof opt == 'object') {
- for (var k in opt) {
- opt[k] = this.resolveProp(key, opt[k], storeLinks, originalWidget, originalKey)
- }
- }
-
- return opt
-
-
- }
-
- getProp(key){
- return this.cachedProps[key]
- }
-
- checkPropsChanged(){
- for (var key of this.linkedProps) {
- if (JSON.stringify(this.cachedProps[key]) != JSON.stringify(this.resolveProp(key, undefined, false))) {
- return this.reCreateWidget()
- }
- }
- }
-
- reCreateWidget(){
- updateDom(this.container, this.props, true)
- }
-
- onRemove(){
- $('body').off(`widget-created.${this.hash}`)
- }
-
-}
diff --git a/src/browser/js/app/widgets/containers/clone.js b/src/browser/js/app/widgets/containers/clone.js
deleted file mode 100644
index 6f7d85d0..00000000
--- a/src/browser/js/app/widgets/containers/clone.js
+++ /dev/null
@@ -1,114 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- widgetManager = require('../../managers/widgets'),
- purge = require('../../editor/purge'),
- parser = require('../../parser')
-
-module.exports = class Clone extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'clone',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- css:'',
-
- _clone:'clone',
-
- widgetId:'',
-
- _overrides:'overrides',
-
- props:{},
- }
-
- }
-
- constructor(options) {
-
- options.props.label = ''
- options.props.variables = '@{parent.variables}'
-
- super({...options, html: ''})
-
- this.cloneHash = [0]
- this.cloneLock = false
- this.cloneClass = ''
- this.originalHash = false
- this.createClone()
-
- $('body').on(`widget-created.${this.hash}`, (e)=>{
- var {id, widget} = e
- if (
- (id == this.getProp('widgetId') && this.cloneHash.indexOf(widget.hash) == -1) &&
- !(widget.parent && widget.parent.getProp('type') == 'clone')
- ) {
- this.createClone(widget)
- }
- })
-
- }
-
- createClone(widget) {
-
- if (this.cloneLock) return
-
- this.cloneLock = true
-
- this.widget.empty()
- this.container.removeClass(this.cloneClass)
- purge(this.cloneHash)
-
- var widgets = widget ? [widget] : widgetManager.getWidgetById(this.getProp('widgetId'))
-
- if (widgets.length) {
-
- for (var i = widgets.length - 1; i>=0; i--) {
-
- if (
-
- this.cloneHash.indexOf(widgets[i].hash) == -1 &&
- !(widgets[i].parent && widgets[i].parent.getProp('type') == 'clone')
-
- ) {
-
- this.originalHash = widgets[i].hash
- this.cloneClass = widgets[i].container.attr('class').match(/[^\s]*-container/)[0]
- this.container.addClass(this.cloneClass)
-
- var c = parser.parse([{..._widgets_base.deepCopy(widgets[i].props), ...this.getProp('props')}], this.widget, this)
-
- this.widget.find('.widget').addClass('not-editable')
-
- this.hashes = [this.hash]
- if (c[0].abstract.hashes) {
- this.hashes = this.hashes.concat(c[0].abstract.hashes)
- this.cloneHash = c[0].abstract.hashes
- } else {
- this.hashes.push(c[0].abstract.hash)
- this.cloneHash = [c[0].abstract.hash]
- }
-
- break
-
- }
-
- }
-
- }
-
- this.cloneLock = false
-
- }
-
-
-}
diff --git a/src/browser/js/app/widgets/containers/modal.js b/src/browser/js/app/widgets/containers/modal.js
deleted file mode 100644
index b70c19d6..00000000
--- a/src/browser/js/app/widgets/containers/modal.js
+++ /dev/null
@@ -1,171 +0,0 @@
-var Panel = require('./panel'),
- {icon, iconify} = require('../../utils'),
- doubletab = require('../mixins/double_tap')
-
-
-module.exports = class Modal extends Panel {
-
- static defaults() {
-
- return {
- type:'modal',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _modal:'modal',
-
- doubleTap: false,
- popupLabel:'',
- popupWidth:'80%',
- popupHeight:'80%',
- layout:'',
- spacing:0,
- value:'',
-
- _osc:'osc',
-
- precision:0,
- address:'auto',
- preArgs:[],
- target:[],
-
- _chidlren:'children',
-
- variables:'@{parent.variables}',
-
- widgets:[],
- }
-
- }
-
- constructor(options) {
-
- options.props.tabs = []
- options.props.scroll = true
-
- super(options)
-
- this.popup = $(`
-
- `)
-
- this.popup.appendTo(this.container).hide()
-
-
- // convert dimensions / coordinates to rem
- var width = parseFloat(this.getProp('popupWidth'))==this.getProp('popupWidth')?parseFloat(this.getProp('popupWidth'))+'rem' : this.getProp('popupWidth'),
- height = parseFloat(this.getProp('popupHeight'))==this.getProp('popupHeight')?parseFloat(this.getProp('popupHeight'))+'rem' : this.getProp('popupHeight')
-
- this.popup[0].style.setProperty('--width', width)
- this.popup[0].style.setProperty('--height', height)
-
- this.popup.find('.closer').on('fake-click',(e)=>{
- this.setValue(0, {sync:true, send:true})
- })
-
- this.light = $('').appendTo(this.container)
-
- if (this.getProp('doubleTap')) {
- doubletab(this.light, ()=>{
- this.setValue(1, {sync:true, send:true})
- })
- } else {
- this.light.on('fake-click',(e)=>{
- this.setValue(1, {sync:true, send:true})
- })
- }
-
- this.popup.on('fake-click',(e)=>{
- if (e.target == this.popup[0] && this.value == 1) {
- this.setValue(0, {sync:true, send:true})
- }
- })
-
- this.parentScroll = [0,0]
- this.value = 0
- this.init = false
-
- }
-
- setValue(v, options={}) {
-
- this.value = v ? 1 : 0
-
- if (!this.init && this.value) {
- var label = this.getProp('popupLabel') ? iconify(this.getProp('popupLabel')) : this.container.find('> .label').html()
- this.popup.find('.popup-title .popup-label').html(label)
- this.widget.detach().appendTo(this.popup.find('.popup-content'))
- }
-
- this.fixScrolling()
-
- this.popup.toggle(this.value?true:false)
- this.container.add(this.light).toggleClass('on', this.value?true:false)
- this.bindEscKey(this.value)
-
- if (this.value) {
- $(window).resize()
- }
-
- if (!this.init || this.value) this.fixStacking()
- if (!this.init && this.value) this.init = true
-
- if (options.send) this.sendValue()
- if (options.sync) this.light.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
-
-
- }
-
- bindEscKey(set) {
-
- if (set) {
- $(document).on('keydown.' + this.hash, (e)=>{
- if (e.keyCode==27) this.setValue(0, {sync:true, send:true})
- })
- } else {
- $(document).off('keydown.' + this.hash)
- }
-
- }
-
- onRemove() {
- this.bindEscKey(false)
- super.onRemove()
- }
-
- fixScrolling() {
- if (this.value) {
- var c = this.container.parents('.panel.tab').first()
- this.parentScroll = [c.scrollLeft(), c.scrollTop()]
- c.scrollTop(0).scrollLeft(0).css('overflow','hidden')
- } else {
- this.container.parents('.panel.tab').first().css('overflow','').scrollLeft(this.parentScroll[0]).scrollTop(this.parentScroll[1])
- }
- }
-
- fixStacking() {
- if (this.value) {
- this.container.parents('.widget').css('z-index','initial')
- } else {
- this.container.parents('.widget').css('z-index','')
- }
- }
-
-}
diff --git a/src/browser/js/app/widgets/containers/panel.js b/src/browser/js/app/widgets/containers/panel.js
deleted file mode 100644
index 6732b6d6..00000000
--- a/src/browser/js/app/widgets/containers/panel.js
+++ /dev/null
@@ -1,216 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- autolayout = require('autolayout/dist/autolayout.kiwi.js'),
- {iconify} = require('../../utils'),
- editObject = function(){editObject = require('../../editor/edit-objects').editObject; editObject(...arguments)},
- widgetManager = require('../../managers/widgets'),
- parser = require('../../parser')
-
-
-
-module.exports = class Panel extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'panel',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _panel:'panel',
-
- scroll:true,
- border:true,
- layout:'',
- spacing:0,
- value:'',
-
- _osc:'osc',
-
- precision:0,
- address:'auto',
- preArgs:[],
- target:[],
-
- _children:'children',
-
- variables:'@{parent.variables}',
-
- widgets:[],
- tabs:[]
- }
-
- }
-
- constructor(options) {
-
-
- super({...options, html: ''})
-
- if (this.getProp('scroll') === false) this.widget.addClass('noscroll')
- if (this.getProp('border') === false) this.container.addClass('noborder')
- if (this.getProp('tabs') && this.getProp('tabs').length) this.widget.addClass('has-tabs')
-
-
- this.value = -1
- this.tabs = []
-
- if (this.getProp('tabs') && this.getProp('tabs').length) {
-
- this.navigation = $('').prependTo(this.widget).find('.tablist')
- this.wrapper = $('').appendTo(this.widget)
-
- parser.parse(this.getProp('tabs'), this.wrapper, this, true)
- this.createNavigation()
- this.registerHashes()
-
- this.navigation.on('fake-click', (e)=>{
- if (!e.target.hasAttribute('data-widget')) return
- this.setValue($(e.target).index(), {sync: true, send:this.value != $(e.target).index()})
- })
-
- this.wrapper.on('tab-created', (e)=>{
- e.stopPropagation()
- this.createNavigation()
- })
-
- this.setValue(this.getProp('value') || 0)
-
- } else if (this.getProp('widgets') && this.getProp('widgets').length) {
-
- parser.parse(this.getProp('widgets'), this.widget, this)
- this.registerHashes()
- if (this.getProp('layout') != '') this.parseLayout()
-
- }
-
-
- }
-
- registerHashes(edited) {
-
- this.hashes = [this.hash]
- var widgets = this.widget.add(this.wrapper).find('> .widget')
- for (let widget of widgets) {
- if (widget.abstract.hashes) {
- this.hashes = this.hashes.concat(widget.abstract.hashes)
- } else {
- this.hashes.push(widget.abstract.hash)
- }
- }
-
- if (edited) $('body').trigger({type: 'widget-created', id: this.getProp('id'), widget:this})
-
- if (edited && this.parent && this.parent.registerHashes) this.parent.registerHashes(true)
- }
-
- createNavigation() {
-
- this.navigation.empty()
- this.tabs = []
-
- var tabs = this.wrapper.find('> .widget')
-
- for (let tab of tabs) {
- let style = tab.abstract.getProp('color') == 'auto' ? '' : `style="--color-custom:${tab.abstract.getProp('color')}"`
- this.tabs.push(tab.abstract)
- this.navigation.append(`${$(tab).find('> .label').html()}`)
- }
-
- this.setValue(this.value)
-
- }
-
- parseLayout() {
-
- this.children = this.widget.find('> .widget')
-
- try {
-
- var layout = this.getProp('layout').replace(/\$([0-9])+/g, (m)=>{
- return this.children[m.replace('$','')].abstract.getProp('id')
- })
-
- this.layout = new autolayout.View({
- constraints: autolayout.VisualFormat.parse(layout.split('\\n').join('\n').split(' ').join(''), {extended: true}),
- spacing: this.getProp('spacing')
- });
-
- this.widget.on('resize',(e, w, h)=>{
- if (!w) {
- var w = this.widget.width(),
- h = this.widget.height()
- }
- this.layout.setSize(w,h)
- this.applyLayout()
- })
-
- } catch(err) {
- throw `Visual Format Language error in ${this.getProp('id')}.layout: ${err.message} (line ${err.line})`
- }
-
- }
-
- applyLayout() {
- this.widget.find('> .widget').each((i,widget)=>{
- var id = widget.abstract.getProp('id')
- if (!this.layout.subViews[id]) return
- var $widget = $(widget).addClass('absolute-position').css({'min-height':'auto','min-width':'auto'})
- for (var prop of ['height', 'width', 'top', 'left']) {
- delete widget.abstract.props[prop]
- $widget.css(prop, this.layout.subViews[id][prop] + 'px')
- }
- if ($widget.hasClass('editing')) editObject($widget,widget.abstract.props,true)
- $(window).resize()
- })
- }
-
- setValue(v, options={}) {
- if (this.tabs.length && typeof v == 'number' && v >= 0 && v < this.tabs.length) {
-
- if (v != this.value) {
-
- for (let i in this.tabs) {
-
- this.tabs[i].hide()
- }
-
- this.tabs[v].show()
-
- this.value = v
-
- $(window).resize()
-
- }
-
- this.navigation.find('li').removeClass('on').eq(v).addClass('on')
-
- if (options.send) this.sendValue()
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options})
-
- }
- }
-
- scroll(s) {
-
- if (!s) {
- return [this.widget.scrollLeft(), this.widget.scrollTop()]
- } else {
- this.widget.scrollLeft(s[0])
- this.widget.scrollTop(s[1])
- }
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/containers/root.js b/src/browser/js/app/widgets/containers/root.js
deleted file mode 100644
index 4798334b..00000000
--- a/src/browser/js/app/widgets/containers/root.js
+++ /dev/null
@@ -1,61 +0,0 @@
-var Panel = require('./panel'),
- {iconify} = require('../../utils'),
- Tab = require('./tab')
-
-
-
-module.exports = class Root extends Panel {
-
- static defaults() {
-
- return {
-
- type:'root',
-
- _style:'style',
-
- color:'auto',
- css:'',
-
- _panel: 'panel',
-
- value:'',
-
- _osc:'osc',
-
- precision:0,
- address:'/root',
- preArgs:[],
- target:[],
-
- _children:'children',
-
- variables:{},
-
- tabs:[]
- }
-
- }
-
- constructor(options) {
-
- options.props.id = 'root'
- options.props.scroll = true
- options.props.label = false
-
- super(options)
-
- this.widget.addClass('root')
- this.widget.find('> .navigation').addClass('main')
-
- }
-
- createNavigation() {
-
- super.createNavigation()
-
- this.navigation.append(`${iconify('^navicon')}`)
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/containers/strip.js b/src/browser/js/app/widgets/containers/strip.js
deleted file mode 100644
index 9acaf750..00000000
--- a/src/browser/js/app/widgets/containers/strip.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var Panel = require('./panel')
-
-module.exports = class Strip extends Panel {
-
- static defaults() {
-
- return {
- type:'strip',
- id:'auto',
-
- _style:'style',
-
- label:'auto',
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
- color:'auto',
- css:'',
-
- _strip: 'strip',
-
- scroll:true,
- horizontal:false,
- stretch:false,
- border:true,
- spacing:0,
-
- _children:'children',
-
- variables:'@{parent.variables}',
-
- widgets:[]
- }
-
- }
-
- constructor(options) {
-
- var defaults = Panel.defaults()
- for (var k in defaults) {
- if (!options.props.hasOwnProperty(k))
- options.props[k] = defaults[k]
- }
-
- super(options)
-
- this.widget[0].style.setProperty('--spacing', this.getProp('spacing'))
-
- this.container.addClass(this.getProp('horizontal') ? 'horizontal' : 'vertical')
- this.container.addClass(this.getProp('stretch') ? 'stretch' : '')
-
- this.setValue = undefined
- this.getValue = undefined
-
- }
-
-
-}
diff --git a/src/browser/js/app/widgets/containers/tab.js b/src/browser/js/app/widgets/containers/tab.js
deleted file mode 100644
index 05b98b18..00000000
--- a/src/browser/js/app/widgets/containers/tab.js
+++ /dev/null
@@ -1,73 +0,0 @@
-var Panel = require('./panel'),
- editClean = function(){editClean = require('../../editor/edit-objects').editClean; editClean(...arguments)}
-
-
-
-module.exports = class Tab extends Panel {
-
- static defaults() {
-
- return {
- type:'tab',
- id:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _panel:'panel',
-
- layout:'',
- spacing:0,
- value:'',
-
- _osc:'osc',
-
- precision:0,
- address:'auto',
- preArgs:[],
- target:[],
-
- _children:'children',
-
- variables:'@{parent.variables}',
-
- widgets:[],
- tabs:[]
- }
-
- }
-
- constructor(options) {
-
- options.props.scroll = true
-
- super(options)
-
- this.widget.addClass('tab')
-
- this.detached = false
-
- var $body = $('body')
-
- this.widget.on('change.detached', (e)=>{
- if (this.detached) $body.trigger(e)
- })
-
- }
-
- hide() {
- if (EDITING) editClean()
- this.widget.detach()
- this.container.hide()
- this.detached = true
-
- }
- show() {
- this.container.show().append(this.widget)
- this.detached = false
- }
-
-}
diff --git a/src/browser/js/app/widgets/inputs/input.js b/src/browser/js/app/widgets/inputs/input.js
deleted file mode 100644
index 51fb8b4b..00000000
--- a/src/browser/js/app/widgets/inputs/input.js
+++ /dev/null
@@ -1,222 +0,0 @@
-var {iconify} = require('../../utils'),
- _canvas_base = require('../common/_canvas_base'),
- widgetManager = require('../../managers/widgets')
-
-module.exports = class Input extends _canvas_base {
-
- static defaults() {
-
- return {
- type:'input',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _input:'input',
-
- horizontal:false,
- unit: '',
- widgetId:'',
- editable:true,
- value:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- var html = `
-
-
-
- `
-
- super({...options, html: html})
-
- this.value = ''
- this.stringValue = ''
-
- if (this.getProp('editable')) {
- this.canvas.attr('tabindex', 0)
- this.canvas.on('focus', this.focus.bind(this))
- this.input = $('')
-
- this.input.on('change', (e)=>{
- e.stopPropagation()
- })
-
- }
-
- if (this.getProp('widgetId').length) $('body').on(`change.${this.hash}`,this.syncHandle.bind(this))
-
- }
-
- resizeHandle() {
-
- super.resizeHandle(...arguments)
-
- }
-
- focus() {
-
- this.canvas.attr('tabindex','-1')
- this.input
- .val(this.stringValue)
- .prependTo(this.widget)
- .focus()
- .on('blur', (e)=>{
- this.blur(false)
- })
- .on('keydown', (e)=>{
- if (e.keyCode==13) this.blur()
- if (e.keyCode==27) this.blur(false)
- })
-
- }
-
- blur(change=true) {
-
- if (change) this.inputChange()
-
- this.input.off('blur keydown')
- this.canvas.attr('tabindex','0')
- this.input.detach()
-
- }
-
- inputChange() {
-
- this.setValue(this.input.val(), {sync:true, send:true})
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length || !e.widget) return
-
- this.setValue(e.widget.getValue(), {...e.options, internal:true})
-
- }
-
- resizeHandle(){
-
- super.resizeHandle(...arguments)
-
- if (this.getProp('horizontal')){
- this.ctx.setTransform(1, 0, 0, 1, 0, 0)
- this.ctx.rotate(-Math.PI/2)
- this.ctx.translate(-this.height, 0)
-
- var ratio = CANVAS_SCALING * this.scaling
-
- if (ratio != 1) this.ctx.scale(ratio, ratio)
- }
-
-
- }
-
- setValue(v, options={} ) {
-
- try {
- this.value = JSON.parse(v)
- } catch (err) {
- this.value = v
- }
-
- if (!options.internal && this.getProp('widgetId').length) {
- var widget = widgetManager.getWidgetById(this.getProp('widgetId'))
- for (var i=widget.length-1; i>=0; i--) {
- if (widget[i].setValue) {
- widget[i].setValue(this.value, options)
- this.setValue(widget[i].getValue(), {...options, internal:true, sentOnce:options.send})
- return
- }
- }
- }
-
- if (options.sentOnce) options.send = false
-
- this.stringValue = this.getStringValue()
- this.draw()
-
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
- if (options.send && !options.fromSync) this.sendValue()
-
- }
-
- draw() {
-
- var v = this.stringValue,
- width = this.getProp('horizontal') ? this.height : this.width,
- height = !this.getProp('horizontal') ? this.height : this.width
-
- if (this.getProp('unit') && v.length) v += ' ' + this.getProp('unit')
-
- this.clear()
-
- this.ctx.fillStyle = this.colors.text
-
- if (this.textAlign == 'center') {
- this.ctx.fillText(v, Math.round(width/2), Math.round(height/2))
- } else if (this.textAlign == 'right') {
- this.ctx.fillText(v, width, Math.round(height/2))
- } else {
- this.ctx.fillText(v, 0, Math.round(height/2))
- }
-
- this.clearRect = [0, 0, width, height]
-
- }
-
- static deepCopyWithPrecision(obj, precision) {
-
- var copy = obj,
- key
-
- if (typeof obj === 'object') {
- copy = Array.isArray(obj) ? [] : {}
- for (key in obj) {
- copy[key] = Input.deepCopyWithPrecision(obj[key], precision)
- }
- } else if (typeof obj == 'number') {
- return parseFloat(copy.toFixed(precision))
- }
-
- return copy
-
- }
-
- getStringValue() {
- if (this.value === undefined) return ''
- return typeof this.value != 'string' ?
- JSON.stringify(Input.deepCopyWithPrecision(this.value, this.precision)).replace(/,/g, ', ') :
- this.value
- }
-
-}
diff --git a/src/browser/js/app/widgets/maths/formula.js b/src/browser/js/app/widgets/maths/formula.js
deleted file mode 100644
index 8682718e..00000000
--- a/src/browser/js/app/widgets/maths/formula.js
+++ /dev/null
@@ -1,185 +0,0 @@
-var _widgets_base = require('../common/_widgets_base'),
- widgetManager = require('../../managers/widgets'),
- {math} = require('../utils'),
- Input = require('../inputs/input')
-
-
-module.exports = class Formula extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'formula',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _math: 'math',
-
- formula: '',
- condition: '',
- unit: '',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- split:[],
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- var html = `
-
-
- `
- super({...options, html: html})
-
-
- this.formula = String(this.getProp('formula'))
- this.condition = String(this.getProp('condition'))
-
- this.split = typeof this.getProp('split') == 'object' && this.getProp('split').length ? this.getProp('split') : false
-
- this.input = new Input({
- props:{
- ...Input.defaults(),
- editable:false,
- precision:this.getProp('precision'),
- unit: this.getProp('unit')
- },
- parent:this, parentNode:this.widget
- })
-
- this.widget.append(this.input.widget)
-
- this.linkedWidgets = []
-
- if (this.formula.length) {
-
- if (this.formula.match(/\$\{([^\}]*)\}/g) != null) this.linkedWidgets = this.linkedWidgets.concat(this.formula.match(/\$\{([^\}]*)\}/g).map((a)=>{return a.substr(2, a.length - 3)}))
-
- }
-
- if (this.condition.length) {
-
- if (this.condition.match(/\$\{([^\}]*)\}/g) != null) this.linkedWidgets = this.linkedWidgets.concat(this.condition.match(/\$\{([^\}]*)\}/g).map((a)=>{return a.substr(2, a.length - 3)}))
-
- }
-
-
- this.formula = math.compile(this.formula.replace(/\$\{([^\}]*)\}/g, '_$1'))
-
- this.condition = math.compile(this.condition.replace(/\$\{([^\}]*)\}/g, '_$1'))
-
- this.conditionState = true
-
-
- $('body').on(`change.${this.hash}`,this.syncHandle.bind(this))
- this.updateValue({options:{}})
-
- this.input.widget.on('change', (e)=>{
- e.stopPropagation()
- })
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.linkedWidgets.indexOf(e.id)==-1 || !widgetManager.getWidgetById(e.id).length) return
- this.updateValue(e)
-
- }
-
- updateValue(e){
-
- var variables = {},
- id, n = 0
-
- for (let id of this.linkedWidgets) {
- if (id !== undefined) {
- let widgets = widgetManager.getWidgetById(id)
- for (let w of widgets) {
- if (w.getValue) {
- variables['_'+id] = w.getValue()
- n++
- break
- }
- }
-
- }
- }
-
- if (!this.linkedWidgets.length || n < this.linkedWidgets.length) return
-
-
- if (this.getProp('condition').length) {
-
- try {
-
- var s = this.condition.eval(variables).valueOf()
-
- this.conditionState = s.data !== undefined ? s.data : s
-
- } catch(err) {
-
- throw 'Error parsing formula "' + this.condition + '" (' + err + ')'
-
- }
-
- }
-
- try {
-
- var v = this.formula.eval(variables).valueOf()
-
- this.value = v.data ? v.data : v
-
- this.showValue()
-
- if (e.options.sync && this.conditionState) this.widget.trigger({type: 'change',id: this.getProp('id'),widget: this, linkId: this.getProp('linkId'), options: e.options})
- if (e.options.send && this.conditionState) this.sendValue()
-
- } catch(err) {
-
- throw 'Error parsing formula "' + this.formula + '" (' + err + ')'
-
- }
-
- }
-
- showValue() {
-
- this.input.setValue(this.value)
-
- if (this.getProp('condition').length && !this.conditionState) {
- this.input.stringValue = '* ' + this.input.stringValue
- this.input.draw()
- }
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/matrices/_matrices_base.js b/src/browser/js/app/widgets/matrices/_matrices_base.js
deleted file mode 100644
index e863d067..00000000
--- a/src/browser/js/app/widgets/matrices/_matrices_base.js
+++ /dev/null
@@ -1,44 +0,0 @@
-var _widgets_base = require('../common/_widgets_base')
-
-module.exports = class _matrices_base extends _widgets_base {
-
- constructor(options) {
-
- super({...options, html: ''})
-
- this.value = []
-
- this.start = parseInt(this.getProp('start'))
-
- this.widget.on('change',(e)=>{
-
- if (e.id==this.getProp('id')) return
- this.value[e.widget.container.index()] = e.widget.getValue()
- this.widget.trigger({type:'change',id:this.getProp('id'),widget:this,options:e.options})
-
- })
-
- }
-
- registerHashes() {
- this.hashes = [this.hash]
- var widgets = this.widget.find('.widget')
- for (let widget of widgets) {
- if (widget.abstract.hashes) {
- this.hashes = this.hashes.concat(widget.abstract.hashes)
- } else {
- this.hashes.push(widget.abstract.hash)
- }
- }
- }
-
- // conflicts with switchers (double osc send)
- // setValue(v, options={}) {
- // if (v && v.length == this.value.length) {
- // for (var i in v) {
- // this.widget[0].children[i].abstract.setValue(v[i], options)
- // }
- // }
- // }
-
-}
diff --git a/src/browser/js/app/widgets/matrices/keyboard.js b/src/browser/js/app/widgets/matrices/keyboard.js
deleted file mode 100644
index 6e8f708c..00000000
--- a/src/browser/js/app/widgets/matrices/keyboard.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var _matrices_base = require('./_matrices_base'),
- parser = require('../../parser')
-
-
-module.exports = class Keyboard extends _matrices_base {
-
- static defaults() {
-
- return {
- type:'keyboard',
- id:'auto',
-
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _matrix: 'Matrix',
-
- keys: 24,
- start:60,
- traversing:true,
- on:1,
- off:0,
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- split:false,
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.keys = parseInt(this.getProp('keys'))
-
- var strData = JSON.stringify(options.props),
- pattern = 'wbwbwwbwbwbw',
- wCount = 0
-
- for (var i = this.start; i < this.keys + this.start && i < 108; i++) {
-
- var data = JSON.parse(strData)
-
-
- data.top = data.left = data.height = data.width = 'auto'
- data.type = 'push'
- data.id = this.getProp('id') + '/' + i
- data.label = false
- data.address = this.getProp('split') ? this.getProp('address') + '/' + i : this.getProp('address')
- data.preArgs = this.getProp('split') ? this.getProp('preArgs') : [].concat(this.getProp('preArgs'), i)
- data.css = ''
-
- var element = parser.parse([data],this.widget)
- element[0].classList.add('not-editable')
-
- if (pattern[i % 12] == 'w') {
- element.addClass('white')
- wCount++
- } else {
- element.addClass('black').data('wCount',wCount)
-
- }
-
- this.value[i-this.start] = this.getProp('off')
-
- }
-
- this.widget.find('.widget.white').css('width',`${100/wCount}%`)
- this.widget.find('.widget.black').each(function(){
- $(this).css({
- 'width':`${100/wCount * 6/10}%`,
- 'left':`${100/wCount * ($(this).data('wCount') - 3/10)}%`
- })
-
- })
-
- if (this.getProp('traversing')) this.widget.enableTraversingGestures()
-
- this.registerHashes()
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/matrices/multifader.js b/src/browser/js/app/widgets/matrices/multifader.js
deleted file mode 100644
index 7447fdd9..00000000
--- a/src/browser/js/app/widgets/matrices/multifader.js
+++ /dev/null
@@ -1,105 +0,0 @@
-var _matrices_base = require('./_matrices_base'),
- parser = require('../../parser')
-
-module.exports = class Multifader extends _matrices_base {
-
- static defaults() {
-
- return {
- type:'multifader',
- id:'auto',
-
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _matrix:'Matrix',
-
- strips:2,
- start:0,
- traversing:true,
- value:'',
-
- _fader: 'fader',
-
- range:{min:0,max:1},
- logScale:false,
- unit:'',
- origin: 'auto',
- snap:true,
-
- meter:false,
- alignRight:false,
- horizontal:false,
- pips:false,
- input:true,
- compact:false,
- dashed:false,
-
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- split:false,
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.strips = parseInt(this.getProp('strips'))
-
- if (this.getProp('horizontal')) {
- this.widget.addClass('horizontal')
- }
-
- if (this.getProp('compact')) {
- this.widget.addClass('compact')
- }
-
- var strData = JSON.stringify(options.props)
-
- for (var i = this.start; i < this.strips + this.start; i++) {
-
- var data = JSON.parse(strData)
-
- data.top = data.left = data.height = data.width = 'auto'
- data.type = 'fader'
- data.id = this.getProp('id') + '/' + i
- data.label = i
- data.address = this.getProp('split') ? this.getProp('address') + '/' + i : this.getProp('address')
- data.preArgs = this.getProp('split') ? this.getProp('preArgs') : [].concat(this.getProp('preArgs'), i)
- data.color = typeof this.getProp('color') == 'object' ? '' + this.getProp('color')[i % this.getProp('color').length] : this.getProp('color')
- data.css = ''
-
- var element = parser.parse([data],this.widget)
- element[0].classList.add('not-editable')
-
- if (this.getProp('traversing')) element.find('canvas').off('drag')
-
- this.value[i-this.start] = this.getProp('range').min
-
- }
-
- if (this.getProp('traversing')) this.widget.enableTraversingGestures()
-
- this.registerHashes()
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/matrices/multipush.js b/src/browser/js/app/widgets/matrices/multipush.js
deleted file mode 100644
index 6b29fd00..00000000
--- a/src/browser/js/app/widgets/matrices/multipush.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var _matrices_base = require('./_matrices_base'),
- parser = require('../../parser')
-
-module.exports = class Multipush extends _matrices_base {
-
- static defaults() {
-
- return {
- type:'multipush',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _matrix: 'Matrix',
-
- matrix: [2,2],
- start:0,
- spacing:0,
- traversing:true,
- on:1,
- off:0,
- norelease:false,
- value:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- split:false,
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.widget[0].style.setProperty('--columns', this.getProp('matrix')[0])
- this.widget[0].style.setProperty('--rows', this.getProp('matrix')[1])
- this.widget[0].style.setProperty('--spacing', this.getProp('spacing') + 'rem')
-
- var strData = JSON.stringify(options.props)
-
- for (var i = this.start; i < this.getProp('matrix')[0] * this.getProp('matrix')[1] + this.start; i++) {
-
- var data = JSON.parse(strData)
-
- data.top = data.left = data.height = data.width = 'auto'
- data.type = 'push'
- data.id = this.getProp('id') + '/' + i
- data.label = i
- data.address = this.getProp('split') ? this.getProp('address') + '/' + i : this.getProp('address')
- data.preArgs = this.getProp('split') ? this.getProp('preArgs') : [].concat(this.getProp('preArgs'), i)
- data.color = typeof this.getProp('color') == 'object' ? '' + this.getProp('color')[i % this.getProp('color').length] : this.getProp('color')
- data.css = ''
-
- var element = parser.parse([data],this.widget)
- element[0].classList.add('not-editable')
-
- this.value[i-this.start] = this.getProp('off')
-
- }
-
- if (this.getProp('traversing')) this.widget.enableTraversingGestures()
-
- this.registerHashes()
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/matrices/multitoggle.js b/src/browser/js/app/widgets/matrices/multitoggle.js
deleted file mode 100644
index 9499000d..00000000
--- a/src/browser/js/app/widgets/matrices/multitoggle.js
+++ /dev/null
@@ -1,83 +0,0 @@
-var _matrices_base = require('./_matrices_base'),
- parser = require('../../parser')
-
-module.exports = class Multitoggle extends _matrices_base {
-
- static defaults() {
-
- return {
- type:'multitoggle',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _matrix: 'Matrix',
-
- matrix: [2,2],
- start:0,
- spacing:0,
- traversing:true,
- led: false,
- on:1,
- off:0,
- value:'',
-
- _osc: 'osc',
-
- precision:2,
- address:'auto',
- preArgs:[],
- split:false,
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.widget[0].style.setProperty('--columns', this.getProp('matrix')[0])
- this.widget[0].style.setProperty('--rows', this.getProp('matrix')[1])
- this.widget[0].style.setProperty('--spacing', this.getProp('spacing') + 'rem')
-
- var strData = JSON.stringify(options.props)
-
- for (var i = this.start; i < this.getProp('matrix')[0] * this.getProp('matrix')[1] + this.start; i++) {
-
- var data = JSON.parse(strData)
-
- data.top = data.left = data.height = data.width = 'auto'
- data.type = 'toggle'
- data.id = this.getProp('id') + '/' + i
- data.label = i
- data.address = this.getProp('split') ? this.getProp('address') + '/' + i : this.getProp('address')
- data.preArgs = this.getProp('split') ? this.getProp('preArgs') : [].concat(this.getProp('preArgs'), i)
- data.color = typeof this.getProp('color') == 'object' ? '' + this.getProp('color')[i % this.getProp('color').length] : this.getProp('color')
- data.css = ''
-
- var element = parser.parse([data],this.widget)
- element[0].classList.add('not-editable')
-
- this.value[i-this.start] = this.getProp('off')
-
- }
-
- if (this.getProp('traversing')) this.widget.enableTraversingGestures()
-
- this.registerHashes()
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/mixins/double_tap.js b/src/browser/js/app/widgets/mixins/double_tap.js
deleted file mode 100644
index 08b4a962..00000000
--- a/src/browser/js/app/widgets/mixins/double_tap.js
+++ /dev/null
@@ -1,35 +0,0 @@
-module.exports = (element, callback)=>{
-
- var lastTapTime = 0,
- lastTapX,
- lastTapY,
- touchId
-
- element.on('fake-click',(e, d)=>{
-
- var tapTime = new Date().getTime()
- var tapLength = tapTime - lastTapTime
-
- if (
-
- tapLength < DOUBLE_TAP_TIME && touchId == d.identifier &&
- Math.abs(lastTapX - d.pageX) < 20 &&
- Math.abs(lastTapY - d.pageY) < 20
-
- ) {
-
- callback()
- lastTapTime = 0
-
- } else {
-
- lastTapTime = tapTime
- touchId = d.identifier
- lastTapX = d.pageX
- lastTapY = d.pageY
-
- }
-
- })
-
-}
diff --git a/src/browser/js/app/widgets/pads/_pads_base.js b/src/browser/js/app/widgets/pads/_pads_base.js
deleted file mode 100644
index 33c9030a..00000000
--- a/src/browser/js/app/widgets/pads/_pads_base.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var _canvas_base = require('../common/_canvas_base'),
- touchstate = require('../mixins/touch_state')
-
-module.exports = class _pads_base extends _canvas_base {
-
- constructor(options) {
-
- var html = `
-
- `
-
- super({...options, html: html})
-
- this.wrapper = this.widget.find('.wrapper')
-
- this.pointSize = parseInt(this.getProp('pointSize'))
- this.widget[0].style.setProperty('--pointSize', this.pointSize + 'rem')
-
- touchstate(this, this.wrapper)
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/pads/multixy.js b/src/browser/js/app/widgets/pads/multixy.js
deleted file mode 100644
index 62930e7a..00000000
--- a/src/browser/js/app/widgets/pads/multixy.js
+++ /dev/null
@@ -1,241 +0,0 @@
-var _pads_base = require('./_pads_base'),
- Xy = require('./xy'),
- {clip} = require('../utils')
-
-var xyDefaults = Xy.defaults()
-
-
-module.exports = class MultiXy extends _pads_base {
-
- static defaults() {
-
- return {
- type:'xy',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _mutlixy:'multi xy',
-
- points: 2,
- pointSize: 20,
- snap:false,
- spring:false,
- pips: true,
- rangeX:{min:0,max:1},
- rangeY:{min:0,max:1},
- logScaleX:false,
- logScaleY:false,
- value:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- touchAddress:'',
- preArgs:[],
- split:false,
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.npoints = typeof this.getProp('points') == 'object' ? this.getProp('points').length : this.getProp('points')
- this.labels = typeof this.getProp('points') == 'object'
- this.pointSize = parseInt(this.getProp('pointSize'))
-
- this.split = this.getProp('split')?
- typeof this.getProp('split') == 'object' && this.getProp('split').length == 2 * this.npoints ?
- this.getProp('split')
- : (()=>{
- var s={},
- t
- for (var i=0; i=0;i--) {
- this.pads[i] = new Xy({props:{
- ...xyDefaults,
- snap:this.getProp('snap'),
- spring:this.getProp('spring'),
- value:this.getProp('value').length == this.getProp('points') * 2 ? [this.getProp('value')[i*2], this.getProp('value')[i*2 + 1]] : '',
- rangeX:this.getProp('rangeX'),
- rangeY:this.getProp('rangeY'),
- precision:this.precision,
- logScaleX:this.getProp('logScaleX'),
- logScaleY:this.getProp('logScaleY'),
- pointSize: this.getProp('pointSize'),
- pips: this.getProp('pips') && i == this.npoints-1,
- input:false
- }})
- this.pads[i].sendValue = ()=>{}
- this.wrapper.append(this.pads[i].widget)
-
- this.handles[i] = $(``)
-
- this.wrapper.append(this.handles[i])
-
- }
-
-
- this.value = []
-
- this.handles.forEach((handle, index)=>{
-
- handle.on('draginit',(e, data, traversing)=>{
-
- if (!traversing) {
- handle.addClass('active')
- }
-
- var id, ndiff, diff = -1
-
- for (var i in this.handles) {
- if (this.handlesToPads.indexOf(i) != -1) continue
- ndiff = Math.abs(data.offsetX - this.handlesPositions[i][0]) + Math.abs(data.offsetY - (this.handlesPositions[i][1] + this.height))
- if (diff == -1 || ndiff < diff) {
- id = i
- diff = ndiff
- }
- }
-
- this.handlesToPads[index] = id
-
- if (this.pads[id]) this.pads[id].wrapper.trigger(e.type, [data, traversing])
-
- })
-
- handle.on('drag',(e, data, traversing)=>{
-
- var id = this.handlesToPads[index]
- if (this.pads[id]) this.pads[id].wrapper.trigger(e.type, [data, traversing])
-
- })
-
- handle.on('dragend',(e, data, traversing)=>{
-
- var id = this.handlesToPads[index]
- if (this.pads[id]) this.pads[id].wrapper.trigger(e.type, [data, traversing])
- handle.removeClass('active')
- this.handlesToPads[index] = false
-
- })
-
- })
-
- this.wrapper.on('change',(e)=>{
- e.stopPropagation()
- this.setValue(this.getValue(), e.options)
- })
-
-
- var v = []
- for (var i=0;i`).appendTo(this.widget)
-
- this.hue = new Fader({props:{
- ...faderDefaults,
- id:'h',
- compact:true,
- pips:false,
- horizontal:true,
- snap:this.getProp('snap'),
- range:{min:0,max:360},
- input:false,
- precision:2
- }, cancelDraw: false})
- this.hue.margin = this.pointSize
- this.hue.sendValue = ()=>{}
- this.hueWrapper.append(this.hue.widget)
-
- this.pad = new Xy({props:{
- ...xyDefaults,
- snap:this.getProp('snap'),
- spring:this.getProp('spring'),
- rangeX:{min:0,max:100},
- rangeY:{min:0,max:100},
- precision:2,
- pointSize: this.getProp('pointSize'),
- pips: false,
- input:false
- }})
- this.pad.sendValue = ()=>{}
- this.wrapper.append(this.pad.widget)
-
-
- this.value = []
- this.hsb = {h:0,s:0,b:0}
-
- this.wrapper.on('change',(e)=>{
- e.stopPropagation()
- })
-
- this.hue.widget.on('change',(e)=>{
- e.stopPropagation()
- this.dragHandle(true)
- })
-
- this.wrapper.on('change',(e)=>{
- e.stopPropagation()
- this.dragHandle()
- })
-
- if (this.getProp('input')) {
-
- this.input = new Input({
- props:{...Input.defaults(), precision:this.getProp('precision'), unit:this.getProp('unit')},
- parent:this, parentNode:this.widget
- })
- this.widget.append(this.input.widget)
- this.input.widget.on('change', (e)=>{
- e.stopPropagation()
- this.setValue(this.input.getValue(), {sync:true, send:true})
- this.showValue()
- })
-
- }
-
- this.setValue([0,0,0])
-
- }
-
- dragHandle(hue) {
- var h = this.hue.value,
- s = this.pad.value[0],
- b = this.pad.value[1]
-
- if (h != this.hsb.h ||s != this.hsb.s || b != this.hsb.b) {
-
- this.hsb.h = this.hue.value
- this.hsb.s = this.pad.value[0]
- this.hsb.b = this.pad.value[1]
-
- this.update({nohue:!hue})
-
- var rgb = hsbToRgb(this.hsb)
- if (rgb.r != this.value[0] || rgb.g != this.value[1] || rgb.b != this.value[2]) {
- this.setValue([rgb.r, rgb.g, rgb.b],{send:true,sync:true,dragged:true,nohue:!hue})
- }
- }
-
- }
-
- setValue(v, options={}) {
-
- if (!v || !v.length || v.length!=3) return
- if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
-
- for (let i in [0,1,2]) {
- v[i] = clip(v[i],[0,255])
- }
-
- var hsb = rgbToHsb({r:v[0],g:v[1],b:v[2]})
-
- if (!options.dragged) {
- this.pad.setValue([hsb.s, hsb.b], {sync: false, send:false, dragged:false})
- }
-
- this.hsb = hsb
- this.value = v
-
- if (options.send) this.sendValue()
- if (options.sync) this.widget.trigger({type:'change', id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
-
- this.update({dragged:options.dragged, nohue:options.nohue || (v[0]==v[1]&&v[1]==v[2])})
-
- }
-
- update(options={}) {
-
- if (!options.nohue && !options.dragged) {
- var hue = hsbToRgb({h:this.hsb.h,s:100,b:100}),
- hueStr = `rgb(${Math.round(hue.r)},${Math.round(hue.g)},${Math.round(hue.b)})`
- this.canvas[0].setAttribute('style',`background-color:${hueStr}`)
- this.hue.setValue(this.hsb.h, {sync: false, send:false, dragged:false})
- }
-
-
- this.draw()
-
- this.showValue()
-
- }
-
- draw() {
-
- }
-
- showValue() {
-
- if (this.getProp('input')) this.input.setValue(this.value)
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/pads/xy.js b/src/browser/js/app/widgets/pads/xy.js
deleted file mode 100644
index 4226b266..00000000
--- a/src/browser/js/app/widgets/pads/xy.js
+++ /dev/null
@@ -1,255 +0,0 @@
-var _pads_base = require('./_pads_base'),
- Fader = require('./_fake_fader'),
- {clip} = require('../utils'),
- doubletab = require('../mixins/double_tap'),
- Input = require('../inputs/input')
-
-var faderDefaults = Fader.defaults()
-
-module.exports = class Xy extends _pads_base {
-
- static defaults() {
-
- return {
- type:'xy',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _xy:'xy',
-
- 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:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- touchAddress:'',
- preArgs:[],
- split:false,
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.split = this.getProp('split')?
- typeof this.getProp('split') == 'object' && this.getProp('split').length == 2 ?
- this.getProp('split')
- : [this.getProp('address') + '/x', this.getProp('address') + '/y']
- : false
-
- this.faders = {
- x: new Fader({props:{
- ...faderDefaults,
- id:0,
- compact:true,
- pips:false,
- horizontal:true,
- height:'100%',
- width:'100%',
- value:this.getProp('value').length==2?this.getProp('value')[0]:'',
- snap:this.getProp('snap'),
- range:this.getProp('rangeX'),
- origin:'auto',
- precision:this.precision,
- logScale:this.getProp('logScaleX'),
- input:false
- }, cancelDraw: true}),
- y: new Fader({props:{
- ...faderDefaults,
- id:1,
- compact:true,
- pips:false,
- horizontal:false,
- height:'100%',
- width:'100%',
- value:this.getProp('value').length==2?this.getProp('value')[1]:'',
- snap:this.getProp('snap'),
- range:this.getProp('rangeY'),
- origin:'auto',
- precision:this.precision,
- logScale:this.getProp('logScaleY'),
- input:false
- }, cancelDraw: true}),
- }
-
- this.faders.x.margin = this.faders.y.margin = this.pointSize + 1
-
- this.value = [this.faders.x.value, this.faders.y.value]
-
- this.wrapper.append(this.faders.x.widget)
- this.wrapper.append(this.faders.y.widget)
-
- this.wrapper.on('change',(e)=>{
- e.stopPropagation()
- })
-
- this.wrapper.on('draginit',(e, data, traversing)=>{
- this.faders.x.draginitHandleProxy(e, data, traversing)
- this.faders.y.draginitHandleProxy(e, data, traversing)
- this.dragHandle()
- })
- this.wrapper.on('drag',(e, data, traversing)=>{
- this.faders.x.dragHandleProxy(e, data, traversing)
- this.faders.y.dragHandleProxy(e, data, traversing)
- this.dragHandle()
- })
-
- if (this.getProp('spring')) {
- this.wrapper.on('dragend', ()=>{
- this.setValue([this.faders.x.springValue,this.faders.y.springValue],{sync:true,send:true,fromLocal:true})
- })
- }
-
- if (this.getProp('doubleTap')) {
- doubletab(this.wrapper, ()=>{
- this.setValue([this.faders.x.springValue,this.faders.y.springValue],{sync:true, send:true, fromLocal:true})
- })
- }
-
- if (this.getProp('input')) {
-
- this.input = new Input({
- props:{...Input.defaults(), precision:this.getProp('precision'), unit:this.getProp('unit')},
- parent:this, parentNode:this.widget
- })
- this.widget.append(this.input.widget)
- this.input.widget.on('change', (e)=>{
- e.stopPropagation()
- this.setValue(this.input.getValue(), {sync:true, send:true})
- this.showValue()
- })
-
- }
-
- this.setValue([0,0])
-
- }
-
- dragHandle(){
-
- var x = this.faders.x.value,
- y = this.faders.y.value
-
-
- if (x != this.value[0] || y != this.value[1]) {
- this.setValue([x, y],{send:true,sync:true,dragged:true})
- }
-
- }
-
-
- setValue(v, options={}) {
-
- if (!v || !v.length || v.length!=2) return
- if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
-
- if (!options.dragged) {
- this.faders.x.setValue(v[0], {sync: false, send:false, dragged:false})
- this.faders.y.setValue(v[1], {sync: false, send:false, dragged:false})
- }
-
- this.value = [
- this.faders.x.value,
- this.faders.y.value
- ]
-
- if (options.send) this.sendValue()
- if (options.sync) this.widget.trigger({type:'change', id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
-
- this.draw()
-
- this.showValue()
-
- }
-
- draw() {
-
- var pointSize = this.pointSize * PXSCALE,
- margin = (this.pointSize + 1) * PXSCALE,
- x = this.faders.x.percentToCoord(this.faders.x.percent),
- y = this.faders.y.percentToCoord(this.faders.y.percent)
-
- this.clear()
-
- this.ctx.lineWidth = PXSCALE
- this.ctx.fillStyle = this.colors.custom
- this.ctx.strokeStyle = this.colors.custom
-
-
- if (this.getProp('pips')) {
- this.ctx.globalAlpha = 0.1
- this.ctx.beginPath()
- this.ctx.rect(margin + 0.5, margin + 0.5, this.width - margin * 2 - 1, this.height - margin * 2 - 1)
- this.ctx.stroke()
-
- this.ctx.beginPath()
- for (var pip of this.faders.x.rangeKeys.concat(this.faders.x.valueToPercent(this.faders.x.originValue))) {
- if (pip == 0 || pip == 100) continue
- var xpip = Math.round(2 * this.faders.x.percentToCoord(pip)) / 2
- this.ctx.moveTo(xpip, margin + 0.5)
- this.ctx.lineTo(xpip, this.height - margin - 0.5)
- }
- for (pip of this.faders.y.rangeKeys.concat(this.faders.y.valueToPercent(this.faders.y.originValue))) {
- if (pip == 0 || pip == 100) continue
- var ypip = Math.round(2 * this.faders.y.percentToCoord(pip)) / 2
- this.ctx.moveTo(margin + 0.5, ypip)
- this.ctx.lineTo(this.width - margin - 0.5, ypip)
- }
- this.ctx.stroke()
-
- } else {
-
- this.clearRect = [x - margin, y - margin, margin * 2, margin * 2]
-
- }
-
-
- this.ctx.globalAlpha = 0.7
-
- this.ctx.beginPath()
- this.ctx.arc(x, y, pointSize, Math.PI * 2, false)
- this.ctx.stroke()
-
- this.ctx.globalAlpha = 1
- this.ctx.lineWidth = 1.5 * PXSCALE
-
- this.ctx.beginPath()
- this.ctx.arc(x, y, pointSize / 2, Math.PI * 2, false)
- this.ctx.stroke()
-
- }
-
- showValue() {
-
- if (this.getProp('input')) this.input.setValue(this.value)
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/_plots_base.js b/src/browser/js/app/widgets/plots/_plots_base.js
deleted file mode 100644
index bf5cbbf6..00000000
--- a/src/browser/js/app/widgets/plots/_plots_base.js
+++ /dev/null
@@ -1,172 +0,0 @@
-var {mapToScale} = require('../utils'),
- _widgets_base = require('../common/_widgets_base'),
- _canvas_base = require('../common/_canvas_base'),
- widgetManager = require('../../managers/widgets')
-
-module.exports = class _plots_base extends _canvas_base {
-
- constructor(options) {
-
- var html = `
-
-
-
- `
-
- super({...options, html: html})
-
- this.data = []
- this.linkedWidgets = []
- this.rangeX = this.getProp('rangeX') || {min:0,max:1}
- this.rangeY = this.getProp('rangeY') || {min:0,max:1}
- this.logScaleX = this.getProp('logScaleX')
- this.logScaleY = this.getProp('logScaleY')
- this.pips = {
- x : {
- min: Math.abs(this.rangeX.min)>=1000?this.rangeY.min/1000+'k':this.rangeX.min,
- max: Math.abs(this.rangeX.max)>=1000?this.rangeY.max/1000+'k':this.rangeX.max
- },
- y : {
- min: Math.abs(this.rangeY.min)>=1000?this.rangeY.min/1000+'k':this.rangeY.min,
- max: Math.abs(this.rangeY.max)>=1000?this.rangeY.max/1000+'k':this.rangeY.max
- }
- }
- this.smooth = this.getProp('smooth') === true ? 0.25 : this.getProp('smooth') === false ? 0 : parseFloat(this.getProp('smooth')) || 0
-
-
-
- $('body').on(`change.${this.hash}`,this.syncHandleProxy.bind(this))
-
- }
-
- syncHandleProxy() {
-
- this.syncHandle(...arguments)
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.linkedWidgets.indexOf(e.id)==-1 || !widgetManager.getWidgetById(e.id).length) return
- this.updateData()
- this.draw()
-
- }
-
- resizeHandle() {
-
- this.updateData()
- super.resizeHandle(...arguments)
-
- }
-
- draw() {
-
- this.ctx.clearRect(0,0,this.width,this.height)
- this.ctx.beginPath()
-
- if (!this.width) return
-
- this.draw_data()
-
- this.ctx.globalAlpha = 0.7
- this.ctx.lineWidth = 2 * PXSCALE
- this.ctx.strokeStyle = this.colors.custom
- this.ctx.stroke()
-
- if (this.getProp('origin') !== false) {
-
- var origin = mapToScale(this.getProp('origin') || this.rangeY.min,[this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true)
-
- this.ctx.globalAlpha = 0.1
- this.ctx.fillStyle = this.colors.custom
- this.ctx.lineTo(this.width,origin)
- this.ctx.lineTo(0,origin)
- this.ctx.closePath()
- this.ctx.fill()
-
- }
-
-
- this.ctx.globalAlpha = 1
- this.ctx.font = PXSCALE * 10 + 'px sans-serif'
- this.ctx.fillStyle = this.colors.text
-
- if (this.getProp('pips')) {
-
- if (this.pips.x) {
-
- this.ctx.textBaseline = "bottom"
- this.ctx.textAlign = 'left'
- this.ctx.fillText(this.pips.x.min,(this.pips.y?12:2)*PXSCALE,this.height)
- this.ctx.textAlign = 'right'
- this.ctx.fillText(this.pips.x.max,this.width-2*PXSCALE,this.height)
-
- }
-
- if (this.pips.y) {
-
- this.ctx.save()
- this.ctx.translate(0, this.height)
- this.ctx.rotate(-Math.PI/2)
-
- this.ctx.textBaseline = "top"
- this.ctx.textAlign = 'left'
- this.ctx.fillText(this.pips.y.min,(this.pips.x?12:2)*PXSCALE,2*PXSCALE)
- this.ctx.textAlign = 'right'
- this.ctx.fillText(this.pips.y.max,this.height-2*PXSCALE,2*PXSCALE)
- this.ctx.rotate(Math.PI/2)
- this.ctx.restore()
-
- }
-
- }
-
- }
-
- draw_data() {
-
- var points = []
- for (let i in this.data) {
-
- if (this.data[i].length) {
- points.push(mapToScale(this.data[i][0],[this.rangeX.min,this.rangeX.max],[0,this.width],0,this.logScaleX,true))
- points.push(mapToScale(this.data[i][1],[this.rangeY.min,this.rangeY.max],[this.height-2*PXSCALE,2*PXSCALE],0,this.logScaleY,true))
- } else {
- points.push(mapToScale(i,[0,this.data.length-1],[0,this.width],0,this.logScaleX,true))
- points.push(mapToScale(this.data[i],[this.rangeY.min,this.rangeY.max],[this.height-2*PXSCALE,2*PXSCALE],0,this.logScaleY,true))
- }
-
- }
-
- this.ctx.curve(points, this.smooth, Math.round(this.width/(points.length/2 - 1)))
-
- }
-
- setValue(v) {
-
- this.data = v
- this.draw()
-
- }
-
- getValue() {
-
- return _widgets_base.deepCopy(this.data)
-
- }
-
- updateData() {
-
- // update the coordinates to draw
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/eq.js b/src/browser/js/app/widgets/plots/eq.js
deleted file mode 100644
index 526f44fc..00000000
--- a/src/browser/js/app/widgets/plots/eq.js
+++ /dev/null
@@ -1,122 +0,0 @@
-var {mapToScale, clip} = require('../utils'),
- _biquad_response = require('./_biquad_response'),
- _plots_base = require('./_plots_base'),
- widgetManager = require('../../managers/widgets')
-
-module.exports = class Eq extends _plots_base {
-
- static defaults() {
-
- return {
- type:'eq',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _eq:'eq',
-
- pips:true,
- filters:[],
- resolution:128,
- rangeY: {min:-20,max:20},
- origin: 'auto',
- logScaleX: false,
- smooth: false,
-
- _osc:'osc',
-
- address:'auto',
- preArgs:[],
-
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.rangeX = {min:20,max:22050}
- this.pips.x.min = '20'
- this.pips.x.max = '22k'
-
- this.resolution = clip(this.getProp('resolution'),[64,1024])
-
- for (let i in this.getProp('filters')) {
-
- for (let j in this.getProp('filters')[i]) {
- if (typeof this.getProp('filters')[i][j]=='string' && !(j=='type' && this.getProp('filters')[i][j].match(/peak|notch|highpass|highshelf|lowpass|lowshelf/))) {
- this.linkedWidgets.push(this.getProp('filters')[i][j])
- }
- }
-
- }
-
- }
-
- updateData() {
-
- var filters = [],
- eqResponse = []
-
-
- for (let i in this.getProp('filters')) {
- var filter = this.getProp('filters')[i]
-
- filters[i] = {}
-
- for (let j in filter) {
- let widget = widgetManager.getWidgetById(filter[j])
-
- if (typeof filter[j]=='string' && widget.length) {
-
- filters[i][j] = widget[widget.length-1].getValue()
-
- } else {
-
- filters[i][j] = filter[j]
-
- }
-
- }
-
- }
-
- for (let i in filters) {
-
- var filterResponse
-
- if (!filters[i].type) filters[i].type = "peak"
-
- if (!filters[i].on) {
- filterResponse = _biquad_response({type:"peak",freq:1,gain:0,q:1},!this.getProp('logScaleX'), this.resolution)
- } else {
- filterResponse = _biquad_response(filters[i],!this.getProp('logScaleX'), this.resolution)
- }
-
- for (var k in filterResponse) {
- if (eqResponse[k]===undefined) {
- eqResponse[k]=[0,0]
- }
-
- eqResponse[k] = [filterResponse[k][0], eqResponse[k][1]+filterResponse[k][1]]
- }
-
- }
-
- if (eqResponse.length) this.data = eqResponse
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/led.js b/src/browser/js/app/widgets/plots/led.js
deleted file mode 100644
index b1b8e865..00000000
--- a/src/browser/js/app/widgets/plots/led.js
+++ /dev/null
@@ -1,85 +0,0 @@
-var {mapToScale} = require('../utils'),
- _widgets_base = require('../common/_widgets_base'),
- widgetManager = require('../../managers/widgets')
-
-module.exports = class Led extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'led',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _led:'led',
-
- widgetId:'',
- range:{min:0,max:1},
- logScale:false,
- value:'',
-
- _osc:'osc',
-
- preArgs:[],
- address:'auto'
-
- }
-
- }
-
- constructor(options) {
-
- var html = `
-
-
- `
-
- super({...options, html: html})
-
- if (this.getProp('widgetId').length) $('body').on(`change.${this.hash}`,this.syncHandle.bind(this))
-
- this.setValue(this.getProp('range').min)
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length) return
- var widget = widgetManager.getWidgetById(e.id),
- value
- for (var i=widget.length-1; i>=0; i--) {
- if (widget[i].getValue) {
- this.setValue(widget[i].getValue())
- return
- }
- }
-
- }
- setValue(v) {
-
- if (typeof v != 'number') return
- this.value = v
- this.widget[0].style.setProperty('--opacity', mapToScale(v,[this.getProp('range').min,this.getProp('range').max],[0,1],false,this.getProp('logScale'),true))
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/meter.js b/src/browser/js/app/widgets/plots/meter.js
deleted file mode 100644
index f5ec9799..00000000
--- a/src/browser/js/app/widgets/plots/meter.js
+++ /dev/null
@@ -1,90 +0,0 @@
-var Fader = require('../sliders/fader'),
- widgetManager = require('../../managers/widgets')
-
-
-module.exports = class Meter extends Fader {
-
- static defaults() {
-
- return {
- type:'fader',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
-
- _meter:'meter',
-
- widgetId:'',
- range:{min:0,max:1},
- logScale:false,
- origin:'auto',
- unit:'',
- alignRight:false,
- horizontal:false,
- pips:false,
- dashed:false,
- value:'',
-
- _osc:'osc',
-
- address:'auto',
- preArgs:[]
- }
-
- }
-
- constructor(options) {
-
- options.props.compact = true
- options.props.input = false
-
- super(options)
-
- this.widget.addClass('meter')
- .off('mousewheel')
-
- this.canvas.off('draginit drag')
-
- if (this.getProp('widgetId').length) $('body').on(`change.${this.hash}`,this.syncHandle.bind(this))
-
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length) return
- var widget = widgetManager.getWidgetById(e.id),
- value
- for (var i=widget.length-1; i>=0; i--) {
- if (widget[i].getValue) {
- this.setValue(widget[i].getValue())
- return
- }
- }
-
- }
-
- sendValue() {
- // disabled
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/plot.js b/src/browser/js/app/widgets/plots/plot.js
deleted file mode 100644
index 6fc17b46..00000000
--- a/src/browser/js/app/widgets/plots/plot.js
+++ /dev/null
@@ -1,100 +0,0 @@
-var {mapToScale} = require('../utils'),
- _plots_base = require('./_plots_base'),
- widgetManager = require('../../managers/widgets')
-
-module.exports = class Plot extends _plots_base {
-
- static defaults() {
-
- return {
- type:'plot',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _plot:'plot',
-
- points:[],
- rangeX: {min:0,max:1},
- rangeY: {min:0,max:1},
- origin: 'auto',
- logScaleX: false,
- logScaleY: false,
- smooth: false,
- pips:true,
-
- _osc:'osc',
-
- address:'auto',
- preArgs:[],
-
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- if (typeof this.getProp('points')=='string') {
-
- this.linkedWidgets.push(this.getProp('points'))
-
- } else if (typeof this.getProp('points')=='object') {
-
- for (let i in this.getProp('points')) {
- for (let j in this.getProp('points')[i]) {
- if (typeof this.getProp('points')[i][j] == 'string') {
- this.linkedWidgets.push(this.getProp('points')[i][j])
- }
- }
- }
- }
-
- }
-
- updateData() {
-
- var data = [],
- points = this.getProp('points'),
- widget = widgetManager.getWidgetById(points)
-
- if (typeof points=='string' && widget.length) {
-
- data = widget[widget.length-1].getValue()
-
- } else if (typeof points=='object') {
-
- for (let i in points) {
-
- data[i] = []
-
- for (var k in [0,1]) {
- let widget = widgetManager.getWidgetById(points[i][k])
- if (typeof points[i][k] == 'string' && widget.length) {
- data[i][k] = widget[widget.length-1].getValue()
- } else {
- data[i][k] = points[i][k]
- }
- }
-
- }
-
- }
-
- if (data.length) this.data = data
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/rgbled.js b/src/browser/js/app/widgets/plots/rgbled.js
deleted file mode 100644
index 746ba8aa..00000000
--- a/src/browser/js/app/widgets/plots/rgbled.js
+++ /dev/null
@@ -1,108 +0,0 @@
-var {mapToScale} = require('../utils'),
- _widgets_base = require('../common/_widgets_base'),
- widgetManager = require('../../managers/widgets'),
- {clip} = require('../utils')
-
-module.exports = class Rbgled extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'rgbled',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- css:'',
-
- _rgbled:'rgbled',
-
- widgetId:'',
- value:'',
-
- _osc:'osc',
-
- preArgs:[],
- address:'auto'
-
- }
-
- }
-
- constructor(options) {
-
- var html = `
-
-
- `
-
- super({...options, html: html})
-
- if (this.getProp('widgetId').length) $('body').on(`change.${this.hash}`,this.syncHandle.bind(this))
-
- this.setValue([0,0,0,0])
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length) return
-
- var widget = widgetManager.getWidgetById(e.id),
- value
-
- for (var i=widget.length-1; i>=0; i--) {
- if (widget[i].getValue) {
- this.setValue(widget[i].getValue())
- return
- }
- }
-
- }
- setValue(v) {
-
- var c = ''
-
- if (Array.isArray(v) && v.length >= 3) {
-
- for (let i in [0,1,2]) {
- v[i] = parseInt(clip(v[i],[0,255]))
- }
-
- v[3] = clip(v[3] != undefined ? v[3] : 1,[0,1])
-
- c = `rgba(${v[0]}, ${v[1]}, ${v[2]}, ${v[3]})`
-
- } else if (typeof v == 'string') {
-
- c = v
-
-
- } else {
-
- return
-
- }
-
- this.value = v
-
- this.widget[0].style.setProperty('--color-custom', c)
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/plots/text.js b/src/browser/js/app/widgets/plots/text.js
deleted file mode 100644
index c2ab9751..00000000
--- a/src/browser/js/app/widgets/plots/text.js
+++ /dev/null
@@ -1,88 +0,0 @@
-var {iconify} = require('../../utils'),
- _widgets_base = require('../common/_widgets_base'),
- widgetManager = require('../../managers/widgets')
-
-module.exports = class Text extends _widgets_base {
-
- static defaults() {
-
- return {
- type:'text',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _text: 'text',
-
- widgetId:'',
- vertical:false,
- value:'',
-
- _osc:'osc',
-
- preArgs:[],
- address:'auto',
- }
-
- }
-
- constructor(options) {
-
- super({...options, html: ''})
-
- if (this.getProp('vertical')) this.widget.addClass('vertical')
-
- this.defaultValue = this.getProp('label')===false?
- this.getProp('id'):
- this.getProp('label')=='auto'?
- this.getProp('id'):
- this.getProp('label')
-
- this.value = this.defaultValue
-
- if (this.getProp('widgetId').length) $('body').on(`change.${this.hash}`,this.syncHandle.bind(this))
-
- this.setValue(this.value)
-
- }
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
- syncHandle(e) {
-
- if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length) return
- var widget = widgetManager.getWidgetById(e.id),
- value
- for (var i=widget.length-1; i>=0; i--) {
- if (widget[i].getValue) {
- this.setValue(widget[i].getValue())
- return
- }
- }
-
- }
-
- setValue(v) {
-
- this.value = v==null ? this.defaultValue : v
- this.widget.html(iconify(String(this.value).replace(/\n/g,'
')))
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/sliders/_sliders_base.js b/src/browser/js/app/widgets/sliders/_sliders_base.js
deleted file mode 100644
index ed81a15f..00000000
--- a/src/browser/js/app/widgets/sliders/_sliders_base.js
+++ /dev/null
@@ -1,223 +0,0 @@
-var {clip, mapToScale} = require('../utils'),
- _canvas_base = require('../common/_canvas_base'),
- touchstate = require('../mixins/touch_state'),
- doubletab = require('../mixins/double_tap'),
- Input = require('../inputs/input')
-
-module.exports = class _sliders_base extends _canvas_base {
-
- constructor(options) {
-
- var html = `
-
- `
-
- super({...options, html: html})
-
- this.wrapper = this.widget.find('.wrapper')
-
- this.value = undefined
- this.percent = 0
-
- this.unit = this.getProp('unit') ? ' ' + this.getProp('unit') : ''
-
-
- this.rangeKeys = []
- this.rangeVals = []
- this.rangeLabels = []
-
- for (var k in this.getProp('range')) {
- var key = k=='min'?0:k=='max'?100:parseInt(k),
- val = typeof this.getProp('range')[k] == 'object'?
- this.getProp('range')[k][Object.keys(this.getProp('range')[k])[0]]:
- this.getProp('range')[k],
- label = typeof this.getProp('range')[k] == 'object'?
- Object.keys(this.getProp('range')[k])[0]:
- val
-
- this.rangeKeys.push(key)
- this.rangeVals.push(val)
- this.rangeLabels.push(label)
- }
- this.rangeValsMax = Math.max(...this.rangeVals),
- this.rangeValsMin = Math.min(...this.rangeVals)
-
- this.originValue = this.getProp('origin')=='auto'?
- this.rangeValsMin:
- clip(this.getProp('origin'), [this.rangeValsMin,this.rangeValsMax])
-
- this.springValue = this.getProp('value') !== '' ? this.getProp('value') : this.originValue
-
- if (this.getProp('doubleTap')) {
-
- doubletab(this.widget, ()=>{
- this.setValue(this.springValue,{sync:true, send:true, fromLocal:true})
- })
-
- }
-
- touchstate(this, this.wrapper)
-
- this.wrapper.on('mousewheel',this.mousewheelHandleProxy.bind(this))
- this.wrapper.on('draginit',this.draginitHandleProxy.bind(this))
- this.wrapper.on('drag',this.dragHandleProxy.bind(this))
- this.wrapper.on('dragend',this.dragendHandleProxy.bind(this))
-
-
- if (this.getProp('input')) {
-
- this.input = new Input({
- props:{
- ...Input.defaults(),
- precision:this.getProp('precision'),
- unit:this.getProp('unit'),
- horizontal: this.getProp('type') == 'fader' && this.getProp('compact') && !this.getProp('horizontal')
- },
- parent:this, parentNode:this.widget
- })
-
- this.widget.append(this.input.widget)
- this.input.widget.on('change', (e)=>{
- e.stopPropagation()
- this.setValue(this.input.getValue(), {sync:true, send:true})
- this.showValue()
- })
-
- this.widget.on('fake-right-click',function(e){
- if (!EDITING) {
- e.stopPropagation()
- e.preventDefault()
- this.input.canvas.focus()
- }
- }.bind(this))
-
- }
-
- this.setValue(this.originValue)
-
- }
-
- mousewheelHandleProxy() {
-
- this.mousewheelHandle(...arguments)
-
- }
-
- draginitHandleProxy() {
-
- this.draginitHandle(...arguments)
-
- }
-
- dragHandleProxy() {
-
- this.dragHandle(...arguments)
-
- }
-
- dragendHandleProxy() {
-
- this.dragendHandle(...arguments)
-
- }
-
- mousewheelHandle(e, data, traversing) {
-
- if (e.originalEvent.wheelDeltaX) return
-
- e.preventDefault()
- e.stopPropagation()
-
- var direction = e.originalEvent.wheelDelta / Math.abs(e.originalEvent.wheelDelta),
- increment = e.ctrlKey?0.25:1
-
- this.percent = clip(this.percent + Math.max(increment,10/Math.pow(10,this.precision + 1)) * direction, [0,100])
-
- this.setValue(this.percentToValue(this.percent), {sync:true,send:true,dragged:true})
-
- }
-
- draginitHandle(e, data, traversing) {
-
- }
-
- dragHandle(e, data, traversing) {
-
- }
-
- dragendHandle(e, data, traversing) {
-
- if (this.getProp('spring'))
- this.setValue(this.springValue,{sync:true,send:true,fromLocal:true})
-
- }
-
- resizeHandle(e, width, height, checkColors) {
-
- if (!this.visible || checkColors) {
- var style = getComputedStyle(this.widget[0])
- this.colors.track = style.getPropertyValue('--color-track')
- this.colors.gauge = style.getPropertyValue('--color-gauge')
- this.colors.knob = style.getPropertyValue('--color-knob')
- this.colors.pips = style.getPropertyValue('--color-pips')
- }
-
- super.resizeHandle(...arguments)
-
- }
-
-
- percentToValue(percent) {
-
- var h = clip(percent,[0,100])
- for (var i=0;i= this.rangeKeys[i]) {
- return mapToScale(h,[this.rangeKeys[i],this.rangeKeys[i+1]],[this.rangeVals[i],this.rangeVals[i+1]],false,this.getProp('logScale'))
- }
- }
-
- }
-
- valueToPercent(value) {
-
- for (var i=0;i= this.rangeVals[i]) {
- return mapToScale(value,[this.rangeVals[i],this.rangeVals[i+1]],[this.rangeKeys[i],this.rangeKeys[i+1]],false,this.getProp('logScale'),true)
- }
- }
-
- }
-
- setValue(v,options={}) {
-
- if (typeof v != 'number') return
- if (this.touched && !options.dragged) return this.setValueTouchedQueue = arguments
-
- var value = clip(v,[this.rangeValsMin,this.rangeValsMax])
-
- if ((options.dragged || options.fromLocal) && this.value.toFixed(this.precision) == value.toFixed(this.precision)) options.send = false
-
- this.value = value
-
- if (!options.dragged) this.percent = this.valueToPercent(this.value)
-
- if (!this.noDraw) this.draw()
-
- this.showValue()
-
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
- if (options.send) this.sendValue()
-
- }
-
- showValue() {
-
- if (this.getProp('input')) this.input.setValue(this.value)
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/sliders/fader.js b/src/browser/js/app/widgets/sliders/fader.js
deleted file mode 100644
index 58cedfe7..00000000
--- a/src/browser/js/app/widgets/sliders/fader.js
+++ /dev/null
@@ -1,299 +0,0 @@
-var {clip, mapToScale} = require('../utils'),
- _sliders_base = require('./_sliders_base'),
- parser = require('../../parser')
-
-
-module.exports = class Fader extends _sliders_base {
-
- static defaults() {
-
- return {
- type:'fader',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _fader:'fader',
-
- 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:'',
-
- _osc:'osc',
-
- precision:2,
- address:'auto',
- touchAddress:'',
- meterAddress:'',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super(options)
-
- this.widget.addClass('fader')
- this.margin = 22
-
-
- if (this.getProp('horizontal')) {
- this.widget.add(this.container).addClass('horizontal')
- }
-
- if (this.getProp('compact')) {
- this.widget.addClass('compact')
- this.margin = 0
- }
-
- if (this.getProp('alignRight') && !this.getProp('horizontal')) {
- this.widget.addClass('align-right')
- }
-
- if (this.getProp('meter')) {
- var data = {
- type:'meter',
- id: this.getProp('id') + '/meter',
- label:false,
- horizontal:this.getProp('horizontal'),
- range:this.getProp('range'),
- logScale:this.getProp('logScale'),
- address:this.getProp('meterAddress') || this.getProp('address') + '/meter',
- preArgs:this.getProp('preArgs'),
- color:this.getProp('color'),
- pips:false,
- dashed:true
- }
- var element = parser.parse([data],this.wrapper, this.parent)
- element[0].classList.add('not-editable')
- this.widget[0].classList.add('has-meter')
- }
-
- if (this.getProp('pips')) {
-
- this.widget.addClass('has-pips')
-
- var pips = $('').appendTo(this.wrapper)
- var pipTexts = {}
- for (var k in this.rangeKeys) {
- pipTexts[this.rangeKeys[k]]=this.rangeLabels[k]
- }
-
- var pipsInner = ''
- for (var i=0;i<=100;i++) {
- if (pipTexts[i]==undefined) continue
-
- var pos = this.getProp('horizontal')?'left':'bottom';
-
- var piptext = `${Math.abs(pipTexts[i])>=1000?pipTexts[i]/1000+'k':pipTexts[i]}`
-
- var add = `
- ${piptext}
- `
- pipsInner = pipsInner + add
- }
- pips[0].innerHTML = pipsInner
- }
-
-
- }
-
- draginitHandle(e, data, traversing) {
-
- super.draginitHandle(...arguments)
-
- this.percent = clip(this.percent,[0,100])
-
- if (!(traversing || this.getProp('snap'))) return
-
- this.percent = this.getProp('horizontal')?
- (data.offsetX - this.margin * PXSCALE) / (this.width - (this.margin * PXSCALE * 2)) * 100:
- (this.height - data.offsetY - this.margin * PXSCALE) / (this.height - (this.margin * PXSCALE * 2)) * 100
-
- // this.percent = clip(this.percent,[0,100])
-
- this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true})
-
- }
-
- dragHandle(e, data) {
-
- super.dragHandle(...arguments)
-
- this.percent = this.getProp('horizontal')?
- this.percent + ( data.speedX/(this.width - this.margin * PXSCALE * 2)) * 100:
- this.percent + (-data.speedY/(this.height - this.margin * PXSCALE * 2)) * 100
-
- this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true})
-
- }
-
- percentToCoord(percent) {
-
- if (this.getProp('horizontal')) {
- return clip(percent / 100,[0,1]) * (this.width - 2 * PXSCALE * this.margin) + this.margin * PXSCALE
- } else {
- return (this.height - this.margin * PXSCALE) - clip(percent / 100, [0,1]) * (this.height - 2 * PXSCALE * this.margin)
- }
-
- }
-
- resizeHandle(e, width, height, checkColors) {
-
- var ratio = CANVAS_SCALING * this.scaling
-
- if (this.getProp('compact')) {
- if (this.getProp('horizontal')) {
- super.resizeHandle(e, width, 1 / ratio, checkColors)
- } else {
- super.resizeHandle(e, 1 / ratio, height, checkColors)
- }
- } else {
- super.resizeHandle(...arguments)
- }
-
- if (this.getProp('horizontal')){
- this.ctx.setTransform(1, 0, 0, 1, 0, 0)
- this.ctx.rotate(-Math.PI/2)
- this.ctx.translate(-this.height, 0)
-
- if (ratio != 1) this.ctx.scale(ratio, ratio)
- }
-
-
- }
-
-
- draw() {
-
- var width = this.getProp('horizontal') ? this.height : this.width,
- height = !this.getProp('horizontal') ? this.height : this.width
-
- var d = Math.round(this.percentToCoord(this.percent)),
- o = Math.round(this.percentToCoord(this.valueToPercent(this.originValue))),
- m = Math.round(this.getProp('horizontal') ? this.height / 2 : this.width / 2)
-
- var dashed = this.getProp('dashed')
-
- this.clear()
-
- if (this.getProp('compact')) {
-
- this.ctx.globalAlpha = (dashed ? .3 : .2) + 0.2 * Math.abs(d-o) / (d d)
- this.ctx.stroke()
-
- if (dashed) this.ctx.setLineDash([])
-
- // knob
-
- this.ctx.lineWidth = PXSCALE
-
- this.ctx.fillStyle = this.colors.raised
- this.ctx.beginPath()
- this.ctx.globalAlpha = 1
- this.ctx.arc(this.width / 2, this.height / 2, knobRadius, 0, Math.PI * 2)
- this.ctx.fill()
- this.ctx.strokeStyle = this.colors.bg
- this.ctx.stroke()
-
- this.ctx.beginPath()
- this.ctx.globalAlpha = 1
- this.ctx.arc(this.width / 2, this.height / 2, knobRadius - PXSCALE * 1.5, 0, Math.PI * 2)
- this.ctx.strokeStyle = this.colors.light
- this.ctx.stroke()
-
- var g = this.ctx.createLinearGradient(this.width / 2, this.height / 2 - knobRadius / 2,this.width / 2, this.height / 2 + knobRadius / 2);
- g.addColorStop(0.5, 'transparent');
- g.addColorStop(0, this.colors.light);
-
- this.ctx.strokeStyle = g
- this.ctx.stroke()
-
- // cursor
- this.ctx.globalAlpha = 1
-
- let r1 = knobRadius,
- r2 = knobRadius / 2,
- a = 2 * Math.PI - d
-
- this.ctx.beginPath()
- this.ctx.moveTo(r1 * Math.cos(a) + this.width / 2, this.height / 2 - r1 * Math.sin(a))
- this.ctx.lineTo(r2 * Math.cos(a) + this.width / 2, this.height / 2 - r2 * Math.sin(a))
-
- this.ctx.lineWidth = tiny ? PXSCALE : 2 * PXSCALE
- this.ctx.strokeStyle = this.colors.knob
- this.ctx.stroke()
-
-
-
- }
-
-}
diff --git a/src/browser/js/app/widgets/switchers/switcher.js b/src/browser/js/app/widgets/switchers/switcher.js
deleted file mode 100644
index 8cf31ae5..00000000
--- a/src/browser/js/app/widgets/switchers/switcher.js
+++ /dev/null
@@ -1,86 +0,0 @@
-var _switchers_base = require('./_switchers_base'),
- Switch = require('../buttons/switch')
-
-var switchDefaults = Switch.defaults()
-
-module.exports = class Switcher extends _switchers_base {
-
- static defaults() {
-
- return {
- type:'switcher',
- id:'auto',
- linkId:'',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
-
- _switcher:'Switcher',
-
- horizontal:false,
- linkedWidgets:'',
- values:['A', 'B'],
- value:'A',
-
- _osc:'osc',
-
- address:'auto',
- preArgs:[],
- target:[]
- }
-
- }
-
- constructor(options) {
-
- super({...options, html: ''})
-
- if (this.getProp('horizontal')) this.widget.addClass('horizontal')
-
- this.switch = new Switch({props:{
- ...switchDefaults,
- label:false,
- values:this.getProp('values'),
- value: this.getProp('value'),
- horizontal:this.getProp('horizontal')
- }})
-
- this.switch.sendValue = ()=>{}
-
- this.widget.append(this.switch.widget)
-
- this.switch.widget.on('change', (e)=>{
-
- e.stopPropagation()
-
- var {widget, options} = e
-
- options.fromSelf = true
-
- this.setValue(this.switch.getValue(), options)
-
- })
-
-
- }
-
- setValue(v, options={}) {
-
- super.setValue(...arguments)
-
- if (!options.fromSelf) this.switch.setValue(this.value._selected)
-
- }
-
-
-}
diff --git a/src/browser/js/app/widgets/utils.js b/src/browser/js/app/widgets/utils.js
deleted file mode 100644
index db755163..00000000
--- a/src/browser/js/app/widgets/utils.js
+++ /dev/null
@@ -1,79 +0,0 @@
-module.exports = {
-
- clip: function(value,range) {
- var value = parseFloat(value)
-
- if (isNaN(value)) value = range[0]
- return Math.max(Math.min(range[0],range[1]),Math.min(value,Math.max(range[0],range[1])))
-
- },
-
- // map a value from a scale to another input and output must be range arrays
- mapToScale: function(value,rangeIn,rangeOut,precision,log,revertlog) {
-
- var value = module.exports.clip(value,[rangeIn[0],rangeIn[1]])
-
- value = log?
- revertlog?
- (Math.pow(10,((value-rangeIn[0])/(rangeIn[1]-rangeIn[0])))/9-1/9) * (rangeOut[1]-rangeOut[0]) + rangeOut[0]
- :Math.log10(((value-rangeIn[0])/(rangeIn[1]-rangeIn[0]))*9+1) * (rangeOut[1]-rangeOut[0]) + rangeOut[0]
- :((value-rangeIn[0])/(rangeIn[1]-rangeIn[0])) * (rangeOut[1]-rangeOut[0]) + rangeOut[0]
-
- value = Math.max(Math.min(rangeOut[0],rangeOut[1]),Math.min(value,Math.max(rangeOut[0],rangeOut[1])))
-
- if (precision!==false) value = parseFloat(value.toFixed(precision))
-
-
- return value
-
- },
-
- hsbToRgb: function (hsb) {
- var rgb = {}
- var h = hsb.h
- var s = hsb.s*255/100
- var v = hsb.b*255/100
- if(s == 0) {
- rgb.r = rgb.g = rgb.b = v
- } else {
- var t1 = v
- var t2 = (255-s)*v/255
- var t3 = (t1-t2)*(h%60)/60
- if(h==360) h = 0
- if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
- else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
- else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
- else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
- else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
- else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
- else {rgb.r=0; rgb.g=0; rgb.b=0}
- }
- return rgb
- },
-
- rgbToHsb: function (rgb) {
- var hsb = {h: 0, s: 0, b: 0}
- var min = Math.min(rgb.r, rgb.g, rgb.b)
- var max = Math.max(rgb.r, rgb.g, rgb.b)
- var delta = max - min
- hsb.b = max
- hsb.s = max != 0 ? 255 * delta / max : 0
- if (hsb.s != 0) {
- if (rgb.r == max) hsb.h = (rgb.g - rgb.b) / delta
- else if (rgb.g == max) hsb.h = 2 + (rgb.b - rgb.r) / delta
- else hsb.h = 4 + (rgb.r - rgb.g) / delta
- } else hsb.h = 0
- hsb.h *= 60
- if (hsb.h < 0) hsb.h += 360
- hsb.s *= 100/255
- hsb.b *= 100/255
- return hsb
- },
-
- math: function(){
- var math = require('mathjs/dist/math.min.js')
- // set math's parser array index base to zero
- math.expression.transform = Object.create(math)
- return math
- }()
-}
diff --git a/src/browser/js/browser.js b/src/browser/js/browser.js
deleted file mode 100644
index efe3b8cb..00000000
--- a/src/browser/js/browser.js
+++ /dev/null
@@ -1,17 +0,0 @@
-require('./app/globals')
-require('./app/sourcemap')
-
-var ipc = require('./app/ipc/'),
- osc = require('./app/osc'),
- parser = require('./app/parser'),
- {loading} = require('./app/utils')
-
-ipc.init()
-osc.init()
-parser.init()
-
-$(document).ready(function(){
- LOADING = loading('Connecting server...')
- require('./app/ui')
- ipc.send('ready')
-})
diff --git a/src/browser/js/libs/jquery.drag.js b/src/browser/js/libs/jquery.drag.js
deleted file mode 100644
index f12660f4..00000000
--- a/src/browser/js/libs/jquery.drag.js
+++ /dev/null
@@ -1,395 +0,0 @@
-// jQuery drag event handler
-// note: triggerHandler() is used instead of trigger() when event bubblig is not
-// necessary, this increases performances a lot.
-;(function($){
- var events = {
- touch:{start:'touchstart',stop:'touchend touchcancel',move:'touchmove',touch:true},
- mouse:{start:'mousedown',stop:'mouseup',move:'mousemove',out:'mouseout',touch:false}
- },
-
-
- $document = $(document),
- getOffset = function(obj) {
- var offsetLeft = 0
- var offsetTop = 0
- if (obj) {
- do {
- if (!isNaN(obj.offsetLeft)) {
- offsetLeft += obj.offsetLeft - obj.scrollLeft
- }
- if (!isNaN(obj.offsetTop)) {
- offsetTop += obj.offsetTop - obj.scrollTop
- }
- } while(obj = obj.offsetParent )
- }
-
- return {left: offsetLeft, top: offsetTop}
- }
-
-
- $.event.special.draginit = $.event.special.drag = {
- setup:function(){
-
- var $this = $(this)
-
- if ($this.data('dragSetup') == 'true') return
- $this.data('dragSetup','true')
-
-
- // mouse single touch handler
- var previousEvent = null,
- target = null,
- traversing = false,
- mouseStartHandler = function(e){
-
- // ignore mouse event when fired by a simulated touch event
- if ((e.originalEvent.sourceCapabilities && e.originalEvent.sourceCapabilities.firesTouchEvents) || e.button == 2) return
-
- target = $this
- previousEvent = e
-
- e.speedX = 0
- e.speedY = 0
- e.deltaX = 0
- e.deltaY = 0
-
- target.triggerHandler('draginit',[e,e.originalEvent.traversing])
-
- $document.on(events.mouse.move,mouseMoveHandler)
- $document.on(events.mouse.stop,mouseStopHandler)
- $document.on(events.mouse.out,mouseOutHandler)
-
- },
- mouseMoveHandler = function(e){
- e.stopPropagation()
-
- e.speedX = e.pageX - previousEvent.pageX
- e.speedY = e.pageY - previousEvent.pageY
- e.deltaX = e.speedX + previousEvent.deltaX
- e.deltaY = e.speedY + previousEvent.deltaY
-
-
- if (e.originalEvent.traversing) {
- target = $(e.target)
- e.preventDefault()
- target.triggerHandler('draginit',[e,e.originalEvent.traversing])
- } else {
- target.triggerHandler('drag',[e,e.originalEvent.traversing])
- }
-
- previousEvent = e
- },
- mouseStopHandler = function(e){
- e.stopPropagation()
-
- // ignore mouse event when fired by a simulated touch event
- if (e.originalEvent.sourceCapabilities && e.originalEvent.sourceCapabilities.firesTouchEvents) return
-
- e.speedX = e.pageX - previousEvent.pageX
- e.speedY = e.pageY - previousEvent.pageY
- e.deltaX = e.deltaX + previousEvent.deltaX
- e.deltaY = e.deltaY + previousEvent.deltaY
-
-
- target.trigger('dragend',[e,e.originalEvent.traversing])
-
- $document.off(events.mouse.move,mouseMoveHandler)
- $document.off(events.mouse.stop,mouseStopHandler)
- $document.off(events.mouse.out,mouseOutHandler)
- },
- mouseOutHandler = function(e){
- if (e.originalEvent.traversing) {
- e.stopPropagation()
-
- e.speedX = e.pageX - previousEvent.pageX
- e.speedY = e.pageY - previousEvent.pageY
- e.deltaX = e.deltaX + previousEvent.deltaX
- e.deltaY = e.deltaY + previousEvent.deltaY
-
- target.trigger('dragend',[e,e.originalEvent.traversing])
-
- previousEvent = e
-
- }
- }
-
-
- $this.on(events.mouse.start + '.drag-osc',mouseStartHandler)
-
-
- // multi touch hanlder
- window.targets = window.targets || {}
- window.previousTouches = window.previousTouches || {}
- window.touchActive = window.touchActive || false
-
- var self = this,
- touchStartHandler = function(e){
- e.preventDefault()
-
- var oE = e.originalEvent
-
- for (let i in oE.changedTouches) {
- if (isNaN(i) || !oE.changedTouches[i]) continue
-
- var touch = oE.changedTouches[i],
- id = touch.identifier,
- emit = true
-
- for (let j in targets) {
- if (targets[j][0].isSameNode(touch.target)) {
- emit = false
- break
- }
- }
-
- targets[id] = $(touch.target)
- previousTouches[id] = {
- deltaX:touch.deltaX,
- deltaY:touch.deltaY,
- offsetX:touch.offsetX,
- offsetY:touch.offsetY,
- speedX:touch.speedX,
- speedY:touch.speedY,
- pageX:touch.pageX,
- pageY:touch.pageY,
- clientX:touch.clientX,
- clientY:touch.clientY
- }
-
- touch.speedX = 0
- touch.speedY = 0
-
- touch.deltaX = 0
- touch.deltaY = 0
-
- var off = getOffset(touch.target)
- touch.offsetX = touch.pageX-off.left
- touch.offsetY = touch.pageY-off.top
-
-
- if (emit) targets[id].triggerHandler('draginit',[touch,e.originalEvent.traversing])
-
- }
-
- if (!touchActive) {
- $document.on(events.touch.move,touchMoveHandler)
- $document.on(events.touch.stop,touchStopHandler)
- touchActive = true
- }
-
- },
- touchMoveHandler = function(e){
-
- var oE = e.originalEvent
-
- for (let i in oE.changedTouches) {
- if (isNaN(i) || !oE.changedTouches[i]) continue
-
- var nFingers = 0
- for (let j in oE.touches) {
- if (oE.touches[j].target && oE.touches[j].target.isSameNode(oE.changedTouches[i].target)) {
- nFingers += 1
- }
- }
-
- var touch = oE.changedTouches[i],
- id = touch.identifier,
- speedFactor = nFingers * nFingers
-
- if (e.originalEvent.traversing) {
- targets[id] = $(document.elementFromPoint(touch.clientX, touch.clientY))
- }
-
- if (!targets[id]) continue
-
- touch.speedX = (touch.pageX - previousTouches[id].pageX) / speedFactor
- touch.speedY = (touch.pageY - previousTouches[id].pageY) / speedFactor
-
- touch.deltaX = touch.speedX + previousTouches[id].deltaX
- touch.deltaY = touch.speedY + previousTouches[id].deltaY
-
- touch.offsetX = previousTouches[id].offsetX+touch.speedX
- touch.offsetY = previousTouches[id].offsetY+touch.speedY
-
- if (e.originalEvent.traversing) {
- touch.traversing = true
- var previousTarget = document.elementFromPoint(previousTouches[id].clientX, previousTouches[id].clientY)
- if (targets[id][0]!=previousTarget) {
- var off = getOffset(targets[id][0])
- touch.offsetX = touch.pageX-off.left
- touch.offsetY = touch.pageY-off.top
- $(previousTarget).trigger('dragend',[touch,e.originalEvent.traversing])
- }
- e.preventDefault()
- if (oE.traversingContainer.contains(targets[id][0])) targets[id].triggerHandler('draginit',[touch,e.originalEvent.traversing])
-
- } else {
-
- targets[id].triggerHandler('drag',[touch,e.originalEvent.traversing])
-
- }
-
- previousTouches[id] = {
- deltaX:touch.deltaX,
- deltaY:touch.deltaY,
- offsetX:touch.offsetX,
- offsetY:touch.offsetY,
- speedX:touch.speedX,
- speedY:touch.speedY,
- pageX:touch.pageX,
- pageY:touch.pageY,
- clientX:touch.clientX,
- clientY:touch.clientY
- }
-
- }
-
- },
- touchStopHandler = function(e){
-
- var oE = e.originalEvent
-
- for (let i in oE.changedTouches) {
-
- if (isNaN(i) || !oE.changedTouches[i]) continue
-
- var touch = oE.changedTouches[i],
- id = touch.identifier
-
- $(targets[id]).trigger('dragend',[touch,e.originalEvent.traversing])
-
- delete previousTouches[id]
- delete targets[id]
-
- }
-
- if (oE.touches.length==0) {
- $document.off(events.touch.move,touchMoveHandler)
- $document.off(events.touch.stop,touchStopHandler)
- touchActive = false
- }
-
- }
-
- $this.on(events.touch.start + '.drag-osc',touchStartHandler)
-
-
- },
- teardown: function(){
- var $this = $(this)
- $this.off(events.touch.start + '.drag-osc')
- $this.off(events.mouse.start + '.drag-osc')
- $this.data('dragSetup','false')
- }
-
- }
-
-
-
-
-
-
-
-
- var makeEventTraversing = function(e){
- e.traversing=true
- if (!e.traversingContainer) e.traversingContainer=this
- }
-
-
- $.fn.enableTraversingGestures = function() {
-
- var self = this[0]
-
- var down = function(e){
- makeEventTraversing(e)
- self.addEventListener("mousemove", makeEventTraversing, true)
- self.addEventListener("touchmove", makeEventTraversing, true)
- self.addEventListener("mouseout", makeEventTraversing, true)
- document.addEventListener("mouseup",up,true)
- document.addEventListener("touchend",up,true)
- },
- up = function(e){
- makeEventTraversing(e)
- self.removeEventListener("mousemove", makeEventTraversing, true)
- self.removeEventListener("touchmove", makeEventTraversing, true)
- self.removeEventListener("mouseout", makeEventTraversing, true)
- document.removeEventListener("mouseup",up,true)
- document.removeEventListener("touchend",up,true)
- }
-
- self.addEventListener("mousedown", down, true)
- self.addEventListener("touchstart", down, true)
-
- this.on('draginit.traversing',()=>{})
-
- this.on('disableTraversingGestures',()=>{
- this.off('draginit.traversing')
- self.removeEventListener("mousedown", down, true)
- self.removeEventListener("touchstart", down, true)
- })
-
-
- return this
-
- }
-
- $.fn.disableTraversingGestures = function() {
-
- this.trigger('disableTraversingGestures')
-
- }
-
-
- var longTapTimer = false,
- clearLongTapTimer = function() {
- clearTimeout(longTapTimer)
- longTapTimer = false
- }
-
- $document.on('mousedown',function(e){
-
- if (e.originalEvent.sourceCapabilities && e.originalEvent.sourceCapabilities.firesTouchEvents) return
-
-
- if (e.button==2) {
-
- e.preventDefault()
- $(e.target).trigger('fake-right-click', e)
-
- } else {
-
- $(e.target).trigger('fake-click', e)
-
- }
-
- })
-
- $document.on(events.touch.start,function(e){
- var touch = e.originalEvent.changedTouches[0]
-
- $(e.target).trigger('fake-click', touch)
-
- if (!longTapTimer&&e.originalEvent.touches.length==1) {
- longTapTimer = setTimeout(function(){
- if (longTapTimer) {
- var off = getOffset(touch.target)
-
- touch.offsetX = touch.pageX-off.left
- touch.offsetY = touch.pageY-off.top
- $(e.originalEvent.changedTouches[0].target).trigger('fake-right-click',touch)
- }
- longTapTimer = false
- },600)
- } else {
- clearLongTapTimer()
- }
- })
-
- $document.on(events.touch.stop + ' ' + events.touch.move,function(e){
- clearLongTapTimer()
- })
-
- $document.on('contextmenu',function(){return false})
-
-})($)
diff --git a/src/browser/js/libs/jquery.resize.js b/src/browser/js/libs/jquery.resize.js
deleted file mode 100644
index d1b14fcc..00000000
--- a/src/browser/js/libs/jquery.resize.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* jquery.resize
- * based on jQuery resize event (@ "Cowboy" Ben Alman http://benalman.com/projects/jquery-resize-plugin/)
- * just lighter and faster
-*/
-(function($){
-
- var elems = []
-
- $.event.special.resize = {
- setup: function(data, namespaces, handler) {
-
- if (this===window) return false
-
- // Add this element to the list of internal elements to monitor.
- elems.push(this)
-
- },
- teardown: function() {
-
- if (this===window) return false
-
- // Remove this element from the list of internal elements to monitor.
- for (var i = elems.length - 1; i >= 0; i--) {
- if(elems[i] == this){
- elems.splice(i, 1)
- break
- }
- }
-
- },
- add: function(handleObj) {
- if (this===window) return false
-
- if (this.resizeHandler) {
-
- var handler = this.resizeHandler
-
- this.resizeHandler = function(){
- handler(...arguments)
- handleObj.handler(...arguments)
- }
-
- } else {
-
- this.resizeHandler = function(){
- handleObj.handler(...arguments)
- }
-
- }
- }
-
- }
-
- function checkResizes(){
- // Iterate over all elements to which the 'resize' event is bound.
- var resizedElems = []
- for (var i = elems.length - 1; i >= 0; i--) {
- var elem = elems[i]
-
- if (!document.contains(elem)) continue
-
- var style = window.getComputedStyle(elem),
- width = parseInt(style['width']) - parseInt(style['padding-left']) - parseInt(style['padding-right']),
- height = parseInt(style['height']) - parseInt(style['padding-top']) - parseInt(style['padding-bottom'])
-
- if (!width) continue
-
- // If element size has changed since the last time, update the element
- // data store and trigger the 'resize' event.
- if ( width != elem.resizedataw || height != elem.resizedatah ) {
- elem.resizedataw = width
- elem.resizedatah = height
- resizedElems.push(elem)
- }
- }
- for (var i = resizedElems.length - 1; i >= 0; i--) {
- resizedElems[i].resizeHandler(undefined, resizedElems[i].resizedataw, resizedElems[i].resizedatah)
- }
-
- }
-
- $(window).resize(checkResizes)
-
-})($)
diff --git a/src/browser/js/libs/source-map.min.js b/src/browser/js/libs/source-map.min.js
deleted file mode 100644
index 2e9876d8..00000000
--- a/src/browser/js/libs/source-map.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// source-map
-// Copyright (c) 2009-2011, Mozilla Foundation and contributors
-// All rights reserved.
-!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.sourceMap=n():e.sourceMap=n()}(this,function(){return function(e){function n(t){if(r[t])return r[t].exports;var o=r[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var r={};return n.m=e,n.c=r,n.p="",n(0)}([function(e,n,r){n.SourceMapGenerator=r(1).SourceMapGenerator,n.SourceMapConsumer=r(7).SourceMapConsumer,n.SourceNode=r(10).SourceNode},function(e,n,r){function t(e){e||(e={}),this._file=i.getArg(e,"file",null),this._sourceRoot=i.getArg(e,"sourceRoot",null),this._skipValidation=i.getArg(e,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}var o=r(2),i=r(4),s=r(5).ArraySet,a=r(6).MappingList;t.prototype._version=3,t.fromSourceMap=function(e){var n=e.sourceRoot,r=new t({file:e.file,sourceRoot:n});return e.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(t.source=e.source,null!=n&&(t.source=i.relative(n,t.source)),t.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(t.name=e.name)),r.addMapping(t)}),e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&r.setSourceContent(n,t)}),r},t.prototype.addMapping=function(e){var n=i.getArg(e,"generated"),r=i.getArg(e,"original",null),t=i.getArg(e,"source",null),o=i.getArg(e,"name",null);this._skipValidation||this._validateMapping(n,r,t,o),null!=t&&(t=String(t),this._sources.has(t)||this._sources.add(t)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:t,name:o})},t.prototype.setSourceContent=function(e,n){var r=e;null!=this._sourceRoot&&(r=i.relative(this._sourceRoot,r)),null!=n?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},t.prototype.applySourceMap=function(e,n,r){var t=n;if(null==n){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');t=e.file}var o=this._sourceRoot;null!=o&&(t=i.relative(o,t));var a=new s,u=new s;this._mappings.unsortedForEach(function(n){if(n.source===t&&null!=n.originalLine){var s=e.originalPositionFor({line:n.originalLine,column:n.originalColumn});null!=s.source&&(n.source=s.source,null!=r&&(n.source=i.join(r,n.source)),null!=o&&(n.source=i.relative(o,n.source)),n.originalLine=s.line,n.originalColumn=s.column,null!=s.name&&(n.name=s.name))}var l=n.source;null==l||a.has(l)||a.add(l);var c=n.name;null==c||u.has(c)||u.add(c)},this),this._sources=a,this._names=u,e.sources.forEach(function(n){var t=e.sourceContentFor(n);null!=t&&(null!=r&&(n=i.join(r,n)),null!=o&&(n=i.relative(o,n)),this.setSourceContent(n,t))},this)},t.prototype._validateMapping=function(e,n,r,t){if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||n||r||t)&&!(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:t}))},t.prototype._serializeMappings=function(){for(var e,n,r,t,s=0,a=1,u=0,l=0,c=0,g=0,p="",h=this._mappings.toArray(),f=0,d=h.length;d>f;f++){if(n=h[f],e="",n.generatedLine!==a)for(s=0;n.generatedLine!==a;)e+=";",a++;else if(f>0){if(!i.compareByGeneratedPositionsInflated(n,h[f-1]))continue;e+=","}e+=o.encode(n.generatedColumn-s),s=n.generatedColumn,null!=n.source&&(t=this._sources.indexOf(n.source),e+=o.encode(t-g),g=t,e+=o.encode(n.originalLine-1-l),l=n.originalLine-1,e+=o.encode(n.originalColumn-u),u=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),e+=o.encode(r-c),c=r)),p+=e}return p},t.prototype._generateSourcesContent=function(e,n){return e.map(function(e){if(!this._sourcesContents)return null;null!=n&&(e=i.relative(n,e));var r=i.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)},t.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},t.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=t},function(e,n,r){function t(e){return 0>e?(-e<<1)+1:(e<<1)+0}function o(e){var n=1===(1&e),r=e>>1;return n?-r:r}var i=r(3),s=5,a=1<>>=s,o>0&&(n|=l),r+=i.encode(n);while(o>0);return r},n.decode=function(e,n,r){var t,a,c=e.length,g=0,p=0;do{if(n>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(a=i.decode(e.charCodeAt(n++)),-1===a)throw new Error("Invalid base64 digit: "+e.charAt(n-1));t=!!(a&l),a&=u,g+=a<=0&&e=n&&r>=e?e-n:e>=t&&o>=e?e-t+l:e>=i&&s>=e?e-i+c:e==a?62:e==u?63:-1}},function(e,n){function r(e,n,r){if(n in e)return e[n];if(3===arguments.length)return r;throw new Error('"'+n+'" is a required argument.')}function t(e){var n=e.match(m);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(e){var n="";return e.scheme&&(n+=e.scheme+":"),n+="//",e.auth&&(n+=e.auth+"@"),e.host&&(n+=e.host),e.port&&(n+=":"+e.port),e.path&&(n+=e.path),n}function i(e){var r=e,i=t(e);if(i){if(!i.path)return e;r=i.path}for(var s,a=n.isAbsolute(r),u=r.split(/\/+/),l=0,c=u.length-1;c>=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return r=u.join("/"),""===r&&(r=a?"/":"."),i?(i.path=r,o(i)):r}function s(e,n){""===e&&(e="."),""===n&&(n=".");var r=t(n),s=t(e);if(s&&(e=s.path||"/"),r&&!r.scheme)return s&&(r.scheme=s.scheme),o(r);if(r||n.match(_))return n;if(s&&!s.host&&!s.path)return s.host=n,o(s);var a="/"===n.charAt(0)?n:i(e.replace(/\/+$/,"")+"/"+n);return s?(s.path=a,o(s)):a}function a(e,n){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==n.indexOf(e+"/");){var t=e.lastIndexOf("/");if(0>t)return n;if(e=e.slice(0,t),e.match(/^([^\/]+:\/)?\/*$/))return n;++r}return Array(r+1).join("../")+n.substr(e.length+1)}function u(e){return e}function l(e){return g(e)?"$"+e:e}function c(e){return g(e)?e.slice(1):e}function g(e){if(!e)return!1;var n=e.length;if(9>n)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,n,r){var t=e.source-n.source;return 0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t||r?t:(t=e.generatedColumn-n.generatedColumn,0!==t?t:(t=e.generatedLine-n.generatedLine,0!==t?t:e.name-n.name))))}function h(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:(t=e.generatedColumn-n.generatedColumn,0!==t||r?t:(t=e.source-n.source,0!==t?t:(t=e.originalLine-n.originalLine,0!==t?t:(t=e.originalColumn-n.originalColumn,0!==t?t:e.name-n.name))))}function f(e,n){return e===n?0:e>n?1:-1}function d(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:(r=e.generatedColumn-n.generatedColumn,0!==r?r:(r=f(e.source,n.source),0!==r?r:(r=e.originalLine-n.originalLine,0!==r?r:(r=e.originalColumn-n.originalColumn,0!==r?r:f(e.name,n.name)))))}n.getArg=r;var m=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,_=/^data:.+\,.+$/;n.urlParse=t,n.urlGenerate=o,n.normalize=i,n.join=s,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(m)},n.relative=a;var v=function(){var e=Object.create(null);return!("__proto__"in e)}();n.toSetString=v?u:l,n.fromSetString=v?u:c,n.compareByOriginalPositions=p,n.compareByGeneratedPositionsDeflated=h,n.compareByGeneratedPositionsInflated=d},function(e,n,r){function t(){this._array=[],this._set=Object.create(null)}var o=r(4),i=Object.prototype.hasOwnProperty;t.fromArray=function(e,n){for(var r=new t,o=0,i=e.length;i>o;o++)r.add(e[o],n);return r},t.prototype.size=function(){return Object.getOwnPropertyNames(this._set).length},t.prototype.add=function(e,n){var r=o.toSetString(e),t=i.call(this._set,r),s=this._array.length;(!t||n)&&this._array.push(e),t||(this._set[r]=s)},t.prototype.has=function(e){var n=o.toSetString(e);return i.call(this._set,n)},t.prototype.indexOf=function(e){var n=o.toSetString(e);if(i.call(this._set,n))return this._set[n];throw new Error('"'+e+'" is not in the set.')},t.prototype.at=function(e){if(e>=0&&er||t==r&&s>=o||i.compareByGeneratedPositionsInflated(e,n)<=0}function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var i=r(4);o.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},o.prototype.add=function(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(i.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=o},function(e,n,r){function t(e){var n=e;return"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=n.sections?new s(n):new o(n)}function o(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),t=a.getArg(n,"sources"),o=a.getArg(n,"names",[]),i=a.getArg(n,"sourceRoot",null),s=a.getArg(n,"sourcesContent",null),u=a.getArg(n,"mappings"),c=a.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);t=t.map(String).map(a.normalize).map(function(e){return i&&a.isAbsolute(i)&&a.isAbsolute(e)?a.relative(i,e):e}),this._names=l.fromArray(o.map(String),!0),this._sources=l.fromArray(t,!0),this.sourceRoot=i,this.sourcesContent=s,this._mappings=u,this.file=c}function i(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function s(e){var n=e;"string"==typeof e&&(n=JSON.parse(e.replace(/^\)\]\}'/,"")));var r=a.getArg(n,"version"),o=a.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new l,this._names=new l;var i={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=a.getArg(e,"offset"),r=a.getArg(n,"line"),o=a.getArg(n,"column");if(r=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var l=i.originalColumn;i&&i.originalLine===n&&i.originalColumn==l;)t.push({line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return t},n.SourceMapConsumer=t,o.prototype=Object.create(t.prototype),o.prototype.consumer=t,o.fromSourceMap=function(e){var n=Object.create(o.prototype),r=n._names=l.fromArray(e._names.toArray(),!0),t=n._sources=l.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var s=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=s.length;h>p;p++){var f=s[p],d=new i;d.generatedLine=f.generatedLine,d.generatedColumn=f.generatedColumn,f.source&&(d.source=t.indexOf(f.source),d.originalLine=f.originalLine,d.originalColumn=f.originalColumn,f.name&&(d.name=r.indexOf(f.name)),c.push(d)),u.push(d)}return g(n.__originalMappings,a.compareByOriginalPositions),n},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?a.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,n){for(var r,t,o,s,u,l=1,p=0,h=0,f=0,d=0,m=0,_=e.length,v=0,C={},y={},A=[],S=[];_>v;)if(";"===e.charAt(v))l++,v++,p=0;else if(","===e.charAt(v))v++;else{for(r=new i,r.generatedLine=l,s=v;_>s&&!this._charIsMappingSeparator(e,s);s++);if(t=e.slice(v,s),o=C[t])v+=t.length;else{for(o=[];s>v;)c.decode(e,v,y),u=y.value,v=y.rest,o.push(u);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");C[t]=o}r.generatedColumn=p+o[0],p=r.generatedColumn,o.length>1&&(r.source=d+o[1],d+=o[1],r.originalLine=h+o[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+o[3],f=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),S.push(r),"number"==typeof r.originalLine&&A.push(r)}g(S,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,g(A,a.compareByOriginalPositions),this.__originalMappings=A},o.prototype._findMapping=function(e,n,r,t,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[t]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[t]);return u.search(e,n,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=a.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=a.join(this.sourceRoot,i)));var s=a.getArg(o,"name",null);return null!==s&&(s=this._names.at(s)),{source:i,line:a.getArg(o,"originalLine",null),column:a.getArg(o,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}):!1},o.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=a.urlParse(this.sourceRoot))){var t=e.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(t))return this.sourcesContent[this._sources.indexOf(t)];if((!r.path||"/"==r.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(n)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var n=a.getArg(e,"source");if(null!=this.sourceRoot&&(n=a.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};n=this._sources.indexOf(n);var r={source:n,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",t.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:a.getArg(i,"generatedLine",null),column:a.getArg(i,"generatedColumn",null),lastColumn:a.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=o,s.prototype=Object.create(t.prototype),s.prototype.constructor=t,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],n=0;n0?t-u>1?r(u,t,o,i,s,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,o,i,s,a):a==n.LEAST_UPPER_BOUND?u:0>e?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,o,i){if(0===t.length)return-1;var s=r(-1,t.length,e,t,o,i||n.GREATEST_LOWER_BOUND);if(0>s)return-1;for(;s-1>=0&&0===o(t[s],t[s-1],!0);)--s;return s}},function(e,n){function r(e,n,r){var t=e[n];e[n]=e[r],e[r]=t}function t(e,n){return Math.round(e+Math.random()*(n-e))}function o(e,n,i,s){if(s>i){var a=t(i,s),u=i-1;r(e,a,s);for(var l=e[s],c=i;s>c;c++)n(e[c],l)<=0&&(u+=1,r(e,u,c));r(e,u+1,c);var g=u+1;o(e,n,i,g-1),o(e,n,g+1,s)}}n.quickSort=function(e,n){o(e,n,0,e.length-1)}},function(e,n,r){function t(e,n,r,t,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==n?null:n,this.source=null==r?null:r,this.name=null==o?null:o,this[u]=!0,null!=t&&this.add(t)}var o=r(1).SourceMapGenerator,i=r(4),s=/(\r?\n)/,a=10,u="$$$isSourceNode$$$";t.fromStringWithSourceMap=function(e,n,r){function o(e,n){if(null===e||void 0===e.source)a.add(n);else{var o=r?i.join(r,e.source):e.source;a.add(new t(e.originalLine,e.originalColumn,o,n,e.name))}}var a=new t,u=e.split(s),l=function(){var e=u.shift(),n=u.shift()||"";return e+n},c=1,g=0,p=null;return n.eachMapping(function(e){if(null!==p){if(!(c0&&(p&&o(p,l()),a.add(u.join(""))),n.sources.forEach(function(e){var t=n.sourceContentFor(e);null!=t&&(null!=r&&(e=i.join(r,e)),a.setSourceContent(e,t))}),a},t.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},t.prototype.prepend=function(e){if(Array.isArray(e))for(var n=e.length-1;n>=0;n--)this.prepend(e[n]);else{if(!e[u]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},t.prototype.walk=function(e){for(var n,r=0,t=this.children.length;t>r;r++)n=this.children[r],n[u]?n.walk(e):""!==n&&e(n,{source:this.source,line:this.line,column:this.column,name:this.name})},t.prototype.join=function(e){var n,r,t=this.children.length;if(t>0){for(n=[],r=0;t-1>r;r++)n.push(this.children[r]),n.push(e);n.push(this.children[r]),this.children=n}return this},t.prototype.replaceRight=function(e,n){var r=this.children[this.children.length-1];return r[u]?r.replaceRight(e,n):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,n):this.children.push("".replace(e,n)),this},t.prototype.setSourceContent=function(e,n){this.sourceContents[i.toSetString(e)]=n},t.prototype.walkSourceContents=function(e){for(var n=0,r=this.children.length;r>n;n++)this.children[n][u]&&this.children[n].walkSourceContents(e);for(var t=Object.keys(this.sourceContents),n=0,r=t.length;r>n;n++)e(i.fromSetString(t[n]),this.sourceContents[t[n]])},t.prototype.toString=function(){var e="";return this.walk(function(n){e+=n}),e},t.prototype.toStringWithSourceMap=function(e){var n={code:"",line:1,column:0},r=new o(e),t=!1,i=null,s=null,u=null,l=null;return this.walk(function(e,o){n.code+=e,null!==o.source&&null!==o.line&&null!==o.column?((i!==o.source||s!==o.line||u!==o.column||l!==o.name)&&r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:n.line,column:n.column},name:o.name}),i=o.source,s=o.line,u=o.column,l=o.name,t=!0):t&&(r.addMapping({generated:{line:n.line,column:n.column}}),i=null,t=!1);for(var c=0,g=e.length;g>c;c++)e.charCodeAt(c)===a?(n.line++,n.column=0,c+1===g?(i=null,t=!1):t&&r.addMapping({source:o.source,original:{line:o.line,column:o.column},generated:{line:n.line,column:n.column},name:o.name})):n.column++}),this.walkSourceContents(function(e,n){r.setSourceContent(e,n)}),{code:n.code,map:r}},n.SourceNode=t}])});
diff --git a/src/browser/scss/_vars.scss b/src/browser/scss/_vars.scss
deleted file mode 100644
index 991cd749..00000000
--- a/src/browser/scss/_vars.scss
+++ /dev/null
@@ -1,31 +0,0 @@
-:root {
-
- ////////////////////// COLOR SCHEME
-
- --color-text:rgba(255, 255, 255, .6);
- --color-text-fade:rgba(255, 255, 255, .4);
-
- --color-accent:rgba(82, 168, 255, 1);
- --color-grid: rgba(82, 168, 255, .1);
-
- --color-bg: rgb(25, 31, 42);
- --color-track: rgb(32, 41, 58);
- --color-fg: rgb(40, 49, 67);
- --color-raised: rgb(49, 63, 85);
-
- --color-light:rgba(255, 255, 255, .06);
-
- --color-white: white;
-
- ////////////////////// AUTO
-
- --color-custom:var(--color-accent);
-
- ////////////////////// MISC
-
- --nav-height:40rem;
- --sidepanel-size:300rem;
- --scrollbar-size:20rem;
-
- --grid-width:10;
-}
diff --git a/src/browser/scss/widgets/_inputs.scss b/src/browser/scss/widgets/_inputs.scss
deleted file mode 100644
index f4093822..00000000
--- a/src/browser/scss/widgets/_inputs.scss
+++ /dev/null
@@ -1,62 +0,0 @@
-.input-container {
- width: 100rem;
- height: 60rem;
- padding:1rem;
- .input {
-
- }
-}
-.widget {
- .input {
- display: flex;
- flex: 1 1 100%;
- background:transparent;
- color:var(--color-text-fade);
- overflow: hidden;
- text-align:center;
- padding:1rem;
- border: 1rem solid var(--color-bg);
- background: var(--color-track);
- font-size: 109%;
-
- input {
- display: block;
- flex:1;
- max-width: 100%;
- font: inherit;
- border:0;
- padding:0;
- background: transparent;
- color:var(--color-accent);
- border-radius: inherit;
- -webkit-appearance:none;
- text-align:inherit;
- vertical-align: top;
- letter-spacing: 1rem;
- &:focus {
- color:var(--color-custom);
- }
- }
- canvas {
- flex:1;
- max-width: 100%;
- }
- input + canvas {
- display: none;
- width: 0;
- }
-
-
- }
-
-}
-
-.panel:not(.tab) > .input-container {
- padding: 0rem;
- > .input {
- box-shadow: 0 0 0 1rem var(--color-fg);
- margin:1rem;
- outline: 1rem solid var(--color-light);
- border: 1rem solid var(--color-bg);
- }
-}
diff --git a/src/browser/scss/widgets/_plots.scss b/src/browser/scss/widgets/_plots.scss
deleted file mode 100644
index 8dd7d109..00000000
--- a/src/browser/scss/widgets/_plots.scss
+++ /dev/null
@@ -1,96 +0,0 @@
-.led-container, .rgbled-container {
- width:100rem;
- height:100rem;
- padding:1rem;
- .led {
- display: flex;
- flex-direction: row;
- flex: 1 1 100%;
- background: var(--color-track);
- border:1rem solid var(--color-bg);
- --opacity: 0;
- &:after {
- content:"";
- width:100%;
- height: 100%;
- background: var(--color-custom);
- border-radius: inherit;
- opacity: var(--opacity);
- }
- }
-}
-
-.rgbled-container .led {
- --opacity: 1;
-}
-
-.plot-container, .visualizer-container, .eq-container {
- height: 200rem;
- width: 200rem;
- padding:1rem;
- .plot {
- display: flex;
- flex-direction: row;
- flex: 1 1 100%;
- position: relative;
- background: var(--color-track);
- border:1rem solid var(--color-bg);
- }
- canvas {
- flex:1;
- image-rendering:pixelated;
- width: 100%;
- }
-}
-
-
-.meter-container {
- @extend .fader-container;
- --color-knob: transparent;
- .wrapper {
- pointer-events: none;
- }
-}
-
-.text-container {
- width: 100rem;
- height:60rem;
- flex-shrink: 0;
- padding:1rem;
- .text {
- flex: 1 1 100%;
- height:35rem;
- padding: 10rem;
- justify-content: center;
- display: flex;
- align-items: center;
- background: var(--color-track);
- color:var(--color-custom);
- border: 1rem solid var(--color-bg);
- &.vertical {
- transform: rotate(180deg);
- text-overflow: ellipsis;
- overflow: hidden;
- -webkit-writing-mode:vertical-lr;
- writing-mode:vertical-lr;
- }
- }
-}
-
-.panel:not(.tab) > .led-container,
-.panel:not(.tab) > .rgbled-container,
-.panel:not(.tab) > .text-container,
-.panel:not(.tab) > .visualizer-container,
-.panel:not(.tab) > .eq-container,
-.panel:not(.tab) > .plot-container {
- --color-border:transparent;
- padding: 0rem;
- .plot, .text, .led {
- padding: 0rem;
- margin: 1rem;
- background-clip: content-box;
- box-shadow: 0 0 0 1rem var(--color-fg);
- outline:1rem solid var(--color-light);
- border: 1rem solid var(--color-bg);
- }
-}
diff --git a/src/client/app/dom.js b/src/client/app/dom.js
new file mode 100644
index 00000000..5bc059a8
--- /dev/null
+++ b/src/client/app/dom.js
@@ -0,0 +1,107 @@
+var readyCallbacks = [],
+ initState = false
+
+module.exports = {
+
+ init: function() {
+
+ for (var i in readyCallbacks) {
+ readyCallbacks[i]()
+ }
+
+ initState = true
+
+ },
+
+ ready: function(callback) {
+ if (initState) {
+ callback()
+ } else {
+ readyCallbacks.push(callback)
+ }
+ },
+
+ dispatchEvent: function(element, name, data) {
+
+ var event = new CustomEvent(name, {
+ detail: data,
+ bubbles: true,
+ cancelable: true
+ })
+
+ element.dispatchEvent(event)
+
+ },
+
+ addEventListener: function(element, events, listener, capture) {
+
+ var eventsAsObject = typeof events == 'string' ? events.split(' ') : events
+
+ for (var i in eventsAsObject) {
+
+ element.addEventListener(eventsAsObject[i], listener, capture)
+
+ }
+
+ },
+
+ get: function(a, b) {
+
+ var context = b ? a : document,
+ selector = b || a,
+ nodes
+
+ if (selector.indexOf('>') === 0) selector = ':scope ' + selector
+
+ if (selector.indexOf(' ') === -1 && selector.indexOf(',') === -1) {
+ if (selector.indexOf('#') === 0 && context === document) {
+ nodes = [document.getElementById(selector.substr(1, selector.length - 1))]
+ } else if (selector.indexOf('.') === 0) {
+ nodes = context.getElementsByClassName(selector.substr(1, selector.length - 1))
+ }
+ }
+
+ if (!nodes) nodes = context.querySelectorAll(selector)
+
+ return nodes.forEach ? nodes : [...nodes]
+
+ },
+
+ each: function(context, selector, callback) {
+
+ var nodes = module.exports.get(context, selector)
+
+ nodes.forEach(callback)
+
+ return nodes
+
+ },
+
+ index: function(element) {
+ var parent = element.parentNode
+ return parent ? Array.prototype.indexOf.call(parent.children, element) : -1
+ },
+
+ offset: function(element) {
+
+ var offsetLeft = 0,
+ offsetTop = 0
+
+ if (element) {
+ do {
+ if (!isNaN(element.offsetLeft)) {
+ offsetLeft += element.offsetLeft - element.scrollLeft
+ }
+ if (!isNaN(element.offsetTop)) {
+ offsetTop += element.offsetTop - element.scrollTop
+ }
+ } while ((element = element.offsetParent))
+ }
+
+ return {
+ left: offsetLeft,
+ top: offsetTop
+ }
+ }
+
+}
diff --git a/src/client/app/editor/context-menu.js b/src/client/app/editor/context-menu.js
new file mode 100644
index 00000000..7264ea96
--- /dev/null
+++ b/src/client/app/editor/context-menu.js
@@ -0,0 +1,365 @@
+var {updateWidget} = require('./data-workers'),
+ {categories} = require('../widgets/'),
+ widgetManager = require('../managers/widgets'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw'),
+ {icon} = require('../ui/utils'),
+ editor = require('./'),
+ locales = require('../locales')
+
+
+var multiSelectKey = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrlKey'
+
+
+class ContextMenu {
+
+ constructor(){
+
+ this.menu = null
+ this.event = 'fast-click'
+ this.root = document.body
+
+ }
+
+ open(e, actions, parent) {
+
+ var menu = html``
+
+ for (let action of actions) {
+
+ if (Array.isArray(action.action)) {
+
+ let item = html`${raw(action.label)}
`
+
+ menu.appendChild(item)
+
+ this.open(e, action.action, item)
+
+
+ } else {
+
+ let item = html`${raw(action.label)}
`
+
+ menu.appendChild(item)
+
+ item.addEventListener(this.event, (e)=>{
+ e.detail.preventOriginalEvent = true
+ action.action()
+ this.close()
+ })
+
+ }
+
+ }
+
+ if (parent) parent.appendChild(menu)
+
+ if (!parent) {
+
+ this.menu = menu
+
+ this.root.appendChild(menu)
+
+ DOM.each(menu, '.item', (item)=>{
+ item.addEventListener('mouseenter', ()=>{
+ DOM.each(item.parentNode, '.focus', (focused)=>{
+ focused.classList.remove('focus')
+ })
+ item.classList.add('focus')
+ })
+ item.addEventListener('mouseleave', ()=>{
+ if (!item.classList.contains('has-sub')) item.classList.remove('focus')
+ })
+ })
+
+ menu.style.top = e.pageY + 'px'
+ menu.style.left = e.pageX + 'px'
+
+ this.correctPosition(menu)
+
+ DOM.each(menu, '.context-menu', (m)=>{
+ this.correctPosition(m, m.parentNode)
+ })
+
+ }
+
+
+ }
+
+ close() {
+
+ if (this.menu) {
+
+ this.menu.parentNode.removeChild(this.menu)
+ this.menu = null
+
+ }
+
+ }
+
+ correctPosition(menu, parent) {
+
+ var position = DOM.offset(menu),
+ width = menu.offsetWidth,
+ height = menu.offsetHeight,
+ totalWidth = this.root.offsetWidth,
+ totalHeight = this.root.offsetHeight
+
+ if (width + position.left > totalWidth) {
+ menu.style.right = parent ? '100%' : '0'
+ menu.style.left = 'auto'
+ menu.style.marginRight = '2rem'
+ }
+
+ if (height + position.top > totalHeight) {
+ menu.style.top = 'auto'
+ menu.style.bottom = '2rem'
+ }
+
+ }
+
+}
+
+var contextMenu = new ContextMenu()
+
+var handleClick = function(event) {
+
+ if (!EDITING) return
+
+ if (contextMenu.menu && !contextMenu.menu.contains(event.target)) contextMenu.close()
+
+ if (!event.detail[multiSelectKey] && event.type !== 'fast-right-click' && (
+ event.target.classList.contains('ui-resizable-handle') ||
+ event.target.classList.contains('ui-draggable-handle') ||
+ event.target.id === 'open-toggle'
+ )) { return }
+
+ var eventData = event.detail,
+ widget = widgetManager.getWidgetByElement(eventData.target, ':not(.not-editable)')
+
+ if (!widget) return
+
+ // if the widget is not already selected
+ if (!widget.container.classList.contains('editing')) {
+ // add a flag to the original event to prevent draginit
+ // and prevent any further fast-click (ie input focus)
+ eventData.capturedByEditor = true
+ event.capturedByEditor = true
+ }
+
+
+ if (event.type !== 'fast-right-click') {
+ editor.select(widget, {multi: event.detail[multiSelectKey]})
+ }
+
+ // right-click menu
+ if (event.type !== 'fast-right-click') return
+
+ if (!event.detail.shiftKey && !event.detail[multiSelectKey] && editor.selectedWidgets.length <= 1) {
+ editor.select(widget)
+ }
+
+ if (!editor.selectedWidgets.length) return
+
+ var index = editor.selectedWidgets.map((w)=>DOM.index(w.container)).sort((a,b)=>{return b-a}),
+ data = editor.selectedWidgets.map((w)=>w.props),
+ type = editor.selectedWidgets[0].props.type == 'tab' ? 'tab' : 'widget',
+ parent = editor.selectedWidgets[0].parent,
+ actions = []
+
+ // case root: only "add tab" option
+ if (parent === widgetManager) {
+ actions.push({
+ label: icon('plus') + ' ' + locales('editor_addtab'),
+ action: ()=>{
+ data[0].tabs.push({})
+
+ var indexes = {addedIndexes: [data[0].tabs.length -1]}
+ updateWidget(editor.selectedWidgets[0], indexes)
+ editor.pushHistory(indexes)
+ }
+ })
+ contextMenu.open(eventData, actions)
+
+ return
+ }
+
+ // case !root
+
+ var clickX = Math.round((eventData.offsetX + eventData.target.scrollLeft) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH,
+ clickY = Math.round((eventData.offsetY + eventData.target.scrollTop) / (GRIDWIDTH * PXSCALE)) * GRIDWIDTH
+
+ actions.push({
+ label: icon('expand') + ' ' + locales('editor_editparent'),
+ action: ()=>{
+ editor.select(parent)
+ }
+ })
+
+ if (type === 'widget') {
+
+ actions.push({
+ label: icon('copy') + ' ' + locales('editor_copy'),
+ action: editor.copyWidget.bind(editor)
+ })
+
+ actions.push({
+ label: icon('cut') + ' ' + locales('editor_cut'),
+ action: editor.cutWidget.bind(editor)
+ })
+
+ var wrapActions = []
+ for (let c of categories.Containers) {
+ if (c === 'clone') continue
+ wrapActions.push({
+ label: c,
+ action: ()=>{
+ var wrap = {type: c, widgets:[], label: c === 'modal' ? 'auto' : false}
+
+ wrap.widgets = data
+
+ var minTop = Math.min(...data.map(x=>isNaN(x.top) ? x.top == 'auto' ? 0 : Infinity : x.top))
+ var minLeft = Math.min(...data.map(x=>isNaN(x.left) ? x.left == 'auto' ? 0 : Infinity : x.left))
+
+ wrap.top = minTop === Infinity ? data[0].top : minTop
+ wrap.left= minLeft === Infinity ? data[0].left : minLeft
+
+ for (var w of wrap.widgets) {
+ if (!isNaN(w.top)) w.top = Math.max(w.top - minTop, 0)
+ if (!isNaN(w.left)) w.left = Math.max(w.left - minLeft, 0)
+ }
+
+ var i
+ for (i of index) {
+ parent.props.widgets.splice(i,1)
+ }
+
+ parent.props.widgets = parent.props.widgets.slice(0, i).concat(wrap, parent.props.widgets.slice(i, parent.props.widgets.length))
+
+ editor.select(updateWidget(parent, {preventSelect: true, removedIndexes: index, addedIndexes: [i]}))
+ editor.pushHistory({removedIndexes: index, addedIndexes: [i]})
+
+ }
+ })
+ }
+
+ actions.push({
+ label: icon('box') + ' ' + locales('editor_wrap'),
+ action: wrapActions
+ })
+
+ }
+
+
+ if (data.length == 1 && (!data[0].tabs || !data[0].tabs.length) && (data[0].widgets)) {
+
+ if (editor.clipboard !== null) {
+
+ var pasteActions = []
+
+ pasteActions.push({
+ label: icon('paste') + ' ' + locales('editor_paste'),
+ action: ()=>{
+ editor.pasteWidget(clickX, clickY)
+ }
+ })
+ pasteActions.push({
+ label: icon('plus-square') + ' ' + locales('editor_pasteindent'),
+ action: ()=>{
+ editor.pasteWidget(clickX, clickY, true)
+ }
+ })
+
+ if (editor.idClipboard && widgetManager.getWidgetById(editor.idClipboard).length) {
+ pasteActions.push({
+ label: icon('clone') + ' ' + locales('editor_clone'),
+ action: ()=>{
+ editor.pasteWidgetAsClone(clickX, clickY)
+ }
+ })
+ }
+
+ actions.push({
+ label: icon('paste') + ' ' + locales('editor_paste'),
+ action: pasteActions
+ })
+
+ }
+
+
+ var addActions = []
+
+ for (let category in categories) {
+
+ var catActions = []
+
+ for (let t in categories[category]) {
+
+ let type = categories[category][t]
+
+ catActions.push({
+
+ label: type,
+ action: ()=>{
+
+ var newData = {type: type}
+
+ if (!eventData.target.classList.contains('tablink')) {
+ newData.top = clickY
+ newData.left= clickX
+ }
+
+ data[0].widgets = data[0].widgets || []
+ data[0].widgets.push(newData)
+
+ var indexes = {addedIndexes: [data[0].widgets.length -1]}
+ updateWidget(editor.selectedWidgets[0], indexes)
+ editor.pushHistory(indexes)
+
+ }
+ })
+
+ }
+
+ addActions.push({
+ label: category,
+ action: catActions
+ })
+
+ }
+
+ actions.push({
+ label: icon('plus') + ' ' + locales('editor_addwidget'),
+ action: addActions
+ })
+
+ }
+
+ if (data.length == 1 && (!data[0].widgets || !data[0].widgets.length) && (data[0].tabs)) {
+
+ actions.push({
+ label: icon('plus') + ' ' + locales('editor_addtab'),
+ action: ()=>{
+ data[0].tabs = data[0].tabs || []
+ data[0].tabs.push({})
+
+ var indexes = {addedIndexes: [data[0].tabs.length -1]}
+ updateWidget(editor.selectedWidgets[0], indexes)
+ editor.pushHistory(indexes)
+
+ }
+ })
+
+ }
+
+ actions.push({
+ label: icon('trash') + ' ' + locales('editor_delete'),
+ action: editor.deleteWidget.bind(editor)
+ })
+
+ contextMenu.open(eventData, actions)
+
+}
+
+document.addEventListener('fast-right-click', handleClick, true)
+document.addEventListener('fast-click', handleClick, true)
diff --git a/src/client/app/editor/data-workers.js b/src/client/app/editor/data-workers.js
new file mode 100644
index 00000000..45b6d9c9
--- /dev/null
+++ b/src/client/app/editor/data-workers.js
@@ -0,0 +1,243 @@
+var widgetManager = require('../managers/widgets'),
+ resize = require('../events/resize'),
+ stateManager = require('../managers/state'),
+ parser = require('../parser'),
+ Panel,
+ sidepanel,
+ editor,
+ scrollState = {},
+ sidepanelScroll
+
+DOM.ready(()=>{
+ sidepanel = DOM.get('#sidepanel')[0]
+})
+
+function updateWidget(widget, options={}) {
+
+ if (options.changedProps) {
+ // alternate routine for small edits
+ var propNames = options.changedProps,
+ propValues = propNames.map(x => widget.props[x]),
+ linkedProps = []
+
+ Object.values(widget.nestedLinkedProps).forEach(l => linkedProps = linkedProps.concat(l))
+ Object.values(widget.linkedProps).forEach(l => linkedProps = linkedProps.concat(l))
+ Object.values(widget.linkedPropsValue).forEach(l => linkedProps = linkedProps.concat(l))
+ Object.values(widget.oscReceivers).forEach(r => linkedProps = linkedProps.concat(r.propNames))
+
+ if (
+ // if non dynamic props have changed, skip this and use rebuild routine
+ !propNames.some(n => !widget.isDynamicProp(n))
+ ) {
+
+ var edited = widget.updateProps(options.changedProps, null) || widget
+
+ if (
+ // if prop/osc listeners have changed (@{} / OSC{})
+ // refresh the widget's props cache and update linked props bindings
+ propValues.some(x => typeof x === 'string' && x.match(/OSC\{|@\{/))
+ || propNames.some(n => linkedProps.includes(n))
+ ) {
+ widget.createPropsCache()
+ }
+
+ if (editor.selectedWidgets.includes(widget) && !options.preventSelect) {
+ editor.select(edited)
+ }
+
+ return edited
+
+ }
+
+ }
+
+
+ var reuseChildren = options.reuseChildren !== false && widget instanceof Panel
+
+ // save state
+ if (stateManager.queueCounter === 0) {
+ sidepanelScroll = sidepanel.scrollTop
+ scrollState = {}
+ }
+ stateManager.incrementQueue()
+ var toSave = [widget]
+ if (!reuseChildren) {
+ toSave = toSave.concat(widget.getAllChildren())
+ }
+ for (let w of toSave) {
+ if (widgetManager.widgets[w.hash]) {
+ let id = w.getProp('id'),
+ value = w.getValue(),
+ valueProp = w.getProp('value')
+
+ stateManager.pushValueState(id, value)
+ if (valueProp !== '' && valueProp !== undefined) stateManager.pushValueOldProp(id, valueProp)
+ }
+ if (widgetManager.scrollingWidgets.indexOf(w.hash) > -1 && w.scroll) {
+ var s = w.scroll()
+ if (s[0] !== 0 || s[1] !== 0) {
+ scrollState[w.getProp('id')] = s
+ }
+ }
+ }
+
+ var children = undefined,
+ removedChildren = []
+
+ if (reuseChildren) {
+ children = [...widget.children]
+ if (options.removedIndexes) {
+ options.removedIndexes = options.removedIndexes.sort((a, b) => b - a)
+ for (let i of options.removedIndexes) {
+ removedChildren.push(children.splice(i, 1)[0])
+ }
+ }
+ if (options.addedIndexes) {
+ options.addedIndexes = options.addedIndexes.sort((a, b) => a - b)
+ for (let i of options.addedIndexes) {
+ children.splice(i, 0, null)
+ }
+ }
+
+ }
+
+ // get widget's index
+ var index = widget.parent.children.indexOf(widget)
+
+ // remove old widgets
+ var removedWidgets = reuseChildren ?
+ removedChildren.map(x => x.getAllChildren().concat(x)).concat(widget) :
+ widget.getAllChildren().concat(widget)
+
+ widgetManager.removeWidgets(removedWidgets)
+
+ // create new widget
+ var newWidget = parser.parse({
+ data: widget.props,
+ parent: widget.parent,
+ parentNode: widget.parentNode,
+ reCreateOptions: options.reCreateOptions,
+ children: children,
+ index: index
+ })
+
+
+ newWidget.container.parentNode.replaceChild(newWidget.container, widget.container)
+
+ if (newWidget.getProp('type') === 'tab') newWidget.parent.trigger('tab-created', {widget: widget})
+ if (newWidget.getProp('id') === 'root') DOM.get('.editor-root')[0].setAttribute('data-widget', newWidget.hash)
+
+
+ if (reuseChildren && !(newWidget instanceof Panel)) {
+ // remove remaining children if widget is not a container anymore
+ widgetManager.removeWidgets(widget.getAllChildren())
+ }
+
+ if (reuseChildren) {
+ // children don't listen to their parent's 'widget-created' event
+ // so we have to let them know it's been updated
+ widgetManager.trigger('prop-changed', {
+ id: newWidget.getProp('id'),
+ props: [],
+ widget: newWidget,
+ options: {}
+ })
+ }
+
+ resize.check(newWidget.container)
+
+ // restore state
+ stateManager.decrementQueue()
+ if (stateManager.queueCounter === 0) {
+ sidepanel.scrollTop = sidepanelScroll
+ for (let id in scrollState) {
+ for (let w of widgetManager.getWidgetById(id)) {
+ if (w.scroll) w.scroll(scrollState[id])
+ }
+ }
+ }
+
+ if (editor.selectedWidgets.includes(widget) && !options.preventSelect) {
+ editor.select(newWidget)
+ }
+
+ return newWidget
+
+}
+
+
+var fakeStore = {}
+
+var incrementWidget = function(data, root){
+
+ if (!data) return
+
+ if (root !== false) {
+ fakeStore = {
+ id:[],
+ address:[]
+ }
+ }
+
+ var id = data.id,
+ address = data.address
+
+ if (id && address == '/'+id) {
+
+ data.address = 'auto'
+
+ } else if (address){
+ var addressref
+ while (fakeStore.address.indexOf(address) != -1 || widgetManager.getWidgetByAddress(addressref).length) {
+ address = address.replace(/([0-9]*)$/,function(m){
+ var n = parseInt(m)+1
+ n = isNaN(n)?1:n
+ return n
+ })
+ addressref = widgetManager.createAddressRef(null, data.preArgs,address)
+ }
+
+ fakeStore.address.push(address)
+
+ data.address = address
+
+ }
+
+ if (id) {
+ while (fakeStore.id.indexOf(id) != -1 || widgetManager.getWidgetById(id).length) {
+ id = id.replace(/([0-9]*)$/,function(m){
+ var n = parseInt(m)+1
+ n = isNaN(n)?1:n
+ return n
+ })
+ }
+
+ fakeStore.id.push(id)
+
+ data.id = id
+
+ }
+
+ if (data.widgets && data.widgets.length) {
+ for (let i in data.widgets) {
+ data.widgets[i] = incrementWidget(data.widgets[i], false)
+ }
+ }
+
+ if (data.tabs && data.tabs.length) {
+ for (let i in data.tabs) {
+ data.tabs[i] = incrementWidget(data.tabs[i], false)
+ }
+ }
+
+ return data
+
+}
+
+module.exports = {
+ updateWidget:updateWidget,
+ incrementWidget:incrementWidget
+}
+
+editor = require('./')
+Panel = require('../widgets/containers/panel')
diff --git a/src/client/app/editor/diff.js b/src/client/app/editor/diff.js
new file mode 100644
index 00000000..8f2902a9
--- /dev/null
+++ b/src/client/app/editor/diff.js
@@ -0,0 +1,32 @@
+module.exports = {
+
+ diff: require('jsondiffpatch'),
+
+ diffToWidget: function(widget, diff) {
+
+ // traverse a diff patch and the associated widget
+ // to return the first node (widget and sub-patch) with actual changes
+
+ var children = diff.tabs || diff.widgets
+
+ if (children) {
+ var childrenKeys = Object.keys(children),
+ deletedChildren = childrenKeys.filter(x => typeof x === 'string' && x.match(/_[0-9]+/)),
+ changedChildren = childrenKeys.filter(x => !isNaN(x))
+ }
+
+ if (
+ !children ||
+ Array.isArray(children) || // 'tabs' or 'widgets' property created
+ deletedChildren.length || // 'tabs' or 'widgets' property created
+ changedChildren.length !== 1 || // children reordered (or same property edited in multiple widgets, but case ignored)
+ Array.isArray(children[changedChildren[0]]) // child item created
+ ) {
+ return [widget, diff]
+ }
+
+ return module.exports.diffToWidget(widget.children[changedChildren[0]], children[changedChildren[0]])
+
+ }
+
+}
diff --git a/src/client/app/editor/edit-field.js b/src/client/app/editor/edit-field.js
new file mode 100644
index 00000000..3236d3f3
--- /dev/null
+++ b/src/client/app/editor/edit-field.js
@@ -0,0 +1,233 @@
+var widgetCategories = require('../widgets/').categories,
+ {updateWidget} = require('./data-workers'),
+ widgetManager = require('../managers/widgets'),
+ {deepCopy} = require('../utils'),
+ {icon, Popup} = require('../ui/utils'),
+ locales = require('../locales'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+module.exports = function editField(editor, widget, propName, defaultValue){
+
+ let dynamic = widget.isDynamicProp(propName),
+ disabled = widget.disabledProps.indexOf(propName) > -1,
+ error = widget.errors[propName]
+
+ let field = html`
+
+
+
+ `
+
+ let input
+
+ if (propName !== 'widgets' && propName !== 'tabs') {
+
+ if (propName == 'type') {
+
+ if (widget.props.type == 'tab' || widget.props.type == 'root') {
+ field.classList.add('disabled')
+ field.appendChild(html``)
+ return field
+ }
+
+ input = html``
+
+ for (let category in widgetCategories) {
+ var optGroup = html`
`,
+ closable: false
+ })
+ },
+ icon: function(i) {
+ return ``
+ },
+ iconify:function(string){
+ return String(string).replace(/\^[^\s]*/g,(x)=>{return module.exports.icon(x.substring(1))})
+ },
+ upload: function(types, ok, error) {
+
+ if (uploadSingleton) document.body.removeChild(uploadSingleton)
+
+ uploadSingleton = html``
+ document.body.appendChild(uploadSingleton)
+
+ uploadSingleton.addEventListener('change',function(e){
+
+
+ var reader = new FileReader(),
+ file = e.target.files[0],
+ loader = module.exports.loading(locales('loading_upload'))
+
+ reader.onerror = reader.onabort = function() {
+ loader.close()
+ error()
+ }
+
+ reader.onload = function(e) {
+ loader.close()
+ ok(file.path, e.target.result)
+ }
+
+ reader.readAsText(file, 'utf-8')
+
+ })
+
+ uploadSingleton.click()
+
+ }
+
+}
diff --git a/src/client/app/ui/zoom.js b/src/client/app/ui/zoom.js
new file mode 100644
index 00000000..bc490c49
--- /dev/null
+++ b/src/client/app/ui/zoom.js
@@ -0,0 +1,29 @@
+// mousewheel zoom
+
+var mod = (navigator.platform || '').match('Mac') ? 'metaKey' : 'ctrlKey'
+
+document.addEventListener('mousewheel', function(event) {
+ if (event.ctrlKey) event.preventDefault()
+ if (event[mod]) {
+
+ event.preventDefault()
+
+ if (event.deltaY === 0) return
+
+ var d = - event.deltaY / (10 * Math.abs(event.deltaY))
+
+ PXSCALE = parseFloat(d) + parseFloat(PXSCALE)
+ document.documentElement.style.setProperty('font-size', PXSCALE + 'px')
+
+ DOM.dispatchEvent(window, 'resize')
+ }
+})
+
+document.addEventListener('keydown', function(event){
+ if (event[mod] && (event.keyCode == 96 || event.keyCode == 48)) {
+ PXSCALE = INITIALZOOM
+ document.documentElement.style.setProperty('font-size', PXSCALE + 'px')
+
+ DOM.dispatchEvent(window, 'resize')
+ }
+})
diff --git a/src/client/app/utils.js b/src/client/app/utils.js
new file mode 100644
index 00000000..b2a9c1fd
--- /dev/null
+++ b/src/client/app/utils.js
@@ -0,0 +1,41 @@
+module.exports = {
+
+ deepCopy: function(obj, precision) {
+
+ var copy = obj
+
+ if (obj === null) {
+ return obj
+ }
+
+ if (typeof obj === 'object') {
+ copy = Array.isArray(obj) ? [] : {}
+ for (let key in obj) {
+ copy[key] = module.exports.deepCopy(obj[key], precision)
+ }
+ } else if (typeof obj == 'number') {
+ return precision === undefined ? copy : parseFloat(copy.toFixed(precision))
+ }
+
+ return copy
+
+ },
+
+ deepEqual: function(a, b) {
+
+ // about 2,75 x faster than JSON.stringify(a) === JSON.stringify(b)
+
+ var ta = typeof a,
+ tb = typeof b
+
+ if (ta !== tb) {
+ return false
+ } else if (ta === 'object') {
+ return JSON.stringify(a) === JSON.stringify(b)
+ } else {
+ return a === b
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/buttons/dropdown.js b/src/client/app/widgets/buttons/dropdown.js
new file mode 100644
index 00000000..8a15f868
--- /dev/null
+++ b/src/client/app/widgets/buttons/dropdown.js
@@ -0,0 +1,108 @@
+var Widget = require('../common/widget'),
+ {iconify} = require('../../ui/utils'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+class Dropdown extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _dropdown:'dropdown',
+
+ values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [
+ '`Array` of possible values to switch between : `[1,2,3]`',
+ '`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept',
+ 'An empty option will always be prepended to values (sends an osc message without any value); it can be hidden by adding `option:first-child{display:none}` to the widget\'s `css`'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ this.select = this.widget.appendChild(html``)
+
+ this.values = []
+ this.keys = []
+
+ this.parseValues()
+
+ this.select.addEventListener('change', ()=>{
+ this.setValue(this.values[this.select.selectedIndex - 1], {sync:true, send:true, fromLocal:true})
+ })
+
+ this.value = undefined
+ this.select.selectedIndex = -1
+ this.container.classList.add('noselect')
+
+ }
+
+ parseValues() {
+
+ var i = 0,
+ values = this.getProp('values')
+
+ if (!Array.isArray(values) && !(typeof values === 'object' && values !== null)) {
+ values = values !== '' ? [values] : []
+ }
+
+ this.select.innerHTML = ''
+ this.select.appendChild(html``)
+
+ this.values = []
+
+ for (var k in values) {
+ this.values.push(values[k])
+ this.select.appendChild(html`
+
+ `)
+ i++
+ }
+
+ }
+
+ setValue(v,options={}) {
+
+ var i = this.values.indexOf(v)
+
+ this.value = this.values[i]
+
+ if (!options.fromLocal) this.select.selectedIndex = i + 1
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ var ret = super.onPropChanged(...arguments)
+
+ switch (propName) {
+
+ case 'values':
+ this.parseValues()
+ this.setValue(this.value)
+ return
+
+ }
+
+ return ret
+
+ }
+
+}
+
+Dropdown.dynamicProps = Dropdown.prototype.constructor.dynamicProps.concat(
+ 'values'
+)
+
+
+module.exports = Dropdown
diff --git a/src/client/app/widgets/buttons/push.js b/src/client/app/widgets/buttons/push.js
new file mode 100644
index 00000000..cc124dc5
--- /dev/null
+++ b/src/client/app/widgets/buttons/push.js
@@ -0,0 +1,132 @@
+var Widget = require('../common/widget'),
+ osc = require('../../osc'),
+ html = require('nanohtml')
+
+class Push extends Widget {
+
+ static defaults() {
+
+
+ return super.defaults({
+
+ _push: 'push',
+
+ on: {type: '*', value: 1, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ off: {type: '*', value: 0, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ norelease: {type: 'boolean', value: false, help: 'Set to `true` to prevent sending any osc message when releasing the button'},
+
+ }, ['_value', 'default', 'value'])
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ this.state = 0
+ this.active = 0
+ this.lastChanged = 'state'
+
+ this.on('draginit',()=>{
+ if (this.active) return
+ this.setValuePrivate(this.getProp('on'),{send:true,sync:true})
+ }, {element: this.widget})
+
+ this.on('dragend',()=>{
+ this.setValuePrivate(this.getProp('off'),{send:true,sync:true})
+ }, {element: this.widget})
+
+ this.value = this.getProp('off')
+
+
+ }
+
+ updateValue(){
+
+ this.value = this[this.lastChanged] ?
+ this.getProp('on') != null && this.getProp('on').value !== undefined ? this.getProp('on').value : this.getProp('on')
+ :
+ this.getProp('off') != null && this.getProp('off').value !== undefined ? this.getProp('off').value : this.getProp('off')
+
+ }
+
+ setValuePrivate(v,options={}) {
+
+ if (typeof v == 'object' && v !== null) v = v.value
+ if (v===this.getProp('on') || (this.getProp('on') != null && v === this.getProp('on').value && v !== undefined)) {
+ this.widget.classList.add('active')
+ this.container.classList.add('active')
+ this.active = 1
+ this.lastChanged = 'active'
+ this.updateValue()
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+ } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) {
+ this.widget.classList.remove('active')
+ this.container.classList.remove('active')
+ this.active = 0
+ this.lastChanged = 'active'
+ this.updateValue()
+ if (options.send) this.sendValue(null, {syncOnly: this.getProp('norelease')})
+ if (options.sync) this.changed(options)
+ }
+
+ }
+
+ setValue(v,options={}) {
+
+ if (!options.fromExternal) {
+ this.setValuePrivate(v,options)
+ return
+ }
+ if (typeof v == 'object' && v !== null) v = v.value
+ if (v===this.getProp('on') || (this.getProp('on') != null && v === this.getProp('on').value && v !== undefined)) {
+ this.widget.classList.add('on')
+ this.container.classList.add('on')
+ this.state = 1
+ if (options.send) this.sendValue()
+ this.lastChanged = 'state'
+ if (options.sync) this.changed(options)
+ } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) {
+ this.widget.classList.remove('on')
+ this.container.classList.remove('on')
+ this.state = 0
+ if (options.send) this.sendValue()
+ this.lastChanged = 'state'
+ if (options.sync) this.changed(options)
+ }
+
+ }
+
+ sendValue(overrides, options={}) {
+
+ if (!options.syncOnly) {
+
+ super.sendValue(overrides, options)
+
+ } else {
+
+ osc.sync({
+ h: this.hash,
+ v: this.value
+ })
+
+ }
+
+ }
+
+}
+
+Push.dynamicProps = Push.prototype.constructor.dynamicProps.concat(
+ 'on',
+ 'off',
+ 'norelease'
+)
+
+module.exports = Push
diff --git a/src/client/app/widgets/buttons/switch.js b/src/client/app/widgets/buttons/switch.js
new file mode 100644
index 00000000..80bf6af3
--- /dev/null
+++ b/src/client/app/widgets/buttons/switch.js
@@ -0,0 +1,101 @@
+var Widget = require('../common/widget'),
+ {iconify} = require('../../ui/utils'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+module.exports = class Switch extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _switch:'switch',
+
+ horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'},
+ showValues: {type: 'boolean', value: false, help: 'If values is an object, set to `true` to display both values and labels instead of labels only'},
+ values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [
+ '`Array` of possible values to switch between : `[1,2,3]`',
+ '`Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept',
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+
+ if (this.getProp('horizontal')) this.widget.classList.add('horizontal')
+
+ this.values = []
+ this.stringValues = []
+
+ var values = this.getProp('values')
+
+ if (!Array.isArray(values) && !(typeof values === 'object' && values !== null)) {
+ values = [values]
+ }
+
+ var isArray = Array.isArray(values)
+
+ for (var k in values) {
+
+ this.values.push(values[k])
+
+ if (typeof values[k] == 'object') {
+ this.stringValues.push(JSON.stringify(values[k]))
+ } else {
+ this.stringValues.push(0)
+ }
+
+ var label = isArray ? values[k]: k
+ if (this.getProp('showValues') && !isArray) label = label + ': ' + (this.stringValues[this.stringValues.length - 1] || values[k])
+
+ this.widget.appendChild(html`
+ ${raw(iconify(label))}
+ `)
+
+ }
+
+ this.value = undefined
+
+ this.on('draginit', (e)=>{
+
+ var index = 0,
+ node = e.target
+
+ while ( (node = node.previousSibling) ) {
+ if (node.nodeType != 3) {
+ index++
+ }
+ }
+
+ var value = this.values[index]
+
+ if (value!=this.value || this.value===undefined) this.setValue(value,{sync:true,send:true})
+
+ }, {element: this.widget})
+
+ }
+
+ setValue(v, options={}) {
+
+ var i = typeof v == 'object' ?
+ this.stringValues.indexOf(JSON.stringify(v)) :
+ this.values.indexOf(v)
+
+ DOM.each(this.widget, '.on', (el)=>{el.classList.remove('on')})
+
+ if (i!=-1) {
+ this.value = this.values[i]
+ DOM.get(this.widget, '.value')[i].classList.add('on')
+ if (options.send) this.sendValue(this.value)
+ if (options.sync) this.changed(options)
+ } else {
+ this.value = undefined
+ if (options.sync) this.changed(options)
+ }
+
+ }}
diff --git a/src/client/app/widgets/buttons/toggle.js b/src/client/app/widgets/buttons/toggle.js
new file mode 100644
index 00000000..c87c6760
--- /dev/null
+++ b/src/client/app/widgets/buttons/toggle.js
@@ -0,0 +1,91 @@
+var Widget = require('../common/widget'),
+ doubletab = require('../mixins/double_tap'),
+ html = require('nanohtml')
+
+class Toggle extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _toggle: 'toggle',
+
+ doubleTap: {type: 'boolean', value: false, help: 'Set to `true` to make the button require a double tap to be toggled instead of a single tap'},
+ led: {type: 'boolean', value: false, help: 'Set to `true` to display the toggle\'s state with a led'},
+ on: {type: '*', value: 1, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ off: {type: '*', value: 0, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ this.state = 0
+ this.active = false
+
+ if (this.getProp('led')) this.container.classList.add('led')
+
+ if (this.getProp('doubleTap')) {
+
+ doubletab(this.widget, ()=>{
+ var newVal = this.state?this.getProp('off'):this.getProp('on')
+ this.setValue(newVal,{sync:true,send:true})
+ })
+
+ } else {
+
+ this.on('draginit',()=>{
+ if (this.active) return
+ this.active = true
+ var newVal = this.state?this.getProp('off'):this.getProp('on')
+ this.setValue(newVal,{sync:true,send:true})
+ }, {element: this.widget})
+
+ this.on('dragend',()=>{
+ this.active = false
+ }, {element: this.widget})
+
+ }
+
+ this.value = this.getProp('off')
+
+ }
+
+ setValue(v,options={}) {
+
+ if (typeof v == 'object' && v !== null) v = v.value
+ if (v===this.getProp('on') || (this.getProp('on') != null && v === this.getProp('on').value && v !== undefined)) {
+ this.widget.classList.add('on')
+ this.container.classList.add('on')
+ this.state = 1
+ this.value = this.getProp('on')
+ if (options.send) this.sendValue()
+ } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) {
+ this.widget.classList.remove('on')
+ this.container.classList.remove('on')
+ this.state = 0
+ this.value = this.getProp('off')
+ if (options.send) this.sendValue()
+ }
+
+ if (options.sync) this.changed(options)
+
+ }
+
+}
+
+Toggle.dynamicProps = Toggle.prototype.constructor.dynamicProps.concat(
+ 'on',
+ 'off'
+)
+
+module.exports = Toggle
diff --git a/src/client/app/widgets/common/canvas.js b/src/client/app/widgets/common/canvas.js
new file mode 100644
index 00000000..9c8b90af
--- /dev/null
+++ b/src/client/app/widgets/common/canvas.js
@@ -0,0 +1,205 @@
+var Widget = require('./widget')
+
+class CanvasQueue {
+
+ constructor() {
+
+ this.queue = {}
+ this.flushed = 0
+ this.running = false
+ this.frameLength = 1000 / CANVAS_FRAMERATE
+ this.lastFrame = 0
+ this.bindedLoop = this.loop.bind(this)
+
+ }
+
+ push(widget) {
+
+ this.queue[widget.hash] = widget
+ this.flushed = 0
+
+ if (!this.running) {
+ this.running = true
+ requestAnimationFrame(this.bindedLoop)
+ }
+
+ }
+
+ flush() {
+
+ for (var h in this.queue) {
+ this.queue[h].draw()
+ }
+
+ this.queue = {}
+ this.flushed++
+
+ }
+
+ loop(timestamp) {
+
+ if (this.flushed >= 10) {
+ this.running = false
+ return
+ }
+
+ requestAnimationFrame(this.bindedLoop)
+
+ var delta = timestamp - this.lastFrame
+
+ if (delta > this.frameLength) {
+ this.lastFrame = timestamp - (delta % this.frameLength)
+ this.flush()
+ }
+
+ }
+
+}
+
+var canvasQueue = new CanvasQueue()
+
+
+class Canvas extends Widget {
+
+ constructor(options) {
+
+ super(options)
+
+ this.canvas = DOM.get(this.widget, 'canvas')[0]
+ this.ctx = this.canvas.getContext('2d')
+
+ this.height = undefined
+ this.width = undefined
+ this.scaling = 1
+
+ this.clearRect = []
+
+ this.visible = false
+
+ this.colors = {}
+
+ this.on('resize', this.resizeHandleProxy.bind(this), {element: this.canvas})
+
+ this.ctx.arc = (x, y, r, s, e, c)=>{
+
+ CanvasRenderingContext2D.prototype.arc.call(this.ctx, x, y, Math.max(0,r), s, e, c)
+
+ }
+
+ }
+
+ resizeHandleProxy() {
+
+ this.resizeHandle(...arguments)
+
+ }
+
+ resizeHandle(event){
+
+ var {width, height, style} = event,
+ ratio = CANVAS_SCALING * this.scaling
+
+ this.height = height
+ this.width = width
+
+ this.canvas.setAttribute('width', width * ratio)
+ this.canvas.setAttribute('height', height * ratio)
+
+ this.clearRect = []
+
+ if (ratio != 1) {
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0)
+ this.ctx.scale(ratio, ratio)
+ }
+
+ this.cacheCanvasStyle(style)
+
+ if (!this.visible) this.visible = true
+
+ requestAnimationFrame(this.draw.bind(this))
+
+ }
+
+ cacheCanvasStyle(style){
+
+ style = style || window.getComputedStyle(this.canvas)
+
+ this.colors.custom = style.getPropertyValue('--color-custom')
+ this.colors.track = style.getPropertyValue('--color-track')
+ this.colors.text = style.getPropertyValue('--color-text')
+ this.colors.raised = style.getPropertyValue('--color-raised')
+ this.colors.bg = style.getPropertyValue('--color-bg')
+ this.colors.fg = style.getPropertyValue('--color-fg')
+ this.colors.faded = style.getPropertyValue('--color-faded')
+ this.colors.light = style.getPropertyValue('--color-light')
+
+ this.fontFamily = style.getPropertyValue('font-family')
+ this.textAlign = style.getPropertyValue('text-align')
+ this.fontSize = parseFloat(style.getPropertyValue('font-size'))
+ this.fontWeight = parseFloat(style.getPropertyValue('font-weight'))
+
+ this.ctx.font = this.fontWeight + ' ' + this.fontSize + 'px ' + this.fontFamily
+ this.ctx.textBaseline = 'middle'
+ this.ctx.textAlign = this.textAlign
+
+ }
+
+ clear() {
+
+ if (!this.clearRect.length) {
+ this.ctx.clearRect(0, 0, this.width, this.height)
+ return
+ }
+
+ if (typeof this.clearRect[0] == 'object') {
+ for (let i in this.clearRect) {
+ this.ctx.clearRect(...this.clearRect[i])
+ }
+ return
+ }
+
+ this.ctx.clearRect(...this.clearRect)
+
+ }
+
+ batchDraw() {
+
+ if (this.visible) canvasQueue.push(this)
+
+ }
+
+ draw(){
+ throw new Error('Calling unimplemented draw() method')
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ var ret = super.onPropChanged(...arguments)
+
+ switch (propName) {
+
+ case 'color':
+ this.cacheCanvasStyle()
+ this.batchDraw()
+ return
+
+ }
+
+ return ret
+
+
+ }
+
+ onRemove() {
+ this.off('resize')
+ super.onRemove()
+ }
+
+}
+
+Canvas.dynamicProps = Canvas.prototype.constructor.dynamicProps.concat(
+ 'on',
+ 'off'
+)
+
+module.exports = Canvas
diff --git a/src/client/app/widgets/common/container.js b/src/client/app/widgets/common/container.js
new file mode 100644
index 00000000..235909f6
--- /dev/null
+++ b/src/client/app/widgets/common/container.js
@@ -0,0 +1,75 @@
+var Widget = require('./widget')
+
+class Container extends Widget {
+
+ constructor(options) {
+
+ super(options)
+
+ this.on('widget-created', (e)=>{
+
+ if (e.widget.parent === this) {
+
+ var index = e.index
+ if (index !== undefined) {
+ if (!this.children[index]) {
+ this.children[index] = e.widget
+ } else {
+ this.children.splice(index, 0, e.widget)
+ }
+ } else {
+ this.children.push(e.widget)
+ }
+ }
+
+ })
+
+ this.on('widget-removed', (e)=>{
+
+ if (e.widget.parent === this) {
+ this.children.splice(this.children.indexOf(e.widget), 1)
+ }
+
+ })
+
+ }
+
+ alignChildrenProps() {
+
+ // this is needed after editor.undo to fix data shifting:
+ // say we have children [a, b, c] bound with session data [a, b, c]
+ // we delete one widget [ b, c] the data changes too: [ b, c]
+ // undo first only mutates the data: [a, b, c]
+ // so children have their data mutated too, child 'b' gets data 'a' and so on
+ // each child has to get the data corresponding to its index again.
+ // ...right ? :)
+ var tabs = this.getProp('tabs'),
+ widgets= this.getProp('widgets'),
+ type = tabs && tabs.length ? 'tabs' : widgets && widgets.length ? 'widgets' : null,
+ data = type ? this.getProp(type) : null
+
+ if (!type) return
+
+
+ for (let i in this.children) {
+ if (this.children[i] && data[i]) {
+ this.children[i].props = data[i]
+ this.children[i].cachedProps[type] = this.children[i].props[type]
+ if (this.children[i].alignChildrenProps) {
+ this.children[i].alignChildrenProps()
+ }
+ }
+ }
+
+ }
+
+ onRemove() {
+
+ super.onRemove()
+
+ }
+
+}
+
+
+module.exports = Container
diff --git a/src/client/app/widgets/common/osc-receiver.js b/src/client/app/widgets/common/osc-receiver.js
new file mode 100644
index 00000000..1ed396a8
--- /dev/null
+++ b/src/client/app/widgets/common/osc-receiver.js
@@ -0,0 +1,60 @@
+var osc = require('../../osc')
+
+module.exports = class OscReceiver {
+
+ constructor(address, value, parent, propName) {
+
+ try {
+ this.value = JSON.parse(value)
+ } catch (err) {
+ this.value = value
+ }
+
+ this.parent = parent
+ this.propNames = [propName]
+ this.bindedCallback = this.callback.bind(this)
+ this.setAddress(address)
+
+ }
+
+ setAddress(address) {
+
+ if (this.address !== address) {
+
+ if (this.address) osc.off(this.address, this.bindedCallback, this.parent)
+
+ this.address = address
+ osc.on(this.address, this.bindedCallback, {context: this.parent})
+
+ }
+
+ }
+
+ addProp(propName){
+
+ if (!this.propNames.includes(propName)) this.propNames.push(propName)
+
+ }
+
+ callback(args) {
+
+ if (typeof args !== 'object') args = [args]
+ var preArgs = this.parent.getProp('preArgs') || []
+ if (!Array.isArray(preArgs) && preArgs !== '') preArgs = [preArgs]
+ if (args.length >= preArgs.length) {
+ for (var i in preArgs) {
+ if (preArgs[i] !== args[i]) return
+ }
+ var val = args.slice(preArgs.length)
+ if (val.length < 2) val = val[0]
+ try {
+ this.value = JSON.parse(val)
+ } catch (err) {
+ this.value = val
+ }
+ this.parent.updateProps(this.propNames, this.parent)
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/common/widget.js b/src/client/app/widgets/common/widget.js
new file mode 100644
index 00000000..583047e7
--- /dev/null
+++ b/src/client/app/widgets/common/widget.js
@@ -0,0 +1,873 @@
+var EventEmitter = require('../../events/event-emitter'),
+ osc = require('../../osc'),
+ nanoid = require('nanoid/generate'),
+ widgetManager = require('../../managers/widgets'),
+ {math} = require('../utils'),
+ scopeCss = require('scope-css'),
+ {iconify} = require('../../ui/utils'),
+ resize = require('../../events/resize'),
+ OscReceiver = require('./osc-receiver'),
+ {deepCopy, deepEqual} = require('../../utils'),
+ html = require('nanohtml'),
+ updateWidget = ()=>{}
+
+var oscReceiverState = {}
+
+var OSCProps = [
+ 'precision',
+ 'address',
+ 'preArgs',
+ 'target',
+ 'bypass'
+]
+
+var dummyDOM
+
+DOM.ready(()=>{
+ dummyDOM = html``
+})
+
+setTimeout(()=>{
+ updateWidget = require('../../editor/data-workers').updateWidget
+})
+
+class Widget extends EventEmitter {
+
+ static defaults(insert={}, except=[], push={}) {
+
+ var defaults = {
+
+ type: {type: 'string', value: 'auto', help: ''},
+ id: {type: 'string', value: 'auto', help: 'Widgets sharing the same `id` will act as clones and update each other\'s value(s) without sending extra osc messages.' },
+ linkId: {type: 'string|array', value: '', help: [
+ 'Widgets sharing the same `linkId` update each other\'s value(s) AND send their respective osc messages.',
+ 'When prefixed with >>, the `linkId` will make the widget act as a master (sending but not receiving)',
+ 'When prefixed with <<, the `linkId` will make the widget act as a slave (receiving but not sending)'
+ ]},
+
+ _geometry:'geometry',
+
+ left: {type: 'number|string', value: 'auto', help: [
+ 'When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).',
+ 'Otherwise, the widget will be absolutely positioned'
+ ]},
+ top: {type: 'number|percentage', value: 'auto', help: [
+ 'When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).',
+ 'Otherwise, the widget will be absolutely positioned'
+ ]},
+ width: {type: 'number|percentage', value: 'auto', help: ''},
+ height: {type: 'number|percentage', value: 'auto', help: ''},
+
+ _style:'style',
+
+ label: {type: 'string|boolean', value: 'auto', help: [
+ 'Set to `false` to hide completely',
+ 'Insert icons using the prefix ^ followed by the icon\'s name : ^play, ^pause, etc'
+ ]},
+ color: {type: 'string', value: 'auto', help: 'CSS color code. Set to "auto" to inherit from parent widget.'},
+ css: {type: 'string', value: '', help: 'CSS rules'},
+
+ _value: 'value',
+
+ default: {type: '*', value: '', help: 'If set, the widget will be initialized with this value when the session is loaded.'},
+ value: {type: '*', value: '', help: 'Define the widget\'s value depending on other widget\'s values / properties using property inheritance and property maths'},
+
+ _osc: 'osc',
+
+ precision: {type: 'integer|string', value: 2, help: [
+ 'Defines the number of decimals to display and to send.',
+ 'Set to `0` to send integers only.',
+ 'Data type can be specified by appending a valid osc type tag to the precision value, for example : `3d` will make the widget send double precision numbers rounded to three decimals'
+ ]},
+ address: {type: 'string', value: 'auto', help: 'OSC address for sending messages, it must start with a /'},
+ preArgs: {type: '*|array', value: '', help: [
+ 'A value or array of values that will be prepended to the OSC messages.',
+ 'Values can be defined as objects if the osc type tag needs to be specified: `{type: "i", value: 1}`'
+ ]},
+ target: {type: 'string|array|null', value: '', help: [
+ 'This defines the targets of the widget\'s OSC messages',
+ '- A `string` or `array` of strings formatted as follow: `ip:port` or `["ip:port"]`',
+ '- If midi is enabled, targets can be `midi:device_name`',
+ '- The special item `"self"` can be used to refer to the emitting client directly.',
+ '- If no target is set, messages can still be sent if the server has default targets',
+ '- The server\'s default targets can be bypassed by setting one of the items to `null`'
+ ]},
+ bypass: {type: 'boolean', value: false, help: 'Set to `true` to prevent the widget from sending any osc message'}
+
+ }
+
+ // okay that's bad, but keys happen to be ordered anyway...
+
+ var alterDefaults = {}
+
+ for (var k in defaults) {
+ if (k === '_value') {
+ for (var l in insert) {
+ alterDefaults[l] = insert[l]
+ }
+ }
+ if (except.indexOf(k) < 0) alterDefaults[k] = defaults[k]
+ }
+
+ for (var m in push) {
+ alterDefaults[m] = push[m]
+ }
+
+ alterDefaults._props = function() {
+ var props = {}
+ for (var k in this) {
+ if (k[0] !== '_') {
+ props[k] = this[k].value
+ }
+ }
+ return props
+ }
+
+
+ return alterDefaults
+
+ }
+
+ constructor(options={}) {
+
+ super()
+
+ this.widget = options.html
+ this.props = options.props
+ this.errors = {}
+ this.parsers = {}
+ this.parent = options.root ? widgetManager : options.parent
+ this.parentNode = options.parentNode
+ this.hash = nanoid('abcdefghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ', 10)
+ this.children = []
+ this.reCreateOptions = options.reCreateOptions
+
+ // strip parent ? no position
+ if (this.parent && this.parent.props && this.parent.props.type == 'strip') {
+ delete this.props.top
+ delete this.props.left
+ delete this.props[this.parent.getProp('horizontal') ? 'height' : 'width']
+ }
+
+ this.createPropsCache()
+
+ if (this.getProp('id') == 'root' && !options.root) {
+ this.cachedProps.id = '_root'
+ this.errors.id = 'There can only be one root'
+ }
+
+ this.disabledProps = []
+
+ // cache precision
+ if (this.props.precision != undefined) {
+ this.precision = Math.min(20,Math.max(this.getProp('precision', undefined, false),0))
+ }
+
+ if (options.container) {
+
+ this.container = html`
+
+ `
+ this.label = html``
+ this.container.appendChild(this.label)
+ this.container.appendChild(this.widget)
+ this.container._widget_instance = this
+ this.setContainerStyles()
+ } else {
+ this.container = dummyDOM
+ }
+
+ }
+
+ contains(widget) {
+
+ if (this.children.indexOf(widget) > 0) return true
+
+ var parent = widget.parent
+ while (parent && parent !== widgetManager) {
+ if (parent === this) return true
+ parent = parent.parent
+ }
+ return false
+
+ }
+
+ getAllChildren() {
+
+ var children = []
+ for (var i = 0; i < this.children.length; i++) {
+ if (!this.children[i]) continue
+ children.push(this.children[i])
+ children = children.concat(this.children[i].getAllChildren())
+ }
+ return children
+
+
+ }
+
+ created(index) {
+
+ this.trigger('widget-created', {
+ id: this.getProp('id'),
+ widget: this,
+ options: this.reCreateOptions,
+ index: index
+ })
+
+ }
+
+ changed(options) {
+
+ this.trigger('change', {
+ widget: this,
+ options: options,
+ id: this.getProp('id'),
+ linkId: this.getProp('linkId')
+ })
+
+ }
+
+ sendValue(overrides, options={}) {
+
+ if (this.selfLinkedOSCProps) {
+ this.updateProps(this.selfLinkedOSCProps, this)
+ }
+
+ if (this.getProp('bypass') && !options.force) return
+
+ var data = {
+ h:this.hash,
+ v:this.value
+ }
+
+ if (overrides) {
+ for (var k in overrides) {
+ data[k] = overrides[k]
+ }
+ }
+
+ if (options.syncOnly) {
+
+ osc.sync(data)
+
+ } else {
+
+ osc.send(data)
+
+ }
+
+ }
+
+ setValue() {}
+
+ getValue(withPrecision) {
+
+ return deepCopy(this.value, withPrecision ? this.precision : undefined)
+
+ }
+
+ getSplit() {}
+
+ createPropsCache() {
+
+ // @{props} links lists
+ this.linkedProps = {}
+ this.nestedLinkedProps = {}
+ this.linkedPropsValue = {}
+
+ // OSC{/path} receivers
+ if (this.oscReceivers) {
+ this.removeOscReceivers()
+ }
+ this.oscReceivers = {}
+
+ // Cache resolved props
+ this.cachedProps = {}
+
+ for (var k in this.props) {
+ if (k != 'widgets' && k != 'tabs') {
+ this.cachedProps[k] = this.resolveProp(k, undefined, true)
+ } else {
+ this.cachedProps[k] = this.props[k]
+ }
+ }
+
+ this.createLinkedPropsBindings()
+
+ }
+
+ createLinkedPropsBindings() {
+
+ if (!this.linkedCreatedCallback && Object.keys(this.linkedProps).length) {
+
+ this.linkedCreatedCallback = (e)=>{
+ this.onLinkedPropsChanged(e, 'widget-created')
+ }
+
+ this.linkedPropChangedCallback = (e)=>{
+ this.onLinkedPropsChanged(e, 'prop-changed')
+ }
+
+ widgetManager.on('widget-created', this.linkedCreatedCallback, {context: this})
+ widgetManager.on('prop-changed', this.linkedPropChangedCallback, {context: this})
+
+ } else if (this.linkedCreatedCallback && !Object.keys(this.linkedProps).length) {
+
+ widgetManager.off('widget-created', this.linkedCreatedCallback)
+ widgetManager.off('prop-changed', this.linkedPropChangedCallback)
+ delete this.linkedCreatedCallback
+ delete this.linkedPropChangedCallback
+
+ }
+
+ if (!this.linkedValueChangedCallback && Object.keys(this.linkedPropsValue).length) {
+
+ this.linkedValueChangedCallback = (e)=>{
+ this.onLinkedPropsChanged(e, 'change')
+ }
+
+ widgetManager.on('change', this.linkedValueChangedCallback, {context: this})
+
+ } else if (this.linkedPropsValueCallback && !Object.keys(this.linkedPropsValue).length) {
+
+ widgetManager.off('change', this.linkedValueChangedCallback)
+ delete this.linkedValueChangedCallback
+
+ }
+
+ var selfLinkedOSCProps = (this.linkedPropsValue['this'] || []).filter(i=>OSCProps.indexOf(i) > -1)
+ this.selfLinkedOSCProps = selfLinkedOSCProps.length ? selfLinkedOSCProps : false
+
+ }
+
+ onLinkedPropsChanged(e, type) {
+
+ var {id, widget, options} = e,
+ changedProps = type === 'prop-changed' ? e.props : type === 'change' ? ['value'] : undefined,
+ linkedProps = type === 'change' ? this.linkedPropsValue : this.linkedProps
+
+ if (widget === this.parent) {
+ if (type === 'widget-created') return
+ id = 'parent'
+ }
+
+ if (widget === this) id = 'this'
+
+ if (this.nestedLinkedProps[id]) {
+ this.updateLinkedPropsWithNesting(id)
+ }
+
+ if (linkedProps[id]) {
+ this.updateProps(linkedProps[id], widget, options, changedProps)
+ }
+
+ }
+
+ removeOscReceivers() {
+
+ osc.off(undefined, undefined, this)
+ for (var i in this.oscReceivers) {
+ oscReceiverState[i] = this.oscReceivers[i].value
+ }
+ this.oscReceivers = {}
+
+ }
+
+ updateLinkedPropsWithNesting(i) {
+
+ for (var prop of this.nestedLinkedProps[i]) {
+
+ // 1. remove all linked props found in properties bound to the nested link
+ for (var linksStores of [this.linkedPropsValue, this.linkedProps]) {
+ for (let id in linksStores) {
+ if (linksStores[id].includes(prop)) {
+ linksStores[id].splice(linksStores[id].indexOf(prop), 1)
+ if (!linksStores[id].length) delete linksStores[id]
+ }
+ }
+ }
+
+
+ // 2. resolve these props again and recreate links (3rd arg to true)
+ this.resolveProp(prop, undefined, true, this)
+
+ }
+
+
+ }
+
+ resolveProp(propName, propValue, storeLinks=true, originalWidget, originalPropName, context) {
+
+ propValue = propValue !== undefined ? propValue : deepCopy(this.props[propName])
+ originalWidget = originalWidget || this
+ originalPropName = originalPropName || propName
+
+ var variables = {},
+ mathscope = context || {},
+ varnumber = 0
+
+ if (typeof propValue == 'string') {
+
+ propValue = propValue.replace(/@\{[^{}]*(@\{[^{}]*\})*[^{}]*\}/g, (m, nested)=>{
+ // pretty regexp:
+ // @\{
+ // [^{}]*
+ // (
+ // @\{
+ // [^{}]*
+ // \}
+ // )*
+ // [^{}]*
+ // \}
+
+ if (nested) {
+ m = m.replace(nested, this.resolveProp(propName, nested, storeLinks ? 'nested' : false, this))
+ }
+
+ let id = m.substr(2, m.length - 3).split('.'),
+ k, subk
+
+ if (id.length > 1) {
+
+ k = id.pop()
+ subk = undefined
+
+ if (id.length > 1) {
+ subk = k
+ k = id.pop()
+ }
+
+ id = id.join('.')
+
+ } else {
+
+ id = id[0]
+ k = 'value'
+
+ }
+
+ // backward compat
+ if (k === '_value') k = 'value'
+
+ var widgets = id == 'parent' && this.parent ?
+ [this.parent] : id == 'this' ? [this] :
+ widgetManager.getWidgetById(id)
+
+ if (!widgets.length) {
+ var parent = this.parent
+ while (parent && parent != widgetManager) {
+ if (parent.getProp('id') == id) {
+ widgets.push(parent)
+ break
+ }
+ parent = parent.parent
+ }
+ }
+
+
+ // ignore clone wrapper in @parent stack (https://github.com/jean-emmanuel/open-stage-control/issues/379)
+ if (widgets[0] === this.parent && this.parent.getProp('type') === 'clone') widgets = [this.parent.parent]
+
+ if (storeLinks) {
+
+ if (k == 'value') {
+
+ if (!this.linkedPropsValue[id]) this.linkedPropsValue[id] = []
+ if (this.linkedPropsValue[id].indexOf(propName) == -1) this.linkedPropsValue[id].push(propName)
+
+ } else {
+
+ if (!this.linkedProps[id]) this.linkedProps[id] = []
+ if (this.linkedProps[id].indexOf(propName) == -1) this.linkedProps[id].push(propName)
+
+ }
+
+ if (storeLinks === 'nested') {
+ if (!this.nestedLinkedProps[id]) this.nestedLinkedProps[id] = []
+ if (this.nestedLinkedProps[id].indexOf(propName) == -1) this.nestedLinkedProps[id].push(propName)
+ }
+
+ }
+
+ for (var i in widgets) {
+
+ if (widgets[i] === widgetManager) continue
+
+ if (widgets[i].props[k] !== undefined || k === 'value') {
+
+ if (k !== 'value' && originalPropName === k && widgets[i] === originalWidget) {
+ return 'ERR_CIRCULAR_REF'
+ }
+
+ var r = k == 'value' ?
+ widgets[i].getValue(true) :
+ widgets[i].resolveProp(k, undefined, storeLinks, originalWidget, originalPropName)
+
+ if (subk !== undefined && r !== undefined) r = r[subk]
+
+ var varname = 'VAR_' + varnumber
+ varnumber++
+
+ variables[varname] = r
+ mathscope[varname] = r
+
+ return varname
+
+ }
+
+ }
+
+ })
+
+ propValue = propValue.replace(/OSC\{([^}]+)\}/g, (m)=>{
+ let [address, value] = m.substr(4, m.length - 5).split(',').map(x=>x.trim()),
+ resolvedAddress = address.replace(/VAR_[0-9]+/g, (m)=>{
+ return typeof variables[m] === 'string' ? variables[m] : JSON.stringify(variables[m])
+ })
+
+ if (!this.oscReceivers[address]) {
+ this.oscReceivers[address] = new OscReceiver(resolvedAddress, value, this, propName)
+ if (oscReceiverState[address]) {
+ this.oscReceivers[address].value = oscReceiverState[address]
+ delete oscReceiverState[address]
+ }
+ } else {
+ this.oscReceivers[address].setAddress(resolvedAddress)
+ this.oscReceivers[address].addProp(propName)
+ }
+
+ var r = this.oscReceivers[address].value
+
+ var varname = 'VAR_' + varnumber
+ varnumber++
+
+ variables[varname] = r
+ mathscope[varname] = r
+
+ return varname
+ })
+
+ try {
+ propValue = propValue.replace(/#\{(?:[^{}]|\{[^{}]*\})*\}/g, (m)=>{
+ // one bracket nesting allowed, if we need two: #\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}
+
+ // unescape brackets (not needed anymore, just here for backward compatibility)
+ m = m.replace(/\\(\{|\})/g, '$1')
+
+ // espace multiline strings
+ m = m.replace(/`([^`]*)`/g, (m)=>{
+ return m.replace(/"/g,'\\"').replace(/\n/g,'\\n').replace(/`/g,'"')
+ })
+
+ if (!this.parsers[m]) this.parsers[m] = math.compile(m.substr(2, m.length - 3).trim())
+
+ let r = this.parsers[m].eval(mathscope)
+
+ if (r instanceof math.type.ResultSet && !r.entries.length) {
+ r = ''
+ } else if (typeof r === 'object' && r !== null && r.valueOf) {
+ r = r.valueOf()
+ if (Array.isArray(r) && r.length == 1) r = r[0]
+ }
+
+ return typeof r != 'string' ? JSON.stringify(r) : r
+ })
+ } catch (err) {}
+
+ for (let k in variables) {
+ var v = typeof variables[k] === 'string' ? variables[k] : JSON.stringify(variables[k])
+ propValue = propValue.replace(new RegExp(k, 'g'), v)
+ }
+
+ // heuristic to avoid using JSON when unnecessary
+ // if the string doesn't starts with one of these chars
+ // it's going to fail
+ // ref in source: https://github.com/douglascrockford/JSON-js
+ if (' \n+-eE{([0123456789tfn"'.indexOf(propValue[0]) !== -1) {
+ try {
+ propValue = JSON.parse(propValue)
+ } catch (err) {}
+ }
+
+ } else if (propValue != null && typeof propValue == 'object') {
+ for (let k in propValue) {
+ propValue[k] = this.resolveProp(propName, propValue[k], storeLinks, originalWidget, originalPropName, context)
+ }
+ }
+
+ return propValue
+
+
+ }
+
+ getProp(propName) {
+ return this.cachedProps[propName]
+ }
+
+
+ isDynamicProp(propName) {
+
+ return this.constructor.dynamicProps.indexOf(propName) !== -1
+
+ }
+
+ updateProps(propNames, widget, options, updatedProps = []) {
+
+ if (propNames.includes('value')) {
+ propNames.splice(propNames.indexOf('value'), 1)
+ propNames.push('value')
+ }
+
+ var reCreate = false,
+ changedProps = []
+
+ for (var propName of propNames) {
+
+ if (widget === this && updatedProps.includes(propName)) continue
+
+ let propValue = this.resolveProp(propName, undefined, false),
+ oldPropValue = this.getProp(propName)
+
+ if (!deepEqual(oldPropValue, propValue)) {
+
+ if (!this.isDynamicProp(propName)) {
+
+ reCreate = true
+
+ } else {
+
+ this.cachedProps[propName] = propValue
+ changedProps.push({propName, oldPropValue})
+
+ }
+
+
+ }
+ }
+
+ if (reCreate && (!widget || !this.contains(widget)) && widget !== this && !(widget === this && updatedProps.length === 1 && updatedProps[0] === 'value')) {
+
+ return this.reCreateWidget({reCreateOptions: options})
+
+ } else if (changedProps.length) {
+
+ for (var i in changedProps) {
+
+ this.onPropChanged(changedProps[i].propName, options, changedProps[i].oldPropValue)
+ }
+
+ widgetManager.trigger('prop-changed', {
+ id: this.getProp('id'),
+ props: changedProps,
+ widget: this,
+ options: options
+ })
+
+ }
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ switch(propName) {
+
+ case 'value':
+ this.setValue(this.getProp('value'), {sync: true, send: options && options.send})
+ return
+
+ case 'top':
+ case 'left':
+ this.setContainerStyles(['geometry'])
+ return
+
+ case 'height':
+ case 'width':
+ this.setContainerStyles(['geometry'])
+ resize.check(this.container)
+ return
+
+ case 'label':
+ this.setContainerStyles(['label'])
+ if (oldPropValue === false || this.getProp('label') === false) {
+ resize.check(this.container)
+ }
+ return
+
+ case 'css':
+ this.setContainerStyles(['css'])
+ this.onPropChanged('color')
+ var re = /width|height|display/
+ if (re.test(oldPropValue) || re.test(this.getProp('css'))) {
+ resize.check(this.container)
+ }
+ return
+
+ case 'color':
+ this.setContainerStyles(['color'])
+ return
+
+ case 'precision':
+ case 'address':
+ case 'preArgs':
+ case 'target':
+ case 'noSync':
+ if (propName == 'precision') this.precision = Math.min(20,Math.max(this.getProp('precision', undefined, false),0))
+ var data = {},
+ oldData = {
+ preArgs: propName == 'preArgs' ? oldPropValue : this.getProp('preArgs'),
+ address: propName == 'address' ? oldPropValue : this.getProp('address')
+ }
+ data[propName] = this.getProp(propName)
+ if (propName === 'address' && this.getSplit()) {
+ data['split'] = this.getSplit()
+ }
+ widgetManager.registerWidget(this, data, oldData)
+ return
+
+ }
+
+ }
+
+ setContainerStyles(styles = ['geometry', 'label', 'css', 'color']) {
+
+ if (styles.includes('geometry')) {
+
+ // geometry
+ for (let d of ['width', 'height', 'top', 'left']) {
+ let val = this.getProp(d),
+ geometry
+
+ if (val !== undefined) {
+ if (parseFloat(val) < 0) val = 0
+ geometry = parseFloat(val) == val ? parseFloat(val)+'rem' : val
+ }
+
+ if (geometry && geometry != 'auto') {
+ this.container.style[d] = geometry
+ if (d == 'width') this.container.style.minWidth = geometry
+ if (d == 'height') this.container.style.minHeight = geometry
+ if (d == 'top' || d == 'left') this.container.classList.add('absolute-position')
+ }
+ }
+
+ }
+
+ if (styles.includes('label')) {
+
+ // label
+ if (this.getProp('label') === false) {
+ this.container.classList.add('nolabel')
+ } else {
+ this.container.classList.remove('nolabel')
+ var label = this.getProp('label') == 'auto'?
+ this.getProp('id'):
+ iconify(this.getProp('label'))
+
+ this.label.innerHTML = label
+ }
+
+ }
+
+ if (styles.includes('css')) {
+
+ // css
+ var css = String(this.getProp('css')),
+ prefix = '#' + this.hash,
+ scopedCss = scopeCss(css, prefix),
+ unScopedCss = '',
+ extraCssClasses = []
+
+
+ // extra css "class" property
+ css = css.replace(/^[^\S\n]*class[^\S\n]*:[^\S\n]*([^;\n\s]+);?/igm, (m, c)=>{
+ if (c === 'widget' || c.includes('-container')) return
+ extraCssClasses.push(c.replace(/"'/g,''))
+ })
+
+ try {
+
+ dummyDOM.style = css
+ unScopedCss = dummyDOM.getAttribute('style') || ''
+
+ } catch(err) {
+
+ // fallback for browser that don't allow assigning "style" property
+ css
+ .replace(/\{[^}]*\}/g, '')
+ .replace(/^[^@#.]*:.*/gm, (m)=>{
+ unScopedCss += m[m.length - 1] === ';' ? m : m + ';'
+ })
+
+ }
+
+
+
+ if (scopedCss.indexOf('@keyframes') > -1) scopedCss = scopedCss.replace(new RegExp(prefix + '\\s+([0-9]+%|to|from)', 'g'), ' $1')
+ if (scopedCss.indexOf('&') > -1) scopedCss = scopedCss.replace(new RegExp(prefix + '\\s&', 'g'), prefix)
+
+ var style = html``,
+ oldStyle = DOM.get(this.container, '> style')[0]
+
+ if (oldStyle) {
+ this.container.replaceChild(style, oldStyle)
+ } else if (scopedCss.length || unScopedCss.length){
+ this.container.insertBefore(style, this.widget)
+ }
+
+
+ // apply extra css classes
+
+ if (this.extraCssClasses && this.extraCssClasses.length) {
+ this.container.classList.remove(...this.extraCssClasses)
+ this.extraCssClasses = []
+ }
+
+ if (extraCssClasses.length) {
+ this.container.classList.add(...extraCssClasses)
+ this.extraCssClasses = extraCssClasses
+ }
+
+ }
+
+ if (styles.includes('color')) {
+
+ // color
+ this.container.style.setProperty('--color-custom', this.getProp('color') && this.getProp('color') != 'auto' ? this.getProp('color') : '')
+
+ }
+
+
+ }
+
+ reCreateWidget(options={}){
+
+ return updateWidget(this, options)
+
+ }
+
+ onRemove(){
+
+ widgetManager.off(undefined, undefined, this)
+ this.removeOscReceivers()
+
+ }
+
+}
+
+Widget.dynamicProps = [
+ 'top',
+ 'left',
+ 'height',
+ 'width',
+ 'label',
+ 'css',
+ 'value',
+ 'color',
+ 'precision',
+ 'address',
+ 'preArgs',
+ 'target',
+ 'bypass'
+]
+
+module.exports = Widget
diff --git a/src/client/app/widgets/containers/clone.js b/src/client/app/widgets/containers/clone.js
new file mode 100644
index 00000000..d4e6e4c1
--- /dev/null
+++ b/src/client/app/widgets/containers/clone.js
@@ -0,0 +1,293 @@
+var Container = require('../common/container'),
+ widgetManager = require('../../managers/widgets'),
+ resize = require('../../events/resize'),
+ parser = require('../../parser'),
+ {deepCopy, deepEqual} = require('../../utils'),
+ {diff, diffToWidget} = require('../../editor/diff'),
+ html = require('nanohtml')
+
+var excludedCloneClasses = ['widget', 'absolute-position', 'ui-resizable', 'ui-draggable', 'not-editable']
+
+class Clone extends Container {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _clone:'clone',
+
+ widgetId: {type: 'string', value: '', help: '`id` of the widget to clone'},
+
+ _overrides:'overrides',
+
+ props: {type: 'object', value: {}, help: 'Cloned widget\'s properties to override'},
+
+ }, ['label', 'color', 'linkId', '_value', 'default', 'value', '_osc', 'precision', 'address', 'preArgs', 'target', 'bypass'])
+
+ }
+
+ constructor(options) {
+
+ options.props.label = ''
+ options.props.variables = '@{parent.variables}'
+
+ super({...options, html: html``})
+
+ this.cloneLock = false
+ this.cloneTarget = null
+ this.cloneClass = []
+
+ this.container.classList.add('empty')
+
+ this.bindTarget(this.getCloneTarget())
+ if (this.cloneTarget) this.createClone(true)
+
+ // global listener to catch cloneTarget's creation if no target is locked
+ widgetManager.on('widget-created', (e)=>{
+
+ if (this.cloneTarget) return
+
+ var {id, widget} = e
+
+ if (id === this.getProp('widgetId') && this.isValidCloneTarget(widget)) {
+
+ var clone = this.children[0]
+
+ this.unbindTarget()
+
+ if (!clone) {
+
+ this.updateContainer(false)
+ this.bindTarget(widget)
+ this.createClone()
+
+ } else {
+
+ this.bindTarget(widget)
+ this.updateClone()
+
+ }
+
+ }
+
+ }, {context: this})
+
+ widgetManager.on('prop-changed', (e)=>{
+
+ if (!this.cloneTarget) return
+
+ if (e.widget === this.cloneTarget || this.cloneTarget.contains(e.widget)) {
+
+ this.updateClone()
+
+ }
+
+ }, {context: this})
+
+ }
+
+ getCloneTarget() {
+
+ // attempt to acquire a cloneTarget if 'widget-created' event has not been catched
+ // (the target might have been created before the clone itself)
+
+ var widgets = widgetManager.getWidgetById(this.getProp('widgetId'))
+ .filter(el=>this.isValidCloneTarget(el))
+
+ if (widgets.length === 0) return null
+ if (widgets.length === 1) {
+ return widgets[0]
+ }
+
+ // when duplicating clones pointing to an object with a static id,
+ // each clone will recreate an object with the same id internally
+ // we try to get the original one if there is more than 2 clone pointing to the same id (avoiding cloning the clone)
+
+ function isCreatedByAClone(wi){
+ var parent = wi.parent
+ return parent && parent.getProp('type') === 'clone'
+ }
+
+ var target = widgets[0]
+ for (var w of widgets) {
+ if (!isCreatedByAClone(w)) {
+ target = w
+ break
+ }
+ }
+
+ return target
+
+ }
+
+ isValidCloneTarget(widget) {
+
+ return !(widget.contains(this) || this.contains(widget))
+
+ }
+
+ createClone(init) {
+
+ if (this.cloneLock) return
+
+ this.cloneLock = true
+
+ var data = {...deepCopy(this.cloneTarget.props), ...this.getProp('props')}
+
+ parser.parse({
+ data: data,
+ parentNode: this.widget,
+ parent: this
+ })
+
+ this.updateContainer(!init)
+
+ this.cloneLock = false
+
+ }
+
+ unbindTarget() {
+
+ if (!this.cloneTarget) return
+
+ this.cloneTarget.off(undefined, undefined, this)
+
+ this.cloneTarget = null
+
+ }
+
+ bindTarget(target) {
+
+ if (!target) return
+
+ this.cloneTarget = target
+
+ // listen for cloneTarget's deletion
+ // if it is just edited, its recreation will be catched by the global 'widget-created' event handler
+ this.cloneTarget.on('widget-removed', (e)=>{
+ if (this.cloneTarget === e.widget) {
+ this.unbindTarget()
+ }
+ }, {context: this})
+
+ // listen for cloneTarget's content updates
+ this.cloneTarget.on('widget-created', (e)=>{
+
+ var {widget} = e,
+ parent = widget.parent
+
+ while (parent !== this.cloneTarget && parent !== widgetManager) {
+ // if updated widget is in a nested clone, ignore it:
+ // it will be handled by the nested clone that targets it
+ if (parent.getProp('type') === 'clone') return
+ parent = parent.parent
+ }
+
+ this.updateClone()
+
+ }, {context: this})
+
+ }
+
+ updateClone() {
+
+ if (this.cloneLock) return
+
+ this.cloneLock = true
+
+ var data = {...deepCopy(this.cloneTarget.props), ...this.getProp('props')},
+ clone = this.children[0]
+
+ var delta = diff.diff(clone.props, data) || {},
+ [widget, patch] = diffToWidget(clone, delta),
+ changedProps = Object.keys(patch)
+
+ if (changedProps.length) {
+
+ diff.patch(widget.props, patch)
+
+
+ if (changedProps.some(x => !widget.isDynamicProp(x))) {
+
+ clone.reCreateWidget({reuseChildren: false})
+ this.updateContainer(false)
+
+ } else {
+
+ widget.updateProps(changedProps, this)
+ this.updateContainer(true)
+
+ }
+
+ }
+
+
+
+ this.cloneLock = false
+
+ }
+
+ updateContainer(checkResize) {
+
+
+ if (this.cloneTarget) {
+
+ var classes = [...this.cloneTarget.container.classList].filter(i=>excludedCloneClasses.indexOf(i) === -1)
+
+ if (!deepEqual(classes, this.cloneClass)) {
+ this.container.classList.remove(...this.cloneClass)
+ this.cloneClass = classes
+ this.container.classList.add(...this.cloneClass)
+ }
+
+ this.container.classList.remove('empty')
+
+ for (var w of this.getAllChildren()) {
+ w.container.classList.add('not-editable')
+ }
+
+ if (checkResize) resize.check(this.widget)
+
+ } else if (this.cloneClass.length) {
+
+ this.container.classList.remove(...this.cloneClass)
+ this.container.classList.add('empty')
+ this.cloneClass = []
+ this.widget.innerHTML = ''
+ widgetManager.removeWidgets(this.getAllChildren())
+
+ }
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'widgetId':
+ this.unbindTarget()
+ this.updateContainer(false)
+ this.bindTarget(this.getCloneTarget())
+ if (this.cloneTarget) this.createClone()
+ return
+
+ }
+
+ }
+
+ onRemove(){
+
+ this.unbindTarget()
+ super.onRemove()
+
+ }
+
+}
+
+Clone.dynamicProps = Clone.prototype.constructor.dynamicProps.concat(
+ 'widgetId'
+)
+
+module.exports = Clone
diff --git a/src/client/app/widgets/containers/modal.js b/src/client/app/widgets/containers/modal.js
new file mode 100644
index 00000000..a3ee493e
--- /dev/null
+++ b/src/client/app/widgets/containers/modal.js
@@ -0,0 +1,180 @@
+var Panel = require('./panel'),
+ Widget = require('../common/widget'),
+ {icon, iconify} = require('../../ui/utils'),
+ resize = require('../../events/resize'),
+ doubletab = require('../mixins/double_tap'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+module.exports = class Modal extends Panel {
+
+ static defaults() {
+
+ return Widget.defaults({
+
+ _modal:'modal',
+
+ doubleTap: {type: 'boolean', value: false, help: 'Set to `true` to make the modal require a double tap to open instead of a single tap'},
+ popupLabel: {type: 'string', value: '', help: 'Alternative label for the modal popup'},
+ popupWidth: {type: 'number|percentage', value: '80%', help: 'Modal popup\'s size'},
+ popupHeight: {type: 'number|percentage', value: '80%', help: 'Modal popup\'s size'},
+ popupLeft: {type: 'number|percentage', value: 'auto', help: 'Modal popup\'s position'},
+ popupTop: {type: 'number|percentage', value: 'auto', help: 'Modal popup\'s position'},
+
+ }, [], {
+
+ _chidlren:'children',
+
+ variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
+ widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object'},
+ value: {type: 'integer', value: '', help: [
+ 'Defines the modal\'s state:`0` for closed, `1` for opened'
+ ]},
+
+ })
+
+ }
+
+ constructor(options) {
+
+ options.props.scroll = true
+
+ super(options)
+
+ this.disabledProps = []
+
+ this.popup = html`
+
+ `
+
+ this.container.appendChild(this.popup)
+
+ // convert dimensions / coordinates to rem
+ var geometry = {}
+ for (var g of ['Width', 'Height', 'Left', 'Top']) {
+ geometry[g] = parseFloat(this.getProp('popup' + g)) == this.getProp('popup' + g) ? parseFloat(this.getProp('popup' + g)) + 'rem' : this.getProp('popup' + g)
+ }
+
+ this.popup.style.setProperty('--width', geometry.Width)
+ this.popup.style.setProperty('--height', geometry.Height)
+
+ if (geometry.Left !== 'auto') {
+ this.popup.style.setProperty('--left', geometry.Left)
+ this.popup.classList.add('x-positionned')
+ }
+
+ if (geometry.Top !== 'auto') {
+ this.popup.style.setProperty('--top', geometry.Top)
+ this.popup.classList.add('y-positionned')
+ }
+
+ this.light = this.container.appendChild(html``)
+
+ if (this.getProp('doubleTap')) {
+ doubletab(this.light, ()=>{
+ this.setValue(1, {sync:true, send:true})
+ })
+ } else {
+ this.light.addEventListener('fast-click',(e)=>{
+ if (e.capturedByEditor === true) return
+ this.setValue(1, {sync:true, send:true})
+ })
+ }
+
+ var closer = DOM.get(this.popup, '.closer')[0]
+ this.popup.addEventListener('fast-click',(e)=>{
+ if ((e.target === this.popup || e.target === closer) && this.value == 1) {
+ e.detail.preventOriginalEvent = true
+ this.setValue(0, {sync:true, send:true})
+ }
+ })
+
+ this.escapeKeyHandler = ((e)=>{
+ if (e.keyCode==27) this.setValue(0, {sync:true, send:true})
+ }).bind(this)
+
+ this.parentScroll = [0,0]
+ this.value = 0
+ this.init = false
+
+ }
+
+ setValue(v, options={}) {
+
+ if (this.init === undefined) return
+
+ this.value = v ? 1 : 0
+
+ if (!this.init && this.value) {
+ var label = this.getProp('popupLabel') ? iconify(this.getProp('popupLabel')) : DOM.get(this.container, '> .label')[0].innerHTML
+ DOM.get(this.popup, '.popup-title .popup-label')[0].innerHTML = label
+ DOM.get(this.popup, '.popup-content')[0].appendChild(this.widget)
+ this.init = true
+ }
+
+ this.popup.classList.toggle('show', this.value)
+ this.container.classList.toggle('on', this.value)
+ this.light.classList.toggle('on', this.value)
+
+ this.bindEscKey(this.value)
+
+ if (this.value) {
+ resize.check(this.widget, true)
+ }
+
+ if (this.init) this.fixParents()
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+
+ }
+
+ bindEscKey(set) {
+
+ if (set) {
+ document.addEventListener('keydown', this.escapeKeyHandler)
+ } else {
+ document.removeEventListener('keydown', this.escapeKeyHandler)
+ }
+
+ }
+
+ onRemove() {
+ this.bindEscKey(false)
+ this.setValue(0)
+ super.onRemove()
+ }
+
+ fixParents() {
+
+ var parent = this.parent,
+ scrollFixed = false
+
+ while (parent && parent.props) {
+
+ // scroll
+ if (!scrollFixed && parent.getProp('type') == 'tab') {
+ if (this.value) {
+ this.parentScroll = [parent.widget.scrollLeft, parent.widget.scrollTop]
+ }
+ parent.widget.scrollLeft = this.value ? 0 : this.parentScroll[0]
+ parent.widget.scrollTop = this.value ? 0 : this.parentScroll[1]
+ parent.widget.style.overflow = this.value ? 'hidden' : ''
+ scrollFixed = true
+ }
+
+ // stacking
+ parent.container.style.zIndex = this.value ? 'initial' : ''
+
+ parent = parent.parent
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/containers/panel.js b/src/client/app/widgets/containers/panel.js
new file mode 100644
index 00000000..e1633c2b
--- /dev/null
+++ b/src/client/app/widgets/containers/panel.js
@@ -0,0 +1,209 @@
+var Container = require('../common/container'),
+ widgetManager = require('../../managers/widgets'),
+ parser = require('../../parser'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+class Panel extends Container {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _panel:'panel',
+
+ scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
+ border: {type: 'boolean', value: true, help: 'By default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the panel too'},
+
+ }, [], {
+
+ _children:'children',
+
+ variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
+ widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'},
+ tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously'},
+
+ value: {type: 'integer', value: '', help: [
+ 'Defines currently opened tab in the widget',
+ 'A tab can be opened only by setting its parent\'s value'
+ ]},
+
+ })
+
+
+ }
+
+ constructor(options) {
+
+
+ super({...options, html: html``})
+
+ if (this.getProp('scroll') === false) this.widget.classList.add('noscroll')
+ if (this.getProp('border') === false) this.container.classList.add('noborder')
+ if (this.getProp('tabs') && this.getProp('tabs').length) this.widget.classList.add('has-tabs')
+
+ this.value = -1
+ this.tabs = []
+
+ if (this.getProp('tabs') && this.getProp('tabs').length) {
+
+ this.widget.appendChild(html``)
+ this.navigation = DOM.get(this.widget, '.tablist')[0]
+
+ this.wrapper = this.widget.appendChild(html``)
+
+ this.children = options.children || new Array(this.getProp('tabs').length)
+ for (let i = 0; i < this.children.length; i++) {
+ if (this.children[i]) {
+ this.wrapper.appendChild(this.children[i].container)
+ this.children[i].parent = this
+ this.children[i].parentNode = this.wrapper
+ } else {
+ parser.parse({
+ data: this.getProp('tabs')[i],
+ parentNode: this.wrapper,
+ parent: this,
+ tab: true,
+ index: i
+ })
+ }
+ }
+
+ if (options.children) this.alignChildrenProps()
+
+ this.createNavigation()
+
+ this.navigation.addEventListener('fast-click', (e)=>{
+ if (!e.target.hasAttribute('data-widget')) return
+ var index = DOM.index(e.target)
+ this.setValue(index, {sync: true, send:this.value != index})
+ })
+
+ this.on('tab-created', (e)=>{
+ this.createNavigation()
+ e.stopPropagation = true
+ })
+
+ this.setValue(this.getProp('value') || 0)
+
+ } else if (this.getProp('widgets') && this.getProp('widgets').length) {
+
+ this.children = options.children || new Array(this.getProp('widgets').length)
+ for (let i = 0; i < this.children.length; i++) {
+ if (this.children[i]) {
+ this.widget.appendChild(this.children[i].container)
+ this.children[i].parent = this
+ this.children[i].parentNode = this.widget
+ } else {
+ parser.parse({
+ data: this.getProp('widgets')[i],
+ parentNode: this.widget,
+ parent: this,
+ index: i
+ })
+ }
+ }
+
+ if (options.children) this.alignChildrenProps()
+
+
+ }
+
+ if (this.getProp('tabs') && !this.getProp('tabs').length) {
+ this.disabledProps.push(
+ 'precision', 'address', 'preArgs', 'target', 'bypass',
+ 'value', 'default'
+ )
+ }
+ if (this.getProp('widgets') && !this.getProp('widgets').length) {
+ this.disabledProps.push(
+ 'scroll'
+ )
+ }
+
+
+
+ }
+
+ createNavigation() {
+
+ this.navigation.innerHTML = ''
+ this.tabs = []
+
+ DOM.each(this.wrapper, '> .widget', (tab)=>{
+
+ let widget = widgetManager.getWidgetByElement(tab),
+ style = widget.getProp('color') == 'auto' ? '' : `--color-custom:${widget.getProp('color')}`
+
+ this.tabs.push(widget)
+ this.navigation.appendChild(html`
+
+ ${raw(DOM.get(tab, '> .label')[0].innerHTML)}
+
+ `)
+
+ })
+
+
+ this.setValue(this.value)
+
+ }
+
+ setValue(v, options={}) {
+ if (this.tabs.length && typeof v == 'number' && v >= 0 && v < this.tabs.length) {
+
+ for (let i in this.tabs) {
+ if (i != v) this.tabs[i].hide()
+ }
+
+ this.value = v
+
+ this.tabs[v].show()
+ DOM.each(this.navigation, 'li', (el)=>{el.classList.remove('on')})[v].classList.add('on')
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+ }
+
+ scroll(s) {
+
+ if (!s) {
+ return [this.widget.scrollLeft, this.widget.scrollTop]
+ } else {
+ this.widget.scrollLeft = s[0]
+ this.widget.scrollTop = s[1]
+ }
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of this.children) {
+ if (w) w.onPropChanged('color')
+ }
+ return
+
+ }
+
+ }
+
+
+ onRemove() {
+ this.off('resize')
+ super.onRemove()
+ }
+
+}
+
+Panel.dynamicProps = Panel.prototype.constructor.dynamicProps.concat(
+ 'variables'
+)
+
+module.exports = Panel
diff --git a/src/client/app/widgets/containers/root.js b/src/client/app/widgets/containers/root.js
new file mode 100644
index 00000000..3985525c
--- /dev/null
+++ b/src/client/app/widgets/containers/root.js
@@ -0,0 +1,95 @@
+var Panel = require('./panel'),
+ Widget = require('../common/widget'),
+ {icon} = require('../../ui/utils'),
+ {enableTraversingGestures, disableTraversingGestures} = require('../../events/drag'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+class Root extends Panel {
+
+ static defaults() {
+
+ return Widget.defaults({}, ['label', '_geometry', 'left', 'top', 'width', 'height'], {
+
+ _children:'children',
+
+ traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'},
+ variables: {type: '*', value: {}, help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
+ tabs: {type: 'array', value: [{}], help: 'Each element of the array must be a tab object'},
+ id: {type: 'string', value: 'root', help: 'Widgets sharing the same id will act as clones and update each other\'s value(s) without sending extra osc messages' },
+
+ value: {type: 'integer', value: '', help: [
+ 'Defines currently opened tab in the widget',
+ 'A tab can be opened only by setting its parent\'s value'
+ ]},
+
+ })
+
+ }
+
+ constructor(options) {
+
+ options.root = true
+ options.props.id = 'root'
+ options.props.scroll = true
+ options.props.label = false
+
+ super(options)
+
+ this.widget.classList.add('root')
+
+ this.disabledProps.push('id')
+
+ DOM.each(this.widget, '> .navigation', (el)=>{
+ el.classList.add('main')
+ })
+
+ if (this.getProp('traversing')) this.setTraversing()
+
+ }
+
+ createNavigation() {
+
+ super.createNavigation()
+
+ this.navigation.appendChild(html`
+
+ ${raw(icon('bars'))}
+
+ `)
+
+ }
+
+ setTraversing(update) {
+
+ var traversing = this.getProp('traversing')
+
+ disableTraversingGestures(this.widget)
+
+ if (traversing) {
+ enableTraversingGestures(this.widget, {smart: typeof traversing === 'string' && traversing.match(/smart|auto/)})
+ }
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'traversing':
+ this.setTraversing()
+ return
+
+ }
+
+ }
+
+}
+
+Root.dynamicProps = Root.prototype.constructor.dynamicProps.concat(
+ 'traversing'
+)
+
+module.exports = Root
diff --git a/src/client/app/widgets/containers/strip.js b/src/client/app/widgets/containers/strip.js
new file mode 100644
index 00000000..a6608047
--- /dev/null
+++ b/src/client/app/widgets/containers/strip.js
@@ -0,0 +1,60 @@
+var Panel = require('./panel'),
+ Widget = require('../common/widget')
+
+module.exports = class Strip extends Panel {
+
+ static defaults() {
+
+ return Widget.defaults({
+
+ _strip: 'strip',
+
+ scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'},
+ horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display widgets horizontally'},
+ stretch: {type: 'boolean', value: true, help: 'Set to `true` to stretch widgets evenly'},
+ border: {type: 'boolean', value: true, help: 'By default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the panel too'},
+ spacing: {type: 'integer|percentage', value: 0, help: 'Adds space between widgets. Percents are always relative to the strips width'}
+
+ }, [], {
+
+ _children:'children',
+
+ variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
+ widgets: {type: 'array', value: [], help: [
+ 'Each element of the array must be a widget object',
+ '- By default, children widgets that don\'t have an explicit `width`/`height` set will be shrinked to respect the sizes specified by others',
+ '- Adding `flex:1;` to a children\'s `css` will give it the ability the fill the remaining space',
+ '- Multiple children can have a `flex:x;` css property (`x` will ponderate their expansion)'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ var defaults = Panel.defaults()._props()
+ for (var k in defaults) {
+ if (!options.props.hasOwnProperty(k))
+ options.props[k] = defaults[k]
+ }
+
+ super(options)
+
+ this.disabledProps = []
+
+ if (this.getProp('spacing')) {
+ var spacing = this.getProp('spacing')
+ if (!isNaN(spacing)) spacing += 'rem'
+ this.widget.style.setProperty('--spacing', spacing)
+ }
+
+ this.container.classList.add(this.getProp('horizontal') ? 'horizontal' : 'vertical')
+ if (this.getProp('stretch')) this.container.classList.add('stretch')
+
+ }
+
+ setValue(){}
+ getValue(){}
+
+}
diff --git a/src/client/app/widgets/containers/tab.js b/src/client/app/widgets/containers/tab.js
new file mode 100644
index 00000000..b983d9b8
--- /dev/null
+++ b/src/client/app/widgets/containers/tab.js
@@ -0,0 +1,69 @@
+var Panel = require('./panel'),
+ Widget = require('../common/widget'),
+ resize = require('../../events/resize')
+
+module.exports = class Tab extends Panel {
+
+ static defaults() {
+
+ return Widget.defaults({}, ['_geometry', 'left', 'top', 'width', 'height'], {
+
+ _children:'children',
+
+ variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'},
+ widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A tab cannot contain widgets and tabs simultaneously'},
+ tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A tab cannot contain widgets and tabs simultaneously'},
+
+ value: {type: 'integer', value: '', help: [
+ 'Defines currently opened tab in the widget',
+ 'A tab can be opened only by setting its parent\'s value'
+ ]},
+
+ })
+
+ }
+
+ constructor(options) {
+
+ options.props.scroll = true
+
+ super(options)
+
+ this.container.classList.add('show')
+ this.widget.classList.add('tab')
+
+ this.detached = false
+
+ }
+
+ hide() {
+ if (this.detached) return
+ this.container.removeChild(this.widget)
+ this.container.classList.remove('show')
+ this.detached = true
+
+ }
+ show() {
+ if (!this.detached) return
+ this.container.appendChild(this.widget)
+ this.container.classList.add('show')
+ this.detached = false
+ resize.check(this.widget, true)
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'label':
+ case 'color':
+ if (this.parent.createNavigation) this.parent.createNavigation()
+ return
+
+ }
+
+ }
+
+}
diff --git a/src/browser/js/app/widgets/index.js b/src/client/app/widgets/index.js
similarity index 75%
rename from src/browser/js/app/widgets/index.js
rename to src/client/app/widgets/index.js
index 79c5d6be..4b8d4bf0 100644
--- a/src/browser/js/app/widgets/index.js
+++ b/src/client/app/widgets/index.js
@@ -7,6 +7,7 @@ module.exports.widgets = {
fader: require('./sliders/fader'),
knob: require('./sliders/knob'),
encoder: require('./sliders/encoder'),
+ range: require('./sliders/range'),
// buttons
toggle: require('./buttons/toggle'),
@@ -20,6 +21,7 @@ module.exports.widgets = {
multixy: require('./pads/multixy'),
// matrices
+ matrix: require('./matrices/matrix'),
multitoggle: require('./matrices/multitoggle'),
multipush: require('./matrices/multipush'),
multifader: require('./matrices/multifader'),
@@ -33,6 +35,9 @@ module.exports.widgets = {
visualizer: require('./plots/visualizer'),
meter: require('./plots/meter'),
text: require('./plots/text'),
+ image: require('./plots/image'),
+ svg: require('./plots/svg'),
+ frame: require('./plots/frame'),
// containers
strip: require('./containers/strip'),
@@ -46,20 +51,23 @@ module.exports.widgets = {
// inputs
input: require('./inputs/input'),
+ keys: require('./inputs/keys'),
+ script: require('./inputs/script'),
+ gyroscope: require('./inputs/gyroscope'),
// maths
+ // deprecated / hidden
formula: require('./maths/formula')
}
module.exports.categories = {
- 'Sliders':['fader','knob', 'encoder'],
+ 'Sliders':['fader','knob', 'encoder', 'range'],
'Buttons':['toggle','push','switch', 'dropdown'],
'Pads':['xy','rgb','multixy'],
- 'Matrices':['multifader','multitoggle','multipush', 'keyboard'],
- 'Plots':['plot','eq','visualizer','led', 'rgbled','meter','text'],
+ 'Matrices':['matrix', 'multifader','multitoggle','multipush', 'keyboard'],
+ 'Plots':['plot','eq','visualizer','led', 'rgbled','meter','text', 'image', 'svg', 'frame'],
'Containers':['panel','strip','modal', 'clone'],
'Switchers':['switcher','crossfader'],
- 'Inputs':['input'],
- 'Maths':['formula']
+ 'Inputs':['input', 'keys', 'script', 'gyroscope']
}
diff --git a/src/client/app/widgets/inputs/gyroscope.js b/src/client/app/widgets/inputs/gyroscope.js
new file mode 100644
index 00000000..f1563d0b
--- /dev/null
+++ b/src/client/app/widgets/inputs/gyroscope.js
@@ -0,0 +1,119 @@
+var Widget = require('../common/widget'),
+ GyroNorm = require('gyronorm/dist/gyronorm.complete.min.js'),
+ {icon} = require('../../ui/utils'),
+ {clip} = require('../utils'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+
+class Gyroscope extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _gyroscope: 'gyroscope',
+
+ frequency: {type: 'number', value: 30, help: 'Value update frequency (updates per seconds)'},
+ normalize: {type: 'boolean', value: true, help: 'Normalize gravity related values'},
+ compass: {type: 'boolean', value: false, help: 'Set to `true` to return the orientation values with respect to the actual north direction of the world instead of the head direction of the device'},
+ screenAdjusted: {type: 'boolean', value: false, help: 'Set to `true` to return screen adjusted values'}
+
+ }, [], {
+
+ value: {type: 'object', value: '', help: [
+ 'The gyroscope\'s value is an object containing multiple values, which can be used by other widgets via the property maths syntax',
+ '- `value.do.alpha`: deviceorientation event alpha',
+ '- `value.do.beta`: deviceorientation event beta',
+ '- `value.do.gamma`: deviceorientation event gamma',
+ '- `value.do.absolute`: deviceorientation event absolute',
+ '- `value.dm.x`: devicemotion event acceleration x',
+ '- `value.dm.y`: devicemotion event acceleration y',
+ '- `value.dm.z`: devicemotion event acceleration z',
+ '- `value.dm.gx`: devicemotion event accelerationIncludingGravity x',
+ '- `value.dm.gy`: devicemotion event accelerationIncludingGravity y',
+ '- `value.dm.gz`: devicemotion event accelerationIncludingGravity z',
+ '- `value.dm.alpha`: devicemotion event rotationRate alpha',
+ '- `value.dm.beta`: devicemotion event rotationRate beta',
+ '- `value.dm.gamma`: devicemotion event rotationRate gamma'
+ ]},
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+ ${raw(icon('compass'))}
+
+ `})
+
+ this.sensor = new GyroNorm()
+ this.sensor.init({
+
+ frequency: 1000 / clip(this.getProp('frequency'), [0.01, 60]),
+ gravityNormalized: this.getProp('normalize'),
+ orientationBase: this.getProp('compass') ? GyroNorm.WORLD : GyroNorm.GAME,
+ decimalCount: this.getProp('precision'),
+ screenAdjusted: this.getProp('screenAdjusted'),
+ logger: null
+
+ }).then(()=>{
+
+ this.sensor.start((data)=>{
+
+ this.setValue(data, {sync: true, send: true})
+
+ // data.do.alpha ( deviceorientation event alpha value )
+ // data.do.beta ( deviceorientation event beta value )
+ // data.do.gamma ( deviceorientation event gamma value )
+ // data.do.absolute ( deviceorientation event absolute value )
+
+ // data.dm.x ( devicemotion event acceleration x value )
+ // data.dm.y ( devicemotion event acceleration y value )
+ // data.dm.z ( devicemotion event acceleration z value )
+
+ // data.dm.gx ( devicemotion event accelerationIncludingGravity x value )
+ // data.dm.gy ( devicemotion event accelerationIncludingGravity y value )
+ // data.dm.gz ( devicemotion event accelerationIncludingGravity z value )
+
+ // data.dm.alpha ( devicemotion event rotationRate alpha value )
+ // data.dm.beta ( devicemotion event rotationRate beta value )
+ // data.dm.gamma ( devicemotion event rotationRate gamma value )
+
+
+ })
+
+ }).catch((e)=>{
+
+ console.log(e)
+
+ })
+
+ }
+
+
+
+ setValue(v, options={} ) {
+
+ this.value = v
+
+ // if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+
+ onRemove() {
+
+ this.sensor.end()
+
+ super.onRemove()
+
+ }
+
+
+}
+
+module.exports = Gyroscope
diff --git a/src/client/app/widgets/inputs/input.js b/src/client/app/widgets/inputs/input.js
new file mode 100644
index 00000000..5bf6f40a
--- /dev/null
+++ b/src/client/app/widgets/inputs/input.js
@@ -0,0 +1,152 @@
+var Canvas = require('../common/canvas'),
+ {deepCopy} = require('../../utils'),
+ html = require('nanohtml')
+
+module.exports = class Input extends Canvas {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _input:'input',
+
+ vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'},
+ align: {type: 'string', value: '', help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
+ unit: {type: 'string', value: '', help: 'Unit will be appended to the displayed widget\'s value (it doesn\'t affect osc messages)'},
+ editable: {type: 'boolean', value: true, help: 'Set to `false` to make the input non-editable'}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+
+
+ `})
+
+ this.value = ''
+ this.stringValue = ''
+ this.focused = false
+
+ if (this.getProp('vertical')) this.widget.classList.add('vertical')
+ if (this.getProp('align') === 'left') this.widget.classList.add('left')
+ if (this.getProp('align') === 'right') this.widget.classList.add('right')
+
+
+ if (this.getProp('editable')) {
+ this.canvas.setAttribute('tabindex', 0)
+ this.canvas.addEventListener('focus', this.focus.bind(this))
+ this.input = html``
+ this.input.addEventListener('blur', (e)=>{
+ this.blur(false)
+ })
+ this.input.addEventListener('keydown', (e)=>{
+ if (e.keyCode==13) this.blur()
+ if (e.keyCode==27) this.blur(false)
+ })
+ } else {
+ this.widget.classList.add('not-editable')
+ }
+
+ }
+
+ focus() {
+
+ if (this.focused) return
+ this.focused = true
+
+ this.canvas.setAttribute('tabindex','-1')
+ this.input.value = this.stringValue
+ this.widget.insertBefore(this.input, this.canvas)
+ this.input.focus()
+
+ }
+
+ blur(change=true) {
+
+ if (!this.focused) return
+ this.focused = false
+
+ if (change) this.inputChange()
+
+ this.canvas.setAttribute('tabindex','0')
+ this.widget.removeChild(this.input)
+
+ }
+
+ inputChange() {
+
+ this.setValue(this.input.value, {sync:true, send:true})
+
+ }
+
+ resizeHandle(event){
+
+ super.resizeHandle(event)
+
+ if (this.getProp('vertical')){
+
+ var ratio = CANVAS_SCALING * this.scaling
+
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0)
+ this.ctx.rotate(-Math.PI/2)
+ this.ctx.translate(-this.height * ratio, 0)
+
+
+ if (ratio != 1) this.ctx.scale(ratio, ratio)
+ }
+
+
+ }
+
+ setValue(v, options={} ) {
+
+ try {
+ this.value = JSON.parse(v)
+ } catch (err) {
+ this.value = v
+ }
+
+ this.stringValue = this.getStringValue()
+ this.batchDraw()
+
+ if (options.send && !options.fromSync) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+
+ draw() {
+
+ var v = this.stringValue,
+ width = this.getProp('vertical') ? this.height : this.width,
+ height = !this.getProp('vertical') ? this.height : this.width
+
+ if (this.getProp('unit') && v.length) v += ' ' + this.getProp('unit')
+
+ this.clear()
+
+ this.ctx.fillStyle = this.colors.text
+
+ if (this.textAlign == 'center') {
+ this.ctx.fillText(v, Math.round(width/2), Math.round(height/2))
+ } else if (this.textAlign == 'right') {
+ this.ctx.fillText(v, width, Math.round(height/2))
+ } else {
+ this.ctx.fillText(v, 0, Math.round(height/2))
+ }
+
+ this.clearRect = [0, 0, width, height]
+
+ }
+
+ getStringValue() {
+ if (this.value === undefined) return ''
+ return typeof this.value != 'string' ?
+ JSON.stringify(deepCopy(this.value, this.precision)).replace(/,/g, ', ') :
+ this.value
+ }
+
+}
diff --git a/src/client/app/widgets/inputs/keys.js b/src/client/app/widgets/inputs/keys.js
new file mode 100644
index 00000000..772a3749
--- /dev/null
+++ b/src/client/app/widgets/inputs/keys.js
@@ -0,0 +1,142 @@
+var Widget = require('../common/widget'),
+ {icon} = require('../../ui/utils'),
+ keyboardJS = require('keyboardjs'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+class Keys extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _keys:'keys',
+
+ binding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see KeyboardJS documentation)'},
+ keydown: {type: 'string', value: '', help: [
+ 'This property is evaluated each time the key combo is pressed. Formulas are given extras variables in this context:',
+ '- `key`: pressed key name (usefull for handling multiple keys with a single keys widget)',
+ '- `ctrl`: control key state',
+ '- `alt`: alt key state',
+ '- `shift`: shift key state',
+ '- `super`: command/windows key state'
+ ]},
+ keyup: {type: 'string', value: '', help: 'Same as `keydown`, but evaluated when releasing the key combo'},
+ repeat: {type: 'boolean', value: true, help: 'Set to `false` to prevent keydown repeats when holding the key combo pressed'},
+
+ })
+
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+ ${raw(icon('keyboard'))}
+
+ `})
+
+ if (this.getProp('binding')) {
+
+ this.widget.appendChild(html`${this.getProp('binding')}`)
+
+ this.keyDownHandler = this.keyDown.bind(this)
+ this.keyUpHandler = this.keyUp.bind(this)
+
+ keyboardJS.bind(this.getProp('binding'), this.keyDownHandler, this.keyUpHandler)
+
+ }
+
+ }
+
+ onRemove() {
+
+ super.onRemove()
+
+ if (this.getProp('binding')) {
+
+ keyboardJS.unbind(this.getProp('binding'), this.keyDownHandler, this.keyUpHandler)
+
+ }
+
+ }
+
+ keyDown(e) {
+
+ if (e.target.classList.contains('no-keybinding')) return
+
+ if (!this.getProp('repeat') && e) e.preventRepeat()
+
+ if (this.getProp('keydown') !== '') {
+
+ var context = {
+ key: e.key,
+ ctrl: e.ctrlKey,
+ shift: e.shiftKey,
+ alt: e.altKey,
+ meta: e.metaKey
+ }
+
+ this.setValue(this.resolveProp('keydown', undefined, false, false, false, context), {sync: true, send: true})
+
+ }
+
+
+ this.showKeydown()
+
+ }
+
+
+ keyUp(e) {
+
+ if (e.target.classList.contains('no-keybinding')) return
+
+ if (this.getProp('keyup') !== '') {
+
+ var context = {
+ key: e.key,
+ ctrl: e.ctrlKey,
+ shift: e.shiftKey,
+ alt: e.altKey,
+ meta: e.metaKey
+ }
+
+ this.setValue(this.resolveProp('keyup', undefined, false, false, false, context), {sync: true, send: true})
+
+ }
+
+ this.showKeyup()
+
+ }
+
+ showKeydown(){
+
+ this.widget.style.setProperty('--opacity', 1)
+
+ }
+
+ showKeyup(){
+
+ this.widget.style.setProperty('--opacity', 0.75)
+
+ }
+
+ setValue(v, options = {}) {
+
+ this.value = v
+
+ // if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+
+}
+
+Keys.dynamicProps = Keys.prototype.constructor.dynamicProps.concat(
+ 'keydown',
+ 'keyup',
+ 'repeat'
+)
+
+module.exports = Keys
diff --git a/src/client/app/widgets/inputs/script.js b/src/client/app/widgets/inputs/script.js
new file mode 100644
index 00000000..5676e496
--- /dev/null
+++ b/src/client/app/widgets/inputs/script.js
@@ -0,0 +1,95 @@
+var Widget = require('../common/widget'),
+ widgetManager = require('../../managers/widgets'),
+ {icon} = require('../../ui/utils'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+
+class Script extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _script:'script',
+
+ condition: {type: 'string', value: 1, help: [
+ 'When the widget receives a value, if this property return a falsy value, the script property won\'t be evaluated. If it\'s non-falsy, it will be evaluated normally. Formulas are given one extra variable in this context:',
+ '- `value`: the value received by the widget'
+ ]},
+ script: {type: 'string', value: '', help: [
+ 'This property is evaluated each time the widget receives a value if condition is non-falsy. Formulas are given extras variables in this context:',
+ '- `value`: the value received by the widget',
+ '- `send(target, address, arg1, arg2, ...)`: function for sending osc messages (ignores the script\'s targets and the server\'s defaults unless `target` is `false`; ignores the script\'s `preArgs`)',
+ '- `set(id, value)`: function for setting a widget\'s value'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+ ${raw(icon('code'))}
+
+ `})
+
+ }
+
+
+ static scriptSet(id, value, options) {
+
+ var widgets = widgetManager.getWidgetById(id)
+
+ for (var i = widgets.length - 1; i >= 0; i--) {
+
+ return widgets[i].setValue(value, options)
+
+ }
+
+ }
+
+ scriptSend(target, address, ...args) {
+
+ var overrides = {
+ address,
+ v: args,
+ preArgs: []
+ }
+
+ if (target) overrides.target = Array.isArray(target) ? target : [target]
+
+ this.sendValue(overrides)
+
+ }
+
+
+ setValue(v, options={} ) {
+
+ var context = {
+ value: v,
+ send: options.send ? this.scriptSend.bind(this) : ()=>{},
+ set: (id, value)=>{Script.scriptSet(id, value, options)},
+ log: console.log
+ }
+
+ var condition = this.resolveProp('condition', undefined, false, false, false, {value: v})
+
+ if (condition) this.resolveProp('script', undefined, false, false, false, context)
+
+ // if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+
+
+}
+
+Script.dynamicProps = Script.prototype.constructor.dynamicProps.concat(
+ 'condition',
+ 'script'
+)
+
+module.exports = Script
diff --git a/src/client/app/widgets/maths/formula.js b/src/client/app/widgets/maths/formula.js
new file mode 100644
index 00000000..a3a9c4ca
--- /dev/null
+++ b/src/client/app/widgets/maths/formula.js
@@ -0,0 +1,197 @@
+var Widget = require('../common/widget'),
+ widgetManager = require('../../managers/widgets'),
+ {math} = require('../utils'),
+ Input = require('../inputs/input'),
+ html = require('nanohtml')
+
+
+module.exports = class Formula extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _formula: 'formula',
+
+ formula: {type: 'string', value: '', help: ''},
+ condition: {type: 'string', value: '', help: ''},
+ unit: {type: 'string', value: '', help: ''},
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+
+ `})
+
+
+ this.formulaString = String(this.getProp('formula'))
+ this.conditionString = String(this.getProp('condition'))
+
+ this.input = new Input({
+ props:{
+ ...Input.defaults()._props(),
+ editable:false,
+ precision:this.getProp('precision'),
+ unit: this.getProp('unit')
+ },
+ parent:this, parentNode:this.widget
+ })
+
+ this.widget.appendChild(this.input.widget)
+
+ this.linkedWidgets = []
+
+ if (this.formulaString.length) {
+
+ if (this.formulaString.match(/\$\{([^}]*)\}/g) != null) this.linkedWidgets = this.linkedWidgets.concat(this.formulaString.match(/\$\{([^}]*)\}/g).map((a)=>{return a.substr(2, a.length - 3)}))
+
+ }
+
+ if (this.conditionString.length) {
+
+ if (this.conditionString.match(/\$\{([^}]*)\}/g) != null) this.linkedWidgets = this.linkedWidgets.concat(this.conditionString.match(/\$\{([^}]*)\}/g).map((a)=>{return a.substr(2, a.length - 3)}))
+
+ }
+
+
+ try {
+
+ this.condition = math.compile(this.conditionString.replace(/\$\{([^}]*)\}/g, '_$1'))
+ delete this.errors.condition
+
+ } catch(err) {
+
+ this.errors.condition = 'Error parsing formula "' + this.conditionString + '" (' + err + ')'
+
+ }
+
+ try {
+
+ this.formula = math.compile(this.formulaString.replace(/\$\{([^}]*)\}/g, '_$1'))
+ delete this.errors.formula
+
+ } catch(err) {
+
+ this.errors.formula = 'Error parsing formula "' + this.conditionString + '" (' + err + ')'
+
+ }
+
+ this.conditionState = true
+
+
+ widgetManager.on('change', this.syncHandle.bind(this), {context: this})
+
+ if (this.formulaString.length) this.updateValue({options:{}})
+
+ }
+
+ syncHandle(e) {
+
+ if (this.linkedWidgets.indexOf(e.id)==-1 || !widgetManager.getWidgetById(e.id).length) return
+ this.updateValue(e)
+
+ }
+
+ updateValue(e){
+
+ var variables = {}
+
+ for (let id of this.linkedWidgets) {
+ if (id !== undefined) {
+ variables['_'+id] = 0
+ let widgets = widgetManager.getWidgetById(id)
+ for (let w of widgets) {
+ if (w.getValue) {
+ variables['_'+id] = w.getValue()
+ break
+ }
+ }
+
+ }
+ }
+
+ if (this.conditionString.length) {
+
+ try {
+
+ var s = this.condition.eval(variables).valueOf()
+
+ if (Array.isArray(s) && s.length == 1) s = s[0]
+
+ this.conditionState = s.data !== undefined ? s.data : s
+
+ delete this.errors.condition
+
+ } catch(err) {
+
+ this.errors.condition = 'Error parsing formula "' + this.conditionString + '" (' + err + ')'
+ this.conditionState = false
+ }
+
+ }
+
+ try {
+
+ var v = this.formula.eval(variables).valueOf()
+
+ if (Array.isArray(v) && v.length == 1) v = v[0]
+
+ this.value = v.data ? v.data : v
+
+ this.showValue()
+
+ if (e.options.sync && this.conditionState) this.changed(e.options)
+ if (e.options.send && this.conditionState) this.sendValue()
+
+ delete this.errors.formula
+
+ } catch(err) {
+
+ this.errors.formula = 'Error parsing formula "' + this.formulaString + '" (' + err + ')'
+ this.value = undefined
+
+ }
+
+ }
+
+ showValue() {
+
+ this.input.setValue(this.value)
+
+ if (this.getProp('condition').length && !this.conditionState) {
+ this.input.stringValue = '* ' + this.input.stringValue
+ this.input.batchDraw()
+ }
+
+ }
+
+ getSplit() {
+
+ return typeof this.getProp('split') == 'object' && this.getProp('split').length ? this.getProp('split') : false
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ if (this.input) this.input.onPropChanged('color')
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.input.onRemove()
+ super.onRemove()
+ }
+}
diff --git a/src/client/app/widgets/matrices/_matrix_base.js b/src/client/app/widgets/matrices/_matrix_base.js
new file mode 100644
index 00000000..49c65839
--- /dev/null
+++ b/src/client/app/widgets/matrices/_matrix_base.js
@@ -0,0 +1,45 @@
+var Container = require('../common/container'),
+ {enableTraversingGestures} = require('../../events/drag'),
+ html = require('nanohtml')
+
+
+module.exports = class _matrix_base extends Container {
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ this.value = []
+
+ this.start = parseInt(this.getProp('start'))
+
+ this.on('change',(e)=>{
+
+ if (e.widget == this) return
+
+ this.value[DOM.index(e.widget.container)] = e.widget.getValue()
+ this.changed(e.options)
+
+ })
+
+ if (this.getProp('traversing')) enableTraversingGestures(this.widget)
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of this.children) {
+ if (w) w.onPropChanged('color')
+ }
+ return
+
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/matrices/keyboard.js b/src/client/app/widgets/matrices/keyboard.js
new file mode 100644
index 00000000..9ad7a01e
--- /dev/null
+++ b/src/client/app/widgets/matrices/keyboard.js
@@ -0,0 +1,104 @@
+var _matrix_base = require('./_matrix_base'),
+ parser = require('../../parser')
+
+
+module.exports = class Keyboard extends _matrix_base {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _matrix: 'matrix',
+
+ keys: {type: 'number', value: 25, help: 'Defines the number keys'},
+ start: {type: 'number', value: 48, help: [
+ 'MIDI note number to start with (default is C4)',
+ 'Standard keyboards settings are: `[25, 48]`, `[49, 36]`, `[61, 36]`, `[88, 21]`'
+ ]},
+ traversing: {type: 'boolean', value: true, help: 'Set to `false` to disable traversing gestures'},
+ on: {type: '*', value: 1, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ off: {type: '*', value: 0, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+
+ }, ['_value', 'default', 'value'], {
+
+ split: {type: 'boolean|string', value: false, help: [
+ '`true`: the widget\'s index will be appended to the matrice\'s osc address',
+ '`false`: it will be prepended to the widget\'s preArgs',
+ '`string`: will be used to define the widgets\' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\\$`))'
+ ]},
+ css: {type: 'string', value: '', help: [
+ 'Available CSS variables:',
+ '- `--color-white:color;` (white keys color)',
+ '- `--color-black:color;` (black keys color)'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.keys = parseInt(this.getProp('keys'))
+
+ var strData = JSON.stringify(options.props),
+ pattern = 'wbwbwwbwbwbw',
+ whiteKeys = 0, whiteKeys2 = 0, i
+
+ for (i = this.start; i < this.keys + this.start && i < 109; i++) {
+ if (pattern[i % 12] == 'w') whiteKeys++
+ }
+
+ for (i = this.start; i < this.keys + this.start && i < 109; i++) {
+
+ var data = JSON.parse(strData)
+
+ data.top = data.left = data.height = data.width = 'auto'
+ data.type = 'push'
+ data.id = this.getProp('id') + '/' + i
+ data.label = false
+ data.css = ''
+
+ if (!this.getProp('split')) {
+ data.address = '@{parent.address}'
+ data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
+ } else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
+ data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
+ data.preArgs = '@{parent.preArgs}'
+ } else if (this.getProp('split')) {
+ data.address = '@{parent.address}/' + i
+ data.preArgs = '@{parent.preArgs}'
+ }
+
+ var key = parser.parse({
+ data: data,
+ parentNode: this.widget,
+ parent: this
+ })
+
+ key.container.classList.add('not-editable')
+
+ if (pattern[i % 12] == 'w') {
+ key.container.classList.add('white')
+ key.container.style.width = `${100/whiteKeys}%`
+ whiteKeys2++
+ } else {
+ key.container.classList.add('black')
+ key.container.style.width = `${60 / whiteKeys}%`
+ key.container.style.left = `${100 / whiteKeys * (whiteKeys2 - 3/10)}%`
+ }
+
+ this.value[i-this.start] = this.getProp('off')
+
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/matrices/matrix.js b/src/client/app/widgets/matrices/matrix.js
new file mode 100644
index 00000000..7705ac21
--- /dev/null
+++ b/src/client/app/widgets/matrices/matrix.js
@@ -0,0 +1,110 @@
+var _matrix_base = require('./_matrix_base'),
+ parser = require('../../parser')
+
+class Matrix extends _matrix_base {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _matrix: 'matrix',
+
+ widgetType: {type: 'string', value: 'toggle', help: 'Defines the type of the widgets in the matrix'},
+ matrix: {type: 'array', value: [2,2], help: 'Defines the number of columns and and rows in the matrix'},
+ start: {type: 'integer', value: 0, help: 'First widget\'s index'},
+ spacing: {type: 'integer', value: 0, help: 'Adds space between widgets'},
+ traversing: {type: 'boolean', value: true, help: 'Set to `false` to disable traversing gestures'},
+ border: {type: 'boolean', value: true, help: 'Set to `false` to disables the widgets\' borders'},
+ props: {type: 'object', value: {}, help: [
+ 'Defines a set of property to override the widgets\' defaults.',
+ 'Formulas in this field are resolved with an extra variable representing each widget\'s index: `$`'
+ ]}
+
+ }, [], {})
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.widget.style.setProperty('--columns', this.getProp('matrix')[0])
+ this.widget.style.setProperty('--rows', this.getProp('matrix')[1])
+ this.widget.style.setProperty('--spacing', this.getProp('spacing') + 'rem')
+
+ if (this.getProp('borders') === false) this.widget.classList.add('noborders')
+
+ if (parser.widgets[this.getProp('widgetType')]) {
+
+ for (var i = this.start; i < this.getProp('matrix')[0] * this.getProp('matrix')[1] + this.start; i++) {
+
+ var props = this.resolveProp('props', undefined, false, false, false, {'$':i})
+ var data = {
+ type: this.getProp('widgetType'),
+ id: this.getProp('id') + '/' + i,
+ label: i,
+ top: 'auto',
+ left: 'auto',
+ height: 'auto',
+ width: 'auto'
+ }
+ if (typeof props === 'object' && props !== null) {
+ Object.assign(data, props)
+ }
+
+ var widget = parser.parse({
+ data: data,
+ parentNode: this.widget,
+ parent: this
+ })
+
+ widget.container.classList.add('not-editable')
+
+ this.value[i-this.start] = widget.getValue()
+
+ }
+
+ } else {
+
+ this.errors.widgetType = this.getProp('widgetType') + ' is not a valid widget type'
+
+ }
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'props':
+
+
+ for (let i = this.children.length - 1; i >= 0; i--) {
+
+ let data = this.resolveProp('props', undefined, false, false, false, {'$':i})
+
+ if (typeof data === 'object' && data !== null) {
+ Object.assign(this.children[i].props, data)
+ }
+ this.children[i].updateProps(Object.keys(data), this)
+ // this.children[i] might have been recreated
+ this.children[i].container.classList.add('not-editable')
+
+ }
+
+ return
+
+ }
+
+ }
+
+}
+
+
+Matrix.dynamicProps = Matrix.prototype.constructor.dynamicProps.concat(
+ 'props'
+)
+
+module.exports = Matrix
diff --git a/src/client/app/widgets/matrices/multifader.js b/src/client/app/widgets/matrices/multifader.js
new file mode 100644
index 00000000..31182e4d
--- /dev/null
+++ b/src/client/app/widgets/matrices/multifader.js
@@ -0,0 +1,99 @@
+var _matrix_base = require('./_matrix_base'),
+ parser = require('../../parser')
+
+module.exports = class Multifader extends _matrix_base {
+
+ static defaults() {
+
+
+ return super.defaults({
+
+ _matrix:'matrix',
+
+ strips: {type: 'integer', value: 2, help: [
+ 'Number of faders in the row, each fader will inherit its parent\'s properties and the following ones (where i is the fader\'s index in the row)',
+ '- `id`: same as the widget\'s with /i appended to it',
+ '- `label`: i',
+ '- `address`: see split',
+ ]},
+ start: {type: 'integer', value: 0, help: 'First widget\'s index'},
+ traversing: {type: 'boolean', value: true, help: 'Set to `false` to disable traversing gestures'},
+
+ _fader: 'fader',
+
+ range: {type: 'object', value: {min:0,max:1}, help: 'See fader\'s `range`'},
+ logScale: {type: 'boolean', value: false, help: 'See fader\'s `logScale`'},
+ origin: {type: 'number', value: 'auto', help: 'See fader\'s `origin`'},
+ unit: {type: 'string', value: '', help: 'See fader\'s `unit`'},
+ alignRight: {type: 'boolean', value: false, help: 'See fader\'s `alignRight`'},
+ horizontal: {type: 'boolean', value: false, help: 'See fader\'s `horizontal`'},
+ pips: {type: 'boolean', value: false, help: 'See fader\'s `pips`'},
+ dashed: {type: 'boolean', value: false, help: 'See fader\'s `dashed`'},
+ snap: {type: 'boolean', value: true, help: 'See fader\'s `snap`'},
+ meter: {type: 'boolean', value: false, help: 'See fader\'s `meter`'},
+ input: {type: 'boolean', value: true, help: 'See fader\'s `input`'},
+ compact: {type: 'boolean', value: false, help: 'See fader\'s `compact`'},
+
+ }, [], {
+
+ split: {type: 'boolean|string', value: false, help: [
+ '- `true`: the widget\'s index will be appended to the matrice\'s osc address',
+ '- `false`: it will be prepended to the widget\'s preArgs',
+ '- `string`: will be used to define the widgets\' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\\$`))'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.strips = parseInt(this.getProp('strips'))
+
+ if (this.getProp('horizontal')) {
+ this.widget.classList.add('horizontal')
+ }
+
+ if (this.getProp('compact')) {
+ this.widget.classList.add('compact')
+ }
+
+ var strData = JSON.stringify(options.props)
+
+ for (var i = this.start; i < this.strips + this.start; i++) {
+
+ var data = JSON.parse(strData)
+
+ data.top = data.left = data.height = data.width = 'auto'
+ data.type = 'fader'
+ data.id = this.getProp('id') + '/' + i
+ data.label = i
+ data.css = ''
+
+ if (!this.getProp('split')) {
+ data.address = '@{parent.address}'
+ data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
+ } else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
+ data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
+ data.preArgs = '@{parent.preArgs}'
+ } else if (this.getProp('split')) {
+ data.address = '@{parent.address}/' + i
+ data.preArgs = '@{parent.preArgs}'
+ }
+
+ var fader = parser.parse({
+ data: data,
+ parentNode: this.widget,
+ parent: this
+ })
+ fader.container.classList.add('not-editable')
+
+ this.value[i-this.start] = this.getProp('range').min
+
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/matrices/multipush.js b/src/client/app/widgets/matrices/multipush.js
new file mode 100644
index 00000000..41bb35a4
--- /dev/null
+++ b/src/client/app/widgets/matrices/multipush.js
@@ -0,0 +1,91 @@
+var _matrix_base = require('./_matrix_base'),
+ parser = require('../../parser')
+
+module.exports = class Multipush extends _matrix_base {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _matrix: 'matrix',
+
+ matrix: {type: 'array', value: [2,2], help: [
+ 'Defines the number of columns and and rows in the matrix. Each cell will contain a push button that will inherit its parent\'s properties and the following ones (where i is the push\'s index)',
+ '- `id`: same as the widget\'s with /i appended to it',
+ '- `label`: i',
+ '- `address`: see split'
+ ]},
+ start: {type: 'integer', value: 0, help: 'First widget\'s index'},
+ traversing: {type: 'boolean', value: true, help: 'Set to `false` to disable traversing gestures'},
+ spacing: {type: 'integer', value: 0, help: 'Adds space between widgets'},
+
+ _push: 'push',
+
+ on: {type: '*', value: 1, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ off: {type: '*', value: 0, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ norelease: {type: 'boolean', value: false, help: 'Set to `true` to prevent sending any osc message when releasing the button'},
+
+ }, ['_value', 'default', 'value'], {
+
+ split: {type: 'boolean|string', value: false, help: [
+ '`true`: the widget\'s index will be appended to the matrice\'s osc address',
+ '`false`: it will be prepended to the widget\'s preArgs',
+ '`string`: will be used to define the widgets\' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\\$`))'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.widget.style.setProperty('--columns', this.getProp('matrix')[0])
+ this.widget.style.setProperty('--rows', this.getProp('matrix')[1])
+ this.widget.style.setProperty('--spacing', this.getProp('spacing') + 'rem')
+
+ var strData = JSON.stringify(options.props)
+
+ for (var i = this.start; i < this.getProp('matrix')[0] * this.getProp('matrix')[1] + this.start; i++) {
+
+ var data = JSON.parse(strData)
+
+ data.top = data.left = data.height = data.width = 'auto'
+ data.type = 'push'
+ data.id = this.getProp('id') + '/' + i
+ data.label = i
+ data.css = ''
+
+ if (!this.getProp('split')) {
+ data.address = '@{parent.address}'
+ data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
+ } else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
+ data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
+ data.preArgs = '@{parent.preArgs}'
+ } else if (this.getProp('split')) {
+ data.address = '@{parent.address}/' + i
+ data.preArgs = '@{parent.preArgs}'
+ }
+
+ var push = parser.parse({
+ data: data,
+ parentNode: this.widget,
+ parent: this
+ })
+
+ push.container.classList.add('not-editable')
+
+ this.value[i-this.start] = this.getProp('off')
+
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/matrices/multitoggle.js b/src/client/app/widgets/matrices/multitoggle.js
new file mode 100644
index 00000000..f78bdc2a
--- /dev/null
+++ b/src/client/app/widgets/matrices/multitoggle.js
@@ -0,0 +1,90 @@
+var _matrix_base = require('./_matrix_base'),
+ parser = require('../../parser')
+
+module.exports = class Multitoggle extends _matrix_base {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _matrix:'matrix',
+
+ matrix: {type: 'array', value: [2,2], help: [
+ 'Defines the number of columns and and rows in the matrix. Each cell will contain a toggle button that will inherit its parent\'s properties and the following ones (where i is the toggle\'s index)',
+ '- `id`: same as the widget\'s with /i appended to it',
+ '- `label`: i',
+ '- `address`: see split'
+ ]},
+ start: {type: 'integer', value: 0, help: 'First widget\'s index'},
+ spacing: {type: 'integer', value: 0, help: 'Adds space between widgets'},
+ traversing: {type: 'boolean', value: true, help: 'Set to `false` to disable traversing gestures'},
+
+ _toggle: 'toggle',
+
+ led: {type: 'boolean', value: false, help: 'Set to `true` to display the toggle\'s state with a led'},
+ on: {type: '*', value: 1, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see preArgs)'
+ ]},
+ off: {type: '*', value: 0, help: [
+ 'Set to `null` to send send no argument in the osc message',
+ 'Can be an `object` if the type needs to be specified (see `preArgs`)'
+ ]},
+
+ }, [], {
+
+ split: {type: 'boolean|string', value: false, help: [
+ '`true`: the widget\'s index will be appended to the matrice\'s osc address',
+ '`false`: it will be prepended to the widget\'s `preArgs`',
+ '`string`: will be used to define the widgets\' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\\$`))'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.widget.style.setProperty('--columns', this.getProp('matrix')[0])
+ this.widget.style.setProperty('--rows', this.getProp('matrix')[1])
+ this.widget.style.setProperty('--spacing', this.getProp('spacing') + 'rem')
+
+ var strData = JSON.stringify(options.props)
+
+ for (var i = this.start; i < this.getProp('matrix')[0] * this.getProp('matrix')[1] + this.start; i++) {
+
+ var data = JSON.parse(strData)
+
+ data.top = data.left = data.height = data.width = 'auto'
+ data.type = 'toggle'
+ data.id = this.getProp('id') + '/' + i
+ data.label = i
+ data.css = ''
+
+ if (!this.getProp('split')) {
+ data.address = '@{parent.address}'
+ data.preArgs = '#{concat(@{parent.preArgs},[' + i + '])}'
+ } else if (typeof this.getProp('split') === 'string' && this.getProp('split')[0] === '/' && /[^\\]\$/.test(this.getProp('split'))) {
+ data.address = this.getProp('split').replace(/([^\\])(\$)/g,'$1' + i).replace(/\\\$/g, '$')
+ data.preArgs = '@{parent.preArgs}'
+ } else if (this.getProp('split')) {
+ data.address = '@{parent.address}/' + i
+ data.preArgs = '@{parent.preArgs}'
+ }
+
+ var toggle = parser.parse({
+ data: data,
+ parentNode: this.widget,
+ parent: this
+ })
+ toggle.container.classList.add('not-editable')
+
+ this.value[i-this.start] = this.getProp('off')
+
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/mixins/double_tap.js b/src/client/app/widgets/mixins/double_tap.js
new file mode 100644
index 00000000..7ad8ceb1
--- /dev/null
+++ b/src/client/app/widgets/mixins/double_tap.js
@@ -0,0 +1,37 @@
+module.exports = (element, callback)=>{
+
+ var lastTapTime = 0,
+ lastTapX,
+ lastTapY
+
+ element.addEventListener('fast-click', (event)=>{
+
+ if (event.capturedByEditor) return
+
+ var tapTime = Date.now(),
+ tapLength = tapTime - lastTapTime,
+ eventData = event.detail
+
+ if (
+
+ tapLength < DOUBLE_TAP_TIME &&
+ Math.abs(lastTapX - eventData.pageX) < 20 &&
+ Math.abs(lastTapY - eventData.pageY) < 20
+
+ ) {
+
+ // execute callback at next cycle to ensure draginit events are resolved first
+ setTimeout(callback, 0)
+ lastTapTime = 0
+
+ } else {
+
+ lastTapTime = tapTime
+ lastTapX = eventData.pageX
+ lastTapY = eventData.pageY
+
+ }
+
+ })
+
+}
diff --git a/src/browser/js/app/widgets/mixins/touch_state.js b/src/client/app/widgets/mixins/touch_state.js
similarity index 69%
rename from src/browser/js/app/widgets/mixins/touch_state.js
rename to src/client/app/widgets/mixins/touch_state.js
index 90b26224..ce3f857d 100644
--- a/src/browser/js/app/widgets/mixins/touch_state.js
+++ b/src/client/app/widgets/mixins/touch_state.js
@@ -1,11 +1,11 @@
-module.exports = (self, element)=>{
+module.exports = (self, options)=>{
var sendTouchState = self.getProp('touchAddress') && self.getProp('touchAddress').length
self.touched = 0
self.setValueTouchedQueue = undefined
- element.on('draginit',(e)=>{
+ self.on('draginit',(e)=>{
self.touched += 1
if (self.touched == 1 && sendTouchState)
self.sendValue({
@@ -13,9 +13,9 @@ module.exports = (self, element)=>{
v:1,
split:false
})
- })
+ }, options)
- element.on('dragend', (e, data, traversing)=>{
+ self.on('dragend', (e)=>{
if (self.touched == 1) {
self.touched = 0
@@ -34,8 +34,18 @@ module.exports = (self, element)=>{
} else if (self.touched > 1){
self.touched -= 1
- if (traversing) self.touched = 1
}
- })
+ }, options)
+
+ self.onRemove = ()=>{
+ if (sendTouchState && self.touched > 0) {
+ self.sendValue({
+ address:self.getProp('touchAddress'),
+ v:0,
+ split:false
+ })
+ }
+ self.__proto__.onRemove.call(self)
+ }
}
diff --git a/src/browser/js/app/widgets/pads/_fake_fader.js b/src/client/app/widgets/pads/_fake_fader.js
similarity index 92%
rename from src/browser/js/app/widgets/pads/_fake_fader.js
rename to src/client/app/widgets/pads/_fake_fader.js
index 58b5f8a1..4ac7cbc7 100644
--- a/src/browser/js/app/widgets/pads/_fake_fader.js
+++ b/src/client/app/widgets/pads/_fake_fader.js
@@ -9,7 +9,7 @@ module.exports = class _fake_fader extends Fader {
if (arguments.cancelDraw) this.noDraw = true
}
- sendValue() {
+ sendValue() {
// disabled
}
diff --git a/src/client/app/widgets/pads/multixy.js b/src/client/app/widgets/pads/multixy.js
new file mode 100644
index 00000000..a777f67c
--- /dev/null
+++ b/src/client/app/widgets/pads/multixy.js
@@ -0,0 +1,272 @@
+var Pad = require('./pad'),
+ Xy = require('./xy'),
+ {clip} = require('../utils'),
+ touchstate = require('../mixins/touch_state')
+
+
+var xyDefaults = Xy.defaults()._props()
+
+
+module.exports = class MultiXy extends Pad {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _mutlixy: 'multi xy',
+
+ points: {type: 'integer|array', value: 2, help: [
+ 'Defines the number of points on the pad',
+ 'Can be an array of strings that will be used as labels for the points (ex: `[\'A\', \'B\']`)'
+ ]},
+
+
+ _xy: 'xy',
+
+ pointSize: {type: 'integer', value: 20, help: 'Defines the points\' size'},
+ snap: {type: 'boolean', value: false, help: [
+ 'By default, the points are dragged from their initial position.',
+ 'If set to `true`, touching anywhere on the widget\'s surface will make them snap to the touching coordinates',
+ ]},
+ spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its default value when released'},
+ pips: {type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
+ rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'},
+ rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},
+ logScaleX: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the x axis (log10)'},
+ logScaleY: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis (log10)'}
+
+ }, [], {
+
+ touchAddress: {type: 'string', value:'', help: 'OSC address for touched state messages: `/touchAddress [preArgs] 0/1`'},
+ split: {type: 'boolean|object', value: false, help: [
+ 'Set to `true` to send separate osc messages for each point\'s x and y axis. The address will be the same as the widget\'s with `/N/x` or `/N/y` appended to it, where N is the point\'s id (or the point\'s label if points is an array)',
+ 'Can be set as an `object` to specify a different address : `[\'/0/x\', \'/0/y\', \'/1/x\', \'/2/y\']`',
+ 'Note: the widget will only respond to its original osc address, not to the splitted version'
+ ]}
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.npoints = typeof this.getProp('points') == 'object' ? this.getProp('points').length : this.getProp('points')
+ this.labels = typeof this.getProp('points') == 'object'
+ this.pointSize = parseInt(this.getProp('pointSize'))
+
+ this.pads = []
+
+ for (let i=this.npoints-1;i>=0;i--) {
+ this.pads[i] = new Xy({props:{
+ ...xyDefaults,
+ snap:this.getProp('snap'),
+ spring:this.getProp('spring'),
+ default:this.getProp('default').length === this.getProp('points') * 2 ? [this.getProp('default')[i*2], this.getProp('default')[i*2 + 1]] : '',
+ rangeX:this.getProp('rangeX'),
+ rangeY:this.getProp('rangeY'),
+ precision:this.getProp('precision'),
+ logScaleX:this.getProp('logScaleX'),
+ logScaleY:this.getProp('logScaleY'),
+ pointSize: this.getProp('pointSize'),
+ pips: this.getProp('pips') && i == this.npoints-1,
+ input:false
+ }, parent: this})
+ this.pads[i].sendValue = ()=>{}
+ this.wrapper.appendChild(this.pads[i].widget)
+
+ }
+
+
+ this.value = []
+
+ this.padsCoords = []
+ this.touchMap = {}
+
+ touchstate(this, {element: this.wrapper, multitouch: true})
+
+ this.on('draginit',(e)=>{
+
+ var id
+
+ if (!this.touchMap[e.pointerId]) {
+
+ var ndiff, diff = -1
+
+ for (var i in this.pads) {
+
+ if (Object.values(this.touchMap).indexOf(i) != -1) continue
+
+ ndiff = Math.abs(e.offsetX - this.padsCoords[i][0]) + Math.abs(e.offsetY - (this.padsCoords[i][1] + this.height))
+
+ if (diff == -1 || ndiff < diff) {
+ id = i
+ diff = ndiff
+ }
+
+ }
+
+ this.touchMap[e.pointerId] = id
+
+
+ }
+
+ if (!id) return
+
+ e.stopPropagation = true
+
+ this.pads[id].trigger('draginit', e)
+
+ }, {element: this.wrapper, multitouch: true})
+
+ this.on('drag',(e)=>{
+
+ var i = this.touchMap[e.pointerId]
+
+ this.pads[i].trigger('drag', e)
+
+ }, {element: this.wrapper[0], multitouch: true})
+
+ this.on('dragend',(e)=>{
+
+ var i = this.touchMap[e.pointerId]
+
+ e.stopPropagation = true
+
+ this.pads[i].trigger('dragend', e)
+
+ delete this.touchMap[e.pointerId]
+
+ }, {element: this.wrapper, multitouch: true})
+
+ this.on('change',(e)=>{
+ if (e.widget == this) return
+ e.stopPropagation = true
+ this.setValue(this.getValue(), e.options)
+ })
+
+
+ var v = []
+ for (let i = 0; i < this.npoints * 2; i = i + 2) {
+ [v[i],v[i+1]] = this.pads[i/2].getValue()
+ }
+
+ this.setValue(v)
+
+ }
+
+ resizeHandle() {
+
+ super.resizeHandle(...arguments)
+ this.updateHandlesPosition()
+
+ }
+
+ updateHandlesPosition() {
+
+ for (var i=0;i{
+ var s={},
+ t
+ for (var i=0; i
+
+
+
+
+ `})
+
+ this.wrapper = DOM.get(this.widget, '.wrapper')[0]
+
+ this.pointSize = parseInt(this.getProp('pointSize'))
+ this.widget.style.setProperty('--pointSize', this.pointSize + 'rem')
+
+ }
+
+}
+
+Pad.dynamicProps = Pad.prototype.constructor.dynamicProps.filter(n => n !== 'precision')
+
+module.exports = Pad
diff --git a/src/client/app/widgets/pads/rgb.js b/src/client/app/widgets/pads/rgb.js
new file mode 100644
index 00000000..c604ae32
--- /dev/null
+++ b/src/client/app/widgets/pads/rgb.js
@@ -0,0 +1,227 @@
+var Pad = require('./pad'),
+ Xy = require('./xy'),
+ Fader = require('./_fake_fader'),
+ {clip, hsbToRgb, rgbToHsb} = require('../utils'),
+ Input = require('../inputs/input'),
+ html = require('nanohtml')
+
+var faderDefaults = Fader.defaults()._props(),
+ xyDefaults = Xy.defaults()._props()
+
+module.exports = class Rgb extends Pad {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _rgb:'rgb',
+
+ snap: {type: 'boolean', value: false, help: [
+ 'By default, the points are dragged from their initial position.',
+ 'If set to `true`, touching anywhere on the widget\'s surface will make them snap to the touching coordinates',
+ ]},
+ spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its default value when released'},
+ range: {type: 'object', value: {min: 0, max: 255}, help: 'Defines the widget\'s output scale.'},
+ input: {type: 'boolean', value: true, help: 'Set to `false` to hide the built-in input widget'},
+
+ }, ['color'], {
+
+ split: {type: 'boolean|object', value: false, help: [
+ 'Set to `true` to send separate osc messages for for r and g & b. The address will be the same as the widget\'s with `/r`, `/g` or `/b` appended to it',
+ 'Can be set as an `object` to specify a different address : `[\'/r\', \'/g\', \'b\']`',
+ 'Note: the widget will only respond to its original osc address, not to the splitted version'
+ ]}
+ })
+
+ }
+
+ constructor(options) {
+
+ options.props.pointSize = 10
+
+ super(options)
+
+ this.hueWrapper = this.widget.appendChild(html``)
+
+ this.hue = new Fader({props:{
+ ...faderDefaults,
+ id:'h',
+ compact:true,
+ pips:false,
+ horizontal:true,
+ snap:this.getProp('snap'),
+ range:{min:0,max:360},
+ input:false,
+ precision:2
+ }, cancelDraw: false, parent: this})
+ this.hue.margin = this.pointSize
+ this.hue.sendValue = ()=>{}
+ this.hueWrapper.appendChild(this.hue.widget)
+
+ this.pad = new Xy({props:{
+ ...xyDefaults,
+ snap:this.getProp('snap'),
+ spring:this.getProp('spring'),
+ rangeX:{min:0,max:100},
+ rangeY:{min:0,max:100},
+ precision:2,
+ pointSize: this.getProp('pointSize'),
+ pips: false,
+ input:false
+ }, parent: this})
+ this.pad.sendValue = ()=>{}
+ this.wrapper.appendChild(this.pad.widget)
+
+
+ this.value = []
+ this.hsb = {h:0,s:0,b:0}
+
+ this.hue.on('change',(e)=>{
+ e.stopPropagation = true
+ this.dragHandle(true)
+ })
+
+ this.pad.on('change',(e)=>{
+ e.stopPropagation = true
+ this.dragHandle()
+ })
+
+ if (this.getProp('input')) {
+
+ this.input = new Input({
+ props:{...Input.defaults()._props(), precision:this.getProp('precision'), unit:this.getProp('unit')},
+ parent:this, parentNode:this.widget
+ })
+ this.widget.appendChild(this.input.widget)
+ this.input.on('change', (e)=>{
+ e.stopPropagation = true
+ this.setValue(this.input.getValue(), {sync:true, send:true})
+ this.showValue()
+ })
+
+ }
+
+ this.setValue([this.getProp('range').min, this.getProp('range').min, this.getProp('range').min])
+
+ }
+
+ dragHandle(hue) {
+ var h = this.hue.value,
+ s = this.pad.value[0],
+ b = this.pad.value[1]
+
+ if (h != this.hsb.h ||s != this.hsb.s || b != this.hsb.b) {
+
+ this.hsb.h = this.hue.value
+ this.hsb.s = this.pad.value[0]
+ this.hsb.b = this.pad.value[1]
+
+ this.update({nohue:!hue})
+
+ var rgb = hsbToRgb(this.hsb),
+ {min, max} = this.getProp('range')
+
+ if (min !== 0 || max !== 255) {
+ for (var k in rgb) {
+ rgb[k] = min + max * rgb[k] / 255
+ }
+ }
+
+ if (rgb.r != this.value[0] || rgb.g != this.value[1] || rgb.b != this.value[2]) {
+ this.setValue([rgb.r, rgb.g, rgb.b],{send:true,sync:true,dragged:true,nohue:!hue})
+ }
+ }
+
+ }
+
+ setValue(v, options={}) {
+
+ if (!v || !v.length || v.length!=3) return
+ if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
+
+ for (let i in [0,1,2]) {
+ v[i] = clip(v[i],[this.getProp('range').min, this.getProp('range').max])
+ }
+
+ var rgb = {r:v[0],g:v[1],b:v[2]},
+ {min, max} = this.getProp('range')
+
+ if (min !== 0 || max !== 255) {
+ for (var k in rgb) {
+ rgb[k] = (rgb[k] - min ) * 255 / max
+ }
+ }
+
+ var hsb = rgbToHsb(rgb)
+
+ if (!options.dragged) {
+ this.pad.setValue([hsb.s, hsb.b], {sync: false, send:false, dragged:false})
+ }
+
+ this.hsb = hsb
+ this.value = v
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ this.update({dragged:options.dragged, nohue:options.nohue || (v[0]==v[1]&&v[1]==v[2])})
+
+ }
+
+ update(options={}) {
+
+ if (!options.nohue && !options.dragged) {
+ var hue = hsbToRgb({h:this.hsb.h,s:100,b:100}),
+ hueStr = `rgb(${Math.round(hue.r)},${Math.round(hue.g)},${Math.round(hue.b)})`
+ this.canvas.setAttribute('style',`background-color:${hueStr}`)
+ this.hue.setValue(this.hsb.h, {sync: false, send:false, dragged:false})
+ }
+
+
+ this.showValue()
+
+ }
+
+ draw() {}
+
+ showValue() {
+
+ if (this.getProp('input')) this.input.setValue(this.value)
+
+ }
+
+ getSplit() {
+
+ return this.getProp('split')?
+ typeof this.getProp('split') == 'object' && this.getProp('split').length == 3 ?
+ this.getProp('split')
+ : [this.getProp('address') + '/r', this.getProp('address') + '/g', this.getProp('address') + '/b']
+ : false
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of [this.hue, this.pad]) {
+ w.onPropChanged('color')
+ }
+ if (this.input) this.input.onPropChanged('color')
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.hue.onRemove()
+ this.pad.onRemove()
+ if (this.input) this.input.onRemove()
+ super.onRemove()
+ }
+
+}
diff --git a/src/client/app/widgets/pads/xy.js b/src/client/app/widgets/pads/xy.js
new file mode 100644
index 00000000..b84b0462
--- /dev/null
+++ b/src/client/app/widgets/pads/xy.js
@@ -0,0 +1,299 @@
+var Pad = require('./pad'),
+ Fader = require('./_fake_fader'),
+ doubletab = require('../mixins/double_tap'),
+ Input = require('../inputs/input'),
+ touchstate = require('../mixins/touch_state')
+
+var faderDefaults = Fader.defaults()._props()
+
+module.exports = class Xy extends Pad {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _xy:'xy',
+
+ pointSize: {type: 'integer', value: 20, help: 'Defines the points\' size'},
+ snap: {type: 'boolean', value: false, help: [
+ 'By default, the points are dragged from their initial position.',
+ 'If set to `true`, touching anywhere on the widget\'s surface will make them snap to the touching coordinates',
+ ]},
+ spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its default value when released'},
+ pips: {type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
+ rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'},
+ rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},
+ logScaleX: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the x axis (log10)'},
+ logScaleY: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis (log10)'},
+ input: {type: 'boolean', value: true, help: 'Set to false to hide the built-in input widget'},
+ doubleTap: {type: 'boolean|string', value: false, help: [
+ 'Set to `true` to make the fader reset to its default value when receiving a double tap.',
+ 'Can also be an osc address, which case the widget will just send an osc message: `/ `'
+ ]},
+
+ }, [], {
+
+ touchAddress: {type: 'string', value:'', help: 'OSC address for touched state messages: `/touchAddress [preArgs] 0/1`)'},
+ split: {type: 'boolean|object', value: false, help: [
+ 'Set to `true` to send separate osc messages for each point\'s x and y axis. The address will be the same as the widget\'s with `/x` or `/y` appended to it',
+ 'Can be set as an `object` to specify a different address : [\'/osc_address_x\', \'/osc_address_y\']',
+ 'Note: the widget will only respond to its original osc address, not to the splitted version'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.faders = {
+ x: new Fader({props:{
+ ...faderDefaults,
+ id:0,
+ compact:true,
+ pips:false,
+ horizontal:true,
+ height:'100%',
+ width:'100%',
+ default:this.getProp('default').length === 2 ? this.getProp('default')[0] : '',
+ snap:this.getProp('snap'),
+ range:this.getProp('rangeX'),
+ origin:'auto',
+ precision:this.getProp('precision'),
+ logScale:this.getProp('logScaleX'),
+ input:false
+ }, cancelDraw: true, parent: this}),
+ y: new Fader({props:{
+ ...faderDefaults,
+ id:1,
+ compact:true,
+ pips:false,
+ horizontal:false,
+ height:'100%',
+ width:'100%',
+ default:this.getProp('default').length === 2 ? this.getProp('default')[1] : '',
+ snap:this.getProp('snap'),
+ range:this.getProp('rangeY'),
+ origin:'auto',
+ precision:this.getProp('precision'),
+ logScale:this.getProp('logScaleY'),
+ input:false
+ }, cancelDraw: true, parent: this}),
+ }
+
+ this.faders.x.margin = this.faders.y.margin = this.pointSize + 1
+
+ this.value = [this.faders.x.value, this.faders.y.value]
+
+ this.wrapper.appendChild(this.faders.x.widget)
+ this.wrapper.appendChild(this.faders.y.widget)
+
+ this.faders.x.on('change',(e)=>{
+ e.stopPropagation = true
+ })
+
+ this.faders.y.on('change',(e)=>{
+ e.stopPropagation = true
+ })
+
+ touchstate(this, {element: this.wrapper})
+
+ this.on('draginit',(e)=>{
+ e.stopPropagation = true
+ this.faders.x.trigger('draginit', e)
+ this.faders.y.trigger('draginit', e)
+ this.dragHandle()
+ }, {element: this.wrapper})
+
+ this.on('drag',(e)=>{
+ this.faders.x.trigger('drag', e)
+ this.faders.y.trigger('drag', e)
+ this.dragHandle()
+ }, {element: this.wrapper})
+
+ this.on('dragend', (e)=>{
+ e.stopPropagation = true
+ this.faders.x.trigger('dragend', e)
+ this.faders.y.trigger('dragend', e)
+ if (this.getProp('spring')) {
+ this.setValue([this.faders.x.springValue,this.faders.y.springValue],{sync:true,send:true})
+ }
+ }, {element: this.wrapper})
+
+ if (this.getProp('doubleTap')) {
+
+ if (typeof this.getProp('doubleTap') === 'string' && this.getProp('doubleTap')[0] === '/') {
+
+ doubletab(this.widget, ()=>{
+ this.sendValue({v:null, address: this.getProp('doubleTap')})
+ })
+
+ } else {
+
+ doubletab(this.wrapper, ()=>{
+ this.faders.x.setValue(this.faders.x.springValue, {sync: false, send:false, dragged:true})
+ this.faders.y.setValue(this.faders.y.springValue, {sync: false, send:false, dragged:true})
+ this.setValue([this.faders.x.springValue,this.faders.y.springValue],{sync:true, send:true})
+ })
+
+ }
+
+ }
+
+ if (this.getProp('input')) {
+
+ this.input = new Input({
+ props:{...Input.defaults()._props(), precision:this.getProp('precision'), unit:this.getProp('unit')},
+ parent:this, parentNode:this.widget
+ })
+ this.widget.appendChild(this.input.widget)
+ this.input.on('change', (e)=>{
+ e.stopPropagation = true
+ this.setValue(this.input.getValue(), {sync:true, send:true})
+ this.showValue()
+ })
+
+ }
+
+ this.setValue([0,0])
+
+ }
+
+ dragHandle(){
+
+ var x = this.faders.x.value,
+ y = this.faders.y.value
+
+
+ if (x != this.value[0] || y != this.value[1]) {
+ this.setValue([x, y],{send:true,sync:true,dragged:true})
+ }
+
+ }
+
+
+ setValue(v, options={}) {
+
+ if (!v || !v.length || v.length!=2) return
+ if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
+
+ if (!options.dragged) {
+ this.faders.x.setValue(v[0], {sync: false, send:false, dragged:false})
+ this.faders.y.setValue(v[1], {sync: false, send:false, dragged:false})
+ }
+
+ this.value = [
+ this.faders.x.value,
+ this.faders.y.value
+ ]
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ this.batchDraw()
+
+ this.showValue()
+
+ }
+
+ draw() {
+
+ var pointSize = this.pointSize * PXSCALE,
+ margin = (this.pointSize + 1) * PXSCALE,
+ x = this.faders.x.percentToCoord(this.faders.x.percent),
+ y = this.faders.y.percentToCoord(this.faders.y.percent)
+
+ this.clear()
+
+ this.ctx.lineWidth = PXSCALE
+ this.ctx.fillStyle = this.colors.custom
+ this.ctx.strokeStyle = this.colors.custom
+
+
+ if (this.getProp('pips')) {
+ this.ctx.globalAlpha = 0.1
+ this.ctx.beginPath()
+ this.ctx.rect(margin + 0.5, margin + 0.5, this.width - margin * 2 - 1, this.height - margin * 2 - 1)
+ this.ctx.stroke()
+
+ this.ctx.beginPath()
+ for (var pip of this.faders.x.rangeKeys.concat(this.faders.x.valueToPercent(this.faders.x.originValue))) {
+ if (pip == 0 || pip == 100) continue
+ var xpip = Math.round(2 * this.faders.x.percentToCoord(pip)) / 2
+ this.ctx.moveTo(xpip, margin + 0.5)
+ this.ctx.lineTo(xpip, this.height - margin - 0.5)
+ }
+ for (pip of this.faders.y.rangeKeys.concat(this.faders.y.valueToPercent(this.faders.y.originValue))) {
+ if (pip == 0 || pip == 100) continue
+ var ypip = Math.round(2 * this.faders.y.percentToCoord(pip)) / 2
+ this.ctx.moveTo(margin + 0.5, ypip)
+ this.ctx.lineTo(this.width - margin - 0.5, ypip)
+ }
+ this.ctx.stroke()
+
+ } else {
+
+ this.clearRect = [x - margin, y - margin, margin * 2, margin * 2]
+
+ }
+
+
+ this.ctx.globalAlpha = 0.7
+
+ this.ctx.beginPath()
+ this.ctx.arc(x, y, pointSize, Math.PI * 2, false)
+ this.ctx.stroke()
+
+ this.ctx.globalAlpha = 1
+ this.ctx.lineWidth = 1.5 * PXSCALE
+
+ this.ctx.beginPath()
+ this.ctx.arc(x, y, pointSize / 1.5, Math.PI * 2, false)
+ this.ctx.stroke()
+
+ }
+
+ showValue() {
+
+ if (this.getProp('input')) this.input.setValue(this.value)
+
+ }
+
+ getSplit() {
+
+ return this.getProp('split')?
+ typeof this.getProp('split') == 'object' && this.getProp('split').length == 2 ?
+ this.getProp('split')
+ : [this.getProp('address') + '/x', this.getProp('address') + '/y']
+ : false
+
+ }
+
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of [this.faders.x, this.faders.y]) {
+ w.onPropChanged('color')
+ }
+ if (this.input) this.input.onPropChanged('color')
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.faders.x.onRemove()
+ this.faders.y.onRemove()
+ if (this.input) this.input.onRemove()
+ super.onRemove()
+ }
+
+}
diff --git a/src/browser/js/app/widgets/plots/_biquad_response.js b/src/client/app/widgets/plots/_biquad_response.js
similarity index 92%
rename from src/browser/js/app/widgets/plots/_biquad_response.js
rename to src/client/app/widgets/plots/_biquad_response.js
index 7efdd8a7..f3345a96 100644
--- a/src/browser/js/app/widgets/plots/_biquad_response.js
+++ b/src/client/app/widgets/plots/_biquad_response.js
@@ -8,13 +8,13 @@ module.exports = function(options,linear,resolution) {
var {type, freq, q, gain} = options,
Fs = 44100,
a0,a1,a2,b1,b2,norm,
- ymin, ymax, minVal, maxVal,
+ minVal, maxVal,
len = resolution
var V = Math.pow(10, Math.abs(gain) / 20)
var K = Math.tan(Math.PI * freq / Fs)
switch (type) {
- case "lowpass":
+ case 'lowpass':
norm = 1 / (1 + K / q + K * K)
a0 = K * K * norm
a1 = 2 * a0
@@ -23,7 +23,7 @@ module.exports = function(options,linear,resolution) {
b2 = (1 - K / q + K * K) * norm
break
- case "highpass":
+ case 'highpass':
norm = 1 / (1 + K / q + K * K)
a0 = 1 * norm
a1 = -2 * a0
@@ -32,7 +32,7 @@ module.exports = function(options,linear,resolution) {
b2 = (1 - K / q + K * K) * norm
break
- case "bandpass":
+ case 'bandpass':
norm = 1 / (1 + K / q + K * K)
a0 = K / q * norm
a1 = 0
@@ -41,7 +41,7 @@ module.exports = function(options,linear,resolution) {
b2 = (1 - K / q + K * K) * norm
break
- case "notch":
+ case 'notch':
norm = 1 / (1 + K / q + K * K)
a0 = (1 + K * K) * norm
a1 = 2 * (K * K - 1) * norm
@@ -50,7 +50,7 @@ module.exports = function(options,linear,resolution) {
b2 = (1 - K / q + K * K) * norm
break
- case "peak":
+ case 'peak':
if (gain >= 0) {
norm = 1 / (1 + 1/q * K + K * K)
a0 = (1 + V/q * K + K * K) * norm
@@ -68,7 +68,7 @@ module.exports = function(options,linear,resolution) {
b2 = (1 - V/q * K + K * K) * norm
}
break
- case "lowshelf":
+ case 'lowshelf':
if (gain >= 0) {
norm = 1 / (1 + Math.SQRT2 * K + K * K)
a0 = (1 + Math.sqrt(2*V) * K + V * K * K) * norm
@@ -86,7 +86,7 @@ module.exports = function(options,linear,resolution) {
b2 = (1 - Math.sqrt(2*V) * K + V * K * K) * norm
}
break
- case "highshelf":
+ case 'highshelf':
if (gain >= 0) {
norm = 1 / (1 + Math.SQRT2 * K + K * K)
a0 = (V + Math.sqrt(2*V) * K + K * K) * norm
@@ -110,9 +110,9 @@ module.exports = function(options,linear,resolution) {
for (var i = 0; i < len; i++) {
var w, phi, y
if (linear)
- w = i / (len - 1) * Math.PI; // 0 to pi, linear scale
+ w = i / (len - 1) * Math.PI // 0 to pi, linear scale
else
- w = Math.exp(Math.log(1 / 0.001) * i / (len - 1)) * 0.001 * Math.PI; // 0.001 to 1, times pi, log scale
+ w = Math.exp(Math.log(1 / 0.001) * i / (len - 1)) * 0.001 * Math.PI // 0.001 to 1, times pi, log scale
phi = Math.pow(Math.sin(w/2), 2)
diff --git a/src/client/app/widgets/plots/_plots_base.js b/src/client/app/widgets/plots/_plots_base.js
new file mode 100644
index 00000000..fe9fbb0e
--- /dev/null
+++ b/src/client/app/widgets/plots/_plots_base.js
@@ -0,0 +1,208 @@
+var {mapToScale} = require('../utils'),
+ Canvas = require('../common/canvas'),
+ html = require('nanohtml')
+
+module.exports = class _plots_base extends Canvas {
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+
+
+ `})
+
+ this.value = []
+ this.rangeX = this.getProp('rangeX') || {min:0,max:1}
+ this.rangeY = this.getProp('rangeY') || {min:0,max:1}
+ this.logScaleX = this.getProp('logScaleX')
+ this.logScaleY = this.getProp('logScaleY')
+ this.pips = {
+ x : {
+ min: Math.abs(this.rangeX.min)>=1000?this.rangeY.min/1000+'k':this.rangeX.min,
+ max: Math.abs(this.rangeX.max)>=1000?this.rangeY.max/1000+'k':this.rangeX.max
+ },
+ y : {
+ min: Math.abs(this.rangeY.min)>=1000?this.rangeY.min/1000+'k':this.rangeY.min,
+ max: Math.abs(this.rangeY.max)>=1000?this.rangeY.max/1000+'k':this.rangeY.max
+ }
+ }
+ this.smooth = this.getProp('smooth') === true ? 0.25 : this.getProp('smooth') === false ? 0 : parseFloat(this.getProp('smooth')) || 0
+
+ }
+
+ resizeHandle() {
+
+ this.updateData()
+ super.resizeHandle(...arguments)
+
+ }
+
+ draw() {
+
+ this.ctx.clearRect(0,0,this.width,this.height)
+
+ if (this.getProp('bars')) {
+ this.draw_bars()
+ } else {
+ var points = this.draw_line()
+ if (this.getProp('dots')) {
+ this.draw_dots(points)
+ }
+ }
+
+ if (this.getProp('pips')) this.draw_pips()
+
+ }
+
+ draw_pips() {
+
+ this.ctx.globalAlpha = 1
+ this.ctx.fillStyle = this.colors.text
+
+ if (this.pips.x) {
+
+ this.ctx.textBaseline = 'bottom'
+ this.ctx.textAlign = 'left'
+ this.ctx.fillText(this.pips.x.min,(this.pips.y?12:2)*PXSCALE,this.height)
+ this.ctx.textAlign = 'right'
+ this.ctx.fillText(this.pips.x.max,this.width-2*PXSCALE,this.height)
+
+ }
+
+ if (this.pips.y) {
+
+ this.ctx.save()
+ this.ctx.translate(0, this.height)
+ this.ctx.rotate(-Math.PI/2)
+
+ this.ctx.textBaseline = 'top'
+ this.ctx.textAlign = 'left'
+ this.ctx.fillText(this.pips.y.min,(this.pips.x?12:2)*PXSCALE,2*PXSCALE)
+ this.ctx.textAlign = 'right'
+ this.ctx.fillText(this.pips.y.max,this.height-2*PXSCALE,2*PXSCALE)
+ this.ctx.rotate(Math.PI/2)
+ this.ctx.restore()
+
+ }
+
+ }
+
+ draw_line() {
+
+ var points = []
+
+ for (let i in this.value) {
+
+ if (this.value[i].length) {
+ points.push(mapToScale(this.value[i][0],[this.rangeX.min,this.rangeX.max],[0,this.width],0,this.logScaleX,true))
+ points.push(mapToScale(this.value[i][1],[this.rangeY.min,this.rangeY.max],[this.height-2*PXSCALE,2*PXSCALE],0,this.logScaleY,true))
+ } else {
+ points.push(mapToScale(i,[0,this.value.length-1],[0,this.width],0,this.logScaleX,true))
+ points.push(mapToScale(this.value[i],[this.rangeY.min,this.rangeY.max],[this.height-2*PXSCALE,2*PXSCALE],0,this.logScaleY,true))
+ }
+
+ }
+
+ if (points.length < 4) return points
+
+ this.ctx.beginPath()
+
+ this.ctx.curve(points, this.smooth, Math.round(this.width/(points.length/2 - 1)))
+
+ this.ctx.globalAlpha = 0.7
+ this.ctx.lineWidth = 2 * PXSCALE
+ this.ctx.strokeStyle = this.colors.custom
+ this.ctx.stroke()
+
+ if (this.getProp('origin') !== false) {
+
+ var origin = mapToScale(this.getProp('origin') || this.rangeY.min,[this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true)
+
+ this.ctx.globalAlpha = 0.1
+ this.ctx.fillStyle = this.colors.custom
+ this.ctx.lineTo(this.width,origin)
+ this.ctx.lineTo(0,origin)
+ this.ctx.closePath()
+ this.ctx.fill()
+
+ }
+
+ return points
+
+ }
+
+ draw_dots(points) {
+
+ this.ctx.globalAlpha = 1
+ this.ctx.fillStyle = this.colors.custom
+ this.ctx.strokeStyle = this.colors.track
+ this.ctx.lineWidth = 2 * PXSCALE
+ for (var i = 0; i < points.length; i += 2) {
+ this.ctx.beginPath()
+ this.ctx.arc(points[i], points[i + 1], 4 * PXSCALE, 0, 2*Math.PI)
+ this.ctx.fill()
+ this.ctx.stroke()
+ }
+
+ }
+
+ draw_bars() {
+
+ var barWidth = Math.round(this.width / this.value.length),
+ offset = Math.round((this.width - barWidth * this.value.length) / 2)
+
+ var origin = mapToScale(this.getProp('origin') || this.rangeY.min,[this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true)
+
+ this.ctx.beginPath()
+
+ for (let i in this.value) {
+ var y = mapToScale(this.value[i].length ? this.value[i][1] : this.value[i],[this.rangeY.min,this.rangeY.max],[this.height-2*PXSCALE,2*PXSCALE],0,this.logScaleY,true)
+ this.ctx.rect(offset + i * barWidth, Math.min(y, origin), barWidth - PXSCALE, Math.abs(Math.min(y - origin)))
+
+ }
+
+ this.ctx.globalAlpha = 0.4
+ this.ctx.fillStyle = this.colors.custom
+ this.ctx.fill()
+
+ }
+
+ setValue(v, options={}) {
+
+ if (typeof v == 'string') {
+ try {
+ v = JSON.parseFlex(v)
+ } catch(err) {}
+ }
+
+ if (typeof v == 'object' && v !== null) {
+
+ if (Array.isArray(v)) {
+
+ this.value = v
+
+ } else {
+
+ for (var i in v) {
+ if (!isNaN(i)) this.value[i] = v[i]
+ }
+
+ }
+
+ this.batchDraw()
+
+ if (options.sync) this.changed(options)
+
+ }
+
+
+ }
+
+ updateData() {
+
+ // update the coordinates to draw
+
+ }
+
+}
diff --git a/src/client/app/widgets/plots/eq.js b/src/client/app/widgets/plots/eq.js
new file mode 100644
index 00000000..abca866f
--- /dev/null
+++ b/src/client/app/widgets/plots/eq.js
@@ -0,0 +1,91 @@
+var {clip} = require('../utils'),
+ _biquad_response = require('./_biquad_response'),
+ _plots_base = require('./_plots_base')
+
+module.exports = class Eq extends _plots_base {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _eq:'eq',
+
+ pips: {type: 'boolean', value: true, help: 'Set to false to hide the scale'},
+ resolution: {type: 'number', value: 128, help: 'Defines the number of points used to compute the frequency response'},
+ rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},
+ origin: {type: 'number|boolean', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it'},
+ logScaleX: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the x axis (log10)'},
+ smooth: {type: 'boolean|number', value: false, help: 'Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`)'},
+
+ }, ['target', 'precision', 'bypass'], {})
+
+ }
+
+ constructor(options) {
+
+ // backward compat
+ if (options.props.filters && options.props.filters.length) {
+ options.props.value = options.props.filters
+ delete options.props.filters
+ }
+
+ super(options)
+
+ this.rangeX = {min:20,max:22050}
+ this.pips.x.min = '20'
+ this.pips.x.max = '22k'
+
+ this.resolution = clip(this.getProp('resolution'),[64,1024])
+
+ }
+
+ setValue(v, options={}) {
+
+ if (typeof v == 'string') {
+ try {
+ v = JSON.parseFlex(v)
+ } catch(err) {}
+ }
+
+ if (Array.isArray(v)) {
+
+ var filters = v,
+ eqResponse = []
+
+ if (v.length === this.resolution) {
+
+ eqResponse = v
+
+ } else {
+
+ for (let i in filters) {
+
+ var filterResponse
+
+ if (!filters[i].type) filters[i].type = 'peak'
+
+ if (!filters[i].on) {
+ filterResponse = _biquad_response({type:'peak',freq:1,gain:0,q:1},!this.getProp('logScaleX'), this.resolution)
+ } else {
+ filterResponse = _biquad_response(filters[i],!this.getProp('logScaleX'), this.resolution)
+ }
+
+ for (var k in filterResponse) {
+ if (eqResponse[k]===undefined) {
+ eqResponse[k]=[0,0]
+ }
+
+ eqResponse[k] = [filterResponse[k][0], eqResponse[k][1]+filterResponse[k][1]]
+ }
+
+ }
+
+ }
+
+ if (eqResponse.length) super.setValue(eqResponse, options)
+
+ }
+
+ }
+
+}
diff --git a/src/client/app/widgets/plots/frame.js b/src/client/app/widgets/plots/frame.js
new file mode 100644
index 00000000..242ac719
--- /dev/null
+++ b/src/client/app/widgets/plots/frame.js
@@ -0,0 +1,72 @@
+var Widget = require('../common/widget'),
+ html = require('nanohtml'),
+ locales = require('../../locales'),
+ localUrlRe = /(^127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^172\.1[6-9]{1}[0-9]{0,1}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^172\.2[0-9]{1}[0-9]{0,1}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^172\.3[0-1]{1}[0-9]{0,1}\.[0-9]{1,3}\.[0-9]{1,3}$)|(^192\.168\.[0-9]{1,3}\.[0-9]{1,3}$)/
+
+class Frame extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _frame: 'frame',
+
+ border: {type: 'boolean', value: true, help: 'Set to `false` to disable the borders and background-color'},
+
+ }, ['color', 'target', 'precision', 'bypass'], {
+
+ label: {type: 'string|boolean', value: 'auto', help: [
+ 'Set to `false` to hide completely',
+ 'Insert icons using the prefix ^ followed by the icon\'s name : ^play, ^pause, etc',
+ 'If set to `false`, all pointer-events will be disabled on the frame as long as the editor is enabled to ensure it can be selected'
+ ]},
+ value: {type: 'string', value: '', help: [
+ 'External web page URL. Only local URLs are allowed (starting with `http://127.0.0.1/`, `http://10.x.x.x/`, `http://192.168.x.x/`, etc)',
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ if (!this.getProp('border')) this.container.classList.add('noborder')
+
+ this.frame = DOM.get(this.widget, 'iframe')[0]
+ this.errorText = html`${locales('iframe_unauthorized')}`
+ this.errorTextMounted = false
+
+
+ }
+
+ setValue(v, options={}) {
+
+ this.value = v
+
+ var parser = document.createElement('a')
+ parser.href = this.value
+
+ if (parser.hostname.match(localUrlRe)) {
+ this.frame.setAttribute('src', this.value)
+ this.widget.classList.remove('error')
+ if (this.errorTextMounted) {
+ this.widget.removeChild(this.errorText)
+ this.errorTextMounted = false
+ }
+ } else {
+ this.frame.setAttribute('src', '')
+ this.widget.classList.add('error')
+ this.widget.appendChild(this.errorText)
+ this.errorTextMounted = true
+ }
+
+ if (options.sync) this.changed(options)
+
+ }
+
+
+}
+
+module.exports = Frame
diff --git a/src/client/app/widgets/plots/image.js b/src/client/app/widgets/plots/image.js
new file mode 100644
index 00000000..4114c0b4
--- /dev/null
+++ b/src/client/app/widgets/plots/image.js
@@ -0,0 +1,94 @@
+var Widget = require('../common/widget'),
+ ipc = require('../../ipc'),
+ html = require('nanohtml')
+
+module.exports = class Led extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _image:'image',
+
+ size: {type: 'string', value: 'cover', help: 'CSS background-size'},
+ position: {type: 'string', value: 'center', help: 'CSS background-position'},
+ repeat: {type: 'string', value: 'no-repear', help: 'CSS background-repeat'},
+ border: {type: 'boolean', value: true, help: 'Set to `false` to disable the borders and background-color'},
+ cache: {type: 'boolean', value: true, help: [
+ 'Set to false to disable image caching (forces file reload when updating or editing the widget).',
+ 'When true, sending `reload` to the widget reloads its image without changing its value'
+ ]}
+
+ }, ['color', 'target', 'precision', 'bypass'], {
+
+ value: {type: 'string', value: '', help: [
+ '- File `url` or `absolute path`',
+ '- Base64 encoded image : `data:image/...`'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ if (!this.getProp('border')) this.container.classList.add('noborder')
+
+ this.widget.style.setProperty('background-size', this.getProp('size'))
+ this.widget.style.setProperty('background-position', this.getProp('position'))
+ this.widget.style.setProperty('background-repeat', this.getProp('repeat'))
+
+ if (this.getProp('stream') !== '') {
+ this.bindedOnStreamUpdate = this.onStreamUpdate.bind(this)
+ ipc.on('video', this.bindedOnStreamUpdate)
+ }
+
+ }
+
+ setValue(v, options={}) {
+
+ var s = v==null ? '' : '' + v,
+ cache_query = ''
+
+ if (!s.length) {
+
+ this.value = this.getProp('value')
+
+ } else if (s != 'reload') {
+
+ if (s.length > 1) this.value = s
+
+ }
+
+ if (typeof this.value === 'string' && this.value.length) {
+
+ cache_query = this.getProp('cache') || this.value.indexOf('base64') != -1 ?
+ '' : (this.value.indexOf('?') != -1 ? '&' : '?') + Date.now()
+
+ }
+
+ this.widget.style.setProperty('background-image', `url(${this.value}${cache_query})`)
+
+ if (options.sync) this.changed(options)
+
+ }
+
+ onStreamUpdate(event) {
+
+ var [stream, data] = event
+ if (stream === this.getProp('stream')) {
+ this.setValue('data:image/jpeg;base64,' + data)
+ }
+
+ }
+
+ onRemove() {
+
+ if (this.bindedOnStreamUpdate) ipc.off('video', this.bindedOnStreamUpdate)
+ super.onRemove()
+
+ }
+
+}
diff --git a/src/client/app/widgets/plots/led.js b/src/client/app/widgets/plots/led.js
new file mode 100644
index 00000000..3b0b6540
--- /dev/null
+++ b/src/client/app/widgets/plots/led.js
@@ -0,0 +1,45 @@
+var {mapToScale} = require('../utils'),
+ Widget = require('../common/widget'),
+ html = require('nanohtml')
+
+module.exports = class Led extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _led:'led',
+
+ range: {type: 'object', value: {min:0,max:1}, help: 'Value to led intensity mapping range'},
+ logScale: {type: 'boolean', value: false, help: 'Set to `true` to use a logarithmic mapping scale)'},
+
+ }, ['target', 'precision', 'bypass'], {})
+
+ }
+
+ constructor(options) {
+
+ // backward compat
+ if (options.props.widgetId) {
+ options.props.value = '@{' + options.props.widgetId + '}'
+ delete options.props.widgetId
+ }
+
+ super({...options, html: html``})
+
+ this.setValue(this.getProp('range').min)
+
+ }
+
+ setValue(v, options={}) {
+
+ if (typeof v != 'number') return
+
+ this.value = v
+ this.widget.style.setProperty('--opacity', mapToScale(v,[this.getProp('range').min,this.getProp('range').max],[0,1],false,this.getProp('logScale'),true))
+
+ if (options.sync) this.changed(options)
+
+ }
+
+}
diff --git a/src/client/app/widgets/plots/meter.js b/src/client/app/widgets/plots/meter.js
new file mode 100644
index 00000000..e360a340
--- /dev/null
+++ b/src/client/app/widgets/plots/meter.js
@@ -0,0 +1,57 @@
+var Fader = require('../sliders/fader')
+
+module.exports = class Meter extends Fader {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _meter:'meter',
+
+ range: {type: 'object', value: {min:0,max:1}, help: 'See fader\'s `range`'},
+ logScale: {type: 'boolean', value: false, help: 'See fader\'s `logScale`'},
+ origin: {type: 'number', value: 'auto', help: 'See fader\'s `origin`'},
+ unit: {type: 'string', value: 'auto', help: 'See fader\'s `unit`'},
+ alignRight: {type: 'boolean', value: false, help: 'See fader\'s `alignRight`'},
+ horizontal: {type: 'boolean', value: false, help: 'See fader\'s `horizontal`'},
+ pips: {type: 'boolean', value: false, help: 'See fader\'s `pips`'},
+ dashed: {type: 'boolean', value: false, help: 'See fader\'s `dashed`'},
+ gradient: {type: 'array', value: [], help: 'When set, the meter\'s gauge will be filled with a linear color gradient : each item must be a CSS color string. Example: `[\'blue\', \'red\']`'},
+
+ }, ['target', 'precision', 'bypass'], {
+
+ css: {type: 'string', value: '', help: [
+ 'Available CSS variables:',
+ '- `--color-gauge: color;`',
+ '- `--color-knob: color;`',
+ '- `--color-pips: color;`',
+ '- `--gauge-opacity: number;`'
+ ]},
+
+ })
+
+ }
+
+ constructor(options) {
+
+ // backward compat
+ if (options.props.widgetId) {
+ options.props.value = '@{' + options.props.widgetId + '}'
+ delete options.props.widgetId
+ }
+ options.props.compact = true
+ options.props.input = false
+
+ super(options)
+
+ this.widget.classList.add('meter')
+
+ this.off(/drag(.*)?/)
+
+ }
+
+ sendValue() {
+ // disabled
+ }
+
+}
diff --git a/src/client/app/widgets/plots/plot.js b/src/client/app/widgets/plots/plot.js
new file mode 100644
index 00000000..55cfc59b
--- /dev/null
+++ b/src/client/app/widgets/plots/plot.js
@@ -0,0 +1,47 @@
+var _plots_base = require('./_plots_base')
+
+module.exports = class Plot extends _plots_base {
+
+ static defaults() {
+
+
+ return super.defaults({
+
+ _plot:'plot',
+
+ rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'},
+ rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},
+ logScaleX: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the x axis (log10)'},
+ logScaleY: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis (log10)'},
+ origin: {type: 'number', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it.'},
+ dots: {type: 'boolean', value: true, help: ''},
+ bars: {type: 'boolean', value: false, help: 'Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing)'},
+ smooth: {type: 'boolean|number', value: false, help: 'Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`)'},
+ pips:{type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
+
+ }, ['target', 'precision', 'bypass'], {
+
+ value: {type: 'array|string', value: '', help: [
+ '- `Array` of `y` values',
+ '- `Array` of `[x, y]` `array` values',
+ '- `String` `array`',
+ '- `String` `object` to update specific coordinates only: `{0:1, 4:0}` will change the 1st and 5th points\' coordinates',
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ // backward compat
+ if (options.props.points && options.props.points.length) {
+ options.props.value = options.props.points
+ delete options.props.points
+ }
+
+ super(options)
+
+ }
+
+}
diff --git a/src/client/app/widgets/plots/rgbled.js b/src/client/app/widgets/plots/rgbled.js
new file mode 100644
index 00000000..6bae6abe
--- /dev/null
+++ b/src/client/app/widgets/plots/rgbled.js
@@ -0,0 +1,72 @@
+var Widget = require('../common/widget'),
+ {clip} = require('../utils'),
+ html = require('nanohtml')
+
+module.exports = class Rbgled extends Widget {
+
+ static defaults() {
+
+ return super.defaults({}, ['color', 'target', 'precision', 'bypass'], {
+
+ value: {type: 'array|string', value: '', help: [
+ '- `Array`: `[r, g, b]` (`r`, `g` and `b` between `0` and `255`)',
+ '- `Array`: `[r, g, b, alpha]` (`alpha` between `0` and `255`)',
+ '- `String`: CSS color',
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ // backward compat
+ if (options.props.widgetId) {
+ options.props.value = '@{' + options.props.widgetId + '}'
+ delete options.props.widgetId
+ }
+
+ super({...options, html: html`
+
+
+ `})
+
+ this.setValue([0,0,0,0])
+
+ }
+
+
+ setValue(v, options={}) {
+
+ var c = ''
+
+ if (Array.isArray(v) && v.length >= 3) {
+
+ for (let i in [0,1,2]) {
+ v[i] = parseInt(clip(v[i],[0,255]))
+ }
+
+ v[3] = clip(v[3] != undefined ? v[3] : 1,[0,1])
+
+ c = `rgba(${v[0]}, ${v[1]}, ${v[2]}, ${v[3]})`
+
+ } else if (typeof v == 'string') {
+
+ c = v
+
+
+ } else {
+
+ return
+
+ }
+
+ this.value = v
+
+ this.widget.style.setProperty('--color-led', c)
+
+ if (options.sync) this.changed(options)
+
+ }
+
+}
diff --git a/src/client/app/widgets/plots/svg.js b/src/client/app/widgets/plots/svg.js
new file mode 100644
index 00000000..fe1b8839
--- /dev/null
+++ b/src/client/app/widgets/plots/svg.js
@@ -0,0 +1,94 @@
+var Widget = require('../common/widget'),
+ morph = require('nanomorph'),
+ html = require('nanohtml'),
+ raw = require('nanohtml/raw')
+
+
+class Svg extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _svg:'svg',
+
+ svg: {type: 'string', value: '', help: [
+ 'Svg xml definition:',
+ '- will be wrapped in a `` element',
+ '- `` commands support a special percent notation (`%x` and `%y`)'
+ ]}
+
+ }, ['color', 'target', 'precision', 'bypass'], {})
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+
+
+ `})
+
+ this.height = undefined
+ this.width = undefined
+
+ this.on('resize', this.resizeHandleProxy.bind(this), {element: this.widget})
+
+ }
+
+ updateSvg(){
+
+ if (!this.width || !this.height) return
+
+ var svg = this.getProp('svg')
+
+ svg = svg.replace(/<\/svg>/gi, 'x')
+ svg = svg.replace(/([0-9.]+%x)/gi, m=>(parseFloat(m) * this.width / 100).toFixed(2))
+ svg = svg.replace(/([0-9.]+%y)/gi, m=>(parseFloat(m) * this.height / 100).toFixed(2))
+
+
+
+ morph(this.widget, html``)
+ }
+
+ resizeHandleProxy() {
+
+ this.resizeHandle(...arguments)
+
+ }
+
+ resizeHandle(event){
+
+ var {width, height} = event
+
+ this.height = height
+ this.width = width
+
+ this.updateSvg()
+
+ }
+
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'svg':
+ this.updateSvg()
+ return
+
+ }
+
+ }
+
+
+}
+
+Svg.dynamicProps = Svg.prototype.constructor.dynamicProps.concat(
+ 'svg'
+)
+
+module.exports = Svg
diff --git a/src/client/app/widgets/plots/text.js b/src/client/app/widgets/plots/text.js
new file mode 100644
index 00000000..f332e7f4
--- /dev/null
+++ b/src/client/app/widgets/plots/text.js
@@ -0,0 +1,60 @@
+var {iconify} = require('../../ui/utils'),
+ Widget = require('../common/widget'),
+ html = require('nanohtml')
+
+module.exports = class Text extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _text: 'text',
+
+ vertical: {type: 'boolean', value: false, help: 'Set to `true` to display the text vertically'},
+ wrap: {type: 'boolean', value: false, help: [
+ 'Set to `true` to wrap long lines automatically.',
+ 'This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property',
+ ]},
+ align: {type: 'string', value: '', help: 'Set to `left` or `right` to change text alignment (otherwise center)'},
+
+ }, ['target', 'precision', 'bypass'], {})
+
+ }
+
+ constructor(options) {
+
+ // backward compat
+ if (options.props.widgetId) {
+ options.props.value = '@{' + options.props.widgetId + '}'
+ delete options.props.widgetId
+ }
+ super({...options, html: html``})
+
+ if (this.getProp('vertical')) this.widget.classList.add('vertical')
+ if (this.getProp('align') === 'left') this.widget.classList.add('left')
+ if (this.getProp('align') === 'right') this.widget.classList.add('right')
+ if (this.getProp('wrap')) this.widget.classList.add('wrap')
+
+ this.defaultValue = this.getProp('default') || ( this.getProp('label')===false ?
+ this.getProp('id'):
+ this.getProp('label')=='auto'?
+ this.getProp('id'):
+ this.getProp('label') )
+
+ this.value = this.defaultValue
+
+ this.setValue(this.value)
+
+ }
+
+
+ setValue(v, options={}) {
+
+ this.value = v==null ? this.defaultValue : v
+ this.widget.innerHTML = iconify(String(this.value).replace(/\n/g,'
'))
+
+ if (options.sync) this.changed(options)
+
+ }
+
+}
diff --git a/src/browser/js/app/widgets/plots/visualizer.js b/src/client/app/widgets/plots/visualizer.js
similarity index 52%
rename from src/browser/js/app/widgets/plots/visualizer.js
rename to src/client/app/widgets/plots/visualizer.js
index 6488f0f4..ed930494 100644
--- a/src/browser/js/app/widgets/plots/visualizer.js
+++ b/src/client/app/widgets/plots/visualizer.js
@@ -1,60 +1,43 @@
-var {mapToScale, clip} = require('../utils'),
- _plots_base = require('./_plots_base'),
- widgetManager = require('../../managers/widgets')
+var {clip} = require('../utils'),
+ _plots_base = require('./_plots_base')
module.exports = class Visualizer extends _plots_base {
static defaults() {
- return {
- type:'visualizer',
- id:'auto',
-
- _geometry:'geometry',
-
- left:'auto',
- top:'auto',
- width:'auto',
- height:'auto',
-
- _style:'style',
-
- label:'auto',
- color:'auto',
- css:'',
+ return super.defaults({
_visualizer:'visualizer',
- widgetId:'',
- duration:1,
- range: {min:0,max:1},
- origin: 'auto',
- logScale: false,
- smooth: false,
- pips:true,
- value:'',
+ duration: {type: 'number', value: 1, help: 'Defines visualization duration in seconds'},
+ range: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},
+ origin: {type: 'number', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it'},
+ logScale: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis'},
+ smooth: {type: 'boolean|number', value: false, help: 'Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`)'},
+ pips:{type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
- _osc:'osc',
-
- address:'auto',
- preArgs:[],
- }
+ }, ['target', 'precision', 'bypass'], {})
}
constructor(options) {
+ // backward compat
+ if (options.props.widgetId) {
+ options.props.value = '@{' + options.props.widgetId + '}'
+ delete options.props.widgetId
+ }
+
super(options)
- this.fps = 30
+ this.fps = CANVAS_FRAMERATE
this.pips.y.min = Math.abs(this.getProp('range').min) >= 1000? this.getProp('range').min/1000+'k' : this.getProp('range').min
this.pips.y.max = Math.abs(this.getProp('range').max) >= 1000? this.getProp('range').max/1000+'k' : this.getProp('range').max
this.pips.x = false
this.rangeY = this.getProp('range') || {min:0,max:1}
this.logScaleY = this.getProp('logScale')
this.length = Math.round(clip(this.fps * this.getProp('duration'), [8, 4096]))
- this.data = new Array(this.length).fill(this.rangeY.min)
- this.value = this.getProp('range').min
+ this.value = new Array(this.length).fill(this.rangeY.min)
this.cancel = false
this.looping = false
this.clock = 0
@@ -64,18 +47,11 @@ module.exports = class Visualizer extends _plots_base {
}
- syncHandle(e) {
-
- if (this.getProp('widgetId')!=e.id || !widgetManager.getWidgetById(e.id).length || !e.widget) return
- this.setValue(e.widget.getValue())
-
- }
-
startLoop() {
- this.clock = new Date().getTime()
+ this.clock = Date.now()
if (!this.looping) {
- this.lastUpdate = new Date().getTime()
+ this.lastUpdate = Date.now()
this.looping = true
this.ticks = 0
this.loop()
@@ -84,7 +60,7 @@ module.exports = class Visualizer extends _plots_base {
loop() {
- var t = new Date().getTime()
+ var t = Date.now()
if (t -this.clock >= this.watchDuration) {
this.looping = false
@@ -95,7 +71,7 @@ module.exports = class Visualizer extends _plots_base {
if (Math.floor(this.ticks) > 0) {
this.shiftData(Math.floor(this.ticks))
this.ticks -= Math.floor(this.ticks)
- this.draw()
+ this.batchDraw()
}
this.lastUpdate = t
@@ -111,25 +87,36 @@ module.exports = class Visualizer extends _plots_base {
shiftData(n) {
for (var i=0; i `)'
+ ]},
- _osc:'osc',
+ }, [], {
- precision:2,
- address:'auto',
- touchAddress:'',
- preArgs:[],
- target:[]
- }
+ touchAddress: {type: 'string', value:'', help: 'OSC address for touched state messages: `/touchAddress [preArgs] 0/1`'},
+
+ })
}
constructor(options) {
- var html = `
+ super({...options, html: html`
- `
- super({...options, html: html})
+ `})
- this.wrapper = this.widget.find('.wrapper')
+ this.wrapper = DOM.get(this.widget, '.wrapper')[0]
this.ticks = Math.abs(parseInt(this.getProp('ticks')))
this.knob = new EncoderKnob({props:{
@@ -87,7 +75,7 @@ module.exports = class Encoder extends _widgets_base {
snap:true,
range:{min:0,max:this.ticks},
pips:false,
- }})
+ }, parent: this})
this.knob.noDraw = true
@@ -97,18 +85,24 @@ module.exports = class Encoder extends _widgets_base {
range:{min:0,max:this.ticks},
origin:this.ticks/2,
pips:false,
- }})
+ }, parent: this})
- this.wrapper.append(this.knob.widget.addClass('drag-knob'))
- this.wrapper.append(this.display.widget.addClass('display-knob'))
+ this.knob.widget.classList.add('drag-knob')
+ this.display.widget.classList.add('display-knob')
+
+ this.wrapper.appendChild(this.knob.widget)
+ this.wrapper.appendChild(this.display.widget)
this.knob.setValue(this.ticks/2)
this.display.setValue(this.ticks/2)
this.previousValue = this.ticks/2
- this.wrapper.on('change',(e)=>{
- e.stopPropagation()
+ this.on('change',(e)=>{
+
+ if (e.widget == this) return
+
+ e.stopPropagation = true
var value = this.knob.getValue()
@@ -130,34 +124,37 @@ module.exports = class Encoder extends _widgets_base {
})
- this.wrapper.on('draginit', (e)=>{
+ this.knob.on('draginit', (e)=>{
if (this.getProp('touchAddress') && this.getProp('touchAddress').length
- && e.target == this.wrapper[0])
+ && e.target == this.wrapper)
this.sendValue({
address:this.getProp('touchAddress'),
v:1
})
})
- this.wrapper.on('dragend', (e)=>{
+ this.knob.on('dragend', (e)=>{
if (this.getProp('release') !== '' && this.value !== this.getProp('release')) {
this.knob.setValue(this.ticks/2)
this.display.setValue(this.ticks/2)
this.setValue(this.getProp('release'), {sync:true, send:true, dragged:false})
}
- if (this.getProp('touchAddress') && this.getProp('touchAddress').length
- && e.target == this.wrapper[0])
+ if (
+ this.getProp('touchAddress') && this.getProp('touchAddress').length
+ && e.target == this.wrapper
+ ) {
this.sendValue({
address:this.getProp('touchAddress'),
v:0
})
+ }
})
if (this.getProp('doubleTap')) {
doubletab(this.wrapper, ()=>{
- this.knob.setValue(this.ticks/2)
- this.display.setValue(this.ticks/2)
+ this.knob.setValue(this.ticks/2)
+ this.display.setValue(this.ticks/2)
if (this.getProp('release') !== '' && this.value !== this.getProp('release')) {
this.setValue(this.getProp('release'), {sync:true, send:true, dragged:false})
}
@@ -165,11 +162,11 @@ module.exports = class Encoder extends _widgets_base {
}
- this.wrapper.on('mousewheel', (e)=>{
+ this.wrapper.addEventListener('mousewheel', (e)=>{
- if (e.originalEvent.wheelDeltaX || e.originalEvent.wheelDelta == 0) return
+ if (e.wheelDeltaX || e.wheelDelta == 0) return
- var direction = e.originalEvent.wheelDelta / Math.abs(e.originalEvent.wheelDelta)
+ var direction = e.wheelDelta / Math.abs(e.wheelDelta)
this.display.setValue(this.display.value + direction)
this.setValue(direction < 0 ? this.getProp('back') : this.getProp('forth'), {sync:true, send:true})
@@ -186,7 +183,7 @@ module.exports = class Encoder extends _widgets_base {
setValue(v,options={}) {
- if (this.getProp('snap') || (!this.getProp('snap') && !options.draginit)) {
+ if (this.getProp('snap') || (!this.getProp('snap') && !options.draginit)) {
var match = true
@@ -202,16 +199,16 @@ module.exports = class Encoder extends _widgets_base {
}
- if (options.sync && match) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
+ if (options.sync && match) this.changed(options)
if (options.send && match && !(!this.getProp('snap') && options.draginit)) this.sendValue()
- if (options.dragged || options.draginit) this.updateDisplay(options.draginit)
+ if (options.dragged || options.draginit) this.updateDisplay(options.draginit)
}
updateDisplay(init){
- if (this.getProp('snap')) {
+ if (this.getProp('snap')) {
this.display.setValue(this.knob.value)
return
}
@@ -250,4 +247,27 @@ module.exports = class Encoder extends _widgets_base {
}
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of [this.knob, this.display]) {
+ w.onPropChanged('color')
+ }
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.knob.onRemove()
+ this.display.onRemove()
+ super.onRemove()
+ }
+
}
diff --git a/src/client/app/widgets/sliders/fader.js b/src/client/app/widgets/sliders/fader.js
new file mode 100644
index 00000000..84365e3d
--- /dev/null
+++ b/src/client/app/widgets/sliders/fader.js
@@ -0,0 +1,326 @@
+var {clip} = require('../utils'),
+ Slider = require('./slider'),
+ parser = require('../../parser'),
+ html = require('nanohtml')
+
+module.exports = class Fader extends Slider {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _fader:'fader',
+
+ horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display the fader horizontally'},
+ alignRight: {type: 'boolean', value: false, help: 'Set to `true` to invert the pip\'s and fader\'s position'},
+ pips: {type: 'boolean', value: true, help: 'Set to `false` to hide the scale'},
+ input: {type: 'boolean', value: true, help: 'Set to `false` to hide the built-in input'},
+ meter: {type: 'boolean', value: false, help: [
+ 'Set to true to display a vu-meter next in the fader',
+ '- the meter\'s `id` will be the same as the widget\'s with `/meter` appended to it',
+ '- the meter\'s `id` will be the same as the widget\'s with `/meter` appended to it'
+ ]},
+ compact: {type: 'boolean', value: false, help: 'Set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display.'},
+ dashed: {type: 'boolean', value: false, help: 'Set to `true` to display a dashed gauge'},
+ snap: {type: 'boolean', value: false, help: 'By default, dragging the widget will modify it\'s value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position'},
+ spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its `default` value when released'},
+ doubleTap: {type: 'boolean', value: false, help: [
+ 'Set to `true` to make the fader reset to its `default` value when receiving a double tap.',
+ 'Can also be an osc address, in which case the widget will just send an osc message (`/ `)'
+ ]},
+ range: {type: 'object', value: {min:0,max:1}, help: [
+ 'Defines the breakpoints of the fader\'s scale:',
+ '- keys can be percentages and/or `min` / `max`',
+ '- values can be `number` or `object` if a custom label is needed',
+ 'Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`)'
+ ]},
+ logScale: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis'},
+ unit: {type: 'string', value: '', help: 'Unit will be appended to the displayed widget\'s value (it doesn\'t affect osc messages)'},
+ origin: {type: 'number', value: 'auto', help: 'Defines the starting point\'s value of the fader\'s gauge'},
+
+ }, [], {
+
+ touchAddress: {type: 'string', value:'', help: 'OSC address for touched state messages: `/touchAddress [preArgs] 0/1`'},
+ meterAddress: {type: 'string', value:'', help: 'OSC address for the built-in meter'},
+ css: {type: 'string', value: '', help: [
+ 'Available CSS variables:',
+ '- `--color-gauge: color;`',
+ '- `--color-knob: color;`',
+ '- `--color-pips: color;`',
+ '- `--gauge-opacity: number;`'
+ ]}
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.widget.classList.add('fader')
+ this.margin = 22
+
+
+ if (this.getProp('horizontal')) {
+ this.widget.classList.add('horizontal')
+ this.container.classList.add('horizontal')
+ }
+
+ if (this.getProp('compact')) {
+ this.widget.classList.add('compact')
+ this.margin = 0
+ if (this.getProp('input')) {
+ this.widget.addEventListener('fast-right-click', (e)=>{
+ if (e.detail.button == 2 && !EDITING) {
+ // Mouse only
+ this.input.focus()
+ }
+ })
+ }
+ }
+
+ if (this.getProp('alignRight') && !this.getProp('horizontal')) {
+ this.widget.classList.add('align-right')
+ }
+
+ if (this.getProp('meter')) {
+ var data = {
+ type:'meter',
+ id: this.getProp('id') + '/meter',
+ label:false,
+ horizontal:this.getProp('horizontal'),
+ range:this.getProp('range'),
+ logScale:this.getProp('logScale'),
+ address:this.getProp('meterAddress') || this.getProp('address') + '/meter',
+ preArgs:this.getProp('preArgs'),
+ color:this.getProp('color'),
+ pips:false,
+ dashed:true
+ }
+ var meter = parser.parse({
+ data: data,
+ parentNode: this.wrapper,
+ parent: this
+ })
+
+ meter.container.classList.add('not-editable')
+ this.children.push(meter)
+ this.widget.classList.add('has-meter')
+ }
+
+ if (this.getProp('pips')) {
+
+ this.widget.classList.add('has-pips')
+
+
+ var pipTexts = {}
+ for (var k in this.rangeKeys) {
+ pipTexts[this.rangeKeys[k]]=this.rangeLabels[k]
+ }
+
+ var pips = html``
+ for (var i=0;i<=100;i++) {
+ if (pipTexts[i]==undefined) continue
+
+ var pos = this.getProp('horizontal')?'left':'bottom'
+
+ pips.appendChild(html`
+
+ ${Math.abs(pipTexts[i])>=1000?pipTexts[i]/1000+'k':pipTexts[i]}
+
+ `)
+
+ }
+
+ this.wrapper.appendChild(pips)
+
+ }
+
+
+ }
+
+ draginitHandle(e) {
+
+ super.draginitHandle(...arguments)
+
+ this.percent = clip(this.percent,[0,100])
+
+ if (!(e.traversing || this.getProp('snap')) || e.ctrlKey) return
+
+ this.percent = this.getProp('horizontal')?
+ (e.offsetX - this.margin * PXSCALE) / (this.width - (this.margin * PXSCALE * 2)) * 100:
+ (this.height - e.offsetY - this.margin * PXSCALE) / (this.height - (this.margin * PXSCALE * 2)) * 100
+
+ // this.percent = clip(this.percent,[0,100])
+
+ this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true})
+
+ }
+
+ dragHandle(e, data) {
+
+ super.dragHandle(...arguments)
+
+ this.percent = this.getProp('horizontal')?
+ this.percent + ( e.movementX/(this.width - this.margin * PXSCALE * 2)) * 100 / e.inertia:
+ this.percent + (-e.movementY/(this.height - this.margin * PXSCALE * 2)) * 100 / e.inertia
+
+ this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true})
+
+ }
+
+ percentToCoord(percent) {
+
+ if (this.getProp('horizontal')) {
+ return clip(percent / 100,[0,1]) * (this.width - 2 * PXSCALE * this.margin) + this.margin * PXSCALE
+ } else {
+ return (this.height - this.margin * PXSCALE) - clip(percent / 100, [0,1]) * (this.height - 2 * PXSCALE * this.margin)
+ }
+
+ }
+
+ resizeHandle(event) {
+
+ var ratio = CANVAS_SCALING * this.scaling
+
+ if (this.getProp('compact') && this.getProp('horizontal')) {
+ event.height = 1 / ratio
+ }
+
+ super.resizeHandle(event)
+
+ if (this.getProp('horizontal')){
+ this.ctx.setTransform(1, 0, 0, 1, 0, 0)
+ this.ctx.rotate(-Math.PI/2)
+ this.ctx.translate(-this.height * ratio, 0)
+
+ if (ratio != 1) this.ctx.scale(ratio, ratio)
+ }
+
+ if (this.getProp('gradient')) {
+ var colors = this.getProp('gradient')
+ if (Array.isArray(colors) && colors.length > 1) {
+ try {
+ var grad = this.ctx.createLinearGradient(0, this.getProp('horizontal') ? 0 : this.height, 0, this.getProp('horizontal') ? this.width : 0)
+ for (var i in colors) {
+ grad.addColorStop(i / (colors.length - 1), colors[i])
+ }
+ this.colors.gradient = grad
+ } catch(err) {
+ this.errors.gradient = err
+ }
+ }
+ }
+
+
+ }
+
+
+ draw() {
+
+ var width = this.getProp('horizontal') ? this.height : this.width,
+ height = !this.getProp('horizontal') ? this.height : this.width
+
+ var d = Math.round(this.percentToCoord(this.percent)),
+ o = Math.round(this.percentToCoord(this.valueToPercent(this.originValue))),
+ m = Math.round(this.getProp('horizontal') ? this.height / 2 : this.width / 2)
+
+ var dashed = this.getProp('dashed')
+
+ this.clear()
+
+ if (this.getProp('compact')) {
+
+ this.ctx.globalAlpha = this.colors.gaugeOpacity || (dashed ? .3 : .2) + 0.2 * Math.abs(d-o) / (d `)'
+ ]},
+ range: {type: 'object', value: {min:0,max:1}, help: [
+ 'Defines the breakpoints of the fader\'s scale:',
+ '- keys can be percentages and/or `min` / `max`',
+ '- values can be `number` or `object` if a custom label is needed',
+ 'Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`)'
+ ]},
+ logScale: {type: 'boolean', value: false, help: 'Set to `true` to use logarithmic scale for the y axis'},
+ unit: {type: 'string', value: '', help: 'Unit will be appended to the displayed widget\'s value (it doesn\'t affect osc messages)'},
+ origin: {type: 'number', value: 'auto', help: 'Defines the starting point\'s value of the knob\'s gauge'},
+
+ }, [], {
+
+ touchAddress: {type: 'string', value:'', help: 'OSC address for touched state messages: `/touchAddress [preArgs] 0/1`'},
+ css: {type: 'string', value: '', help: [
+ 'Available CSS variables:',
+ '- `--color-gauge: color;`',
+ '- `--color-knob: color;`',
+ '- `--color-pips: color;`'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super(options)
+
+ this.widget.classList.add('knob')
+
+ this.widget.classList.add('compact')
+
+ this.lastOffsetX = 0
+ this.lastOffsetY = 0
+ this.minDimension = 0
+
+ this.maxAngle = this.getProp('angle')
+
+ // calculate lost height factor
+ var a = (1 - Math.sin((Math.max(this.maxAngle,247.5) - 180) / 2 * Math.PI / 180)) / 3
+ this.lostHeightFactor = a / 4
+
+ }
+
+ draginitHandle(e) {
+
+ this.percent = clip(this.percent,[0,100])
+
+ this.lastOffsetX = e.offsetX
+ this.lastOffsetY = e.offsetY
+
+ if (!(e.traversing || this.getProp('snap')) || e.ctrlKey) return
+
+ this.percent = this.angleToPercent(this.coordsToAngle(e.offsetX, e.offsetY))
+
+ this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true})
+
+ }
+
+ dragHandle(e) {
+
+ if (!(e.traversing || this.getProp('snap')) || e.ctrlKey) {
+
+ this.percent = -100 * (e.movementY / e.inertia) / this.height + this.percent
+
+ } else {
+
+ this.lastOffsetX = this.lastOffsetX + e.movementX / e.inertia
+ this.lastOffsetY = this.lastOffsetY + e.movementY / e.inertia
+ this.percent = this.angleToPercent(this.coordsToAngle(this.lastOffsetX, this.lastOffsetY))
+ }
+
+ this.percent = this.percent,[0,100]
+
+ this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true})
+
+ }
+
+ coordsToAngle(x,y) {
+
+ var xToCenter = x - this.width /2,
+ yToCenter = y - this.height / 2,
+ angle = Math.atan2(-yToCenter, -xToCenter) * 180 / Math.PI + 90
+
+ return angle<0?360+angle:angle
+
+ }
+
+ angleToPercent(angle) {
+
+ return clip(angle - (360 - this.maxAngle) / 2, [0, this.maxAngle]) / this.maxAngle * 100
+
+ }
+
+ percentToAngle(percent) {
+
+ percent = clip(percent, [0, 100])
+
+ return 2 * Math.PI * percent / 100 * (this.maxAngle / 360) // angle relative to maxAngle
+ + Math.PI / 2 // quarter circle offset
+ + Math.PI * (1 - this.maxAngle / 360) // centering offset depending on maxAngle
+
+ }
+
+ resizeHandle() {
+
+ super.resizeHandle(...arguments)
+
+ this.minDimension = Math.min(this.width, this.height)
+
+ this.wrapper.style.top = (this.minDimension) * this.lostHeightFactor - (this.getProp('label') === false ? 0 : this.gaugeWidth / 4) + 'px'
+
+ }
+
+ draw() {
+
+ var o = this.percentToAngle(this.valueToPercent(this.originValue)),
+ d = this.percentToAngle(this.percent),
+ min = this.percentToAngle(0),
+ max = this.percentToAngle(100),
+ dashed = this.getProp('dashed'),
+ pips = this.getProp('pips'),
+ gaugeWidth = Math.max(7 * PXSCALE, this.minDimension / 20),
+ gaugeRadius = this.minDimension / 2 - gaugeWidth / 2 - 2 * PXSCALE,
+ knobRadius = gaugeRadius - gaugeWidth,
+ rad = PXSCALE / gaugeRadius / 2
+
+
+ this.ctx.clearRect(0,0,this.width,this.height)
+
+ this.ctx.globalAlpha = 1
+
+ this.ctx.strokeStyle = this.colors.light
+ this.ctx.lineWidth = gaugeWidth
+ this.ctx.beginPath()
+ this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, min - 4 * rad - (pips ? 3 * rad : 0), max + 4 * rad + (pips ? 3 * rad : 0))
+ this.ctx.stroke()
+
+ this.ctx.strokeStyle = this.colors.bg
+ this.ctx.lineWidth = gaugeWidth - 2 * PXSCALE
+ this.ctx.beginPath()
+ this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, min - 2 * rad, max + 2 * rad)
+ this.ctx.stroke()
+
+ if (dashed) this.ctx.setLineDash([1.5 * PXSCALE, 1.5 * PXSCALE])
+
+ this.ctx.strokeStyle = this.colors.track
+ this.ctx.lineWidth = gaugeWidth - 4.5 * PXSCALE
+ this.ctx.beginPath()
+ this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, min, max)
+ this.ctx.stroke()
+
+ this.ctx.globalAlpha = pips ? 0.5 : 0.7
+ this.ctx.strokeStyle = this.colors.gauge
+ this.ctx.lineWidth = gaugeWidth - 4.5 * PXSCALE
+ this.ctx.beginPath()
+
+ this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, o, d, o > d)
+ this.ctx.stroke()
+
+ if (dashed) this.ctx.setLineDash([])
+
+
+ if (pips) {
+
+ this.ctx.globalAlpha = 1
+ this.ctx.lineWidth = gaugeWidth - 4.5 * PXSCALE
+
+ for (var pip of this.rangeKeys.concat(this.valueToPercent(this.originValue))) {
+
+ let a = this.percentToAngle(pip)
+
+ this.ctx.lineWidth = gaugeWidth - 2 * PXSCALE
+ this.ctx.strokeStyle = this.colors.bg
+ this.ctx.beginPath()
+ this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, a - 5 * rad, a + 5 * rad)
+ this.ctx.stroke()
+
+ this.ctx.lineWidth = gaugeWidth - 4.5 * PXSCALE
+ this.ctx.strokeStyle = this.colors.pips
+ this.ctx.beginPath()
+ this.ctx.arc(this.width / 2, this.height / 2, gaugeRadius, a - 2 * rad, a + 2 * rad)
+ this.ctx.stroke()
+
+ }
+
+ }
+
+ // knob
+
+ this.ctx.lineWidth = PXSCALE
+
+ this.ctx.fillStyle = this.colors.raised
+ this.ctx.beginPath()
+ this.ctx.globalAlpha = 1
+ this.ctx.arc(this.width / 2, this.height / 2, knobRadius, 0, Math.PI * 2)
+ this.ctx.fill()
+ this.ctx.strokeStyle = this.colors.bg
+ this.ctx.stroke()
+
+ this.ctx.beginPath()
+ this.ctx.globalAlpha = 1
+ this.ctx.arc(this.width / 2, this.height / 2, knobRadius - PXSCALE * 1.5, 0, Math.PI * 2)
+ this.ctx.strokeStyle = this.colors.light
+ this.ctx.stroke()
+
+ var g = this.ctx.createLinearGradient(this.width / 2, this.height / 2 - knobRadius / 2,this.width / 2, this.height / 2 + knobRadius / 2)
+ g.addColorStop(0.5, 'transparent')
+ g.addColorStop(0, this.colors.light || 'transparent')
+
+ this.ctx.strokeStyle = g
+ this.ctx.stroke()
+
+ // cursor
+ this.ctx.globalAlpha = 1
+
+ let r1 = knobRadius - PXSCALE,
+ r2 = knobRadius / 4,
+ a = 2 * Math.PI - d
+
+ this.ctx.beginPath()
+ this.ctx.moveTo(r1 * Math.cos(a) + this.width / 2, this.height / 2 - r1 * Math.sin(a))
+ this.ctx.lineTo(r2 * Math.cos(a) + this.width / 2, this.height / 2 - r2 * Math.sin(a))
+
+ this.ctx.lineWidth = gaugeWidth - 4.5 * PXSCALE
+ this.ctx.strokeStyle = this.colors.knob
+ this.ctx.stroke()
+
+ }
+
+}
diff --git a/src/client/app/widgets/sliders/range.js b/src/client/app/widgets/sliders/range.js
new file mode 100644
index 00000000..a75b5d89
--- /dev/null
+++ b/src/client/app/widgets/sliders/range.js
@@ -0,0 +1,457 @@
+var {clip} = require('../utils'),
+ Widget = require('../common/widget'),
+ Fader = require('./fader'),
+ Input = require('../inputs/input'),
+ touchstate = require('../mixins/touch_state'),
+ html = require('nanohtml')
+
+var faderDefaults = Fader.defaults()._props()
+
+var RangeFader = class RangeFader extends Fader {
+
+ constructor(options) {
+
+ super(options)
+ this.cancelDraw = options.cancelDraw
+
+ }
+
+ sendValue() {}
+
+ draginitHandle() {
+
+ this.percent = clip(this.percent,[
+ this.valueToPercent(this.rangeValsMin),
+ this.valueToPercent(this.rangeValsMax)
+ ])
+
+ super.draginitHandle(...arguments)
+ }
+
+ draw() {
+
+ if (this.cancelDraw || !this.parent.faders) return
+
+ var width = this.getProp('horizontal') ? this.height : this.width,
+ height = !this.getProp('horizontal') ? this.height : this.width
+
+ var d = Math.round(this.percentToCoord(this.valueToPercent(this.parent.faders[this.getProp('horizontal')?0:1].value))),
+ d2 = Math.round(this.percentToCoord(this.valueToPercent(this.parent.faders[this.getProp('horizontal')?1:0].value))),
+ m = Math.round(this.getProp('horizontal') ? this.height / 2 : this.width / 2)
+
+ var dashed = this.getProp('dashed')
+
+ this.clear()
+
+ if (this.getProp('compact')) {
+
+ this.ctx.globalAlpha = this.colors.gaugeOpacity || (dashed ? .3 : .2) + 0.2 * Math.abs(d-d2) / height
+ this.ctx.strokeStyle = this.colors.gauge
+ this.ctx.beginPath()
+ this.ctx.moveTo(m, d2)
+ this.ctx.lineTo(m, d)
+ this.ctx.lineWidth = width + 2 * PXSCALE
+ if (dashed) this.ctx.setLineDash([PXSCALE, PXSCALE])
+ this.ctx.stroke()
+ if (dashed) this.ctx.setLineDash([])
+
+ this.ctx.globalAlpha = 1
+ this.ctx.beginPath()
+ this.ctx.fillStyle = this.colors.knob
+ this.ctx.rect(0, Math.min(d, height - PXSCALE), width, PXSCALE)
+ this.ctx.rect(0, Math.min(d2, height - PXSCALE), width, PXSCALE)
+ this.ctx.fill()
+
+ this.clearRect = [0, 0, width, height]
+
+ } else {
+
+ this.ctx.lineWidth = 6 * PXSCALE
+
+ this.ctx.beginPath()
+ this.ctx.globalAlpha = 1
+ this.ctx.strokeStyle = this.colors.light
+ this.ctx.moveTo(m, this.margin * PXSCALE - 2 * PXSCALE)
+ this.ctx.lineTo(m, height - this.margin * PXSCALE + 2 * PXSCALE)
+ this.ctx.stroke()
+
+ this.ctx.lineWidth = 4 * PXSCALE
+
+ this.ctx.beginPath()
+ this.ctx.globalAlpha = 1
+ this.ctx.strokeStyle = this.colors.bg
+ this.ctx.moveTo(m, this.margin * PXSCALE - 1 * PXSCALE)
+ this.ctx.lineTo(m, height - this.margin * PXSCALE + 1 * PXSCALE)
+ this.ctx.stroke()
+
+ this.ctx.lineWidth = 2 * PXSCALE
+
+ this.ctx.beginPath()
+ this.ctx.strokeStyle = this.colors.track
+ this.ctx.moveTo(m, this.margin * PXSCALE)
+ this.ctx.lineTo(m, height - this.margin * PXSCALE)
+ this.ctx.stroke()
+
+ this.ctx.beginPath()
+ this.ctx.globalAlpha = 0.7
+ this.ctx.strokeStyle = this.colors.gauge
+ this.ctx.moveTo(m, d2)
+ this.ctx.lineTo(m, d)
+ if (dashed) this.ctx.setLineDash([PXSCALE, PXSCALE])
+ this.ctx.stroke()
+ if (dashed) this.ctx.setLineDash([])
+
+ this.ctx.globalAlpha = 1
+
+ // high knob bg
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 9 * PXSCALE, d - 14 * PXSCALE, 18 * PXSCALE, 16 * PXSCALE)
+ this.ctx.lineWidth = PXSCALE
+ this.ctx.fillStyle = this.colors.bg
+ this.ctx.fill()
+
+ // low knob bg
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 9 * PXSCALE, d2 - PXSCALE, 18 * PXSCALE, 16 * PXSCALE)
+ this.ctx.lineWidth = PXSCALE
+ this.ctx.fillStyle = this.colors.bg
+ this.ctx.fill()
+
+ // high knob
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 8 * PXSCALE, d - 13 * PXSCALE, 16 * PXSCALE, 14 * PXSCALE)
+ this.ctx.fillStyle = this.colors.raised
+ this.ctx.fill()
+ this.ctx.lineWidth = PXSCALE
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 7.5 * PXSCALE, d - 12.5 * PXSCALE, 15 * PXSCALE, 13.5 * PXSCALE)
+ this.ctx.lineWidth = PXSCALE
+ this.ctx.strokeStyle = this.colors.light
+ this.ctx.stroke()
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 8 * PXSCALE, d - 13 * PXSCALE, 16 * PXSCALE, PXSCALE)
+ this.ctx.lineWidth = PXSCALE
+ this.ctx.fillStyle = this.colors.light
+ this.ctx.fill()
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 4 * PXSCALE, d, 8 * PXSCALE, PXSCALE)
+ this.ctx.fillStyle = this.colors.knob
+ this.ctx.fill()
+
+ // low knob
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 8 * PXSCALE, d2, 16 * PXSCALE, 14 * PXSCALE)
+ this.ctx.fillStyle = this.colors.raised
+ this.ctx.fill()
+ this.ctx.lineWidth = PXSCALE
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 7.5 * PXSCALE, d2, 15 * PXSCALE, 13.5 * PXSCALE)
+ this.ctx.lineWidth = PXSCALE
+ this.ctx.strokeStyle = this.colors.light
+ this.ctx.stroke()
+
+ this.ctx.beginPath()
+ this.ctx.rect(m - 4 * PXSCALE, d2, 8 * PXSCALE, PXSCALE)
+ this.ctx.fillStyle = this.colors.knob
+ this.ctx.fill()
+
+
+
+ this.clearRect = [width / 2 - 11 * PXSCALE, 0, 22 * PXSCALE, height]
+ }
+ }
+
+}
+
+
+class Range extends Widget {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _range:'range',
+
+ range: {type: 'object', value: {min:0,max:1}, help: 'See fader\'s `range`'},
+ horizontal: {type: 'boolean', value: false, help: 'See fader\'s `horizontal`'},
+ alignRight: {type: 'boolean', value: false, help: 'See fader\'s `alignRight`'},
+ input: {type: 'boolean', value: true, help: 'See fader\'s `input`'},
+ compact: {type: 'boolean', value: false, help: 'See fader\'s `compact`'},
+ pips: {type: 'boolean', value: true, help: 'See fader\'s `pips`'},
+ snap: {type: 'boolean', value: false, help: 'See fader\'s `snap`'},
+ spring: {type: 'boolean', value: false, help: 'See fader\'s `spring`'},
+ logScale: {type: 'boolean', value: false, help: 'See fader\'s `logScale`'},
+
+ }, [], {
+
+ touchAddress: {type: 'string', value: '', help: 'See fader\'s `touchAddress`'},
+ split: {type: 'boolean|object', value: false, help: [
+ 'Set to `true` to send separate osc messages for `low` and `high` handles. The `address` will be the same as the widget\'s with `/low` or `/high` appended to it',
+ 'Can be set as an object to specify a different `address` : `[\'/osc_address_low\', \'/osc_address_high\']`',
+ 'Note: the widget will only respond to its original osc address, not to the splitted version'
+ ]},
+ css: {type: 'string', value: '', help: [
+ 'Available CSS variables:',
+ '- `--color-gauge: color;`',
+ '- `--color-knob: color;`',
+ '- `--color-pips: color;`',
+ '- `--gauge-opacity: number;`'
+ ]}
+
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+ `})
+
+ this.wrapper = DOM.get(this.widget, '.wrapper')[0]
+
+ this.faders = [
+ new RangeFader({props:{
+ ...faderDefaults,
+ compact:this.getProp('compact'),
+ pips:false,
+ alignRight:false,
+ horizontal:this.getProp('horizontal'),
+ height:'100%',
+ width:'100%',
+ default:this.getProp('default').length === 2 ? this.getProp('default')[0] : this.getProp('range').min,
+ snap:this.getProp('snap'),
+ spring:this.getProp('spring'),
+ range:this.getProp('range'),
+ origin:'auto',
+ precision:this.getProp('precision'),
+ logScale:this.getProp('logScale'),
+ input:false
+ }, cancelDraw: true, parent: this}),
+ new RangeFader({props:{
+ ...faderDefaults,
+ compact:this.getProp('compact'),
+ pips:this.getProp('pips'),
+ alignRight:this.getProp('alignRight'),
+ horizontal:this.getProp('horizontal'),
+ height:'100%',
+ width:'100%',
+ default:this.getProp('default').length === 2 ? this.getProp('default')[1] : this.getProp('range').max,
+ snap:this.getProp('snap'),
+ spring:this.getProp('spring'),
+ range:this.getProp('range'),
+ origin:'auto',
+ precision:this.getProp('precision'),
+ logScale:this.getProp('logScale'),
+ input:false
+ }, cancelDraw: false, parent: this})
+ ]
+
+ this.wrapper.appendChild(this.faders[0].widget)
+ this.wrapper.appendChild(this.faders[1].widget)
+
+ this.on('change',(e)=>{
+
+ if (e.widget == this) return
+
+ e.stopPropagation = true
+
+ var v = [
+ this.faders[0].getValue(),
+ this.faders[1].getValue()
+ ]
+
+ this.setValue(v, e.options)
+
+ })
+
+ this.touchMap = {}
+
+ touchstate(this, {element: this.wrapper, multitouch: true})
+
+ this.on('draginit',(e)=>{
+
+ var id
+
+ if (!this.touchMap[e.pointerId]) {
+
+ var ndiff, diff = -1
+
+ for (var i in this.faders) {
+
+ if (Object.values(this.touchMap).indexOf(i) != -1) continue
+
+ var coord = this.faders[i].percentToCoord(this.faders[i].valueToPercent(this.faders[i].value)) - (this.getProp('horizontal') ? -1 : 1) * (i == 0 ? -20 : 20)
+
+ ndiff = this.getProp('horizontal')?
+ Math.abs(e.offsetX - coord) :
+ Math.abs(e.offsetY - coord)
+
+ if (diff == -1 || ndiff < diff) {
+ id = i
+ diff = ndiff
+ }
+
+ }
+
+ this.touchMap[e.pointerId] = id
+
+
+ } else if (e.traversing) {
+
+ id = this.touchMap[e.pointerId]
+
+ }
+
+ if (!id) return
+
+ e.stopPropagation = true
+ this.faders[id].trigger('draginit', e)
+
+ }, {element: this.wrapper, multitouch: true})
+
+ this.on('drag',(e)=>{
+
+ var i = this.touchMap[e.pointerId]
+ if (e.shiftKey) {
+ this.faders[0].trigger('drag', e)
+ this.faders[1].trigger('drag', e)
+ } else {
+ this.faders[i].trigger('drag', e)
+ }
+
+ }, {element: this.wrapper, multitouch: true})
+
+ this.on('dragend',(e)=>{
+
+ var i = this.touchMap[e.pointerId]
+ e.stopPropagation = true
+ this.faders[i].trigger('dragend', e)
+ delete this.touchMap[e.pointerId]
+
+ }, {element: this.wrapper, multitouch: true})
+
+ if (this.getProp('input')) {
+
+ this.input = new Input({
+ props:{...Input.defaults()._props(),
+ precision:this.getProp('precision'),
+ unit:this.getProp('unit'),
+ vertical: this.getProp('compact') && !this.getProp('horizontal')
+ },
+ parent:this, parentNode:this.widget,
+ })
+ this.widget.appendChild(this.input.widget)
+ this.input.on('change', (e)=>{
+ e.stopPropagation = true
+ this.setValue(this.input.getValue(), {sync:true, send:true})
+ this.showValue()
+ })
+
+ }
+
+
+ if (this.getProp('horizontal')) {
+ this.widget.classList.add('horizontal')
+ this.container.classList.add('horizontal')
+ }
+ if (this.getProp('alignRight') && !this.getProp('horizontal')) {
+ this.widget.classList.add('align-right')
+ }
+ if (this.getProp('compact')) {
+ this.widget.classList.add('compact')
+ }
+ if (this.getProp('pips')) {
+ this.widget.classList.add('has-pips')
+ }
+
+ this.setValue([
+ this.faders[0].rangeValsMin,
+ this.faders[1].rangeValsMax
+ ])
+
+ }
+
+ setValue(v, options={}) {
+ if (!v || !v.length || v.length!=2) return
+
+
+ this.faders[0].rangeValsMax = v[1]
+ this.faders[1].rangeValsMin = v[0]
+
+ if (!options.dragged) {
+ this.faders[0].setValue(v[0])
+ this.faders[1].setValue(v[1])
+ }
+
+ this.value = [
+ this.faders[0].getValue(),
+ this.faders[1].getValue()
+ ]
+
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ this.faders[1].batchDraw()
+
+ this.showValue()
+
+
+ }
+
+ showValue() {
+
+ if (this.getProp('input')) this.input.setValue(this.value)
+
+ }
+
+ getSplit() {
+
+ return this.getProp('split')?
+ typeof this.getProp('split') == 'object' && this.getProp('split').length == 2 ?
+ this.getProp('split')
+ : [this.getProp('address') + '/low', this.getProp('address') + '/high']
+ : false
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of this.faders) {
+ w.onPropChanged('color')
+ }
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.faders[0].onRemove()
+ this.faders[1].onRemove()
+ if (this.input) this.input.onRemove()
+ super.onRemove()
+ }
+
+}
+
+
+Range.dynamicProps = Range.prototype.constructor.dynamicProps.filter(n => n !== 'precision')
+
+module.exports = Range
diff --git a/src/client/app/widgets/sliders/slider.js b/src/client/app/widgets/sliders/slider.js
new file mode 100644
index 00000000..62d496dc
--- /dev/null
+++ b/src/client/app/widgets/sliders/slider.js
@@ -0,0 +1,254 @@
+var {clip, mapToScale} = require('../utils'),
+ Canvas = require('../common/canvas'),
+ touchstate = require('../mixins/touch_state'),
+ doubletab = require('../mixins/double_tap'),
+ Input = require('../inputs/input'),
+ html = require('nanohtml')
+
+class Slider extends Canvas {
+
+ constructor(options) {
+
+ super({...options, html: html`
+
+ `})
+
+ this.wrapper = DOM.get(this.widget, '.wrapper')[0]
+
+ this.value = undefined
+ this.percent = 0
+
+ this.unit = this.getProp('unit') ? ' ' + this.getProp('unit') : ''
+
+
+ this.rangeKeys = []
+ this.rangeVals = []
+ this.rangeLabels = []
+
+ for (var k in this.getProp('range')) {
+ var key = k=='min'?0:k=='max'?100:parseInt(k),
+ val = typeof this.getProp('range')[k] == 'object'?
+ this.getProp('range')[k][Object.keys(this.getProp('range')[k])[0]]:
+ this.getProp('range')[k],
+ label = typeof this.getProp('range')[k] == 'object'?
+ Object.keys(this.getProp('range')[k])[0]:
+ val
+
+ this.rangeKeys.push(key)
+ this.rangeVals.push(val)
+ this.rangeLabels.push(label)
+ }
+ this.rangeValsMax = Math.max(...this.rangeVals),
+ this.rangeValsMin = Math.min(...this.rangeVals)
+
+ this.originValue = this.getProp('origin')=='auto'?
+ this.rangeValsMin:
+ clip(this.getProp('origin'), [this.rangeValsMin,this.rangeValsMax])
+
+ this.springValue = this.getProp('default') !== '' ? this.getProp('default') : this.originValue
+
+ if (this.getProp('doubleTap')) {
+
+ if (typeof this.getProp('doubleTap') === 'string' && this.getProp('doubleTap')[0] === '/') {
+
+ doubletab(this.widget, ()=>{
+ this.sendValue({v:null, address: this.getProp('doubleTap')})
+ })
+
+ } else {
+
+ doubletab(this.widget, ()=>{
+ this.setValue(this.springValue,{sync:true, send:true, fromLocal:true})
+ })
+
+ }
+
+ }
+
+
+ this.wrapper.addEventListener('mousewheel',this.mousewheelHandleProxy.bind(this))
+
+ this.on('draginit', this.draginitHandleProxy.bind(this), {element:this.wrapper})
+ this.on('drag', this.dragHandleProxy.bind(this), {element:this.wrapper})
+ this.on('dragend', this.dragendHandleProxy.bind(this), {element:this.wrapper})
+
+ touchstate(this, {element: this.wrapper})
+
+
+ if (this.getProp('input')) {
+
+ this.input = new Input({
+ props:{
+ ...Input.defaults()._props(),
+ precision:this.getProp('precision'),
+ unit:this.getProp('unit'),
+ vertical: this.getProp('type') == 'fader' && this.getProp('compact') && !this.getProp('horizontal')
+ },
+ parent:this, parentNode:this.widget
+ })
+
+ this.widget.appendChild(this.input.widget)
+ this.input.on('change', (e)=>{
+ e.stopPropagation = true
+ this.setValue(this.input.getValue(), {sync:true, send:true})
+ this.showValue()
+ })
+
+ }
+
+ this.setValue(this.springValue)
+
+ }
+
+ mousewheelHandleProxy() {
+
+ this.mousewheelHandle(...arguments)
+
+ }
+
+ draginitHandleProxy() {
+
+ this.draginitHandle(...arguments)
+
+ }
+
+ dragHandleProxy() {
+
+ this.dragHandle(...arguments)
+
+ }
+
+ dragendHandleProxy() {
+
+ this.dragendHandle(...arguments)
+
+ }
+
+ mousewheelHandle(e) {
+
+ if (e.wheelDeltaX) return
+
+ e.preventDefault()
+ e.stopPropagation()
+
+ var direction = e.wheelDelta / Math.abs(e.wheelDelta),
+ increment = e.ctrlKey?0.25:1
+
+ this.percent = clip(this.percent + Math.max(increment,10/Math.pow(10,this.precision + 1)) * direction, [0,100])
+
+ this.setValue(this.percentToValue(this.percent), {sync:true,send:true,dragged:true})
+
+ }
+
+ draginitHandle(e, data, traversing) {
+
+ }
+
+ dragHandle(e, data, traversing) {
+
+ }
+
+ dragendHandle(e, data, traversing) {
+
+ if (this.getProp('spring')) {
+ this.setValue(this.springValue,{sync:true,send:true,fromLocal:true})
+ }
+
+ }
+
+ cacheCanvasStyle(style) {
+
+ style = style || window.getComputedStyle(this.canvas)
+
+ super.cacheCanvasStyle(style)
+
+ this.colors.gauge = style.getPropertyValue('--color-gauge') || this.colors.custom
+ this.colors.knob = style.getPropertyValue('--color-knob') || this.colors.custom
+ this.colors.pips = style.getPropertyValue('--color-pips') || this.colors.custom
+ this.colors.gaugeOpacity = style.getPropertyValue('--gauge-opacity')
+
+
+ }
+
+
+ percentToValue(percent) {
+
+ var h = clip(percent,[0,100])
+ for (var i=0;i= this.rangeKeys[i]) {
+ return mapToScale(h,[this.rangeKeys[i],this.rangeKeys[i+1]],[this.rangeVals[i],this.rangeVals[i+1]],false,this.getProp('logScale'))
+ }
+ }
+
+ }
+
+ valueToPercent(value) {
+
+ for (var i=0;i this.rangeVals[i] && value <= this.rangeVals[i+1] && value >= this.rangeVals[i]) ||
+ (this.rangeVals[i+1] < this.rangeVals[i] && value >= this.rangeVals[i+1] && value <= this.rangeVals[i])
+ ) {
+ return mapToScale(value,[this.rangeVals[i],this.rangeVals[i+1]],[this.rangeKeys[i],this.rangeKeys[i+1]],false,this.getProp('logScale'),true)
+ }
+ }
+
+ }
+
+ setValue(v,options={}) {
+
+ if (typeof v != 'number') return
+ if (this.touched && !options.dragged) return this.setValueTouchedQueue = [v, options]
+
+ var value = clip(v,[this.rangeValsMin,this.rangeValsMax])
+
+ if ((options.dragged || options.fromLocal) && this.value.toFixed(this.precision) == value.toFixed(this.precision)) options.send = false
+
+ this.value = value
+
+ if (!options.dragged) this.percent = this.valueToPercent(this.value)
+
+ if (!this.noDraw) this.batchDraw()
+
+ this.showValue()
+
+ if (options.send) this.sendValue()
+ if (options.sync) this.changed(options)
+
+ }
+
+ showValue() {
+
+ if (this.getProp('input')) this.input.setValue(this.value)
+
+ }
+
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ if (this.input) this.input.onPropChanged('color')
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ if (this.input) this.input.onRemove()
+ super.onRemove()
+ }
+
+}
+
+Slider.dynamicProps = Slider.prototype.constructor.dynamicProps.filter(n => n !== 'precision')
+
+module.exports = Slider
diff --git a/src/browser/js/app/widgets/switchers/_switchers_base.js b/src/client/app/widgets/switchers/_switchers_base.js
similarity index 69%
rename from src/browser/js/app/widgets/switchers/_switchers_base.js
rename to src/client/app/widgets/switchers/_switchers_base.js
index 5c065ac3..e5563715 100644
--- a/src/browser/js/app/widgets/switchers/_switchers_base.js
+++ b/src/client/app/widgets/switchers/_switchers_base.js
@@ -1,11 +1,10 @@
-var _widgets_base = require('../common/_widgets_base'),
+var Widget = require('../common/widget'),
widgetManager = require('../../managers/widgets'),
osc = require('../../osc')
+module.exports = class _switchers_base extends Widget {
-module.exports = class _switchers_base extends _widgets_base {
-
- constructor(options) {
+ constructor(options) {
super(options)
@@ -19,7 +18,7 @@ module.exports = class _switchers_base extends _widgets_base {
}
- $('body').on(`change.${this.hash}`,this.syncHandler.bind(this))
+ widgetManager.on('change', this.syncHandler.bind(this), {context: this})
}
@@ -36,14 +35,6 @@ module.exports = class _switchers_base extends _widgets_base {
}
-
- onRemove() {
-
- $('body').off(`change.${this.hash}`)
- super.onRemove()
-
- }
-
isWatching(id, widget) {
if (this.linkedWidgets.indexOf(id) != -1) return true
@@ -54,7 +45,7 @@ module.exports = class _switchers_base extends _widgets_base {
for (var i in widgets) {
- if (widgets[i].widget[0].contains(widget.widget[0])) return true
+ if (widgets[i].contains(widget) || widgets[i] === widget) return true
}
@@ -91,20 +82,23 @@ module.exports = class _switchers_base extends _widgets_base {
}
- applyState(state, options) {
+ applyState(state, options) {
+
+ // extra sync routine to ensure linked widgets' props update before osc is sent
+ if (options.sync) this.changed({...options, send:false, sync:false})
+ //
+
for (var id in state) {
var value = state[id],
widgets = widgetManager.getWidgetById(id)
- if (widgets.length) {
- for (var i=widgets.length-1;i>=0;i--) {
- if (widgets[i].setValue) {
- widgets[i].setValue(value,{sync:options.sync, send:options.send})
- }
+ for (var i = widgets.length - 1; i >= 0; i--) {
+ if (widgets[i].setValue) {
+ widgets[i].setValue(value,{sync:options.sync, send:options.send})
}
}
}
- if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this, linkId:this.getProp('linkId'), options:options})
+ if (options.sync) this.changed(options)
if (options.send) this.sendValue()
}
diff --git a/src/browser/js/app/widgets/switchers/crossfader.js b/src/client/app/widgets/switchers/crossfader.js
similarity index 50%
rename from src/browser/js/app/widgets/switchers/crossfader.js
rename to src/client/app/widgets/switchers/crossfader.js
index ed3fbdbd..d51558df 100644
--- a/src/browser/js/app/widgets/switchers/crossfader.js
+++ b/src/client/app/widgets/switchers/crossfader.js
@@ -1,20 +1,27 @@
var Switcher = require('./switcher'),
+ Widget = require('../common/widget'),
Fader = require('../sliders/fader'),
- {mapToScale, clip} = require('../utils')
+ {mapToScale} = require('../utils')
-var faderDefaults = Fader.defaults()
+var faderDefaults = Fader.defaults()._props()
module.exports = class Crossfader extends Switcher {
static defaults(){
- var o = super.defaults()
- o.type = 'crossfader'
- delete o.values
+ return Widget.defaults({
- return o
+ _crossfader: 'crossfader',
+ linkedWidgets: {type: 'string|array', value: '', help: [
+ '- `String`: a widget\'s `id` whose state changes will be stored',
+ '- `Array`: a list of widget `id` string'
+ ]},
+ horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'}
+
+ })
+
}
constructor(options) {
@@ -26,30 +33,40 @@ module.exports = class Crossfader extends Switcher {
this.fader = new Fader({props:{
...faderDefaults,
horizontal: this.getProp('horizontal'),
- range: {min:{'A':0}, '50%':{" ":0.5},max:{'B':1}}
- }})
+ range: {min:{'A':0}, '50%':{' ':0.5},max:{'B':1}},
+ input: false
+ }, parent: this})
this.fader.sendValue = ()=>{}
- this.widget.append($('').append(this.fader.widget))
+ this.widget.appendChild(this.fader.widget)
- this.fader.widget.on('change', (e)=>{
+ if (this.getProp('horizontal')) {
+ this.widget.classList.add('horizontal')
+ } else {
+ this.widget.classList.add('vertical')
- e.stopPropagation()
+ }
+
+ this.fader.on('change', (e)=>{
+
+ e.stopPropagation = true
this.setValue(this.fader.getValue(), e.options)
})
+ this.value._fader = 0
+
}
setValue(v, options={}) {
- var v = v <= 0 || v == 'A' ?
- 'A' :
- v >= 1 || v == 'B' ?
- 'B' :
- v
+ v = v <= 0 || v == 'A' ?
+ 'A' :
+ v >= 1 || v == 'B' ?
+ 'B' :
+ v
super.setValue(v, options)
@@ -93,7 +110,7 @@ module.exports = class Crossfader extends Switcher {
if (!isNaN(s['A'][i][k])) {
- a[i][k] = mapToScale(v, [0,1], [s['A'][i][k], s['B'][i][k]], false)
+ a[i][k] = mapToScale(v, [0,1], [s['A'][i][k], s['B'][i][k]], false)
}
@@ -101,7 +118,7 @@ module.exports = class Crossfader extends Switcher {
} else if (!isNaN(s['A'][i])) {
- a[i] = mapToScale(v, [0,1], [s['A'][i], s['B'][i]], false)
+ a[i] = mapToScale(v, [0,1], [s['A'][i], s['B'][i]], false)
}
}
@@ -111,4 +128,25 @@ module.exports = class Crossfader extends Switcher {
}
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of [this.fader]) {
+ w.onPropChanged('color')
+ }
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.fader.onRemove()
+ super.onRemove()
+ }
+
}
diff --git a/src/client/app/widgets/switchers/switcher.js b/src/client/app/widgets/switchers/switcher.js
new file mode 100644
index 00000000..87a84613
--- /dev/null
+++ b/src/client/app/widgets/switchers/switcher.js
@@ -0,0 +1,88 @@
+var _switchers_base = require('./_switchers_base'),
+ Switch = require('../buttons/switch'),
+ html = require('nanohtml')
+
+var switchDefaults = Switch.defaults()._props()
+
+module.exports = class Switcher extends _switchers_base {
+
+ static defaults() {
+
+ return super.defaults({
+
+ _switcher: 'switcher',
+
+ linkedWidgets: {type: 'string|array', value: '', help: [
+ '- `String`: a widget\'s `id` whose state changes will be stored',
+ '- `Array`: a list of widget `id` string'
+ ]},
+ horizontal: {type: 'boolean', value: false, help: 'Set to `true` to display values horizontally'},
+ values: {type: 'array|object', value: {'Value 1':1,'Value 2':2}, help: [
+ 'Each item represents a bank that stores the values from the widgets listed in `linkedWidgets`',
+ '- `Array` of possible values to switch between : `[1,2,3]`',
+ '- `Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won\'t be kept',
+ ]}
+ })
+
+ }
+
+ constructor(options) {
+
+ super({...options, html: html``})
+
+ if (this.getProp('horizontal')) this.widget.classList.add('horizontal')
+
+ this.switch = new Switch({props:{
+ ...switchDefaults,
+ label:false,
+ values:this.getProp('values'),
+ value: this.getProp('value'),
+ horizontal:this.getProp('horizontal')
+ }, parent: this})
+
+ this.switch.sendValue = ()=>{}
+
+ this.widget.appendChild(this.switch.widget)
+
+ this.switch.on('change', (e)=>{
+
+ e.stopPropagation = true
+ e.options.fromSelf = true
+
+ this.setValue(this.switch.getValue(), e.options)
+
+ })
+
+
+ }
+
+ setValue(v, options={}) {
+
+ super.setValue(v, options)
+
+ if (!options.fromSelf) this.switch.setValue(this.value._selected)
+
+ }
+
+ onPropChanged(propName, options, oldPropValue) {
+
+ if (super.onPropChanged(...arguments)) return true
+
+ switch (propName) {
+
+ case 'color':
+ for (var w of [this.switch]) {
+ w.onPropChanged('color')
+ }
+ return
+
+ }
+
+ }
+
+ onRemove() {
+ this.switch.onRemove()
+ super.onRemove()
+ }
+
+}
diff --git a/src/client/app/widgets/utils.js b/src/client/app/widgets/utils.js
new file mode 100644
index 00000000..8294345b
--- /dev/null
+++ b/src/client/app/widgets/utils.js
@@ -0,0 +1,108 @@
+module.exports = {
+
+ clip: function(value,range) {
+
+ value = parseFloat(value)
+
+ if (isNaN(value)) value = range[0]
+ return Math.max(Math.min(range[0],range[1]),Math.min(value,Math.max(range[0],range[1])))
+
+ },
+
+ // map a value from a scale to another input and output must be range arrays
+ mapToScale: function(value,rangeIn,rangeOut,precision,log,revertlog) {
+
+ value = module.exports.clip(value,[rangeIn[0],rangeIn[1]])
+
+ value = log ?
+ revertlog ?
+ (Math.pow(10,((value-rangeIn[0])/(rangeIn[1]-rangeIn[0])))/9-1/9) * (rangeOut[1]-rangeOut[0]) + rangeOut[0]
+ :Math.log10(((value-rangeIn[0])/(rangeIn[1]-rangeIn[0]))*9+1) * (rangeOut[1]-rangeOut[0]) + rangeOut[0]
+ :((value-rangeIn[0])/(rangeIn[1]-rangeIn[0])) * (rangeOut[1]-rangeOut[0]) + rangeOut[0]
+
+ value = Math.max(Math.min(rangeOut[0],rangeOut[1]),Math.min(value,Math.max(rangeOut[0],rangeOut[1])))
+
+ if (precision !== false) value = parseFloat(value.toFixed(precision))
+
+
+ return value
+
+ },
+
+ hsbToRgb: function(hsb) {
+ var rgb = {}
+ var h = hsb.h
+ var s = hsb.s*255/100
+ var v = hsb.b*255/100
+ if(s == 0) {
+ rgb.r = rgb.g = rgb.b = v
+ } else {
+ var t1 = v
+ var t2 = (255-s)*v/255
+ var t3 = (t1-t2)*(h%60)/60
+ if(h==360) h = 0
+ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
+ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
+ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
+ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
+ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
+ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
+ else {rgb.r=0; rgb.g=0; rgb.b=0}
+ }
+ return rgb
+ },
+
+ rgbToHsb: function(rgb) {
+ var hsb = {h: 0, s: 0, b: 0}
+ var min = Math.min(rgb.r, rgb.g, rgb.b)
+ var max = Math.max(rgb.r, rgb.g, rgb.b)
+ var delta = max - min
+ hsb.b = max
+ hsb.s = max != 0 ? 255 * delta / max : 0
+ if (hsb.s != 0) {
+ if (rgb.r == max) hsb.h = (rgb.g - rgb.b) / delta
+ else if (rgb.g == max) hsb.h = 2 + (rgb.b - rgb.r) / delta
+ else hsb.h = 4 + (rgb.r - rgb.g) / delta
+ } else hsb.h = 0
+ hsb.h *= 60
+ if (hsb.h < 0) hsb.h += 360
+ hsb.s *= 100/255
+ hsb.b *= 100/255
+ return hsb
+ },
+
+ math: (()=>{
+ var math = require('mathjs/dist/math.min.js').create({
+ matrix: 'Array'
+ })
+ math.import({
+ unpack: function(a) { return Array.isArray(a) ? a.toString() : a },
+ pad: function(x, padding) {
+ var str = String(x),
+ [int, dec] = str.split('.')
+ while (int.length < padding) {
+ int = '0' + int
+ }
+ return dec ? int + '.' + dec : int
+ },
+ length: function(x) { return x.length },
+ values: function(x) { return Object.values(x) },
+ keys: function(x) { return Object.keys(x) },
+ extend: function(x, y) { return Object.assign(x, y) },
+ timestamp: function() { return Date.now() },
+ // basic relationnal to keep alphabetical string comparison (v4 change)
+ equal: function(a, b) { return a == b },
+ unequal: function(a, b) { return a != b },
+ smaller: function(a, b) { return a < b },
+ larger: function(a, b) { return a > b },
+ smallerEq: function(a, b) { return a <= b },
+ largerEq: function(a, b) { return a >= b }
+ }, {override:true})
+
+ // set math's parser array index base to zero
+ math.expression.mathWithTransform = Object.assign({}, math)
+
+ return math
+ })()
+
+}
diff --git a/src/client/index.js b/src/client/index.js
new file mode 100644
index 00000000..8a8aacf6
--- /dev/null
+++ b/src/client/index.js
@@ -0,0 +1,27 @@
+require('./app/stacktrace')
+
+require('./app/globals')
+
+var {loading} = require('./app/ui/utils'),
+ locales = require('./app/locales')
+
+document.addEventListener('DOMContentLoaded', function(event) {
+
+ DOM.init()
+
+ LOADING = loading(locales('loading_server'))
+
+ setTimeout(()=>{
+
+ var ipc = require('./app/ipc/')
+
+ ipc.init()
+
+ require('./app/ui/init')
+
+ ipc.send('ready', {backupId: ARGV.backupId})
+
+
+ }, 100)
+
+})
diff --git a/src/client/libs/jquery.touch.js b/src/client/libs/jquery.touch.js
new file mode 100644
index 00000000..d8f533d4
--- /dev/null
+++ b/src/client/libs/jquery.touch.js
@@ -0,0 +1,183 @@
+/*!
+ * jQuery UI Touch Punch 0.2.3
+ *
+ * Copyright 2011–2014, Dave Furfero
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ *
+ * Depends:
+ * jquery.ui.widget.js
+ * jquery.ui.mouse.js
+ */
+(function ($) {
+
+ // Detect touch support
+ $.support.touch = 'ontouchend' in document;
+
+ // Ignore browsers without touch support
+ if (!$.support.touch) {
+ return;
+ }
+
+ var mouseProto = $.ui.mouse.prototype,
+ _mouseInit = mouseProto._mouseInit,
+ _mouseDestroy = mouseProto._mouseDestroy,
+ touchHandled;
+
+ /**
+ * Simulate a mouse event based on a corresponding touch event
+ * @param {Object} event A touch event
+ * @param {String} simulatedType The corresponding mouse event
+ */
+ function simulateMouseEvent (event, simulatedType) {
+
+ // Ignore multi-touch events
+ if (event.originalEvent.touches.length > 1) {
+ return;
+ }
+
+ event.preventDefault();
+
+ var touch = event.originalEvent.changedTouches[0],
+ simulatedEvent = document.createEvent('MouseEvents');
+
+ // Initialize the simulated mouse event using the touch event's coordinates
+ simulatedEvent.initMouseEvent(
+ simulatedType, // type
+ true, // bubbles
+ true, // cancelable
+ window, // view
+ 1, // detail
+ touch.screenX, // screenX
+ touch.screenY, // screenY
+ touch.clientX, // clientX
+ touch.clientY, // clientY
+ false, // ctrlKey
+ false, // altKey
+ false, // shiftKey
+ false, // metaKey
+ 0, // button
+ null // relatedTarget
+ );
+
+ // osc: add a flag to prevent fast-click
+ simulatedEvent.touchPunch = true
+
+ // Dispatch the simulated event to the target element
+ event.target.dispatchEvent(simulatedEvent);
+ }
+
+ /**
+ * Handle the jQuery UI widget's touchstart events
+ * @param {Object} event The widget element's touchstart event
+ */
+ mouseProto._touchStart = function (event) {
+
+ var self = this;
+
+ // Ignore the event if another widget is already being handled
+ if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
+ return;
+ }
+
+ // Set the flag to prevent other widgets from inheriting the touch event
+ touchHandled = true;
+
+ // Track movement to determine if interaction was a click
+ self._touchMoved = false;
+
+ // Simulate the mouseover event
+ simulateMouseEvent(event, 'mouseover');
+
+ // Simulate the mousemove event
+ simulateMouseEvent(event, 'mousemove');
+
+ // Simulate the mousedown event
+ simulateMouseEvent(event, 'mousedown');
+ };
+
+ /**
+ * Handle the jQuery UI widget's touchmove events
+ * @param {Object} event The document's touchmove event
+ */
+ mouseProto._touchMove = function (event) {
+
+ // Ignore event if not handled
+ if (!touchHandled) {
+ return;
+ }
+
+ // Interaction was not a click
+ this._touchMoved = true;
+
+ // Simulate the mousemove event
+ simulateMouseEvent(event, 'mousemove');
+ };
+
+ /**
+ * Handle the jQuery UI widget's touchend events
+ * @param {Object} event The document's touchend event
+ */
+ mouseProto._touchEnd = function (event) {
+
+ // Ignore event if not handled
+ if (!touchHandled) {
+ return;
+ }
+
+ // Simulate the mouseup event
+ simulateMouseEvent(event, 'mouseup');
+
+ // Simulate the mouseout event
+ simulateMouseEvent(event, 'mouseout');
+
+ // If the touch interaction did not move, it should trigger a click
+ if (!this._touchMoved) {
+
+ // Simulate the click event
+ simulateMouseEvent(event, 'click');
+ }
+
+ // Unset the flag to allow other widgets to inherit the touch event
+ touchHandled = false;
+ };
+
+ /**
+ * A duck punch of the $.ui.mouse _mouseInit method to support touch events.
+ * This method extends the widget with bound touch event handlers that
+ * translate touch events to mouse events and pass them to the widget's
+ * original mouse event handling methods.
+ */
+ mouseProto._mouseInit = function () {
+
+ var self = this;
+
+ // Delegate the touch handlers to the widget's element
+ self.element.bind({
+ touchstart: $.proxy(self, '_touchStart'),
+ touchmove: $.proxy(self, '_touchMove'),
+ touchend: $.proxy(self, '_touchEnd')
+ });
+
+ // Call the original $.ui.mouse init method
+ _mouseInit.call(self);
+ };
+
+ /**
+ * Remove the touch event handlers
+ */
+ mouseProto._mouseDestroy = function () {
+
+ var self = this;
+
+ // Delegate the touch handlers to the widget's element
+ self.element.unbind({
+ touchstart: $.proxy(self, '_touchStart'),
+ touchmove: $.proxy(self, '_touchMove'),
+ touchend: $.proxy(self, '_touchEnd')
+ });
+
+ // Call the original $.ui.mouse destroy method
+ _mouseDestroy.call(self);
+ };
+
+})($);
diff --git a/src/browser/js/libs/jquery.ui.js b/src/client/libs/jquery.ui.js
similarity index 98%
rename from src/browser/js/libs/jquery.ui.js
rename to src/client/libs/jquery.ui.js
index 2fdd10a6..8ba8cd1d 100644
--- a/src/browser/js/libs/jquery.ui.js
+++ b/src/client/libs/jquery.ui.js
@@ -6,15 +6,3 @@
(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t($)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.0";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l=this;return a?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new s(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var s=!1;t(document).on("mouseup",function(){s=!1}),t.widget("ui.mouse",{version:"1.12.0",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!s){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,n=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),s=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,s=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this._blurActiveElement(e),this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("
").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);this._getHandle(e)&&s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left
i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(l=this.originalPageX),"x"===a.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY=0;d--)l=s.snapElements[d].left-s.margins.left,h=l+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,l-g>_||m>h+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(l-_),r=g>=Math.abs(h-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(l-m),r=g>=Math.abs(h-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())
}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t(""),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,l=this._change[o];return this._updatePrevProperties(),l?(i=l.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,l,h=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,l=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,h.animate||this.element.css(t.extend(a,{top:l,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth
t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&c&&(t.top=l-e.minHeight),n&&c&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t(""),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,l={width:i.size.width-r,height:i.size.height-a},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,c&&h?{top:c,left:h}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,l=t(this).resizable("instance"),h=l.options,c=l.element,u=h.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(l.containerElement=t(d),/document/.test(u)||u===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=l._num(e.css("padding"+s))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=l.containerOffset,n=l.containerSize.height,o=l.containerSize.width,a=l._hasScroll(d,"left")?d.scrollWidth:o,r=l._hasScroll(d)?d.scrollHeight:n,l.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,l=a.containerOffset,h=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=l),h.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?l.left:0),h.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?l.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-l.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-l.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),l=a.outerWidth()-e.sizeDiff.width,h=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,l="number"==typeof s.grid?[s.grid,s.grid]:s.grid,h=l[0]||1,c=l[1]||1,u=Math.round((n.width-o.width)/h)*h,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=l,_&&(p+=h),v&&(f+=c),g&&(p-=h),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-h)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-h>0?(i.size.width=p,i.position.left=a.left-u):(p=h-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.sortable",t.ui.mouse,{version:"1.12.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+h>r&&l>s+h,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&l>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(s=h.length-1;s>=0;s--)for(o=t(h[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=l.length-1;s>=0;s--)l[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,l,h,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,h=r.length;h>s;s++)l=t(r[s]),l.data(this.widgetName+"-item",a),c.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("| | ",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,l,h,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(l=this.items[s].item.offset()[a],h=!1,e[u]-l>this.items[s][r]/2&&(h=!0),n>Math.abs(e[u]-l)&&(n=Math.abs(e[u]-l),o=this.items[s],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1
}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})});
-
-/*!
- * jQuery UI Touch Punch 0.2.3
- *
- * Copyright 2011–2014, Dave Furfero
- * Dual licensed under the MIT or GPL Version 2 licenses.
- *
- * Depends:
- * jquery.ui.widget.js
- * jquery.ui.mouse.js
- */
-!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.on({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.off({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}($);
diff --git a/src/launcher/index.js b/src/launcher/index.js
new file mode 100644
index 00000000..fa66f1b0
--- /dev/null
+++ b/src/launcher/index.js
@@ -0,0 +1,305 @@
+var {remote, ipcRenderer, shell} = eval('require(\'electron\')'),
+ {dialog, Menu, MenuItem, app} = remote.require('electron'),
+ menu = new Menu(),
+ settings = remote.getGlobal('settings'),
+ packageInfos = remote.require('./package.json'),
+ packageVersion = packageInfos.version,
+ packageUrl = packageInfos.repository.url,
+ argv_remote = settings.read('argv'),
+ ansiHTML = require('ansi-html'),
+ argv = {},
+ $ = require('jquery/dist/jquery.slim.min.js')
+
+for (i in argv_remote) {
+ argv[i] = argv_remote[i]
+}
+
+$(document).ready(()=>{
+
+ var form = $(`
+