summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/audio_port.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-10-29 18:30:18 +0100
committerRobin Gareus <robin@gareus.org>2017-10-29 20:04:00 +0100
commit927788a0b0bf6a621e7cee60365f4e8cbd67d829 (patch)
tree43ebe89319b4b9416391f2f195dbc4f8effad161 /libs/ardour/ardour/audio_port.h
parent7fb3c3e137d7a96998f21a4ec275339b4bc08c1a (diff)
Move vari-speed into backend (resample ports)
Previously Ardour used a /local/ per track vari-speed mechanism. Now that the disk-reader is a latency-compensated processor, the speed of each disk-reader would need to be maintained locally, offset by each disk-reader's output latency. Furthermore each disk-reader may produce a different number of samples, depending on its global alignment. This commit introduces port-data resampling directly at the engine-level: Up/down-sample all input ports at the beginning, and down/up-sample output port-data using the inverse ratio at the end of the session's process cycle. The session itself is unaware of the speed-change, and only needs to handle transport speeds {-1, 0, +1}. This also allows for aligned cue-monitoring and vari-speed recording, and also pitch-shifts synthesized MIDI along.
Diffstat (limited to 'libs/ardour/ardour/audio_port.h')
-rw-r--r--libs/ardour/ardour/audio_port.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/ardour/ardour/audio_port.h b/libs/ardour/ardour/audio_port.h
index 384de3ef5d..4224a88d55 100644
--- a/libs/ardour/ardour/audio_port.h
+++ b/libs/ardour/ardour/audio_port.h
@@ -21,6 +21,8 @@
#ifndef __ardour_audio_port_h__
#define __ardour_audio_port_h__
+#include "zita-resampler/vmresampler.h"
+
#include "ardour/port.h"
#include "ardour/audio_buffer.h"
@@ -49,12 +51,14 @@ class LIBARDOUR_API AudioPort : public Port
friend class PortManager;
AudioPort (std::string const &, PortFlags);
- /* special access for PortManager only (hah, C++) */
- Sample* engine_get_whole_audio_buffer ();
+ /* special access for PortManager only (hah, C++) */
+ Sample* engine_get_whole_audio_buffer ();
private:
- AudioBuffer* _buffer;
- bool _buf_valid;
+ AudioBuffer* _buffer;
+ ArdourZita::VMResampler _src;
+ Sample* _data;
+ bool _buf_valid;
};
} // namespace ARDOUR