From 3caec10c6ce9bd261c1749e7a6a83e03294722e1 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 12 Nov 2026 08:40:38 +0100 Subject: [PATCH] Color idle MPC Play preset text green --- .../media-player-classic/README.md | 20 +++++++++---------- .../media-player-classic/companion/HELP.md | 2 +- .../media-player-classic/src/definitions.js | 16 +++++++++------ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/companion-modules/media-player-classic/README.md b/companion-modules/media-player-classic/README.md index 5309c07..d667afa 100644 --- a/companion-modules/media-player-classic/README.md +++ b/companion-modules/media-player-classic/README.md @@ -46,16 +46,16 @@ their selected version until you explicitly change them. Open **Presets → MPC_DEV → Transport & timing** and drag the buttons onto a spare page. These presets already include their feedback and variable references: -| Preset | Behavior | -| --------------------- | --------------------------------------------------------------- | -| ▶ Play | Play command; green while playing, amber while paused | -| ■ Stop | Stop command; red while the player reports stopped | -| ◀◀ Previous / ▶▶ Next | Previous/next **playlist item**, not chapter or seek | -| Mute | Toggle mute; red **MUTED** when the player mute switch is on | -| Pause | Pause command; amber while paused | -| Remaining | Live media countdown and progress bar | -| Elapsed | Live elapsed media time and progress bar | -| Playback state | Playing, paused, stopped, idle, or offline with matching colors | +| Preset | Behavior | +| --------------------- | ---------------------------------------------------------------------------- | +| ▶ Play | Green text while waiting; green background while playing, amber while paused | +| ■ Stop | Stop command; red while the player reports stopped | +| ◀◀ Previous / ▶▶ Next | Previous/next **playlist item**, not chapter or seek | +| Mute | Toggle mute; red **MUTED** when the player mute switch is on | +| Pause | Pause command; amber while paused | +| Remaining | Live media countdown and progress bar | +| Elapsed | Live elapsed media time and progress bar | +| Playback state | Playing, paused, stopped, idle, or offline with matching colors | The Previous/Next transport presets use command IDs verified against this player's `/commands.json`: Previous → `919`, Next → `920`. The old catalog was diff --git a/companion-modules/media-player-classic/companion/HELP.md b/companion-modules/media-player-classic/companion/HELP.md index 2e32111..8f6d42c 100644 --- a/companion-modules/media-player-classic/companion/HELP.md +++ b/companion-modules/media-player-classic/companion/HELP.md @@ -8,7 +8,7 @@ in this connection. Allow remote access from the Companion computer if needed. Choose **Transport & timing** in this connection's Presets: -- **Play**: green while playing; amber while paused. Press to play/resume. +- **Play**: green text while waiting; white text on green while playing; amber while paused. Press to play/resume. - **Stop**: red while stopped. - **Previous / Next**: navigate playlist items (verified command IDs 919/920). These load and start playback; the web API has no reliable open-next-paused diff --git a/companion-modules/media-player-classic/src/definitions.js b/companion-modules/media-player-classic/src/definitions.js index 5e19de8..12cac6b 100644 --- a/companion-modules/media-player-classic/src/definitions.js +++ b/companion-modules/media-player-classic/src/definitions.js @@ -51,10 +51,10 @@ export function presets(label = 'MPC_DEV') { options: {}, style: { bgcolor, color: colors.white, ...(text ? { text } : {}) }, }) - const button = (name, text, id, feedback = [], size = '18') => ({ + const button = (name, text, id, feedback = [], size = '18', color = colors.white) => ({ type: 'simple', name, - style: { text, size, color: colors.white, bgcolor: colors.dark, show_topbar: false }, + style: { text, size, color, bgcolor: colors.dark, show_topbar: false }, steps: [{ down: id ? [{ actionId: id, options: { target: 'both' } }] : [], up: [] }], feedbacks: [...feedback, offline], }) @@ -66,10 +66,14 @@ export function presets(label = 'MPC_DEV') { steps: [{ down: [], up: [] }], feedbacks: [{ feedbackId: 'redundancy', options: {} }], }, - transport_play: button('Play — green while playing', '▶\nPLAY', '887', [ - active('playing', colors.green), - active('paused', colors.amber, 'Ⅱ\nPAUSED'), - ]), + transport_play: button( + 'Play — green while playing', + '▶\nPLAY', + '887', + [active('playing', colors.green), active('paused', colors.amber, 'Ⅱ\nPAUSED')], + '18', + 0x4ade80, + ), transport_stop: button('Stop — red while stopped', '■\nSTOP', '890', [active('stopped', colors.red)]), // Verified against MPC-HC 2.8.5's /commands.json: 918 is an after-playback setting. transport_previous: button('Previous playlist item', '◀◀\nPREV', '919'),