summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_port.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-10-08 20:14:22 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-10-08 20:14:22 +0000
commit89e4d352445e9394073804f78fbd6845e6820f20 (patch)
tree14cf1f812444a3fa5271cc7c324e1d9a67c744e9 /libs/ardour/midi_port.cc
parent1d210a54f9b1c0da7a196413bd760ff53f198270 (diff)
torben's port buffer reworking; torben's panner automation loading patch (allows loading of 2.X sessions)
git-svn-id: svn://localhost/ardour2/branches/3.0@3890 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_port.cc')
-rw-r--r--libs/ardour/midi_port.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc
index 14f88f2ad5..779d317247 100644
--- a/libs/ardour/midi_port.cc
+++ b/libs/ardour/midi_port.cc
@@ -30,6 +30,7 @@ MidiPort::MidiPort (const std::string& name, Flags flags, bool external, nframes
: Port (name, flags)
, BaseMidiPort (name, flags)
, PortFacade (name, flags)
+ , _has_been_mixed_down (false)
{
// FIXME: size kludge (see BufferSet::ensure_buffers)
// Jack needs to tell us this
@@ -73,14 +74,21 @@ MidiPort::cycle_start (nframes_t nframes, nframes_t offset)
if (_ext_port) {
_ext_port->cycle_start (nframes, offset);
}
+}
+
+MidiBuffer &
+MidiPort::get_midi_buffer( nframes_t nframes, nframes_t offset ) {
+ if (_has_been_mixed_down)
+ return *_buffer;
+
if (_flags & IsInput) {
if (_ext_port) {
BaseMidiPort* mprt = dynamic_cast<BaseMidiPort*>(_ext_port);
assert(mprt);
- assert(&mprt->get_midi_buffer() == _buffer);
+ assert(&mprt->get_midi_buffer(nframes,offset) == _buffer);
if (!_connections.empty()) {
(*_mixdown) (_connections, _buffer, nframes, offset, false);
@@ -96,9 +104,12 @@ MidiPort::cycle_start (nframes_t nframes, nframes_t offset)
}
} else {
-
_buffer->silence (nframes, offset);
}
+ if (nframes)
+ _has_been_mixed_down = true;
+
+ return *_buffer;
}
@@ -108,5 +119,13 @@ MidiPort::cycle_end (nframes_t nframes, nframes_t offset)
if (_ext_port) {
_ext_port->cycle_end (nframes, offset);
}
+ _has_been_mixed_down = false;
}
+void
+MidiPort::flush_buffers (nframes_t nframes, nframes_t offset)
+{
+ if (_ext_port) {
+ _ext_port->flush_buffers (nframes, offset);
+ }
+}