summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-07-11 09:15:42 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2019-09-17 17:57:43 -0600
commitcbb7f6d863a24aa3caae4751ed742a3cc4f3691d (patch)
treec9df4cbd9251ecd42e500803ff7c20583761634b /libs
parentb84c99639f0dd28e210ed9c064429c17014093a7 (diff)
use const int rather than macro
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/disk_reader.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc
index d40f17a23d..4b13b1678a 100644
--- a/libs/ardour/disk_reader.cc
+++ b/libs/ardour/disk_reader.cc
@@ -1454,21 +1454,22 @@ DiskReader::DeclickAmp::apply_gain (AudioBuffer& buf, samplecnt_t n_samples, con
const float a = _a;
Sample* const buffer = buf.data ();
-#define MAX_NPROC 16
+ const int max_nproc = 16;
uint32_t remain = n_samples;
uint32_t offset = 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) {
buffer[offset + i] *= g;
}
#if 1
g += a * (target - g);
#else /* accurate exponential fade */
- if (n_proc == MAX_NPROC) {
+ if (n_proc == max_nproc) {
g += a * (target - g);
} else {
- g = target - (target - g) * expf (_l * n_proc / MAX_NPROC);
+ g = target - (target - g) * expf (_l * n_proc / max_nproc);
}
#endif
remain -= n_proc;