From 8812c7a1ea343ce85f4c1cc8e379f6ab2c8bdaca Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 8 Apr 2018 21:34:53 -0300 Subject: Add %esc% and %name% %esc% is for fancy ANSI formatting (e.g. %esc%[2m%timeLeft%). %name% is just an alias for %trackName%. --- src/loop-play.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/loop-play.js b/src/loop-play.js index cca1108..62e67fd 100644 --- a/src/loop-play.js +++ b/src/loop-play.js @@ -463,14 +463,18 @@ class PlayController extends EventEmitter { const groupIndexArr = (track && track.groupTrackIndex) || ['', ''] fullStatusLine += processTemplateString(statusLineTemplate, Object.assign({ + esc: '\x1b', index: track ? (track.overallTrackIndex[0] + 1) : '', trackCount: track ? (track.overallTrackIndex[1]) : '', indexGroup: groupIndexArr[0], trackCountGroup: groupIndexArr[1], longIndex, - trackName: track.name + trackName: track.name, name: track.name }, playerData)) + // Clear format - custom color codes, etc. + fullStatusLine += '\x1b[0m' + // Carriage return - moves the cursor back to the start of the line, // so that the next status line is printed on top of this one. fullStatusLine += '\r' -- cgit 1.3.0-6-gf8a5