From 05a6871463fb8a2b4d982d6b7091ee09bbbe2b25 Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Sat, 4 Jan 2025 09:45:41 -0800 Subject: [PATCH 1/4] Get rid of state color Fixes #333 --- .../images/actions/atisLetter/template.svg | 15 ++++++++++++- .../images/actions/hotline/template.svg | 21 ++++++++++++++++++- .../images/actions/pushToTalk/template.svg | 13 +++++++++++- .../images/actions/stationStatus/withMute.svg | 13 ------------ .../actions/trackAudioStatus/template.svg | 15 ++++++++++++- src/controllers/atisLetter.ts | 9 -------- src/controllers/hotline.ts | 15 ------------- src/controllers/pushToTalk.ts | 7 ------- src/controllers/stationStatus.ts | 15 ------------- src/controllers/trackAudioStatus.ts | 10 +-------- 10 files changed, 61 insertions(+), 72 deletions(-) delete mode 100644 com.neil-enns.trackaudio.sdPlugin/images/actions/stationStatus/withMute.svg diff --git a/com.neil-enns.trackaudio.sdPlugin/images/actions/atisLetter/template.svg b/com.neil-enns.trackaudio.sdPlugin/images/actions/atisLetter/template.svg index 0f01978..08ec96a 100644 --- a/com.neil-enns.trackaudio.sdPlugin/images/actions/atisLetter/template.svg +++ b/com.neil-enns.trackaudio.sdPlugin/images/actions/atisLetter/template.svg @@ -1,3 +1,16 @@ - + + \ No newline at end of file diff --git a/com.neil-enns.trackaudio.sdPlugin/images/actions/hotline/template.svg b/com.neil-enns.trackaudio.sdPlugin/images/actions/hotline/template.svg index b74eb0b..fce5a9b 100644 --- a/com.neil-enns.trackaudio.sdPlugin/images/actions/hotline/template.svg +++ b/com.neil-enns.trackaudio.sdPlugin/images/actions/hotline/template.svg @@ -1,7 +1,26 @@ - + + - + + \ No newline at end of file diff --git a/com.neil-enns.trackaudio.sdPlugin/images/actions/stationStatus/withMute.svg b/com.neil-enns.trackaudio.sdPlugin/images/actions/stationStatus/withMute.svg deleted file mode 100644 index d73e1d1..0000000 --- a/com.neil-enns.trackaudio.sdPlugin/images/actions/stationStatus/withMute.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/com.neil-enns.trackaudio.sdPlugin/images/actions/trackAudioStatus/template.svg b/com.neil-enns.trackaudio.sdPlugin/images/actions/trackAudioStatus/template.svg index fa1bfa8..aecf52f 100644 --- a/com.neil-enns.trackaudio.sdPlugin/images/actions/trackAudioStatus/template.svg +++ b/com.neil-enns.trackaudio.sdPlugin/images/actions/trackAudioStatus/template.svg @@ -1,5 +1,18 @@ - + .headset { + {{#if (eq state "notConnected")}} + fill: white; + {{else if (eq state "connected")}} + fill: #5fcdfa; + {{else if (eq state "voiceConnected")}} + fill: ##060; + {{else}} + fill: black; + {{/if}} + } + + \ No newline at end of file diff --git a/src/controllers/atisLetter.ts b/src/controllers/atisLetter.ts index 51194fc..5a23d3a 100644 --- a/src/controllers/atisLetter.ts +++ b/src/controllers/atisLetter.ts @@ -5,12 +5,6 @@ import TitleBuilder from "@root/utils/titleBuilder"; import { stringOrUndefined } from "@root/utils/utils"; import { BaseController } from "./baseController"; -const StateColor = { - CURRENT: "black", - UNAVAILABLE: "black", - UPDATED: "#f60", -}; - const defaultTemplatePath = "images/actions/atisLetter/template.svg"; const defaultUnavailableTemplatePath = "images/actions/atisLetter/unavailable.svg"; @@ -248,7 +242,6 @@ export class AtisLetterController extends BaseController { if (this.isUnavailable) { this.setImage(this.unavailableImagePath, { ...replacements, - stateColor: StateColor.CURRENT, state: "current", }); return; @@ -257,7 +250,6 @@ export class AtisLetterController extends BaseController { if (this.isUpdated) { this.setImage(this.updatedImagePath, { ...replacements, - stateColor: StateColor.UPDATED, state: "updated", }); return; @@ -265,7 +257,6 @@ export class AtisLetterController extends BaseController { this.setImage(this.currentImagePath, { ...replacements, - stateColor: StateColor.CURRENT, state: "current", }); } diff --git a/src/controllers/hotline.ts b/src/controllers/hotline.ts index cc041c7..2ed0ea3 100644 --- a/src/controllers/hotline.ts +++ b/src/controllers/hotline.ts @@ -5,15 +5,6 @@ import TitleBuilder from "@root/utils/titleBuilder"; import { stringOrUndefined } from "@root/utils/utils"; import { BaseController } from "./baseController"; -const StateColor = { - BOTH_ACTIVE: "#900", - HOTLINE_ACTIVE: "#c60", - LISTENING: "#009", - NEITHER_ACTIVE: "black", - RECEIVING: "#060", - UNAVAILABLE: "black", -}; - const defaultTemplatePath = "images/actions/hotline/template.svg"; const defaultUnavailableTemplatePath = "images/actions/hotline/unavailable.svg"; @@ -401,7 +392,6 @@ export class HotlineController extends BaseController { if (this.isAvailable !== undefined && !this.isAvailable) { this.setImage(this.unavailableImagePath, { ...replacements, - stateColor: StateColor.UNAVAILABLE, state: "unavailable", }); return; @@ -412,7 +402,6 @@ export class HotlineController extends BaseController { if (this.isTxHotline && this.isTxPrimary) { this.setImage(this.bothActiveImagePath, { ...replacements, - stateColor: StateColor.BOTH_ACTIVE, state: "bothActive", }); return; @@ -422,7 +411,6 @@ export class HotlineController extends BaseController { if (this.isTxHotline) { this.setImage(this.hotlineActiveImagePath, { ...replacements, - stateColor: StateColor.HOTLINE_ACTIVE, state: "hotlineActive", }); return; @@ -431,7 +419,6 @@ export class HotlineController extends BaseController { if (this.isReceiving) { this.setImage(this.receivingImagePath, { ...replacements, - stateColor: StateColor.RECEIVING, state: "receiving", }); return; @@ -441,7 +428,6 @@ export class HotlineController extends BaseController { if (this.isRxHotline) { this.setImage(this.listeningImagePath, { ...replacements, - stateColor: StateColor.LISTENING, state: "listening", }); return; @@ -450,7 +436,6 @@ export class HotlineController extends BaseController { // Nothing is active. this.setImage(this.neitherActiveImagePath, { ...replacements, - stateColor: StateColor.NEITHER_ACTIVE, state: "neitherActive", }); } diff --git a/src/controllers/pushToTalk.ts b/src/controllers/pushToTalk.ts index a5ad61f..5a53d4f 100644 --- a/src/controllers/pushToTalk.ts +++ b/src/controllers/pushToTalk.ts @@ -5,11 +5,6 @@ import TitleBuilder from "@root/utils/titleBuilder"; import { stringOrUndefined } from "@root/utils/utils"; import { BaseController } from "./baseController"; -const StateColor = { - NOT_TRANSMITTING: "black", - TRANSMITTING: "#f60", -}; - const defaultTemplatePath = "images/actions/pushToTalk/template.svg"; /** @@ -153,7 +148,6 @@ export class PushToTalkController extends BaseController { if (this.isTransmitting) { this.setImage(this.transmittingImagePath, { ...replacements, - stateColor: StateColor.TRANSMITTING, state: "transmitting", }); return; @@ -161,7 +155,6 @@ export class PushToTalkController extends BaseController { this.setImage(this.notTransmittingImagePath, { ...replacements, - stateColor: StateColor.NOT_TRANSMITTING, state: "notTransmitting", }); } diff --git a/src/controllers/stationStatus.ts b/src/controllers/stationStatus.ts index b38cbfa..f5560c8 100644 --- a/src/controllers/stationStatus.ts +++ b/src/controllers/stationStatus.ts @@ -11,15 +11,6 @@ import { BaseController } from "./baseController"; // in the kFrequenciesUpdate message. export type ListenTo = "rx" | "tx" | "xc" | "xca"; -const StateColor = { - ACTIVE_COMMS: "#f60", - LISTENING: "#060", - NOT_LISTENING: "black", - UNAVAILABLE: "black", - BLOCKING: "yellow", - MUTED: "#a71d2a", -}; - const defaultTemplatePath = "images/actions/stationStatus/template.svg"; const defaultUnavailableTemplatePath = "images/actions/stationStatus/unavailable.svg"; @@ -576,7 +567,6 @@ export class StationStatusController extends BaseController { if (this.isAvailable !== undefined && !this.isAvailable) { this.setImage(this.unavailableImagePath, { ...replacements, - stateColor: StateColor.UNAVAILABLE, state: "unavailable", }); return; @@ -585,7 +575,6 @@ export class StationStatusController extends BaseController { if (this.isOutputMuted) { this.setImage(this.mutedImagePath, { ...replacements, - stateColor: StateColor.MUTED, state: "muted", }); return; @@ -594,7 +583,6 @@ export class StationStatusController extends BaseController { if (this.isReceiving && this.isTransmitting) { this.setImage(this.blockedCommsImagePath, { ...replacements, - stateColor: StateColor.BLOCKING, state: "blocking", }); return; @@ -603,7 +591,6 @@ export class StationStatusController extends BaseController { if (this.isReceiving || this.isTransmitting) { this.setImage(this.activeCommsImagePath, { ...replacements, - stateColor: StateColor.ACTIVE_COMMS, state: "activeComms", }); return; @@ -612,7 +599,6 @@ export class StationStatusController extends BaseController { if (this.isListening) { this.setImage(this.listeningImagePath, { ...replacements, - stateColor: StateColor.LISTENING, state: "listening", }); return; @@ -620,7 +606,6 @@ export class StationStatusController extends BaseController { this.setImage(this.notListeningImagePath, { ...replacements, - stateColor: StateColor.NOT_LISTENING, state: "notListening", }); } diff --git a/src/controllers/trackAudioStatus.ts b/src/controllers/trackAudioStatus.ts index b11c88a..83eee35 100644 --- a/src/controllers/trackAudioStatus.ts +++ b/src/controllers/trackAudioStatus.ts @@ -5,12 +5,6 @@ import TitleBuilder from "@root/utils/titleBuilder"; import { stringOrUndefined } from "@root/utils/utils"; import { BaseController } from "./baseController"; -const StateColor = { - NOT_CONNECTED: "white", - CONNECTED: "#5fcdfa", - VOICE_CONNECTED: "#060", -}; - const defaultTemplatePath = "images/actions/trackAudioStatus/template.svg"; /** @@ -200,7 +194,6 @@ export class TrackAudioStatusController extends BaseController { if (this.isVoiceConnected) { this.setImage(this.voiceConnectedImagePath, { ...replacements, - stateColor: StateColor.VOICE_CONNECTED, state: "voiceConnected", }); return; @@ -209,14 +202,13 @@ export class TrackAudioStatusController extends BaseController { if (this.isConnected) { this.setImage(this.connectedImagePath, { ...replacements, - stateColor: StateColor.CONNECTED, state: "connected", }); return; } this.setImage(this.notConnectedImagePath, { - stateColor: StateColor.NOT_CONNECTED, + ...replacements, state: "notConnected", }); } From be0494b21a4bd00c9906b9193dcfbcda87fd1910 Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Sat, 4 Jan 2025 09:46:41 -0800 Subject: [PATCH 2/4] Update release notes icon --- .github/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/release.yml b/.github/release.yml index b0fb856..6e0aac4 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -3,6 +3,9 @@ changelog: labels: - ignore-for-release-notes categories: + - title: Breaking changes ⚠️ + labels: + - breaking change - title: New features 🎉 labels: - feature From 2f3a062c4725c90d70cac53442a22591912fbe4f Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Sat, 4 Jan 2025 09:58:00 -0800 Subject: [PATCH 3/4] Update the documentation, fix stationVolume --- docs/svgTemplates.md | 163 +++++++++++++++++++------------ src/controllers/stationVolume.ts | 16 ++- 2 files changed, 112 insertions(+), 67 deletions(-) diff --git a/docs/svgTemplates.md b/docs/svgTemplates.md index 25d24e1..20cdae3 100644 --- a/docs/svgTemplates.md +++ b/docs/svgTemplates.md @@ -5,7 +5,9 @@ - [Hotline variables](#hotline-variables) - [Push to talk variables](#push-to-talk-variables) - [Station status variables](#station-status-variables) +- [Station volume variables](#station-volume-variables) - [TrackAudio status variables](#trackaudio-status-variables) +- [Additional Handlebars helpers](#additional-handlebars-helpers) ## Introduction @@ -15,7 +17,20 @@ For example, the following SVG template renders an ATIS letter large with the ac ```xml - + + {{title}} {{#if @@ -35,62 +50,53 @@ Results in an action displayed like this: The following variables are supported with the ATIS letter action: -| Variable | Description | -| ---------- | --------------------------------------------------------------- | -| callsign | The callsign for the ATIS station | -| letter | The current ATIS letter, or undefined if no letter is available | -| state | The name for the action's current state | -| stateColor | The default color for the action's current state | -| title | The title specified by the user | +| Variable | Description | +| -------- | --------------------------------------------------------------- | +| callsign | The callsign for the ATIS station | +| letter | The current ATIS letter, or undefined if no letter is available | +| state | The action's current state | +| title | The title specified by the user | -The state names and colors are: +The states are: -| stateName | stateColor | -| --------- | ---------- | -| current | black | -| updated | #f60 | +- current +- updated ## Hotline variables The following variables are supported with the hotline action: -| Variable | Description | -| ---------------- | ------------------------------------------------ | -| hotlineCallsign | The hotline callsign | -| hotlineFrequency | The frequency for the hotline callsign | -| primaryCallsign | The primary callsign | -| primaryFrequency | The frequency for the primary callsign | -| state | The name for the action's current state | -| stateColor | The default color for the action's current state | -| title | The title specified by the user | - -The state names and colors are: - -| stateName | stateColor | -| ------------- | ---------- | -| bothActive | #900 | -| hotlineActive | #c60 | -| listening | #009 | -| neitherActive | black | -| receiving | #060 | -| unavailable | black | +| Variable | Description | +| ---------------- | -------------------------------------- | +| hotlineCallsign | The hotline callsign | +| hotlineFrequency | The frequency for the hotline callsign | +| primaryCallsign | The primary callsign | +| primaryFrequency | The frequency for the primary callsign | +| state | The action's current state | +| title | The title specified by the user | + +The states are: + +- bothActive +- hotlineActive +- listening +- neitherActive +- receiving +- unavailable ## Push to talk variables The following variables are supported with the push to talk action: -| Variable | Description | -| ---------- | ------------------------------------------------ | -| state | The name for the action's current state | -| stateColor | The default color for the action's current state | -| title | The title specified by the user | +| Variable | Description | +| -------- | ------------------------------- | +| state | The action's current state | +| title | The title specified by the user | -The state names and colors are: +The states are: -| stateName | stateColor | -| --------------- | ---------- | -| notTransmitting | black | -| transmitting | #f60 | +- notTransmitting +- transmitting ## Station status variables @@ -103,33 +109,64 @@ The following variables are supported with the station status action: | formattedFrequency | The frequency for the station formatted for display, e.g. 121.900 | | lastReceivedCallsign | The last received callsign | | listenTo | The value of the listen to setting | -| state | The name for the action's current state | -| stateColor | The default color for the action's current state | +| state | The action's current state | | title | The title specified by the user | -The state names and colors are: +The states are: + +- activeComs +- listening +- notListening +- unavailable + +## Station volume variables -| stateName | stateColor | -| ------------ | ---------- | -| activeComms | #f60 | -| listening | #060 | -| notListening | black | -| unavailable | black | +The following variables are supported with the station volume action: + +| Variable | Description | +| ------------ | --------------------------------------------------- | +| state | The action's current state | +| outputVolume | The volume level for the station, between 0 and 100 | + +The states are: + +- muted +- notMuted +- unavailable ## TrackAudio status variables The following variables are supported with the TrackAudio status action: -| Variable | Description | -| ---------- | ------------------------------------------------ | -| state | The name for the action's current state | -| stateColor | The default color for the action's current state | -| title | The title specified by the user | +| Variable | Description | +| -------- | --------------------------------------- | +| state | The name for the action's current state | +| title | The title specified by the user | + +The states are: -The state names and colors are: +- connected +- notConnected +- voiceConnected + +## Additional Handlebars helpers + +Logical comparison operators are available in addition to the standard helpers. The +following operators are supported: + +| Operator | Description | +| -------- | --------------------- | +| eq | Equals | +| ne | Not equals | +| gt | Greater than | +| gte | Greater than or equal | +| lt | Less than | +| lte | Less than or equal | + +Example: + +```xml +{{#if (eq state "unavailable")}} {{else}} {{/if}} +``` -| stateName | stateColor | -| -------------- | ---------- | -| connected | #5fcdfa | -| notConnected | white | -| voiceConnected | #060 | +A complete example is available in the [default station state template](https://github.com/neilenns/streamdeck-trackaudio/blob/main/com.neil-enns.trackaudio.sdPlugin/images/actions/stationStatus/template.svg?short_path=ca0646b). diff --git a/src/controllers/stationVolume.ts b/src/controllers/stationVolume.ts index 6a4799f..2992c4f 100644 --- a/src/controllers/stationVolume.ts +++ b/src/controllers/stationVolume.ts @@ -226,22 +226,30 @@ export class StationVolumeController extends BaseController { override refreshImage(): void { const replacements = { - isOutputMuted: this.isOutputMuted, volume: this.outputVolume, }; // Set the unavilable state if the station is not available. if (this.isAvailable !== undefined && !this.isAvailable) { - this.setFeedbackImage(this.unavailableTemplatePath, replacements); + this.setFeedbackImage(this.unavailableTemplatePath, { + ...replacements, + state: "unavailable", + }); return; } if (this.isOutputMuted) { - this.setFeedbackImage(this.mutedTemplatePath, replacements); + this.setFeedbackImage(this.mutedTemplatePath, { + ...replacements, + state: "muted", + }); return; } - this.setFeedbackImage(this.notMutedTemplatePath, replacements); + this.setFeedbackImage(this.notMutedTemplatePath, { + ...replacements, + state: "notMuted", + }); } override refreshTitle(): void { From 17b3ef956354892bce52538a9ddbd4ac79584888 Mon Sep 17 00:00:00 2001 From: Neil Enns Date: Sat, 4 Jan 2025 10:00:52 -0800 Subject: [PATCH 4/4] Add breaking change to required labels --- .github/workflows/pr_label_required.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_label_required.yml b/.github/workflows/pr_label_required.yml index fc03d96..8331a31 100644 --- a/.github/workflows/pr_label_required.yml +++ b/.github/workflows/pr_label_required.yml @@ -19,6 +19,7 @@ jobs: count: 1 add_comment: true labels: | + breaking change ignore-for-release-notes feature enhancement