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 {} +}