use super::{MidiMsg, TimeCode, TimeCodeType};
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ReceiverContext {
pub(crate) previous_channel_message: Option<MidiMsg>,
pub(crate) time_code: TimeCode,
pub(crate) is_smf_sysex: bool,
pub(crate) parsing_smf: bool,
pub complex_cc: bool,
}
impl ReceiverContext {
pub const fn new() -> Self {
Self {
previous_channel_message: None,
time_code: TimeCode {
frames: 0,
seconds: 0,
minutes: 0,
hours: 0,
code_type: TimeCodeType::NDF30,
},
is_smf_sysex: false,
parsing_smf: false,
complex_cc: false,
}
}
pub fn complex_cc(mut self) -> Self {
self.complex_cc = true;
self
}
#[cfg(feature = "file")]
pub(crate) fn parsing_smf(mut self) -> Self {
self.parsing_smf = true;
self
}
}