From b7dc4c6bb157ddda7cc2056f77ed361100011093 Mon Sep 17 00:00:00 2001 From: duncte123 Date: Fri, 2 Feb 2024 14:41:48 +0100 Subject: [PATCH] Add music track to omnibar options --- .gitignore | 1 + schemas/omnibar.json | 3 +- src/browser_shared/replicant_store.ts | 5 +- .../components/MusicTrack.vue | 29 +++++++++++ src/dashboard/omnibar-ticker-control/main.vue | 6 +++ src/graphics/omnibar/components/Ticker.vue | 2 + .../omnibar/components/Ticker/MusicTrack.vue | 48 +++++++++++++++++++ src/types/schemas/omnibar.d.ts | 6 ++- 8 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 src/dashboard/omnibar-ticker-control/components/MusicTrack.vue create mode 100644 src/graphics/omnibar/components/Ticker/MusicTrack.vue diff --git a/.gitignore b/.gitignore index 831631bc..7bef4941 100644 --- a/.gitignore +++ b/.gitignore @@ -134,3 +134,4 @@ streamdeck-plugin/com.esamarathon.streamdeck.sdPlugin streamdeck-plugin/DistributionTool.exe *.psd /boxart/ +.idea/ diff --git a/schemas/omnibar.json b/schemas/omnibar.json index 83cb2e6a..5382be08 100644 --- a/schemas/omnibar.json +++ b/schemas/omnibar.json @@ -18,7 +18,8 @@ "UpcomingRun", "Prize", "Bid", - "Milestone" + "Milestone", + "MusicTrack" ] }, "alerts": { diff --git a/src/browser_shared/replicant_store.ts b/src/browser_shared/replicant_store.ts index 762a5539..1e0b3c4d 100644 --- a/src/browser_shared/replicant_store.ts +++ b/src/browser_shared/replicant_store.ts @@ -1,4 +1,4 @@ -import type { Bids, BigbuttonPlayerMap, Commentators, Countdown, CurrentRunDelay, DonationAlerts, DonationReader, DonationTotal, DonationTotalMilestones, DonationsToRead, GameLayouts, IntermissionSlides, ObsData, Omnibar, OtherStreamData, Prizes, ReaderIntroduction, ServerTimestamp, StreamDeckData, TtsVoices, UpcomingRunID, VideoPlayer } from '@esa-layouts/types/schemas'; +import type { Bids, BigbuttonPlayerMap, Commentators, Countdown, CurrentRunDelay, DonationAlerts, DonationReader, DonationTotal, DonationTotalMilestones, DonationsToRead, GameLayouts, IntermissionSlides, MusicData, ObsData, Omnibar, OtherStreamData, Prizes, ReaderIntroduction, ServerTimestamp, StreamDeckData, TtsVoices, UpcomingRunID, VideoPlayer } from '@esa-layouts/types/schemas'; import type NodeCGTypes from '@nodecg/types'; import clone from 'clone'; import { SpeedcontrolUtilBrowser } from 'speedcontrol-util'; @@ -28,6 +28,7 @@ export const reps: { donationTotalMilestones: NodeCGTypes.ClientReplicant; gameLayouts: NodeCGTypes.ClientReplicant; intermissionSlides: NodeCGTypes.ClientReplicant; + musicData: NodeCGTypes.ClientReplicant; obsData: NodeCGTypes.ClientReplicant; omnibar: NodeCGTypes.ClientReplicant; otherStreamData: NodeCGTypes.ClientReplicant; @@ -59,6 +60,7 @@ export const reps: { donationTotalMilestones: nodecg.Replicant('donationTotalMilestones'), gameLayouts: nodecg.Replicant('gameLayouts'), intermissionSlides: nodecg.Replicant('intermissionSlides'), + musicData: nodecg.Replicant('musicData'), obsData: nodecg.Replicant('obsData'), omnibar: nodecg.Replicant('omnibar'), otherStreamData: nodecg.Replicant('otherStreamData'), @@ -92,6 +94,7 @@ export interface ReplicantTypes { donationTotalMilestones: DonationTotalMilestones; gameLayouts: GameLayouts; intermissionSlides: IntermissionSlides; + musicData: MusicData; obsData: ObsData; omnibar: Omnibar; otherStreamData: OtherStreamData; diff --git a/src/dashboard/omnibar-ticker-control/components/MusicTrack.vue b/src/dashboard/omnibar-ticker-control/components/MusicTrack.vue new file mode 100644 index 00000000..9f879df6 --- /dev/null +++ b/src/dashboard/omnibar-ticker-control/components/MusicTrack.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/dashboard/omnibar-ticker-control/main.vue b/src/dashboard/omnibar-ticker-control/main.vue index b40945fd..b4a95544 100644 --- a/src/dashboard/omnibar-ticker-control/main.vue +++ b/src/dashboard/omnibar-ticker-control/main.vue @@ -92,6 +92,7 @@ import GenericMsg from './components/GenericMsg.vue'; import Milestone from './components/Milestone.vue'; import Prize from './components/Prize.vue'; import UpcomingRun from './components/UpcomingRun.vue'; +import MusicTrack from './components/MusicTrack.vue'; import { storeModule } from './store'; @Component({ @@ -103,6 +104,7 @@ import { storeModule } from './store'; Milestone, Prize, UpcomingRun, + MusicTrack, }, }) export default class OmnibarTickerControl extends Vue { @@ -112,6 +114,10 @@ export default class OmnibarTickerControl extends Vue { key: 'GenericMsg', name: 'Generic Message', }, + { + key: 'MusicTrack', + name: 'Current song', + }, { key: 'Bid', name: 'Random Bid (favours sooner)', diff --git a/src/graphics/omnibar/components/Ticker.vue b/src/graphics/omnibar/components/Ticker.vue index cf4a0609..a5a0bbd0 100644 --- a/src/graphics/omnibar/components/Ticker.vue +++ b/src/graphics/omnibar/components/Ticker.vue @@ -34,6 +34,7 @@ import UpcomingRun from './Ticker/UpcomingRun.vue'; import Prize from './Ticker/Prize.vue'; import Bid from './Ticker/Bid.vue'; import Milestone from './Ticker/Milestone.vue'; +import MusicTrack from './Ticker/MusicTrack.vue'; @Component({ components: { @@ -44,6 +45,7 @@ import Milestone from './Ticker/Milestone.vue'; UpcomingRun, Prize, Milestone, + MusicTrack, Bid, }, }) diff --git a/src/graphics/omnibar/components/Ticker/MusicTrack.vue b/src/graphics/omnibar/components/Ticker/MusicTrack.vue new file mode 100644 index 00000000..6e1c6567 --- /dev/null +++ b/src/graphics/omnibar/components/Ticker/MusicTrack.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/types/schemas/omnibar.d.ts b/src/types/schemas/omnibar.d.ts index da63886c..a8e953ed 100644 --- a/src/types/schemas/omnibar.d.ts +++ b/src/types/schemas/omnibar.d.ts @@ -7,7 +7,7 @@ export interface Omnibar { rotation: { - type: 'GenericMsg' | 'UpcomingRun' | 'Prize' | 'Bid' | 'Milestone'; + type: 'GenericMsg' | 'UpcomingRun' | 'Prize' | 'Bid' | 'Milestone' | 'MusicTrack'; id: string; props?: Props; }[]; @@ -19,7 +19,9 @@ export interface Omnibar { }; }[]; current: { - type: ('GenericMsg' | 'UpcomingRun' | 'Prize' | 'Bid' | 'Milestone') | ('Tweet' | 'CrowdControl' | 'MiniCredits'); + type: + | ('GenericMsg' | 'UpcomingRun' | 'Prize' | 'Bid' | 'Milestone' | 'MusicTrack') + | ('Tweet' | 'CrowdControl' | 'MiniCredits'); id: string; props?: Props; } | null;