diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2018-09-18 18:51:59 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2018-09-18 19:06:04 -0400 |
commit | e6915e01de2e2167c3384c6c8f2408f763971616 (patch) | |
tree | c67200eda4cf4c595503a850fe6ae72d89032a6f /libs/ardour/audio_port.cc | |
parent | 7390b88c2bb29b1b34624f441adec1e71c74bad8 (diff) |
new transport slave/master implementation, libs/ edition
Diffstat (limited to 'libs/ardour/audio_port.cc')
-rw-r--r-- | libs/ardour/audio_port.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc index 44e0298f1d..1a6c30dcf2 100644 --- a/libs/ardour/audio_port.cc +++ b/libs/ardour/audio_port.cc @@ -30,6 +30,7 @@ using namespace ARDOUR; using namespace std; +#define ENGINE AudioEngine::instance() #define port_engine AudioEngine::instance()->port_engine() AudioPort::AudioPort (const std::string& name, PortFlags flags) @@ -121,12 +122,18 @@ AudioPort::get_audio_buffer (pframes_t nframes) { /* caller must hold process lock */ assert (_port_handle); + + Sample* addr; + if (!externally_connected ()) { - _buffer->set_data ((Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes) + - _global_port_buffer_offset, nframes); + addr = (Sample *) port_engine.get_buffer (_port_handle, nframes); } else { - _buffer->set_data (&_data[_global_port_buffer_offset], nframes); + /* _data was read and resampled as necessary in ::cycle_start */ + addr = &_data[_global_port_buffer_offset]; } + + _buffer->set_data (addr, nframes); + return *_buffer; } @@ -135,5 +142,5 @@ AudioPort::engine_get_whole_audio_buffer () { /* caller must hold process lock */ assert (_port_handle); - return (Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes); + return (Sample *) port_engine.get_buffer (_port_handle, ENGINE->samples_per_cycle()); } |