-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDropDsp.h
executable file
·97 lines (53 loc) · 2.04 KB
/
DropDsp.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*****************************************************************************
DropDsp.h
Copyright (c) 2020 Raphael DINGE
*Tab=3***********************************************************************/
#pragma once
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
#include "dsp/Filter2Poles.h"
#include "dsp/GainRamp.h"
#include <array>
#include <cstddef>
class DropDsp
{
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
public:
enum class Mode
{
HighPass, Mute
};
enum class State
{
None,
Off, Armed, Active
};
DropDsp (float sample_freq);
/*virtual*/ ~DropDsp () = default;
void toggle_arm ();
void sync ();
void set_mode (Mode mode);
void set_highpass_freq (float freq);
void process (float * const out [], const float * const in [], std::size_t size);
State state ();
/*\\\ INTERNAL \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
protected:
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
private:
enum { NBR_CHANNELS = 2 };
using Filters = std::array <dsp::Filter2Poles, NBR_CHANNELS>;
bool _arm_active = false;
dsp::GainRamp _active;
dsp::GainRamp _mode;
Filters _filters;
/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
private:
DropDsp () = delete;
DropDsp (const DropDsp & rhs) = delete;
DropDsp (DropDsp && rhs) = delete;
DropDsp & operator = (const DropDsp & rhs) = delete;
DropDsp & operator = (DropDsp && rhs) = delete;
bool operator == (const DropDsp & rhs) const = delete;
bool operator != (const DropDsp & rhs) const = delete;
}; // class DropDsp
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/