-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexander Weichart
committed
Sep 9, 2022
1 parent
ac00a1b
commit 51a056a
Showing
7 changed files
with
56 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,11 @@ | ||
use std::borrow::Cow; | ||
use num_derive::FromPrimitive; | ||
use num_derive::ToPrimitive; | ||
use strum_macros::{EnumCount, EnumIter}; | ||
use strum::{EnumCount, IntoEnumIterator}; | ||
use nih_plug::prelude::Enum; | ||
|
||
use std::fmt::Display; | ||
use crate::CategoricalIntParam; | ||
|
||
#[derive(FromPrimitive, ToPrimitive, Clone, Copy, EnumCount, EnumIter, Default)] | ||
#[derive(PartialEq, Enum, Clone)] | ||
pub enum FrequencyType { | ||
#[name="Hz"] | ||
Hertz, | ||
#[default] | ||
#[name="ms"] | ||
Milliseconds, | ||
#[name="bpm"] | ||
Bpm | ||
} | ||
|
||
impl Display for FrequencyType { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
match self { | ||
FrequencyType::Hertz => write!(f, "Hz"), | ||
FrequencyType::Milliseconds => write!(f, "ms"), | ||
FrequencyType::Bpm => write!(f, "bpm"), | ||
} | ||
} | ||
} | ||
|
||
impl CategoricalIntParam<FrequencyType> for FrequencyType { | ||
fn title() -> String { | ||
"Frequency type".to_string() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
pub mod freq_type; | ||
pub mod trigger_mode; | ||
pub mod categorical_int_param; | ||
pub mod trigger_mode; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters