From 6e8e4b0de21f40d3431e078875083eedff9d75dc Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 2 Mar 2016 16:03:54 +0100 Subject: [PATCH] split docs, rename mac to osc --- .travis.yml | 12 +- README.md | 185 ++------------------------- package.json | 5 +- resources/docs/build-from-sources.md | 27 ++++ resources/docs/run-from-sources.md | 27 ++++ resources/docs/session-reference.md | 40 ++++++ resources/docs/widgets-reference.md | 108 ++++++++++++++++ resources/{ => images}/logo.icns | Bin resources/{ => images}/logo.ico | Bin resources/{ => images}/logo.png | Bin resources/{ => images}/logo.svg | 0 resources/{icons.sh => logos.sh} | 0 12 files changed, 223 insertions(+), 181 deletions(-) create mode 100644 resources/docs/build-from-sources.md create mode 100644 resources/docs/run-from-sources.md create mode 100644 resources/docs/session-reference.md create mode 100644 resources/docs/widgets-reference.md rename resources/{ => images}/logo.icns (100%) rename resources/{ => images}/logo.ico (100%) rename resources/{ => images}/logo.png (100%) rename resources/{ => images}/logo.svg (100%) rename resources/{icons.sh => logos.sh} (100%) diff --git a/.travis.yml b/.travis.yml index 482503f9..d2934df7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,19 +12,19 @@ deploy: file: - "./dist/open-stage-control-i386.deb" - "./dist/open-stage-control-amd64.deb" - - "./dist/open-stage-control-mac.zip" + - "./dist/open-stage-control-osx.zip" - "./dist/open-stage-control-win32.zip" - "./dist/open-stage-control-win64.zip" skip_cleanup: true on: tags: true before_deploy: + - cd dist + - zip -q -r --symlinks open-stage-control-osx open-stage-control-darwin-x64/open-stage-control.app + - zip -q -r open-stage-control-win32 open-stage-control-win32-ia32 + - zip -q -r open-stage-control-win64 open-stage-control-win32-x64 + - cd .. - npm run deb32 - npm run deb64 - mv dist/open-stage-control-linux-ia32/*.deb dist/open-stage-control-i386.deb - mv dist/open-stage-control-linux-x64/*.deb dist/open-stage-control-amd64.deb - - cd dist - - zip -q -r --symlinks open-stage-control-mac open-stage-control-darwin-x64/open-stage-control.app - - zip -q -r open-stage-control-win32 open-stage-control-win32-ia32 - - zip -q -r open-stage-control-win64 open-stage-control-win32-x64 - - cd .. diff --git a/README.md b/README.md index 321cbf33..e80ae595 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ 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. -The project is under active development; hence, current features are subject to change without notice. - ### Demo You can try the app here http://openstagecontrol.herokuapp.com/ @@ -25,31 +23,17 @@ Please note that : - app state store / recall & import / export - light & dark themes ! -### Run from sources +### Getting started -**Requirements** -- [Node.js](https://nodejs.org/) -- [npm](https://www.npmjs.com/) - -**Download** - ``` -$ git clone https://github.com/jean-emmanuel/Open-Stage-Control -$ cd Open-Stage-Control/ -$ npm install --save-dev - ``` - -**Run** - ``` -$ npm start [ -- options] - -# A double hyphen ("--") is used here to tell npm that the following options are to be given to the app. -``` +Prebuilt binaries for Linux, Windows and OS X can be found on the [release](https://github.com/jean-emmanuel/open-stage-control/releases) page. If you want to build or run the app from sources, here's how to: +- [Build from sources](resources/docs/build-from-sources.md) +- [Run from sources](resources/docs/run-from-sources.md) **Command line switches** ``` Options: -h, --help display help - -s, --sync synchronized hosts (ip:port pairs) + -s, --sync synchronized hosts (ip:port pairs) (all osc messages will also be sent to these) -c, --compile recompile stylesheets (increases startup time), if 'light' is specified, the light theme will be compiled, otherwise, the default dark theme will be compiled. -l, --load session file to load -p, --port osc input port (for synchronization) @@ -57,166 +41,21 @@ Options: Exemples : -$ npm start -- -s 127.0.0.1:5555 127.0.0.1:6666 -p 7777 +$ 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. -$ npm start -- -n 8080 -l path/to/session.js +$ 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. - ``` -**Run without electron** +### Advanced usage -Running the app with the `-n / --nogui` switch can also be done without electron since it works like any node web app : - -``` -npm start -- / -n 8000 -``` - - -### Session file structure - -A valid session file is a javascript file that returns, when eval'd, an array of tab objects. It can be written as a standard json file : - -``` -[ - { - 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 : - -``` -(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 -}() - -``` - - -### Widget generics -``` -{ - id:"my_widget_id", // [string] optional, default to unique 'widget_n' - - label:"My widget", // [string] default to id - top:"auto", // [string|integer] if set, the widget will have an absolute position (percentages allowed) - left:"auto", // [string|integer] if set, the widget will have an absolute position (percentages allowed) - width:"auto", // [string|integer] widget's width in px (percentages allowed) - height:"auto", // [string|integer] widget's height in px (percentages allowed) - 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' -} -``` - -### Widget specifics - -- **Strip** : *simple widget container* - ``` - type:'strip', - horizontal:false, // [bool] set to true to display widgets horizontally - widgets: [] // [array] of widget objects - ``` - -- **Panel** : *widget/tabs containers* - ``` - type:'panel', - stretch:false, // [bool] set to true to stretch widgets width (don't put horizontal strips in it) - widgets: [], // [array] of widget objects - tabs: [] // [array] of tab objects - ``` - -- **fader** - ``` - type:'fader', - horizontal:false, // [bool] set to true to display fader horizontally - range: {"min":0,"max":1}, // [object] defining the breakpoints of the fader - // keys can be percentages or 'min' / 'max' - unit: false, // [string] value suffix - absolute:false // [bool] set to true for absolute value on touch/click instead of relative dragging - ``` - -- **knob** - ``` - type:'knob', - range: {"min":0,"max":1}, // [object] minimum and maximum values - unit: false, // [string] value suffix - absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging - pan:false // [bool] true for panning knob - ``` - -- **xy** - ``` - type:'xy', - range:{ // [object] minimum and maximum values for x and y axis - x:{"min":0,"max":1}, - y:{"min":0,"max":1} - }, - 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** - ``` - 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. - - -- **toggle** - ``` - type:'toggle', - on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending ) - off:0, // [string|number|false] value sent when toggle is off (false to prevent sending ) - ``` - -- **push** - ``` - type:'pus', - on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending ) - off:0, // [string|number|false] value sent when toggle is off (false to prevent sending ) - ``` - -- **switch** - ``` - type:'switch', - values:[] // [array] of values (string or number) - ``` +Although the built-in editor might suits most of your needs while creating small control interfaces, you may need to write the session file yourself to create large and maintainable interfaces. The followings docs will help: +- [Session reference](resources/docs/session-reference.md) +- [Widgets reference](resources/docs/widgets-reference.md) ### License & credits @@ -231,7 +70,7 @@ It relies on the use of several libraries : - [express]() - [Sass.js](https://github.com/medialize/sass.js/) - [jQuery](http://jquery.com/) -- [jQuery-UI](http://jqueryui.com/) (draggable, resizable & [resizable snap ext](https://github.com/polomoshnov/jQuery-UI-Resizable-Snap-extension)) +- [jQuery-UI](http://jqueryui.com/) (draggable, resizable & sortable) - [Font Awesome](http://fontawesome.io/) Design was heavily inspired by [Atom](https://atom.io/)'s theme 'One Dark' diff --git a/package.json b/package.json index 5a278c78..de39ad0e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "open-stage-control", + "productName": "Open Stage Control", "description": "A libre desktop OSC bi-directionnal control surface application.", "version": "0.1.0", "main": "index.js", @@ -24,8 +25,8 @@ "scripts": { "start": "electron .", "build": "electron-packager . open-stage-control --platform=$PLATFORM --arch=$ARCH --out dist/ --icon=resources/logo --overwrite --ignore \"(dist|node_modules/electron.*)\"", - "deb32": "electron-installer-debian --src dist/open-stage-control-linux-ia32/ --arch i386 --dest dist/open-stage-control-linux-ia32/", - "deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/", + "deb32": "electron-installer-debian --src dist/open-stage-control-linux-ia32/ --arch i386 --dest dist/open-stage-control-linux-ia32/ --icon resources/logo.png", + "deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/logo.png", "test": "npm run build" }, "keywords": [ diff --git a/resources/docs/build-from-sources.md b/resources/docs/build-from-sources.md new file mode 100644 index 00000000..152af811 --- /dev/null +++ b/resources/docs/build-from-sources.md @@ -0,0 +1,27 @@ +## Build from sources + +**Requirements** +- [Node.js](https://nodejs.org/) +- [npm](https://www.npmjs.com/) + +``` +$ sudo apt-get install npm # install nodejs & npm +$ sudo npm install -g npm # update npm +``` + +**Build** + ``` +$ git clone https://github.com/jean-emmanuel/open-stage-control +$ cd open-stage-control +$ npm install --save-dev +$ 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`. diff --git a/resources/docs/run-from-sources.md b/resources/docs/run-from-sources.md new file mode 100644 index 00000000..33d0ec96 --- /dev/null +++ b/resources/docs/run-from-sources.md @@ -0,0 +1,27 @@ +## 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/) + +``` +$ sudo apt-get install npm # install nodejs & npm +$ sudo npm install -g npm # update npm +``` + + +**Download** + ``` +$ git clone https://github.com/jean-emmanuel/open-stage-control +$ cd Open-Stage-Control/ +$ npm install --save-dev + ``` + +**Run** + ``` +$ npm start [ -- options] + +# A double hyphen ("--") is used here to tell npm that the following options are to be given to the app. +``` diff --git a/resources/docs/session-reference.md b/resources/docs/session-reference.md new file mode 100644 index 00000000..9efce6f2 --- /dev/null +++ b/resources/docs/session-reference.md @@ -0,0 +1,40 @@ +## 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 standard json file : + +``` +[ + { + 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 : + +``` +(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 +}() + +``` diff --git a/resources/docs/widgets-reference.md b/resources/docs/widgets-reference.md new file mode 100644 index 00000000..22b50936 --- /dev/null +++ b/resources/docs/widgets-reference.md @@ -0,0 +1,108 @@ +## Widgets reference + +### Widget generics + +Every widget has the following characteristics: + +``` +{ + id:"my_widget_id", // [string] optional, default to unique 'widget_n' + + label:"My widget", // [string] default to id + top:"auto", // [string|integer] if set, the widget will have an absolute position (percentages allowed) + left:"auto", // [string|integer] if set, the widget will have an absolute position (percentages allowed) + width:"auto", // [string|integer] widget's width in px (percentages allowed) + height:"auto", // [string|integer] widget's height in px (percentages allowed) + 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' +} +``` + +### Widget specifics + +Each widget type comes with a set of specific characteristics which are described below. + +- **Strip** : *simple widget container* + ``` + type:'strip', + horizontal:false, // [bool] set to true to display widgets horizontally + widgets: [] // [array] of widget objects + ``` + +- **Panel** : *widget/tabs containers* + ``` + type:'panel', + stretch:false, // [bool] set to true to stretch widgets width (don't put horizontal strips in it) + widgets: [], // [array] of widget objects + tabs: [] // [array] of tab objects + ``` + +- **fader** + ``` + type:'fader', + horizontal:false, // [bool] set to true to display fader horizontally + range: {"min":0,"max":1}, // [object] defining the breakpoints of the fader + // keys can be percentages or 'min' / 'max' + unit: false, // [string] value suffix + absolute:false // [bool] set to true for absolute value on touch/click instead of relative dragging + ``` + +- **knob** + ``` + type:'knob', + range: {"min":0,"max":1}, // [object] minimum and maximum values + unit: false, // [string] value suffix + absolute:false, // [bool] set to true for absolute value on touch/click instead of relative dragging + pan:false // [bool] true for panning knob + ``` + +- **xy** + ``` + type:'xy', + range:{ // [object] minimum and maximum values for x and y axis + x:{"min":0,"max":1}, + y:{"min":0,"max":1} + }, + 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** + ``` + 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. + + +- **toggle** + ``` + type:'toggle', + on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending ) + off:0, // [string|number|false] value sent when toggle is off (false to prevent sending ) + ``` + +- **push** + ``` + type:'push', + on: 1, // [string|number|false] value sent when toggle is on (false to prevent sending ) + off:0, // [string|number|false] value sent when toggle is off (false to prevent sending ) + ``` + +- **switch** + ``` + type:'switch', + values: { // [object] of ("label":value) pairs + "Value 1":1, + "Value 2":2 + } + ``` diff --git a/resources/logo.icns b/resources/images/logo.icns similarity index 100% rename from resources/logo.icns rename to resources/images/logo.icns diff --git a/resources/logo.ico b/resources/images/logo.ico similarity index 100% rename from resources/logo.ico rename to resources/images/logo.ico diff --git a/resources/logo.png b/resources/images/logo.png similarity index 100% rename from resources/logo.png rename to resources/images/logo.png diff --git a/resources/logo.svg b/resources/images/logo.svg similarity index 100% rename from resources/logo.svg rename to resources/images/logo.svg diff --git a/resources/icons.sh b/resources/logos.sh similarity index 100% rename from resources/icons.sh rename to resources/logos.sh