use playr_core::notice::{Notice, Outcome, Refusal};
use crate::action::{Action, Key};
use crate::{Display, View};
#[derive(Debug, Clone, PartialEq)]
pub enum Message {
Core(Notice),
Cancelled,
NoMatches,
NoPlaylistUnderCursor,
Display(Display),
Mapped(Action),
Unmapped(Key),
NotBound {
key: Key,
view: Option<View>,
},
NoSlicesPlanned,
SlicesDiscarded,
Command(String),
}
impl From<Notice> for Message {
fn from(notice: Notice) -> Self {
Message::Core(notice)
}
}
impl From<Outcome> for Message {
fn from(outcome: Outcome) -> Self {
Message::Core(Notice::Done(outcome))
}
}
impl From<Refusal> for Message {
fn from(refusal: Refusal) -> Self {
Message::Core(Notice::Refused(refusal))
}
}