1 package net.kreatious.pianoleopard.midi.track;
2
3 import net.kreatious.pianoleopard.midi.event.EventPair;
4 import net.kreatious.pianoleopard.midi.event.NoteEvent;
5 import net.kreatious.pianoleopard.midi.event.PedalEvent;
6
7
8 /**
9 * Provides an immutable view of a MIDI track with efficient retrieval by time
10 * range.
11 *
12 * @author Jay-R Studer
13 */
14 public interface ParsedTrack {
15 /**
16 * Gets the note event pairs overlapping with the specified interval
17 *
18 * @param low
19 * the lower inclusive bound to return events for in microseconds
20 * @param high
21 * the upper inclusive bound to return events for in microseconds
22 * @throws IllegalArgumentException
23 * if {@code low} is greater than {@code high}
24 * @return a read only view of the portion of events overlapping the
25 * specified interval.
26 */
27 Iterable<EventPair<NoteEvent>> getNotePairs(long low, long high);
28
29 /**
30 * Gets the pedal event pairs overlapping with the specified interval
31 *
32 * @param low
33 * the lower inclusive bound to return events for in microseconds
34 * @param high
35 * the upper inclusive bound to return events for in microseconds
36 * @throws IllegalArgumentException
37 * if {@code low} is greater than {@code high}
38 * @return a read only view of the portion of events overlapping the
39 * specified interval.
40 */
41 Iterable<EventPair<PedalEvent>> getPedalPairs(long low, long high);
42 }