use musicus_database::Database;
use std::cell::RefCell;
use std::path::PathBuf;
use std::rc::Rc;
use tokio::sync::{broadcast, broadcast::Sender};
pub use musicus_database as db;
pub use musicus_import as import;
pub mod error;
pub use error::*;
pub mod library;
pub use library::*;
mod logger;
pub mod player;
pub use player::*;
/// General states the application can be in.
#[derive(Debug, Copy, Clone)]
pub enum BackendState {
/// The backend is not set up yet. This means that no backend methods except for setting the
/// music library path should be called. The user interface should adapt and only present this
/// option.
NoMusicLibrary,
/// The backend is loading the music library. No methods should be called. The user interface
/// should represent that state by prohibiting all interaction.
Loading,
/// The backend is ready and all methods may be called.
Ready,
}
/// A collection of all backend state and functionality.
pub struct Backend {
/// A closure that will be called whenever the backend state changes.
state_cb: RefCell