From 41a66fd32f9f3fbaa4d1c297a2d6d4eec170e6a3 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 7 Jul 2024 22:44:39 -0500 Subject: [PATCH] Stuff --- src/model/display.rs | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/model/display.rs b/src/model/display.rs index 450e8e7..7fa7e6e 100644 --- a/src/model/display.rs +++ b/src/model/display.rs @@ -1,8 +1,8 @@ -use super::song::{Plan, Song}; +use super::song::{Plan, Song, Verse}; pub struct PlaylistEntry { pub song: Song, - pub map: Plan, + pub plan_name: String, } pub struct PlaylistVerseRef { @@ -12,8 +12,28 @@ pub struct PlaylistVerseRef { } pub struct Display { - pub playlist: Vec<(Song, Option)>, - pub current: PlaylistVerseRef, - pub frozen_at: Option, + pub playlist: Vec, + current: PlaylistVerseRef, + frozen_at: Option, pub blanked: bool, } + +impl Display { + pub fn verse_ref(&self) -> &PlaylistVerseRef { + self.frozen_at.as_ref().unwrap_or(&self.current) + } + + pub fn verse(&self) -> Option<&Verse> { + if self.blanked { + None + } else { + } + } + + pub fn entry(&self) -> Option { + let vref = self.verse_ref(); + self.playlist.get(vref.song_index) + } + + pub fn plan() -> Plan {} +}