diff options
Diffstat (limited to 'desktop/sources/scripts')
-rw-r--r-- | desktop/sources/scripts/clock.js | 8 | ||||
-rw-r--r-- | desktop/sources/scripts/lib/controller.js | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/desktop/sources/scripts/clock.js b/desktop/sources/scripts/clock.js index fe6f9e3..6607fcf 100644 --- a/desktop/sources/scripts/clock.js +++ b/desktop/sources/scripts/clock.js @@ -47,19 +47,23 @@ function Clock (terminal) { this.play = function () { if (!this.isPaused) { console.warn('Already playing'); return } - console.log('Play') + console.log('Clock', 'Play') this.isPaused = false this.set(this.speed.target, this.speed.target, true) } this.stop = function () { if (this.isPaused) { console.warn('Already stopped'); return } - console.log('Stop') + console.log('Clock', 'Stop') terminal.io.midi.silence() this.isPaused = true this.clearTimer() } + this.tap = function () { + console.log('Clock', 'Tapped..') + } + // Timer this.clearTimer = function () { diff --git a/desktop/sources/scripts/lib/controller.js b/desktop/sources/scripts/lib/controller.js index 3140e49..cc6dfef 100644 --- a/desktop/sources/scripts/lib/controller.js +++ b/desktop/sources/scripts/lib/controller.js @@ -24,6 +24,12 @@ function Controller () { this.menu[mode][cat][label] = { role: label } } + this.addSpacer = function (mode, cat, label, type = 'separator') { + if (!this.menu[mode]) { this.menu[mode] = {} } + if (!this.menu[mode][cat]) { this.menu[mode][cat] = {} } + this.menu[mode][cat][label] = { type: type } + } + this.clearCat = function (mode, cat) { if (this.menu[mode]) { this.menu[mode][cat] = {} } } @@ -42,6 +48,8 @@ function Controller () { const option = m[cat][name] if (option.role) { submenu.push({ role: option.role }) + } else if (option.type) { + submenu.push({ type: option.type }) } else { submenu.push({ label: name, accelerator: option.accelerator, click: option.fn }) } |