Skip to content

Commit

Permalink
Merge branch 'main' into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Nov 25, 2023
2 parents 177bedc + d1e72e6 commit 39a9b97
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
7 changes: 6 additions & 1 deletion src/announcement-data/systems/stations/AmeyCelia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down Expand Up @@ -3034,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:
Expand Down
36 changes: 26 additions & 10 deletions src/announcement-data/systems/stations/AmeyPhil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -3422,28 +3423,38 @@ export default class AmeyPhil extends StationAnnouncementSystem {
terminatingStation: string,
callingPoints: CallingAtPoint[],
stationsAlwaysMiddle: boolean = false,
fromAudio: AudioItem[] = [],
): Promise<AudioItem[]> {
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(
{
id: `toc.m.${toc.toLowerCase()}`,
opts: { delayStart: 150 },
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: 150 },
})
files.push(
{
id: `toc.m.${toc.toLowerCase()} ${_fromAudio.length ? 'service from' : 'service to'}`,
opts: { delayStart: this.BEFORE_TOC_DELAY },
},
..._fromAudio,
)
}
}

Expand Down Expand Up @@ -4019,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<void> {
const files: AudioItem[] = []

Expand All @@ -4035,6 +4050,7 @@ export default class AmeyPhil extends StationAnnouncementSystem {
options.terminatingStationCode,
[],
true,
options.disruptionType === 'cancel' ? [this.disruptionOptions.thisStationAudio] : [],
)),
)

Expand Down
11 changes: 11 additions & 0 deletions src/data/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 39a9b97

Please sign in to comment.