EventList:
Filter:
KtlLoop (extension) | Libraries > Modality

EventList
ExtensionExtension

a list of recorded events in time.

Description

EventList is a list of Events which is usually recorded and used for playback. EventLists are used in EventLoop, KeyPlayer and other related classes for capturing various forms of user gestures in time.

Each event has a required entry for \absTime, i.e. the absolute time at which the event was recorded, plus any other key/value combinations that are needed to describe the event fully in semantically rich form. An EventList always starts with a start event - usually (absTime: 0, type: \start); then some events with ascending values for absTime, and an end event, which is usually (type: \end, absTime: <loopEndTime>);.

Instance Methods

.totalDur

the total duration of the recorded event sequence

.playingDur

the playing total duration of the EventList, may be different.

.print

print event values in the order of keys given; post the rest if flag is true

.start

start recording, add a 'start' event like (type: \start, absTime: 0)

.addEvent

add an event with a value for absTime, plus any other key/value pairs

.finish

add an 'end' event, like (type: \end, absTime: <loopEndTime>).

.quantizeDurs

quantize durations to some grid, and to an optional full duration.

.setDurs

set the dur values in the events by some func, used e.g. when quantizing.

.restoreDurs

restore durations unquantized state.

.calcDeltas

in all events, calculate delta and dur values based on absTime values.

.setDursToDelta

in all events, copy values for delta to dur key.

.hasPositiveDur

check whether event range between minIndex and maxIndex has at least one positive playDur. this is used to avoid infinite loops when running in a play task.