summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-10-29 18:44:06 +0100
committerRobin Gareus <robin@gareus.org>2017-10-29 20:04:11 +0100
commitdb674ac8b676bb3412422bb784abd35ca9a19930 (patch)
tree5dc66652f363dff295730df9e0bcdeb6af14869c /libs
parent4f03b7c1012359c33161f62f3cddf860374be547 (diff)
Remove unused per-port buffer offset
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/io.h1
-rw-r--r--libs/ardour/ardour/io_processor.h2
-rw-r--r--libs/ardour/ardour/port.h3
-rw-r--r--libs/ardour/audio_port.cc4
-rw-r--r--libs/ardour/io.cc12
-rw-r--r--libs/ardour/io_processor.cc8
-rw-r--r--libs/ardour/midi_port.cc20
-rw-r--r--libs/ardour/port.cc10
8 files changed, 12 insertions, 48 deletions
diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h
index 48f3653c2b..1b85fa78ba 100644
--- a/libs/ardour/ardour/io.h
+++ b/libs/ardour/ardour/io.h
@@ -93,7 +93,6 @@ public:
std::string pretty_name () const { return _pretty_name_prefix; }
virtual void silence (samplecnt_t);
- void increment_port_buffer_offset (pframes_t offset);
int ensure_io (ChanCount cnt, bool clear, void *src);
diff --git a/libs/ardour/ardour/io_processor.h b/libs/ardour/ardour/io_processor.h
index 7dcbb630ab..c59addffb2 100644
--- a/libs/ardour/ardour/io_processor.h
+++ b/libs/ardour/ardour/io_processor.h
@@ -67,8 +67,6 @@ class LIBARDOUR_API IOProcessor : public Processor
void silence (samplecnt_t nframes, samplepos_t start_sample);
void disconnect ();
- void increment_port_buffer_offset (pframes_t);
-
virtual bool feeds (boost::shared_ptr<Route> other) const;
PBD::Signal2<void,IOProcessor*,bool> AutomationPlaybackChanged;
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 18d56dd8df..7284f2d9aa 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -139,8 +139,6 @@ public:
_global_port_buffer_offset += n;
}
- virtual void increment_port_buffer_offset (pframes_t n);
-
virtual XMLNode& get_state (void) const;
virtual int set_state (const XMLNode&, int version);
@@ -158,7 +156,6 @@ protected:
static pframes_t _cycle_nframes; /* access only from process() tree */
static pframes_t _global_port_buffer_offset; /* access only from process() tree */
- samplecnt_t _port_buffer_offset; /* access only from process() tree */
LatencyRange _private_playback_latency;
LatencyRange _private_capture_latency;
diff --git a/libs/ardour/audio_port.cc b/libs/ardour/audio_port.cc
index a9d41afce2..797c8383ee 100644
--- a/libs/ardour/audio_port.cc
+++ b/libs/ardour/audio_port.cc
@@ -133,9 +133,9 @@ AudioPort::get_audio_buffer (pframes_t nframes)
assert (_port_handle);
if (!externally_connected ()) {
_buffer->set_data ((Sample *) port_engine.get_buffer (_port_handle, _cycle_nframes) +
- _global_port_buffer_offset + _port_buffer_offset, nframes);
+ _global_port_buffer_offset, nframes);
} else {
- _buffer->set_data (&_data[_global_port_buffer_offset + _port_buffer_offset], nframes);
+ _buffer->set_data (&_data[_global_port_buffer_offset], nframes);
}
return *_buffer;
}
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 3628ec9b48..7eb85477d7 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -131,18 +131,6 @@ IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
}
void
-IO::increment_port_buffer_offset (pframes_t offset)
-{
- /* io_lock, not taken: function must be called from Session::process() calltree */
-
- if (_direction == Output) {
- for (PortSet::iterator i = _ports.begin(); i != _ports.end(); ++i) {
- i->increment_port_buffer_offset (offset);
- }
- }
-}
-
-void
IO::silence (samplecnt_t nframes)
{
/* io_lock, not taken: function must be called from Session::process() calltree */
diff --git a/libs/ardour/io_processor.cc b/libs/ardour/io_processor.cc
index a7e13fecb4..9a162e3f8b 100644
--- a/libs/ardour/io_processor.cc
+++ b/libs/ardour/io_processor.cc
@@ -230,14 +230,6 @@ IOProcessor::silence (samplecnt_t nframes, samplepos_t /* start_sample */)
}
}
-void
-IOProcessor::increment_port_buffer_offset (pframes_t offset)
-{
- if (_own_output && _output) {
- _output->increment_port_buffer_offset (offset);
- }
-}
-
ChanCount
IOProcessor::natural_output_streams() const
{
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index 24dc994535..1aaa25ad70 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -141,17 +141,16 @@ MidiPort::get_midi_buffer (pframes_t nframes)
timestamp = floor (timestamp * _speed_ratio);
/* check that the event is in the acceptable time range */
- if ((timestamp < (_global_port_buffer_offset + _port_buffer_offset)) ||
- (timestamp >= (_global_port_buffer_offset + _port_buffer_offset + nframes))) {
+ if ((timestamp < (_global_port_buffer_offset)) ||
+ (timestamp >= (_global_port_buffer_offset + nframes))) {
// XXX this is normal after a split cycles:
// The engine buffer contains the data for the complete cycle, but
// only the part after _global_port_buffer_offset is needed.
#ifndef NDEBUG
cerr << "Dropping incoming MIDI at time " << timestamp << "; offset="
<< _global_port_buffer_offset << " limit="
- << (_global_port_buffer_offset + _port_buffer_offset + nframes)
+ << (_global_port_buffer_offset + nframes)
<< " = (" << _global_port_buffer_offset
- << " + " << _port_buffer_offset
<< " + " << nframes
<< ")\n";
#endif
@@ -159,7 +158,7 @@ MidiPort::get_midi_buffer (pframes_t nframes)
}
/* adjust timestamp to match current cycle */
- timestamp -= _global_port_buffer_offset + _port_buffer_offset;
+ timestamp -= _global_port_buffer_offset;
assert (timestamp >= 0 && timestamp < nframes);
if ((buf[0] & 0xF0) == 0x90 && buf[2] == 0) {
@@ -275,8 +274,8 @@ MidiPort::flush_buffers (pframes_t nframes)
const Session* s = AudioEngine::instance()->session();
const samplepos_t now = (s ? s->transport_sample() : 0);
DEBUG_STR_DECL(a);
- DEBUG_STR_APPEND(a, string_compose ("MidiPort %8 %1 pop event @ %2 (global %4, within %5 gpbo %6 pbo %7 sz %3 ", _buffer, ev.time(), ev.size(),
- now + ev.time(), nframes, _global_port_buffer_offset, _port_buffer_offset, name()));
+ DEBUG_STR_APPEND(a, string_compose ("MidiPort %7 %1 pop event @ %2 (global %4, within %5 gpbo %6 sz %3 ", _buffer, ev.time(), ev.size(),
+ now + ev.time(), nframes, _global_port_buffer_offset, name()));
for (size_t i=0; i < ev.size(); ++i) {
DEBUG_STR_APPEND(a,hex);
DEBUG_STR_APPEND(a,"0x");
@@ -291,16 +290,15 @@ MidiPort::flush_buffers (pframes_t nframes)
assert (ev.time() < (nframes + _global_port_buffer_offset));
if (ev.time() >= _global_port_buffer_offset) {
- pframes_t tme = floor ((ev.time() + _port_buffer_offset) / _speed_ratio);
+ pframes_t tme = floor (ev.time() / _speed_ratio);
if (port_engine.midi_event_put (port_buffer, tme, ev.buffer(), ev.size()) != 0) {
cerr << "write failed, dropped event, time "
- << ev.time() << " + " << _port_buffer_offset
+ << ev.time()
<< " > " << _global_port_buffer_offset << endl;
}
} else {
cerr << "drop flushed event on the floor, time " << ev.time()
- << " too early for " << _global_port_buffer_offset
- << " + " << _port_buffer_offset;
+ << " too early for " << _global_port_buffer_offset;
for (size_t xx = 0; xx < ev.size(); ++xx) {
cerr << ' ' << hex << (int) ev.buffer()[xx];
}
diff --git a/libs/ardour/port.cc b/libs/ardour/port.cc
index 3ae3063b29..ec67e9c0af 100644
--- a/libs/ardour/port.cc
+++ b/libs/ardour/port.cc
@@ -55,8 +55,7 @@ const uint32_t Port::_resampler_quality = 12;
/** @param n Port short name */
Port::Port (std::string const & n, DataType t, PortFlags f)
- : _port_buffer_offset (0)
- , _name (n)
+ : _name (n)
, _flags (f)
, _last_monitor (false)
{
@@ -342,13 +341,6 @@ Port::reset ()
void
Port::cycle_start (pframes_t)
{
- _port_buffer_offset = 0;
-}
-
-void
-Port::increment_port_buffer_offset (pframes_t nframes)
-{
- _port_buffer_offset += nframes;
}
void