use super::*; use synth::SampleBuffer; use std::collections::HashMap; pub struct VoiceDatum { pitch: Pitch, ampl: f32, } pub enum Datum { Voices(Vec), Samples(SampleBuffer), Playtime(f32, f32), } pub enum DatumKind { Voices, Samples, Playtime, } impl<'a> From<&'a Datum> for DatumKind { fn from(d: &'a Datum) -> DatumKind { match *d { Datum::Voices(_) => DatumKind::Voices, Datum::Samples(_) => DatumKind::Samples, Datum::Playtime(_, _) => DatumKind::Playtime, } } } pub type Data = HashMap; pub trait Monitor { fn process(&mut self, data: &Data); }