updating the docs, site mkdocs site on the way

This commit is contained in:
jean-emmanuel 2016-03-30 17:08:56 +02:00
parent df1c2d26f4
commit 0d5b1a0c0c
20 changed files with 619 additions and 247 deletions

View file

@ -1,29 +0,0 @@
## Build from sources
**Requirements**
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
```bash
$ sudo apt-get install npm # install nodejs & npm
$ sudo npm install -g npm # update npm
```
**Build**
```bash
$ git clone https://github.com/jean-emmanuel/open-stage-control
$ cd open-stage-control
$ npm install --save-optional
$ export PLATFORM=TARGET_PLATFORM # TARGET_PLATFORM can be linux, win32 (windows) or darwin (os x)
$ export ARCH=TARGET_ARCH # TARGET_ARCH can be ia32 or x64
$ npm run build
$ # Do the following if you want a deb package for debian/ubuntu
$ npm run deb32
$ # or
$ npm run deb64
```
This will build the app in `dist/open-stage-control-PLATFORM-ARCH`.
*Please note that building the app for windows from a linux system requires wine to be installed.*

View file

@ -0,0 +1,100 @@
# Getting started
## Run from binaries
Prebuilt binaries for Linux, Windows and OS X can be found on the [release](https://github.com/jean-emmanuel/open-stage-control/releases) page.
```bash
Options:
-h, --help display help
-s, --sync synchronized hosts (ip:port pairs) (all osc messages will also be sent to these)
-l, --load session file to load
-p, --port osc input port (for synchronization)
-n, --nogui disable default gui and makes the app availabe through http on specified port
-t, --theme theme name or path (mutliple values allowed)
Exemples:
$ open-stage-control -s 127.0.0.1:5555 127.0.0.1:6666 -p 7777
This will create an app listening on port 7777 for synchronization messages, and sending its widgets state changes to ports 5555 and 6666.
$ open-stage-control -n 8080 -l path/to/session.js
This will create a headless app available through http on port 8080. Multiple clients can use the app (with chrome only) simultaneously, their widgets will be synchronized.
$ open-stage-control -t light noinput /path/to/custom_theme.css
This will apply three themes (light ui, remove all inputs, and a custom theme file)
Available themes:
- light
- noinput
```
## Run from sources
Running the app from the sources slightly differs from using built binaries : instead of running a binary, we'll launch the app with npm.
**Requirements**
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
```bash
$ sudo apt-get install npm # install nodejs & npm
$ sudo npm install -g npm # update npm
```
**Download**
```bash
$ git clone https://github.com/jean-emmanuel/open-stage-control
$ cd open-stage-control/
$ npm install --save-optional
```
**Run**
```bash
$ npm start [ -- options]
# A double hyphen ("--") is used here to tell npm that the following options are to be given to the app.
```
## Build from sources
**Requirements**
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
```bash
$ sudo apt-get install npm # install nodejs & npm
$ sudo npm install -g npm # update npm
```
**Build**
```bash
$ git clone https://github.com/jean-emmanuel/open-stage-control
$ cd open-stage-control
$ npm install --save-optional
$ export PLATFORM=TARGET_PLATFORM # TARGET_PLATFORM can be linux, win32 (windows) or darwin (os x)
$ export ARCH=TARGET_ARCH # TARGET_ARCH can be ia32 or x64
$ npm run build
$ # Do the following if you want a deb package for debian/ubuntu
$ npm run deb32
$ # or
$ npm run deb64
```
This will build the app in `dist/open-stage-control-PLATFORM-ARCH`.
*Please note that building the app for windows from a linux system requires wine to be installed.*

42
resources/docs/index.md Normal file
View file

@ -0,0 +1,42 @@
# Open Stage Control
Open Stage Control is a libre desktop OSC bi-directionnal control surface application. It's built with HTML, JavaScript & CSS on top of [Electron](http://electron.atom.io/) framework.
## Demo
You can try the app here [http://openstagecontrol.herokuapp.com/](http://openstagecontrol.herokuapp.com/)
Please note that :
- Chrome/Chromium **49** at least is required
- Since there is only one instance running, all connected guests are synchronized (widgets using the same osc paths update each other's states) : you might experience some unwanted synchronization with other users unless you specify custom parameters for your widgets.
- You might want to download the examples sessions files under *examples/* and load them in the app to get started.
## Features
- mouse & multi-touch sensitive widgets
- modular & responsive layout
- built-in live editor
- bi-directionnal osc bindings
- headless server mode with any number of clients using chromium
- app state store / recall & import / export
- themes !
### License & credits
Copyleft © Jean-Emmanuel @ [AMMD](http://ammd.net). This program is released under the GNU/GPL3 license.
It relies on the use of several libraries :
- [Node.js](https://nodejs.org/)
- [Electron](http://electron.atom.io/)
- [node-osc](https://github.com/TheAlphaNerd/node-osc)
- [socket.io](http://socket.io)
- [browserify](http://browserify.org)
- [express](http://expressjs.com)
- [node-sass](https://github.com/sass/node-sass)
- [jQuery](http://jquery.com/)
- [jQuery-UI](http://jqueryui.com/) (draggable, resizable & sortable)
- [Font Awesome](http://fontawesome.io/)

View file

@ -1,27 +0,0 @@
## Run from sources
Running the app from the sources slightly differs from using built binaries : instead of running a binary, we'll launch the app with npm.
**Requirements**
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
```bash
$ sudo apt-get install npm # install nodejs & npm
$ sudo npm install -g npm # update npm
```
**Download**
```bash
$ git clone https://github.com/jean-emmanuel/open-stage-control
$ cd open-stage-control/
$ npm install --save-optional
```
**Run**
```bash
$ npm start [ -- options]
# A double hyphen ("--") is used here to tell npm that the following options are to be given to the app.
```

View file

@ -1,40 +0,0 @@
## Session file reference
A valid session file is a javascript file that returns, when eval'd, an array of tab objects. It can be written as a javascript object :
```js
[
{
id:"my_tab_id", // [string] optional, default to unique 'tab_n'
label:"My tab", // [string] default to id
widgets: [], // [array] of widget objects
tabs: [] // [array] of tab objects
// A tab cannot contain widgets and tabs simultaneously
},
{
// etc
}
]
```
It can also be a self invoking function that returns an array of objects :
```js
(function(){
var tabs = []
for (for i in [0,1,2,3]) {
tabs.push({
id:'tab'+i,
widgets: [
{
id:'tab'+i+'fader',
type:'fader'
}
// etc
]
})
}
return tabs
}()
```

View file

@ -1,20 +1,25 @@
# Editor
## User interface
----
## Editor
The session editor can be enabled in the side panel. Once enabled, clicking on a widget or on a tab will make it the *selected object*, adding a fancy dashed blue border to it.
## Properties
### Properties
All the selected object's properties are displayed and can be modified in the side panel. Any modification will redraw the object **and all its children** if the submitted data is valid. Please refer to the [widgets reference](widgets-reference.md) for the list of valid options.
All the selected object's properties are displayed and can be modified in the side panel. Any modification will redraw the object **and all its children** if the submitted data is valid. Please refer to the [widgets reference](widgets-generics.md) for the list of valid options.
Widgets containers such as tabs, strips and panels will also list their children here, which can be reordered using drag-and-drop.
## Size / Position
### Size / Position
The selected object can be resized using its south, south-east and east handles. It can be dragged with its north handle.
## Context menu
### Context menu
Right clicking on a widget or on a tab will also display a context menu providing useful utilities :

View file

@ -0,0 +1,74 @@
## Session file
A valid session file is a javascript file that returns, when eval'd, an array of tab objects. It can be written as a javascript object :
```js
[
{
label:"A tab containing widgets",
widgets: [
{
// widget properties
},
{
// etc
}
]
},
{
label:"A tab containing tabs",
tabs: [
{
// tab properties
},
{
// etc
}
]
},
{
// tab properties
}
]
```
It can also be a self invoking function that returns an array of tab objects :
```js
(function(){
var tabs = []
for (for i in [0,1,2,3]) {
tabs.push({
id:'tab'+i,
widgets: [
{
id:'tab'+i+'fader',
type:'fader'
}
// etc
]
})
}
return tabs
}()
```
----
## Tab object
### `label`
- type: `string`
- default: `Unnamed`
### `widgets`
- type: `array`
- default: `[]`
- usage: each element of the `array` must be a `widget` object. A tab cannot contain widgets and tabs simultaneously.
### `tabs`
- type: `array`
- default: `[]`
- usage: each element of the `array` must be a `tab` object. A tab cannot contain widgets and tabs simultaneously.

View file

@ -0,0 +1,101 @@
## Widgets generics
Widget objects share a set of generic properties described below. Each widget type comes with an additional set of specific properties which are documented in these pages:
- [Sliders](widgets-specifics/sliders.md)
- [Buttons](widgets-specifics/buttons.md)
- [Pads](widgets-specifics/pads.md)
- [Matrices](widgets-specifics/matrices.md)
- [Plots](widgets-specifics/plots.md)
- [Containers](widgets-specifics/containers.md)
----
## Basics
#### `type`
- type: `string`
- default: `fader`
#### `id`
- type: `string`
- default: generated unique 'widget_n'
- usage: widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages.
----
## Style
#### `label`
- type: `string|false`
- default: `auto`, which displays `id`
- usage: set to `false` to hide completely
#### `top` / `left`
- type: `number|percentage`
- default: `auto`
- usage:
- 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` / `height`
- type: `number|percentage`
- default: `auto`
#### `color`
- type: `string`
- default: `auto`, inherited accent color
- usage: any valid `css` color code is valid, this will change the default accent color for the widget and all its children
#### `css`
- type: `string`
- default: *empty*
- usage: the `css` property can be used to override inherited [theming](theming.md) variables. Also, some widgets expose specific theming variables that allow a finer customization. Standard `css` properties can be applied to the widget's root element though this property.
----
## OSC
#### `precision`
- type: `integer`
- default: `2`
- usage: the `precision` property defines the number of decimals to display and to send. Set to `0` to send `integers` only.
#### `target`
- type: `array`
- default: `[]`
- usage:
- this defines the targets of the widget's osc messages
- each element of the `array` must be a string formatted as follows : `"ip:port"`
- multiple targets can be specified : `["ip1:port1","ip2:port2"]`
#### `path`
- type: `string`
- default: `/widgets_id`
- usage: this is the `path` of the osc messages sent by the widget
#### `preArgs`
- type: `array`
- default: `[]`
- usage:
- each element of the `array` defines a constant value that will be prepended to the osc message
- values can be defined as objects if the type needs to be specified (ie different from the default implied by the `precision`)
- example:
```js
[
"1", // this will always be sent as a string
0.5, // this will be sent as an integer if precision equals 0
1, // this will be sent as float if precision is different from 0
{
type:"float",
value:0.5
},
{
type:"integer",
value:1
}
]
```

View file

@ -0,0 +1,77 @@
## Buttons
Buttons are exactly what you think they are.
----
## Toggle
```js
{
type:'toggle',
// etc
}
```
### `on`
- type: `string|number|object`
- default: `1`
- usage: defines which value is sent on `on` position
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
### `off`
- type: `string|number|object`
- default: `0`
- usage: defines which value is sent on `off` position
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
----
## Push
```js
{
type:'push',
// etc
}
```
### `on`
- type: `string|number|object`
- default: `1`
- usage: defines which value is sent when pushing the button
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
### `off`
- type: `string|number|object`
- default: `0`
- usage: defines which value is sent when releasing the button
- set to `null` to send send no argument in the osc message
- set to `false` to prevent sending any osc message
- can be an object if the type needs to be specified (see [preArgs](../widgets-generics.md#preargs))
Setting the `push`'s value externally (via osc or widget linking/cloning) will toggle it's inner light.
----
## Switch
```js
{
type:'switch',
// etc
}
```
### `values`
- type: `array|object`
- default: `{"Value 1":1,"Value 2":2}`
- usage:
- `array` of possible values to switch between : `[1,2,3]`
- `object` of `"label":value` pairs

View file

@ -0,0 +1,75 @@
## Pads
Pads are multidimensional widgets that output multiple values.
----
## XY
```js
{
type:'xy',
// etc
}
```
#### `range`
- type: `object`
- default:
`{
x:{"min":0,"max":1},
y:{"min":0,"max":1}
}`
- usage: defines the `x` and `y` axis (no breakpoints, only `min` and `max`)
#### `logScaleX`
- type: `boolean`
- default: `false`
- usage: set to `true` to use logarithmic scale for the `x` axis (log10)
#### `logScaleY`
- type: `boolean`
- default: `false`
- usage: set to `true` to use logarithmic scale for the `y` axis (log10)
#### `snap`
- type: `boolean`
- default: `false`
- usage: 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.
#### `split`
- type: `boolean|object`
- default: `false`
- usage:
- set to `true` to send separate osc messages for `x` and `y` axis. The `path` 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 `path` : `{x:'/osc_path_x', y:'/osc_path_y'}`
----
## RGB
RGB is a variant of XY, it outputs rgb values between 0 and 255.
```js
{
type:'rgb',
// etc
}
```
#### `precision`
- default:`0`
#### `snap`
- type: `boolean`
- default: `false`
- usage: 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.
#### `split`
- type: `boolean|object`
- default: `false`
- usage:
- set to `true` to send separate osc messages for `r` and `g` & `b`. The `path` 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 `path` : `{r:'/osc_path_r', g:'/osc_path_g',b:'/osc_path_b'}`

View file

@ -0,0 +1,137 @@
## Sliders
Sliders are unidimensional widgets that output one value at a time.
----
## Fader
```js
{
type:'fader',
// etc
}
```
#### `horizontal`
- type: `boolean`
- default: `false`
- usage: set to true to display the fader horizontally
#### `align`
- type: `string`
- default: `center`
- usage: set to `left` or `right` to display one scale instead of two
#### `noPip`
- type: `boolean`
- default: `false`
- usage: set to true to hide the scale
#### `range`
- type: `boolean`
- default: `object`
- usage: `range` defines the breakpoints of the fader's scale
- keys can be percentages and/or `min` / `max`
- values can be numbers or object if a custom label is needed
- example:
```js
range: {
"min":0,
"50%":1,
"max": {"inf":10} // "inf" will be used as a custom label on the scale
}
```
#### `horizontal`
- type: `boolean`
- default: `false`
- usage: set to true to display the fader horizontally
#### `logScale`
- type: `boolean`
- default: `false`
- usage: set to true use logarithmic scaling between breakpoints
#### `unit`
- type: `string`
- default: `empty`
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
#### `snap`
- type: `boolean`
- default: `false`
- usage: 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.
#### `meter`
- type: `boolean`
- default: `false`
- usage: set to true to display a vu-meter next in the fader
- the meter's `id` will be the same as the fader's with `#meter` appended to it
- the meter's `path `will be the same as the fader's with `/meter` appended to it
#### `css`
```
--color-gauge:color;
--color-knob:color;
--color-pips:color;
```
----
## Knob
```js
{
type:'knob',
// etc
}
```
#### `noPip`
- type: `boolean`
- default: `false`
- usage: set to true to hide the scale
#### `range`
- type: `boolean`
- default: `object`
- usage: `range` defines the breakpoints of the fader's scale
- keys can be percentages and/or `min` / `max`
- values can be numbers or object if a custom label is needed
- example:
```js
range: {
"min":0,
"50%":1,
"max": {"inf":10} // "inf" will be used as a custom label on the scale
}
```
#### `logScale`
- type: `boolean`
- default: `false`
- usage: set to true use logarithmic scaling between breakpoints
#### `unit`
- type: `string`
- default: `empty`
- usage: `unit` will be appended to the displayed widget's value (it doesn't affect osc messages)
#### `snap`
- type: `boolean`
- default: `false`
- usage: by default, dragging the widget *vertically* will modify it's value starting from its last value. Setting this to true will make it snap directly to the mouse/touch position.
#### `css`
```
--color-gauge:color;
--color-knob:color;
--color-pips:color;
```

View file

@ -1,43 +0,0 @@
# Widgets reference
## Widget generics
Every widget has the following properties:
```js
{
id:"my_widget_id", // [string] optional, default to unique 'widget_n'
label:"My widget", // [string|false] default to id, false to hide completely
top:"auto", // [number|percentage%] if set, the widget will have an absolute position
left:"auto", // [string|percentage%] if set, the widget will have an absolute position
width:"auto", // [string|percentage%] widget's width
height:"auto", // [string|percentage%] widget's height
color:'auto', // [string] css color code replacing the default accent color
css:"", // [string] css styles, yeah
precision:2, // [integer] number of decimals : 0 to send integers
target:false, // [array/string] List of target hosts ("ip:port" pairs), separated by spaces
path:false, // [string] osc path, default to '/widget_id'
preArgs:[] // [array] list of constant values to prepend to the sent value(s)
// a value's type can be specified by writing it as an object:
// preArgs: [{type:"integer",value:1}]
}
```
**Important note about position (`left` & `top`)** : by default, the widget will be positioned according to the normal flow of the page (from left to right, by order of creation).
## CSS
The css property can be used to override theming variables (see [theming](theming.md) for a widget. Also, some widgets expose specific theming variables that allow a finer customization.
## Widget specifics
Each widget type comes with an additional set of specific properties which are described in the pages listed below.
- [Sliders](widgets/sliders.md)
- [Buttons](widgets/buttons.md)
- [Pads](widgets/pads.md)
- [Matrices](widgets/matrices.md)
- [Plots](widgets/plots.md)
- [Containers](widgets/containers.md)

View file

@ -1,26 +0,0 @@
# Buttons
Buttons are exactly what you think they are.
## toggle
```js
type:'toggle',
on: 1, // [string|number|false|null] value sent when toggle is on (false to prevent sending, null to send no arg)
off:0, // [string|number|false|null] value sent when toggle is off (false to prevent sending, null to send no arg)
```
## push
```js
type:'push',
on: 1, // [string|number|false|null] value sent when toggle is on (false to prevent sending, null to send no arg)
off:0, // [string|number|false|null] value sent when toggle is off (false to prevent sending, null to send no arg)
```
## switch
```js
type:'switch',
values: { // [object] of ("label":value) pairs
"Value 1":1,
"Value 2":2
}
```

View file

@ -1,29 +0,0 @@
# Pads
Pads are multidimensional widgets that output multiple values.
## xy
```js
type:'xy',
range:{ // [object] minimum and maximum values for x and y axis
x:{"min":0,"max":1},
y:{"min":0,"max":1}
},
logScaleX: false, // [bool] use logarithmic scale for X axis (log10)
logScaleY: false, // [bool] use logarithmic scale for y axis (log10)
absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging
split:false // [bool|object] sends separate osc messages for x and y axes
// if true : '/x' & '/y' will be appended to the widget's path
// or object : {x:'/osc_path_x', y:'/osc_path_y'}
```
## rgb
```js
type:'rgb',
absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging
split:false // [bool|object] sends separate osc messages for x and y axes
// if true : '/r', '/g' & '/b' will be appended to the widget's path
// or object : {r:'/osc_path_r', g:'/osc_path_g',b:'/osc_path_b'}
```
Variant of xy pad, it outputs rgb values between 0 and 255.

View file

@ -1,48 +0,0 @@
# Sliders
Sliders are unidimensional widgets that output one value at a time.
## fader
```js
type:'fader',
horizontal:false, // [bool] set to true to display fader horizontally
align:'center', // [left|right] only display one scale and one meter
noPip:false, // [bool] set to true to hide the scale
range: {"min":0,"max":1}, // [object] defining the breakpoints of the fader's scale
// keys can be percentages or 'min' / 'max'
// custom label can be set by writing the value as an object:
// range: {
// min:{'-inf':0}
// max:1
// }
logScale: false, // [bool] use logarithmic scale (log10)
unit: false, // [string] value suffix
absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging
meter:false, // [bool] set to true to display a vumeter which will display values send to '/widgets_path/meter'
```
**theming vars**
```
--color-gauge:CSS_COLOR;
--color-knob:CSS_COLOR;
--color-pips:CSS_COLOR;
```
## knob
```js
type:'knob',
noPip:false, // [bool] set to true to hide the scale
range: {"min":0,"max":1}, // [object] defining the breakpoints of the knob's scale (same as fader)
logScale: false, // [bool] use logarithmic scale (log10)
unit: false, // [string] value suffix
absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging
```
**theming vars**
```
--color-gauge:CSS_COLOR;
--color-knob:CSS_COLOR;
--color-pips:CSS_COLOR;
```

3
resources/mkdocs.yml Normal file
View file

@ -0,0 +1,3 @@
site_name: OSC
repo_url: https://github.com/jean-emmanuel/open-stage-control
theme: yeti