use crate::note::Interval;
use crate::note::Semitones;
use structopt::clap::arg_enum;
arg_enum! {
#[derive(Debug, Clone, Copy)]
pub enum Tuning {
C,
D,
G,
}
}
impl Tuning {
pub fn get_semitones(self) -> Semitones {
match self {
Self::C => 0,
Self::D => 2,
Self::G => 7,
}
}
pub fn get_interval(self) -> Interval {
match self {
Self::C => Interval::PerfectUnison,
Self::D => Interval::MajorSecond,
Self::G => Interval::PerfectFifth,
}
}
pub fn get_root_width(self) -> usize {
match self {
Self::C => 1,
Self::D => 2, Self::G => 1,
}
}
}