mirror of
https://github.com/aicodix/dsp.git
synced 2026-04-27 14:30:36 +00:00
initialize buffer optionally with provided value
This commit is contained in:
parent
4de8fe9af1
commit
b934d9fe4e
1 changed files with 2 additions and 2 deletions
4
delay.hh
4
delay.hh
|
|
@ -14,10 +14,10 @@ class Delay
|
||||||
TYPE buf[NUM];
|
TYPE buf[NUM];
|
||||||
int pos;
|
int pos;
|
||||||
public:
|
public:
|
||||||
Delay() : pos(0)
|
Delay(TYPE init = 0) : pos(0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUM; ++i)
|
for (int i = 0; i < NUM; ++i)
|
||||||
buf[i] = 0;
|
buf[i] = init;
|
||||||
}
|
}
|
||||||
TYPE operator () (TYPE input)
|
TYPE operator () (TYPE input)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue