summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-07-30 16:33:10 +0000
committerDavid Robillard <d@drobilla.net>2007-07-30 16:33:10 +0000
commit2cbaa2751c0e346f2a6549f832a0ef69b8dd352c (patch)
treeb5e5d8ad4989a9c3a4bc06beba02b52470e94e11 /libs
parent633d9131af0a04bed812ce75e9f1da07fe7dfcd4 (diff)
Basic canvas note event handling framework.
Note dragging (non-functional). git-svn-id: svn://localhost/ardour2/trunk@2187 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/midi_diskstream.cc36
-rw-r--r--libs/ardour/midi_model.cc5
2 files changed, 8 insertions, 33 deletions
diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc
index 74acae522a..3fed0cf68c 100644
--- a/libs/ardour/midi_diskstream.cc
+++ b/libs/ardour/midi_diskstream.cc
@@ -827,18 +827,6 @@ MidiDiskstream::do_refill ()
return 0;
}
- /* if there are 2+ chunks of disk i/o possible for
- this track, let the caller know so that it can arrange
- for us to be called again, ASAP.
- */
-
- // FIXME: using disk_io_chunk_frames as an event count, not good
- // count vs duration semantic differences are nonexistant for audio,
- // which makes translating for MIDI code confusing...
- if (_playback_buf->write_space() >= (_slaved?3:2) * disk_io_chunk_frames) {
- ret = 1;
- }
-
/* if we're running close to normal speed and there isn't enough
space to do disk_io_chunk_frames of I/O, then don't bother.
@@ -847,7 +835,7 @@ MidiDiskstream::do_refill ()
*/
if ((write_space < disk_io_chunk_frames) && fabs (_actual_speed) < 2.0f) {
- cerr << "No refill 1\n";
+ //cerr << "No refill 1\n";
return 0;
}
@@ -857,12 +845,12 @@ MidiDiskstream::do_refill ()
*/
if (_slaved && write_space < (_playback_buf->capacity() / 2)) {
- cerr << "No refill 2\n";
+ //cerr << "No refill 2\n";
return 0;
}
if (reversed) {
- cerr << "No refill 3 (reverse)\n";
+ //cerr << "No refill 3 (reverse)\n";
return 0;
}
@@ -874,26 +862,10 @@ MidiDiskstream::do_refill ()
return 0;
}
-#if 0
- // or this
- if (file_frame > max_frames - total_space) {
-
- /* to close to the end: read what we can, and zero fill the rest */
-
- zero_fill = total_space - (max_frames - file_frame);
- total_space = max_frames - file_frame;
-
- } else {
- zero_fill = 0;
- }
-#endif
-
- // At this point we:
+ // At this point we...
assert(_playback_buf->write_space() > 0); // ... have something to write to, and
assert(file_frame <= max_frames); // ... something to write
- // So (read it, then) write it:
-
nframes_t file_frame_tmp = file_frame;
nframes_t to_read = min(disk_io_chunk_frames, (max_frames - file_frame));
diff --git a/libs/ardour/midi_model.cc b/libs/ardour/midi_model.cc
index b1a87551b1..7374916c14 100644
--- a/libs/ardour/midi_model.cc
+++ b/libs/ardour/midi_model.cc
@@ -86,7 +86,7 @@ MidiModel::read (MidiRingBuffer& dst, nframes_t start, nframes_t nframes, nframe
{
size_t read_events = 0;
- //cerr << "MM READ " << start << " .. " << nframes << endl;
+ cerr << "MM READ @ " << start << " + " << nframes << endl;
/* FIXME: cache last lookup value to avoid the search */
@@ -140,6 +140,9 @@ MidiModel::read (MidiRingBuffer& dst, nframes_t start, nframes_t nframes, nframe
}
}
+ if (read_events > 0)
+ cerr << "MM READ " << read_events << " EVENTS" << endl;
+
return read_events;
}