mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 13:16:27 +01:00
use const int rather than macro
This commit is contained in:
parent
b84c99639f
commit
cbb7f6d863
1 changed files with 5 additions and 4 deletions
|
|
@ -1454,21 +1454,22 @@ DiskReader::DeclickAmp::apply_gain (AudioBuffer& buf, samplecnt_t n_samples, con
|
||||||
const float a = _a;
|
const float a = _a;
|
||||||
Sample* const buffer = buf.data ();
|
Sample* const buffer = buf.data ();
|
||||||
|
|
||||||
#define MAX_NPROC 16
|
const int max_nproc = 16;
|
||||||
uint32_t remain = n_samples;
|
uint32_t remain = n_samples;
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
while (remain > 0) {
|
while (remain > 0) {
|
||||||
uint32_t n_proc = remain > MAX_NPROC ? MAX_NPROC : remain;
|
uint32_t n_proc = remain > max_nproc ? max_nproc : remain;
|
||||||
|
std::cerr << "g = " << g << std::endl;
|
||||||
for (uint32_t i = 0; i < n_proc; ++i) {
|
for (uint32_t i = 0; i < n_proc; ++i) {
|
||||||
buffer[offset + i] *= g;
|
buffer[offset + i] *= g;
|
||||||
}
|
}
|
||||||
#if 1
|
#if 1
|
||||||
g += a * (target - g);
|
g += a * (target - g);
|
||||||
#else /* accurate exponential fade */
|
#else /* accurate exponential fade */
|
||||||
if (n_proc == MAX_NPROC) {
|
if (n_proc == max_nproc) {
|
||||||
g += a * (target - g);
|
g += a * (target - g);
|
||||||
} else {
|
} else {
|
||||||
g = target - (target - g) * expf (_l * n_proc / MAX_NPROC);
|
g = target - (target - g) * expf (_l * n_proc / max_nproc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
remain -= n_proc;
|
remain -= n_proc;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue