diff options
author | Devine Lu Linvega <[email protected]> | 2019-02-18 13:20:48 +0900 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2019-02-18 13:20:48 +0900 |
commit | 66b318f58c538e5cfb11588780bdc102823e7473 (patch) | |
tree | 2a84bea1849438a3f10650f51fb7bfae85dd37b8 /desktop/sources | |
parent | b693918956dd4c2fcc3f7d10a18bec65a446e857 (diff) | |
download | Orca-66b318f58c538e5cfb11588780bdc102823e7473.tar.gz Orca-66b318f58c538e5cfb11588780bdc102823e7473.zip |
Minor Cleanup
Diffstat (limited to 'desktop/sources')
-rw-r--r-- | desktop/sources/index.html | 73 | ||||
-rw-r--r-- | desktop/sources/scripts/io.midi.clock.js | 2 | ||||
-rw-r--r-- | desktop/sources/scripts/lib/controller.js | 9 | ||||
-rw-r--r-- | desktop/sources/scripts/terminal.js | 5 |
4 files changed, 46 insertions, 43 deletions
diff --git a/desktop/sources/index.html b/desktop/sources/index.html index 2e401c9..4ac7155 100644 --- a/desktop/sources/index.html +++ b/desktop/sources/index.html @@ -19,49 +19,48 @@ terminal.install(document.body) - terminal.controller.add("default","*","About",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Orca'); },"CmdOrCtrl+,") - terminal.controller.add("default","*","Fullscreen",() => { app.toggleFullscreen(); },"CmdOrCtrl+Enter") - terminal.controller.add("default","*","Hide",() => { app.toggleVisible(); },"CmdOrCtrl+H") - terminal.controller.add("default","*","Inspect",() => { app.inspect(); },"CmdOrCtrl+.") - terminal.controller.add("default","*","Reset",() => { terminal.reset(); },"CmdOrCtrl+Backspace") - terminal.controller.add("default","*","Quit",() => { app.exit(); },"CmdOrCtrl+Q") + terminal.controller.add("default","*","About",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Orca') },"CmdOrCtrl+,") + terminal.controller.add("default","*","Fullscreen",() => { app.toggleFullscreen() },"CmdOrCtrl+Enter") + terminal.controller.add("default","*","Hide",() => { app.toggleVisible() },"CmdOrCtrl+H") + terminal.controller.add("default","*","Inspect",() => { app.inspect() },"CmdOrCtrl+.") + terminal.controller.add("default","*","Reset",() => { terminal.reset() },"CmdOrCtrl+Backspace") + terminal.controller.add("default","*","Quit",() => { app.exit() },"CmdOrCtrl+Q") - terminal.controller.add("default","File","New",() => { terminal.source.new(); },"CmdOrCtrl+N") - terminal.controller.add("default","File","Save",() => { terminal.source.save(); },"CmdOrCtrl+S") - terminal.controller.add("default","File","Save As",() => { terminal.source.save(true); },"CmdOrCtrl+Shift+S") - terminal.controller.add("default","File","Open",() => { terminal.source.open(); },"CmdOrCtrl+O") - terminal.controller.add("default","File","Revert",() => { terminal.source.revert(); },"CmdOrCtrl+Shift+R") + terminal.controller.add("default","File","New",() => { terminal.source.new() },"CmdOrCtrl+N") + terminal.controller.add("default","File","Save",() => { terminal.source.save() },"CmdOrCtrl+S") + terminal.controller.add("default","File","Save As",() => { terminal.source.save(true) },"CmdOrCtrl+Shift+S") + terminal.controller.add("default","File","Open",() => { terminal.source.open() },"CmdOrCtrl+O") + terminal.controller.add("default","File","Revert",() => { terminal.source.revert() },"CmdOrCtrl+Shift+R") - terminal.controller.add("default","Edit","Select All",() => { terminal.cursor.selectAll(); },"CmdOrCtrl+A") - terminal.controller.add("default","Edit","Erase Selection",() => { terminal.cursor.erase(); },"Backspace") - terminal.controller.add("default","Edit","Copy Selection",() => { terminal.cursor.copy(); },"CmdOrCtrl+C") - terminal.controller.add("default","Edit","Cut Selection",() => { terminal.cursor.cut(); },"CmdOrCtrl+X") - terminal.controller.add("default","Edit","Paste Selection",() => { terminal.cursor.paste(); },"CmdOrCtrl+V") - terminal.controller.add("default","Edit","Undo",() => { terminal.history.undo(); },"CmdOrCtrl+Z") - terminal.controller.add("default","Edit","Redo",() => { terminal.history.redo(); },"CmdOrCtrl+Shift+Z") + terminal.controller.add("default","Edit","Select All",() => { terminal.cursor.selectAll() },"CmdOrCtrl+A") + terminal.controller.add("default","Edit","Erase Selection",() => { terminal.cursor.erase() },"Backspace") + terminal.controller.add("default","Edit","Copy Selection",() => { terminal.cursor.copy() },"CmdOrCtrl+C") + terminal.controller.add("default","Edit","Cut Selection",() => { terminal.cursor.cut() },"CmdOrCtrl+X") + terminal.controller.add("default","Edit","Paste Selection",() => { terminal.cursor.paste() },"CmdOrCtrl+V") + terminal.controller.add("default","Edit","Undo",() => { terminal.history.undo() },"CmdOrCtrl+Z") + terminal.controller.add("default","Edit","Redo",() => { terminal.history.redo() },"CmdOrCtrl+Shift+Z") - terminal.controller.add("default","Program","Play/Pause",() => { terminal.pause(); },"Space") - terminal.controller.add("default","Program","Reset Frame",() => { terminal.orca.f = 0; },"CmdOrCtrl+Shift+N") - terminal.controller.add("default","Program","Incr. Speed",() => { terminal.modSpeed(1); },">") - terminal.controller.add("default","Program","Decr. Speed",() => { terminal.modSpeed(-1); },"<") - terminal.controller.add("default","Program","Incr. Col",() => { terminal.modGrid(1,0); },"]") - terminal.controller.add("default","Program","Decr. Col",() => { terminal.modGrid(-1,0); },"[") - terminal.controller.add("default","Program","Incr. Row",() => { terminal.modGrid(0,1); },"}") - terminal.controller.add("default","Program","Decr. Row",() => { terminal.modGrid(0,-1); },"{") - terminal.controller.add("default", "Program", "Next clock", () => {terminal.nextClock()}, "Ctrl+Space") + terminal.controller.add("default","Program","Play/Pause",() => { terminal.pause() },"Space") + terminal.controller.add("default","Program","Reset Frame",() => { terminal.orca.f = 0 },"CmdOrCtrl+Shift+N") + terminal.controller.add("default","Program","Incr. Speed",() => { terminal.modSpeed(1) },">") + terminal.controller.add("default","Program","Decr. Speed",() => { terminal.modSpeed(-1) },"<") + terminal.controller.add("default","Program","Incr. Col",() => { terminal.modGrid(1,0) },"]") + terminal.controller.add("default","Program","Decr. Col",() => { terminal.modGrid(-1,0) },"[") + terminal.controller.add("default","Program","Incr. Row",() => { terminal.modGrid(0,1) },"}") + terminal.controller.add("default","Program","Decr. Row",() => { terminal.modGrid(0,-1) },"{") + terminal.controller.add("default", "Program", "Next Clock", () => { terminal.nextClock() }, "Ctrl+Space") + terminal.controller.add("default","View","Zoom In",() => { terminal.modZoom(0.25) },"CmdOrCtrl+=") + terminal.controller.add("default","View","Zoom Out",() => { terminal.modZoom(-0.25) },"CmdOrCtrl+-") + terminal.controller.add("default","View","Zoom Reset",() => { terminal.modZoom(1,true) },"CmdOrCtrl+0") - terminal.controller.add("default","View","Zoom In",() => { terminal.modZoom(0.25); },"CmdOrCtrl+=") - terminal.controller.add("default","View","Zoom Out",() => { terminal.modZoom(-0.25); },"CmdOrCtrl+-") - terminal.controller.add("default","View","Zoom Reset",() => { terminal.modZoom(1,true); },"CmdOrCtrl+0") + terminal.controller.add("default","OSC Port","Default",() => { terminal.io.osc.select(49162) }) + terminal.controller.add("default","OSC Port","TidalCycles",() => { terminal.io.osc.select(6010) }) + terminal.controller.add("default","OSC Port","SonicPi",() => { terminal.io.osc.select(4559) }) - terminal.controller.add("default","OSC Port","Default",() => { terminal.io.osc.select(49162); }) - terminal.controller.add("default","OSC Port","TidalCycles",() => { terminal.io.osc.select(6010); }) - terminal.controller.add("default","OSC Port","SonicPi",() => { terminal.io.osc.select(4559); }) - - terminal.controller.add("default","Theme","Open Theme",() => { terminal.theme.open(); },"CmdOrCtrl+Shift+O") - terminal.controller.add("default","Theme","Reset Theme",() => { terminal.theme.reset(); },"CmdOrCtrl+Shift+Backspace") - terminal.controller.add("default","Theme","Download Themes..",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Themes'); }) + terminal.controller.add("default","Theme","Open Theme",() => { terminal.theme.open() },"CmdOrCtrl+Shift+O") + terminal.controller.add("default","Theme","Reset Theme",() => { terminal.theme.reset() },"CmdOrCtrl+Shift+Backspace") + terminal.controller.add("default","Theme","Download Themes..",() => { require('electron').shell.openExternal('https://github.com/hundredrabbits/Themes') }) terminal.controller.commit() terminal.start() diff --git a/desktop/sources/scripts/io.midi.clock.js b/desktop/sources/scripts/io.midi.clock.js index bbb8f4a..af29a1a 100644 --- a/desktop/sources/scripts/io.midi.clock.js +++ b/desktop/sources/scripts/io.midi.clock.js @@ -63,7 +63,7 @@ class MidiClock { } start () { - console.info('Starting Midi Clock...') + console.info('Midi Clock Starting..') this.setup() } diff --git a/desktop/sources/scripts/lib/controller.js b/desktop/sources/scripts/lib/controller.js index c7ed963..4924738 100644 --- a/desktop/sources/scripts/lib/controller.js +++ b/desktop/sources/scripts/lib/controller.js @@ -18,7 +18,7 @@ function Controller () { this.menu[mode][cat][label] = { fn: fn, accelerator: accelerator } } - this.add_role = function (mode, cat, label) { + this.addRole = function (mode, cat, label) { if (!this.menu[mode]) { this.menu[mode] = {} } if (!this.menu[mode][cat]) { this.menu[mode][cat] = {} } this.menu[mode][cat][label] = { role: label } @@ -55,7 +55,7 @@ function Controller () { this.app.injectMenu(this.format()) } - this.accelerator_for_key = function (key, menu) { + this.accelerator = function (key, menu) { const acc = { basic: null, ctrl: null } for (cat in menu) { const options = menu[cat] @@ -67,6 +67,11 @@ function Controller () { } return acc } + + this.docs = function () { + // TODO + console.log(this.menu.default) + } } module.exports = new Controller() diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js index dc3606c..4e9a9b9 100644 --- a/desktop/sources/scripts/terminal.js +++ b/desktop/sources/scripts/terminal.js @@ -87,7 +87,6 @@ function Terminal () { // this.nextClock = function () { - console.log('Next clock') const previousClock = this.clock() if (previousClock) { previousClock.setRunning(false) @@ -97,14 +96,14 @@ function Terminal () { this.clock().setRunning(!this.isPaused) this.clock().setCallback(() => this.run()) - console.log('Selected clock:', this.clock()) + console.log('Select clock:', this.clock()) this.update() } this.setSpeed = function (bpm) { if (this.clock().canSetBpm()) { bpm = clamp(bpm, 60, 300) - console.log(`Changed speed to ${bpm}.`) + console.log(`Change Speed: ${bpm}.`) this.clock().setBpm(bpm) this.update() } |