From adca578abb24f28815fd3d1d6448bf40d4335199 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sat, 25 Nov 2023 17:46:44 +0000 Subject: [PATCH 1/3] fix: reduce delay before toc --- src/announcement-data/systems/stations/AmeyCelia.tsx | 3 ++- src/announcement-data/systems/stations/AmeyPhil.tsx | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/announcement-data/systems/stations/AmeyCelia.tsx b/src/announcement-data/systems/stations/AmeyCelia.tsx index 6bde8e0ae..e9ced80db 100644 --- a/src/announcement-data/systems/stations/AmeyCelia.tsx +++ b/src/announcement-data/systems/stations/AmeyCelia.tsx @@ -8,8 +8,9 @@ export default class AmeyCelia extends AmeyPhil { protected readonly CALLING_POINT_DELAY = 160 protected readonly CALLING_POINT_AND_DELAY = 80 + protected readonly BEFORE_TOC_DELAY: number = 75 - protected get DEFAULT_CHIME(): ChimeType { + get DEFAULT_CHIME(): ChimeType { return 'three' } diff --git a/src/announcement-data/systems/stations/AmeyPhil.tsx b/src/announcement-data/systems/stations/AmeyPhil.tsx index 585b9ba21..34d9b6f83 100644 --- a/src/announcement-data/systems/stations/AmeyPhil.tsx +++ b/src/announcement-data/systems/stations/AmeyPhil.tsx @@ -54,6 +54,7 @@ export default class AmeyPhil extends StationAnnouncementSystem { protected readonly CALLING_POINT_DELAY: number = 200 protected readonly CALLING_POINT_AND_DELAY: number = 100 + protected readonly BEFORE_TOC_DELAY: number = 150 get DEFAULT_CHIME(): ChimeType { return 'four' @@ -3435,14 +3436,14 @@ export default class AmeyPhil extends StationAnnouncementSystem { files.push( { id: `toc.m.${toc.toLowerCase()}`, - opts: { delayStart: 150 }, + opts: { delayStart: this.BEFORE_TOC_DELAY }, }, 'm.service to', ) } else { files.push({ id: `toc.m.${toc.toLowerCase()} service to`, - opts: { delayStart: 150 }, + opts: { delayStart: this.BEFORE_TOC_DELAY }, }) } } From 7868dacb67fce689ffce4b4469ef7636eacf63c7 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sat, 25 Nov 2023 17:46:58 +0000 Subject: [PATCH 2/3] fix: implement "from this station" for cancellations --- .../systems/stations/AmeyCelia.tsx | 4 +++ .../systems/stations/AmeyPhil.tsx | 33 ++++++++++++++----- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/announcement-data/systems/stations/AmeyCelia.tsx b/src/announcement-data/systems/stations/AmeyCelia.tsx index e9ced80db..f22afe5b0 100644 --- a/src/announcement-data/systems/stations/AmeyCelia.tsx +++ b/src/announcement-data/systems/stations/AmeyCelia.tsx @@ -3035,6 +3035,10 @@ export default class AmeyCelia extends AmeyPhil { travelInCorrectPartId: 'w.please make sure you travel in the correct part of this train', } + protected readonly disruptionOptions = { + thisStationAudio: 'e.this station', + } + processTocForLiveTrains(toc: string, originCrs: string, destinationCrs: string): string { switch (toc.toLowerCase()) { default: diff --git a/src/announcement-data/systems/stations/AmeyPhil.tsx b/src/announcement-data/systems/stations/AmeyPhil.tsx index 34d9b6f83..b95ceb312 100644 --- a/src/announcement-data/systems/stations/AmeyPhil.tsx +++ b/src/announcement-data/systems/stations/AmeyPhil.tsx @@ -3423,14 +3423,20 @@ export default class AmeyPhil extends StationAnnouncementSystem { terminatingStation: string, callingPoints: CallingAtPoint[], stationsAlwaysMiddle: boolean = false, + fromAudio: AudioItem[] = [], ): Promise { const files: AudioItem[] = [`hour.s.${hour}`, `mins.m.${min}`] + const _fromAudio = fromAudio.length ? [...fromAudio, 'm.to'] : [] + if (toc === '') { - files.push({ - id: `m.service to`, - opts: { delayStart: 50 }, - }) + files.push( + { + id: _fromAudio.length ? `m.service from` : `m.service to`, + opts: { delayStart: 50 }, + }, + ..._fromAudio, + ) } else { if (this.AVAILABLE_TOCS.standaloneOnly.some(x => x.toLowerCase() === toc.toLowerCase())) { files.push( @@ -3438,13 +3444,17 @@ export default class AmeyPhil extends StationAnnouncementSystem { id: `toc.m.${toc.toLowerCase()}`, opts: { delayStart: this.BEFORE_TOC_DELAY }, }, - 'm.service to', + _fromAudio.length ? `m.service from` : `m.service to`, + ..._fromAudio, ) } else { - files.push({ - id: `toc.m.${toc.toLowerCase()} service to`, - opts: { delayStart: this.BEFORE_TOC_DELAY }, - }) + files.push( + { + id: `toc.m.${toc.toLowerCase()} ${_fromAudio.length ? 'service from' : 'service to'}`, + opts: { delayStart: this.BEFORE_TOC_DELAY }, + }, + ..._fromAudio, + ) } } @@ -4020,6 +4030,10 @@ export default class AmeyPhil extends StationAnnouncementSystem { await this.playAudioFiles(files, download) } + protected readonly disruptionOptions = { + thisStationAudio: 'm.this station-2', + } + private async playDisruptedTrainAnnouncement(options: IDisruptedTrainAnnouncementOptions, download: boolean = false): Promise { const files: AudioItem[] = [] @@ -4036,6 +4050,7 @@ export default class AmeyPhil extends StationAnnouncementSystem { options.terminatingStationCode, [], true, + options.disruptionType === 'cancel' ? [this.disruptionOptions.thisStationAudio] : [], )), ) From d1e72e63228a57c8709382510501024e8f86a0d4 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sat, 25 Nov 2023 17:52:01 +0000 Subject: [PATCH 3/3] chore: update changelog --- src/data/changelog.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/data/changelog.ts b/src/data/changelog.ts index 6c634b813..5971069d8 100644 --- a/src/data/changelog.ts +++ b/src/data/changelog.ts @@ -266,6 +266,17 @@ const changelog: IChangelogVersion[] = [ additions: ['[Amey Celia] Replace KeTech Celia with Amey Celia using raw audio files'], otherChanges: ['[Amey Phil] Renamed KeTech Phil to Amey Phil to reflect his wording and scripts'], }, + { + date: '2023-11-25', + fixes: [ + '[Amey Celia] Increase spacing between calling points', + '[Amey Celia] Cut down spacing before TOC', + '[Amey Celia] Always default to 3-note chime', + "[Amey Celia & Phil] Add missing 'from this station' for cancellations", + '[Amey Celia & Phil] Swap out some files for more accurate snippets', + ], + additions: ['[Amey Celia] Add custom Northern TOC snippets'], + }, ] export default changelog