summaryrefslogtreecommitdiff
path: root/libs/ardour/disk_reader.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-03-31 20:53:09 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2020-03-31 20:54:14 -0600
commit0047dc383f4c658508c67d18a63201f954076c44 (patch)
treee67842a9cef89b16e49e367ec387048f902c8c7b /libs/ardour/disk_reader.cc
parent88e84067f29e5afb8a5a165988c9f46a5964a42f (diff)
clean up logic for declick out in DiskReader
This is intended to be a no-op that makes the code easier to read/reason about
Diffstat (limited to 'libs/ardour/disk_reader.cc')
-rw-r--r--libs/ardour/disk_reader.cc31
1 files changed, 23 insertions, 8 deletions
diff --git a/libs/ardour/disk_reader.cc b/libs/ardour/disk_reader.cc
index 0eba91d3d2..07f49d398c 100644
--- a/libs/ardour/disk_reader.cc
+++ b/libs/ardour/disk_reader.cc
@@ -280,18 +280,33 @@ DiskReader::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_samp
}
const gain_t target_gain = ((speed == 0.0) || ((ms & MonitoringDisk) == 0)) ? 0.0 : 1.0;
- const bool declicked_out = (_declick_amp.gain() == target_gain) && target_gain == 0.0;
- const bool declick_out = (_declick_amp.gain() != target_gain) && target_gain == 0.0;
+ bool declick_out = (_declick_amp.gain() != target_gain) && target_gain == 0.0;
if (!_session.cfg ()->get_use_transport_fades () || (_session.exporting () && ! _session.realtime_export ())) {
+
+ /* no transport fades or exporting - no declick out logic */
+
_declick_amp.set_gain (target_gain);
- }
+ declick_out = false;
- if (declicked_out && (ms == MonitoringDisk)) {
- /* Stopped and declicking has finished. Don't accidentally pass
- * any data from disk into our outputs (e.g. via interpolation)
- */
- return;
+ } else {
+
+ /* using transport fades and not exporting - declick login in effect */
+
+ if (ms == MonitoringDisk) {
+
+ /* Only monitoring from disk, so if we've finished a
+ * declick (for stop/locate), do not accidentally pass
+ * any data from disk to our outputs.
+ */
+
+ if ((target_gain == 0.0) && (_declick_amp.gain() == target_gain)) {
+ /* we were heading for zero (declick out for
+ stop), and we've reached there. Done.
+ */
+ return;
+ }
+ }
}
BufferSet& scratch_bufs (_session.get_scratch_buffers (bufs.count()));