lyrs/src/model/display.rs

40 lines
811 B
Rust
Raw Normal View History

2024-07-07 22:44:39 -05:00
use super::song::{Plan, Song, Verse};
2024-07-06 18:18:34 -05:00
pub struct PlaylistEntry {
pub song: Song,
2024-07-07 22:44:39 -05:00
pub plan_name: String,
2024-07-06 18:18:34 -05:00
}
pub struct PlaylistVerseRef {
pub song_index: usize,
pub song_map: String,
pub map_verse_index: usize,
}
pub struct Display {
2024-07-07 22:44:39 -05:00
pub playlist: Vec<PlaylistEntry>,
current: PlaylistVerseRef,
frozen_at: Option<PlaylistVerseRef>,
2024-07-06 18:18:34 -05:00
pub blanked: bool,
}
2024-07-07 22:44:39 -05:00
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<PlaylistEntry> {
let vref = self.verse_ref();
self.playlist.get(vref.song_index)
}
pub fn plan() -> Plan {}
}