void reset ();
void cycle_start (nframes_t nframes, nframes_t offset);
+ void cycle_end (nframes_t nframes, nframes_t offset);
protected:
friend class AudioEngine;
if (session) {
session->process (nframes);
}
-
- if (!_running) {
- _processed_frames = next_processed_frames;
- return 0;
- }
// Finalize ports (ie write data if necessary)
(*i)->cycle_end (nframes, 0);
}
+ if (!_running) {
+ _processed_frames = next_processed_frames;
+ return 0;
+ }
+
if (last_monitor_check + monitor_check_interval < next_processed_frames) {
boost::shared_ptr<Ports> p = ports.reader();
, JackPort (name, DataType::MIDI, flgs)
, BaseMidiPort (name, flgs)
{
- if (buf) {
+ // MIDI ports always need a buffer since jack buffer format is different
+ assert(buf);
- cout << name << " BUFFER" << endl;
-
- _buffer = buf;
- _own_buffer = false;
-
- } else {
-
- cout << name << " NO BUFFER" << endl;
-
- /* data space will be provided by JACK */
- _buffer = new MidiBuffer (0);
- _own_buffer = true;
- }
+ _buffer = buf;
+ _own_buffer = false;
}
void
-JackMidiPort::cycle_start (nframes_t nframes, nframes_t offset_ignored_but_probably_should_not_be)
+JackMidiPort::cycle_start (nframes_t nframes, nframes_t offset)
{
+ /* FIXME: offset */
+
_buffer->clear();
assert(_buffer->size() == 0);
if (_flags & IsOutput) {
- // no buffer, nothing to do
return;
}
}
void
-JackMidiPort::cycle_end (nframes_t nframes, nframes_t offset_ignored_but_probably_should_not_be)
+JackMidiPort::cycle_end (nframes_t nframes, nframes_t offset)
{
+ /* FIXME: offset */
+
if (_flags & IsInput) {
return;
}
void
MidiPort::cycle_start (nframes_t nframes, nframes_t offset)
{
- /* caller must hold process lock */
-
if (_ext_port) {
_ext_port->cycle_start (nframes, offset);
}
_buffer->silence (nframes, offset);
}
}
+
+
+void
+MidiPort::cycle_end (nframes_t nframes, nframes_t offset)
+{
+ if (_ext_port) {
+ _ext_port->cycle_end (nframes, offset);
+ }
+}
+