pub mod catalog;
pub(super) mod chip;
pub mod measure;
#[cfg(feature = "sfx")]
pub mod sfx;
#[cfg(feature = "sfx-hd")]
pub mod sfx_hd;
pub mod user;
#[cfg(feature = "va")]
pub mod va;
pub use catalog::{
file_comments, file_text, find, includes_for, library_spec, tones, tones_in, LibraryTone,
};
pub use measure::{audition_mml, audition_mml_for, compare, preset_category, references, report};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ToneFile {
pub name: &'static str,
pub kind: Option<&'static str>,
pub text: &'static str,
}
impl ToneFile {
pub fn tones(&self) -> impl Iterator<Item = (&'static str, &'static str)> {
let text: &'static str = if self.kind.is_some() { self.text } else { "" };
text.lines().filter_map(|line| {
let rest = line.trim_start().strip_prefix('$')?;
let (name, body) = rest.split_once('=')?;
let body = body.split(';').next().unwrap_or("").trim();
Some((name.trim(), body))
})
}
}