diff --git a/CHANGELOG.md b/CHANGELOG.md index 982472e3..b465e0a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ - midi - add active sensing messages support +- remote control + - restore `/TABS` command (for opening tabs by ids) + ## 1.8.6 - bug fixes diff --git a/resources/docs/docs/remote-control.md b/resources/docs/docs/remote-control.md index f3e983ce..d1d12699 100644 --- a/resources/docs/docs/remote-control.md +++ b/resources/docs/docs/remote-control.md @@ -198,3 +198,9 @@ Open session file `path.json`. #### `/SESSION/SAVE path.json` Save current session to `path.json`. If `path.json` is omitted, current session's path is used. + +---- + +#### `/TABS tab_id1 tab_id2 ...` + +Open the tabs designated by the id parameters. diff --git a/src/client/remote-control.js b/src/client/remote-control.js index f0aa4c36..f4aab709 100644 --- a/src/client/remote-control.js +++ b/src/client/remote-control.js @@ -259,10 +259,21 @@ var callbacks = { sessionManager.save(args[0]) + }, + '/TABS': function(args) { + + if (!Array.isArray(args)) args = [args] + + for (let id of args) { + let ws = widgetManager.getWidgetById(id) + for (let w of ws) { + if (w.getProp('type') === 'tab') { + var index = w.parent.children.indexOf(w) + w.parent.setValue(index, {sync: true, send: false}) + } + } + } } - - - } module.exports = {