Modify playstatus to keep track of queue status and derive Clone for songdata

This commit is contained in:
Connor Wittman 2024-02-02 17:17:16 -05:00
parent 7ed5561262
commit c924b5613f
2 changed files with 4 additions and 1 deletions

View File

@ -9,6 +9,8 @@ use crate::songdata::SongData;
pub struct PlayStatus {
/// Whether or not the audio player is currently playing
pub playing: bool,
/// Whether or not the queue is open
pub queue_open: bool,
/// A reference to the HTML audio element
pub audio_player: Option<NodeRef<Audio>>,
/// A queue of songs that have been played, ordered from oldest to newest
@ -53,6 +55,7 @@ impl Default for PlayStatus {
fn default() -> Self {
Self {
playing: false,
queue_open: false,
audio_player: None,
history: VecDeque::new(),
queue: VecDeque::new(),

View File

@ -1,5 +1,5 @@
/// Holds information about a song
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct SongData {
/// Song name
pub name: String,