From 3fc16e0849061c259bb85b161c282f1be46f8b67 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 12 Nov 2026 08:39:41 +0100 Subject: [PATCH] Prevent clipping of MPC playback state labels --- companion-modules/media-player-classic/README.md | 3 ++- .../media-player-classic/src/definitions.js | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/companion-modules/media-player-classic/README.md b/companion-modules/media-player-classic/README.md index d464870..5309c07 100644 --- a/companion-modules/media-player-classic/README.md +++ b/companion-modules/media-player-classic/README.md @@ -164,7 +164,8 @@ for custom buttons. ## Variables and custom feedback The elapsed preset uses **ELAPSED** with size 14 text to avoid wrapping. The -playback-state preset displays **Playing**, **Paused**, **Stopped**, or **Idle**. +playback-state preset uses size 14 text to display **Playing**, **Paused**, +**Stopped**, or **Idle** without clipping. These are connection/module variables, not button-local variables. With the connection labelled `MPC_DEV`, use `$(MPC_DEV:remaining)` in button text. diff --git a/companion-modules/media-player-classic/src/definitions.js b/companion-modules/media-player-classic/src/definitions.js index 4ec1622..5e19de8 100644 --- a/companion-modules/media-player-classic/src/definitions.js +++ b/companion-modules/media-player-classic/src/definitions.js @@ -86,11 +86,13 @@ export function presets(label = 'MPC_DEV') { [{ feedbackId: 'progress_bar', options: {} }], '14', ), - transport_state: button('Playback state', `$(${label}:state_label)`, null, [ - active('playing', colors.green), - active('paused', colors.amber), - active('stopped', colors.red), - ]), + transport_state: button( + 'Playback state', + `$(${label}:state_label)`, + null, + [active('playing', colors.green), active('paused', colors.amber), active('stopped', colors.red)], + '14', + ), } return { ...transport, ...catalog } }