#include <EventTrack.h>
Inheritance diagram for TSE3::EventTrack< etype >:
Public Types | |
typedef Event< etype > | event_type |
Public Member Functions | |
EventTrack (bool allowDuplicates=false) | |
~EventTrack () | |
size_t | size () const |
event_type const & | operator[] (const size_t n) const |
int | index (const Clock c, bool roundup=true) |
size_t | insert (const event_type &event) |
void | erase (const event_type &event) |
void | erase (size_t index) |
Protected Attributes | |
std::vector< event_type > | data |
The EventTrack provides a simple track containing a given type of events.
It is used with instantiations of the Event generic class.
The EventTrack is used as a base class for other types of TSE3 track, for example the TimeSigTrack and TempoTrack.
The contained Event objects are held by value.
The EventTrack has two modes of operating, specified as a boolean parameter in the constructor. The normal operation (as used by most subclasses) is to prevent the insertion of two events with the same time. For example, you don't want to have two different time signatures at the same time. The second mode of operation allows this time duplication.
|
|
|
Creates an EventTrack. The parameter specifies whether or not duplicate time values are allowed in the EventTrack. When false, you may not insert two events with the same time.
|
|
|
|
Returns the number of events in this track.
|
|
Returns the nth event in the track. The value returned for an index that is out of range is undefined. The size method describes the valid values.
|
|
Returns the index of the event at a given Clock.
|
|
Inserts an Event into the EventTrack, and returns the index of the insertion point. If duplicate times are not allowed (see EventTrack::EventTrack) then the new Event will replace the existing Event at this time. If duplicate times are allowed then the new Event is inserted after any other events with the same time.
|
|
Erase an event. If the event is not in this track then no error is raised.
|
|
Erase an event. If the index is invalid then no error is raised.
|
|
|