diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-03 23:28:57 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-05-03 23:28:57 +0000 |
commit | a8da89d745c6a7e7d4c20dfcfb16b2537d767428 (patch) | |
tree | 06fb6cc1795ef89a7ed847395c550b6215e253df /libs/ardour/midi_port.cc | |
parent | 5a1ca70f07aeb999ba3f0f09dbd49f1d50505f3c (diff) |
optimize some performance bottlenecks; remove jack_nframes_t that crept back into the code
git-svn-id: svn://localhost/ardour2/branches/midi@1779 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_port.cc')
-rw-r--r-- | libs/ardour/midi_port.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/ardour/midi_port.cc b/libs/ardour/midi_port.cc index dc8b18a390..ccf63880e6 100644 --- a/libs/ardour/midi_port.cc +++ b/libs/ardour/midi_port.cc @@ -45,7 +45,7 @@ MidiPort::~MidiPort() } void -MidiPort::cycle_start (jack_nframes_t nframes) +MidiPort::cycle_start (nframes_t nframes) { _buffer.clear(); assert(_buffer.size() == 0); @@ -62,7 +62,7 @@ MidiPort::cycle_start (jack_nframes_t nframes) void* jack_buffer = jack_port_get_buffer(_port, nframes); - const jack_nframes_t event_count + const nframes_t event_count = jack_midi_get_event_count(jack_buffer); assert(event_count < _buffer.capacity()); @@ -70,7 +70,7 @@ MidiPort::cycle_start (jack_nframes_t nframes) MidiEvent ev; // FIXME: too slow, event struct is copied twice (here and MidiBuffer::push_back) - for (jack_nframes_t i=0; i < event_count; ++i) { + for (nframes_t i=0; i < event_count; ++i) { // This will fail to compile if we change MidiEvent to our own class jack_midi_event_get(static_cast<jack_midi_event_t*>(&ev), jack_buffer, i); @@ -100,13 +100,13 @@ MidiPort::cycle_end() void* jack_buffer = jack_port_get_buffer(_port, _nframes_this_cycle); - const jack_nframes_t event_count = _buffer.size(); + const nframes_t event_count = _buffer.size(); //if (event_count > 0) // cerr << "MIDIPort writing " << event_count << " events." << endl; jack_midi_clear_buffer(jack_buffer); - for (jack_nframes_t i=0; i < event_count; ++i) { + for (nframes_t i=0; i < event_count; ++i) { const jack_midi_event_t& ev = _buffer[i]; assert(ev.time < _nframes_this_cycle); jack_midi_event_write(jack_buffer, ev.time, ev.buffer, ev.size); |