675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <iostream>
#include <algorithm>
-#include <ardour/buffer_set.h>
-#include <ardour/buffer.h>
-#include <ardour/port.h>
-#include <ardour/port_set.h>
+#include "ardour/buffer_set.h"
+#include "ardour/buffer.h"
+#include "ardour/port.h"
+#include "ardour/port_set.h"
namespace ARDOUR {
/** Make this BufferSet a direct mirror of a PortSet's buffers.
*/
void
-BufferSet::attach_buffers(PortSet& ports)
+BufferSet::attach_buffers(PortSet& ports, nframes_t nframes, nframes_t offset)
{
clear();
for (PortSet::iterator p = ports.begin(*t); p != ports.end(*t); ++p) {
assert(p->type() == *t);
- v.push_back(&(p->get_buffer()));
+ v.push_back(&(p->get_buffer(nframes, offset)));
}
-
}
_count = ports.count();
if (num_buffers == 0)
return;
+ // FIXME: Kludge to make MIDI buffers larger (size is bytes, not frames)
+ // See MidiPort::MidiPort
+ // We probably need a map<DataType, size_t> parameter for capacity
+ if (type == DataType::MIDI)
+ buffer_capacity *= 8;
+
// The vector of buffers of the type we care about
BufferVec& bufs = _buffers[type];