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
//! # Gain

use super::*;

/// Simple gain filter, the simplest filter of all.
#[derive(Default,Copy,Clone)]
pub struct Gain {
    /// The gain of the gain filter.
    pub a: SampleT,
}

impl Gain {
    /// Constructs a new gain filter from the given...... gain....
    pub fn new(a: SampleT) -> Gain {
        Gain{
            a
        }
    }
}

impl Modifier for Gain {
    fn process(&mut self, x: SampleT) -> SampleT {
        x * self.a
    }
}