From 0155069f69a6958f47d29e35a40f0ceac1e5fd37 Mon Sep 17 00:00:00 2001 From: Phillip Ivan Pietruschka Date: Fri, 10 May 2024 13:16:48 +1000 Subject: [PATCH 1/2] Better status updates companion-module-base > 1.8.0 Version bump > 1.2.2 --- companion/HELP.md | 6 ++- package.json | 4 +- src/config.js | 2 + src/main.js | 2 +- src/processcmd.js | 5 +- src/tcp.js | 6 ++- yarn.lock | 130 +++++++++++++++++++++++++--------------------- 7 files changed, 90 insertions(+), 65 deletions(-) diff --git a/companion/HELP.md b/companion/HELP.md index b5fb15f..f1433f0 100644 --- a/companion/HELP.md +++ b/companion/HELP.md @@ -148,7 +148,7 @@ This turns the record function of the controlled device on/off. - **Caution** - **Error** - **Mecha Status** -- **PSU Error** Undocumented and presumed only relevant for the DA-6400dp. Unknown how to query state, so module assumes device is OK on connect. +- **PSU Error** Undocumented. Presumed only relevant for the DA-6400dp. Unknown how to query state - module assumes device is OK on connect. - **Repeat Mode** - **Remote/Local Mode** - **Keyboard Type** @@ -171,6 +171,10 @@ This turns the record function of the controlled device on/off. ## Version History +### Version 1.2.2 +- Better status updates +- Update companion module base to 1.8.0 + ### Version 1.2.1 - Add record preset diff --git a/package.json b/package.json index 8d1e35f..a54097c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tascam-da-6400", - "version": "1.2.1", + "version": "1.2.2", "main": "src/main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", @@ -14,7 +14,7 @@ "url": "git+https://github.com/bitfocus/companion-module-tascam-da-6400.git" }, "dependencies": { - "@companion-module/base": "~1.7.0" + "@companion-module/base": "~1.8.0" }, "devDependencies": { "@companion-module/tools": "^1.5.0" diff --git a/src/config.js b/src/config.js index 86c7092..d3e6221 100644 --- a/src/config.js +++ b/src/config.js @@ -1,8 +1,10 @@ const { Regex } = require('@companion-module/base') +const { InstanceStatus } = require('@companion-module/base') module.exports = { async configUpdated(config) { this.config = config + this.updateStatus(InstanceStatus.Connecting) this.initTCP() this.initVariables() this.updateActions() diff --git a/src/main.js b/src/main.js index d48b4b3..62d8eec 100644 --- a/src/main.js +++ b/src/main.js @@ -17,7 +17,7 @@ class TASCAM_DA_6400 extends InstanceBase { this.cmdQueue = [] } async init(config) { - this.updateStatus('Starting') + this.updateStatus(InstanceStatus.Connecting) this.config = config this.initVariables() this.startTimeOut() diff --git a/src/processcmd.js b/src/processcmd.js index 7da9a63..f4829bf 100644 --- a/src/processcmd.js +++ b/src/processcmd.js @@ -1,3 +1,4 @@ +const { InstanceStatus } = require('@companion-module/base') const { resp, respParam, cmd, SOM, cmdOnLogin } = require('./consts.js') module.exports = { @@ -6,10 +7,11 @@ module.exports = { //this.log('debug', `response recieved: ${reply}`) switch (reply) { case resp.password: + this.updateStatus(InstanceStatus.Connecting, 'Logging in') this.sendCommand(this.config.password) return true case resp.loginSuccess: - this.updateStatus('ok', 'Logged in') + this.updateStatus(InstanceStatus.Ok, 'Logged in') this.log('info', 'OK: Logged In') this.stopTimeOut() this.startCmdQueue() @@ -19,6 +21,7 @@ module.exports = { this.startKeepAlive() return true case resp.loginFail: + this.updateStatus(InstanceStatus.BadConfig, 'Login Fail') this.log('error', 'Password is incorrect') this.stopCmdQueue() this.stopKeepAlive() diff --git a/src/tcp.js b/src/tcp.js index 5fbe0d2..b56494f 100644 --- a/src/tcp.js +++ b/src/tcp.js @@ -57,7 +57,7 @@ module.exports = { queryOnConnect() { this.sendCommand(' ') if (this.config.password == '') { - this.updateStatus('ok', '') + this.updateStatus(InstanceStatus.Ok, '') this.startCmdQueue() for (let i = 0; i < cmdOnLogin.length; i++) { this.addCmdtoQueue(SOM + cmdOnLogin[i]) @@ -130,7 +130,7 @@ module.exports = { if (this.config.host) { this.log('debug', 'Creating New Socket') - this.updateStatus(`Connecting to DA-6400: ${this.config.host}:${this.config.port}`) + this.updateStatus(InstanceStatus.Connecting, `Connecting to DA-6400: ${this.config.host}`) this.socket = new TCPHelper(this.config.host, this.config.port) this.socket.on('status_change', (status, message) => { @@ -138,12 +138,14 @@ module.exports = { }) this.socket.on('error', (err) => { this.log('error', `Network error: ${err.message}`) + this.updateStatus(InstanceStatus.ConnectionFailure, err.message) this.stopCmdQueue() this.stopKeepAlive() this.startTimeOut() }) this.socket.on('connect', () => { this.log('info', `Connected to ${this.config.host}:${this.config.port}`) + this.updateStatus(InstanceStatus.Connecting, 'Connection Established') this.receiveBuffer = '' this.queryOnConnect() }) diff --git a/yarn.lock b/yarn.lock index 605d4e7..777175e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,13 +7,13 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@companion-module/base@~1.7.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@companion-module/base/-/base-1.7.0.tgz#d4bed26890db024b134922bf852d8bc75b449979" - integrity sha512-i9HD0fCMVjBOMyD5z3CK0IjCsfM2EBxeI1RDeVO3RxyQnygUYMkc/WWUiZ7zVZ6WCwNV+Qb93z7L3cdVh8vVFA== +"@companion-module/base@~1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@companion-module/base/-/base-1.8.0.tgz#1c74204b29451bd7740b2428db372fdfaf51d84d" + integrity sha512-97qmnaPAJZbisYR6EBQ/fZxY8dPLV3my6qIHJzifFl/vkwi+a3ucoXQWLwd5tijM9pqbZOS/3b2V1m6sbdAWlQ== dependencies: - "@sentry/node" "^7.82.0" - "@sentry/tracing" "^7.82.0" + "@sentry/node" "^7.109.0" + "@sentry/tracing" "^7.109.0" ajv "^8.12.0" colord "^2.9.3" ejson "^2.2.3" @@ -168,52 +168,62 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@sentry-internal/tracing@7.92.0": - version "7.92.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.92.0.tgz#505d94a93b5df965ec6bfb35da43389988259d4d" - integrity sha512-ur55vPcUUUWFUX4eVLNP71ohswK7ZZpleNZw9Y1GfLqyI+0ILQUwjtzqItJrdClvVsdRZJMRmDV40Hp9Lbb9mA== +"@sentry-internal/tracing@7.114.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.114.0.tgz#bdcd364f511e2de45db6e3004faf5685ca2e0f86" + integrity sha512-dOuvfJN7G+3YqLlUY4HIjyWHaRP8vbOgF+OsE5w2l7ZEn1rMAaUbPntAR8AF9GBA6j2zWNoSo8e7GjbJxVofSg== dependencies: - "@sentry/core" "7.92.0" - "@sentry/types" "7.92.0" - "@sentry/utils" "7.92.0" + "@sentry/core" "7.114.0" + "@sentry/types" "7.114.0" + "@sentry/utils" "7.114.0" -"@sentry/core@7.92.0": - version "7.92.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.92.0.tgz#4e74c1959348b698226c49ead7a24e165502b55c" - integrity sha512-1Tly7YB2I1byI5xb0Cwrxs56Rhww+6mQ7m9P7rTmdC3/ijOzbEoohtYIUPwcooCEarpbEJe/tAayRx6BrH2UbQ== +"@sentry/core@7.114.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.114.0.tgz#3efe86b92a5379c44dfd0fd4685266b1a30fa898" + integrity sha512-YnanVlmulkjgZiVZ9BfY9k6I082n+C+LbZo52MTvx3FY6RE5iyiPMpaOh67oXEZRWcYQEGm+bKruRxLVP6RlbA== dependencies: - "@sentry/types" "7.92.0" - "@sentry/utils" "7.92.0" + "@sentry/types" "7.114.0" + "@sentry/utils" "7.114.0" -"@sentry/node@^7.82.0": - version "7.92.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.92.0.tgz#880d3be5cb8ef805a6856c619db3951b1678f726" - integrity sha512-LZeQL1r6kikEoOzA9K61OmMl32/lK/6PzmFNDH6z7UYwQopCZgVA6IP+CZuln8K2ys5c9hCyF7ICQMysXfpNJA== +"@sentry/integrations@7.114.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.114.0.tgz#baf249cfa9e359510f41e486a75bf184db18927d" + integrity sha512-BJIBWXGKeIH0ifd7goxOS29fBA8BkEgVVCahs6xIOXBjX1IRS6PmX0zYx/GP23nQTfhJiubv2XPzoYOlZZmDxg== dependencies: - "@sentry-internal/tracing" "7.92.0" - "@sentry/core" "7.92.0" - "@sentry/types" "7.92.0" - "@sentry/utils" "7.92.0" - https-proxy-agent "^5.0.0" + "@sentry/core" "7.114.0" + "@sentry/types" "7.114.0" + "@sentry/utils" "7.114.0" + localforage "^1.8.1" -"@sentry/tracing@^7.82.0": - version "7.92.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.92.0.tgz#2471a03db3e1e86889ae1790732bdddc510718e3" - integrity sha512-1+TFFPVEdax4dNi68gin6MENiyGe9mOuNXfjulrP5eCzUEByus5HAxeDI/LLQ1hArfn048AzwSwKUsS2fO5sbg== +"@sentry/node@^7.109.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.114.0.tgz#51a64139c5d5369ec64c169b4c2f73b8870fc759" + integrity sha512-cqvi+OHV1Hj64mIGHoZtLgwrh1BG6ntcRjDLlVNMqml5rdTRD3TvG21579FtlqHlwZpbpF7K5xkwl8e5KL2hGw== dependencies: - "@sentry-internal/tracing" "7.92.0" + "@sentry-internal/tracing" "7.114.0" + "@sentry/core" "7.114.0" + "@sentry/integrations" "7.114.0" + "@sentry/types" "7.114.0" + "@sentry/utils" "7.114.0" -"@sentry/types@7.92.0": - version "7.92.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.92.0.tgz#4c308fdb316c0272f55f0816230fe87e7b9b551a" - integrity sha512-APmSOuZuoRGpbPpPeYIbMSplPjiWNLZRQa73QiXuTflW4Tu/ItDlU8hOa2+A6JKVkJCuD2EN6yUrxDGSMyNXeg== +"@sentry/tracing@^7.109.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.114.0.tgz#32a3438b0f2d02fb7b7359fe7712c5a349a2a329" + integrity sha512-eldEYGADReZ4jWdN5u35yxLUSTOvjsiZAYd4KBEpf+Ii65n7g/kYOKAjNl7tHbrEG1EsMW4nDPWStUMk1w+tfg== + dependencies: + "@sentry-internal/tracing" "7.114.0" + +"@sentry/types@7.114.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.114.0.tgz#ab8009d5f6df23b7342121083bed34ee2452e856" + integrity sha512-tsqkkyL3eJtptmPtT0m9W/bPLkU7ILY7nvwpi1hahA5jrM7ppoU0IMaQWAgTD+U3rzFH40IdXNBFb8Gnqcva4w== -"@sentry/utils@7.92.0": - version "7.92.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.92.0.tgz#20ed29742594eab007f9ff72e008b5262456a319" - integrity sha512-3nEfrQ1z28b/2zgFGANPh5yMVtgwXmrasZxTvKbrAj+KWJpjrJHrIR84r9W277J44NMeZ5RhRW2uoDmuBslPnA== +"@sentry/utils@7.114.0": + version "7.114.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.114.0.tgz#59d30a79f4acff3c9268de0b345f0bcbc6335112" + integrity sha512-319N90McVpupQ6vws4+tfCy/03AdtsU0MurIE4+W5cubHME08HtiEWlfacvAxX+yuKFhvdsO4K4BB/dj54ideg== dependencies: - "@sentry/types" "7.92.0" + "@sentry/types" "7.114.0" "@types/eslint-scope@^3.7.3": version "3.7.7" @@ -540,13 +550,6 @@ acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" @@ -739,7 +742,7 @@ data-uri-to-buffer@^4.0.0: resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== -debug@4, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1228,19 +1231,16 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" -https-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" - integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== - dependencies: - agent-base "6" - debug "4" - ignore@^5.2.0, ignore@^5.2.4: version "5.2.4" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== + import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -1403,11 +1403,25 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +lie@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" + integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== + dependencies: + immediate "~3.0.5" + loader-runner@^4.2.0: version "4.3.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== +localforage@^1.8.1: + version "1.10.0" + resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" + integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== + dependencies: + lie "3.1.1" + locate-path@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" From 828ea7c83658899d136479d443c72df1b4698484 Mon Sep 17 00:00:00 2001 From: Phillip Ivan Pietruschka Date: Fri, 10 May 2024 13:26:26 +1000 Subject: [PATCH 2/2] Transport preset layout --- companion/HELP.md | 1 + src/presets.js | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/companion/HELP.md b/companion/HELP.md index f1433f0..a05f3e9 100644 --- a/companion/HELP.md +++ b/companion/HELP.md @@ -173,6 +173,7 @@ This turns the record function of the controlled device on/off. ### Version 1.2.2 - Better status updates +- Transport preset layout - Update companion module base to 1.8.0 ### Version 1.2.1 diff --git a/src/presets.js b/src/presets.js index 172412c..e3e89fc 100644 --- a/src/presets.js +++ b/src/presets.js @@ -395,6 +395,12 @@ module.exports = async function (self) { }, ], } + presets['track-skip-header'] = { + category: 'Transport', + type: 'text', + name: 'Track Skip', + text: '', + } presets[`track_skip_back`] = { type: 'button', category: 'Transport', @@ -451,6 +457,12 @@ module.exports = async function (self) { ], feedbacks: [], } + presets['mark-skip-header'] = { + category: 'Transport', + type: 'text', + name: 'Mark Skip', + text: '', + } presets[`mark_skip_back`] = { type: 'button', category: 'Transport', @@ -507,6 +519,12 @@ module.exports = async function (self) { ], feedbacks: [], } + presets['search-header'] = { + category: 'Transport', + type: 'text', + name: 'Search', + text: '', + } presets[`search_back`] = { type: 'button', category: 'Transport', @@ -585,6 +603,12 @@ module.exports = async function (self) { }, ], } + presets['search-fast-header'] = { + category: 'Transport', + type: 'text', + name: 'Search Fast', + text: '', + } presets[`search_back_fast`] = { type: 'button', category: 'Transport',