1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! The state of a modulation range
use super::normal::Normal;
/// The state of a modulation range
#[derive(Debug, Clone)]
pub struct ModulationRange {
/// Where the modulation range starts.
/// `0.0.into()` is all the way minimum, and `1.0.into()` is all the way maximum.
pub start: Normal,
/// Where the modulation range ends.
/// `0.0.into()` is all the way minimum, and `1.0.into()` is all the way maximum.
pub end: Normal,
/// Whether the filled portion of the modulation range is visible or not, while keeping
/// the empty portion visible.
pub filled_visible: bool,
}
impl ModulationRange {
/// Creates a new `ModulationRange`
///
/// * start - Where the modulation range starts.
/// `0.0.into()` is all the way minimum, and `1.0.into()` is all the way maximum.
/// * ends - Where the modulation range ends.
/// `0.0.into()` is all the way minimum, and `1.0.into()` is all the way maximum.
pub const fn new(start: Normal, end: Normal) -> Self {
Self {
start,
end,
filled_visible: true,
}
}
}
impl Default for ModulationRange {
fn default() -> Self {
Self {
start: Normal::MIN,
end: Normal::MIN,
filled_visible: true,
}
}
}