|
LMMS
|
#include <allegro.h>
Public Member Functions | |
| virtual Alg_event_ptr & | operator[] (int i) |
| Alg_event_list () | |
| Alg_event_list (Alg_track *owner) | |
| char | get_type () |
| Alg_track * | get_owner () |
| ~Alg_event_list () override=default | |
| double | get_beat_dur () |
| Returns the duration of the sequence in beats or seconds. | |
| void | set_beat_dur (double d) |
| double | get_real_dur () |
| void | set_real_dur (double d) |
| virtual void | set_start_time (Alg_event *event, double) |
| const char * | get_last_error_message () |
| get text description of run-time errors detected, clear error | |
| Public Member Functions inherited from Alg_events | |
| virtual int | length () |
| Alg_event_ptr & | operator[] (int i) |
| Alg_events () | |
| virtual | ~Alg_events () |
| void | set_events (Alg_event_ptr *e, long l, long m) |
| void | insert (Alg_event_ptr event) |
| for use by Alg_track and Alg_seq | |
| void | append (Alg_event_ptr event) |
| Alg_event_ptr | uninsert (long index) |
Protected Attributes | |
| char | type |
| 'e' Alg_event_list, 't' Alg_track, 's' Alg_seq | |
| Alg_track * | events_owner |
| the events are owned by an Alg_track or an Alg_seq | |
| int | sequence_number |
| double | beat_dur |
| double | real_dur |
| Protected Attributes inherited from Alg_events | |
| long | len |
| Alg_event_ptr * | events |
| events is array of pointers | |
Static Protected Attributes | |
| static const char * | last_error_message |
| static int | sequences |
| to keep track of sequence numbers | |
Additional Inherited Members | |
| Public Attributes inherited from Alg_events | |
| double | last_note_off |
| bool | in_use |
Implementation hint: keep a sequence number on each Alg_track that is incremented anytime there is a structural change. (This behavior is inherited by Alg_seq as well.) Copy the sequence number to any Alg_event_list object when it is created. Whenever you access an Alg_event_list, using operator[], assert that the Alg_event_list sequence number matches the Alg_seq sequence number. This will guarantee that you do not try to retain pointers to events beyond the point where the events may no longer exist.
|
inline |
| Alg_event_list::Alg_event_list | ( | Alg_track * | owner | ) |
|
overridedefault |
The destructor does not free events because they are owned by a track or seq structure.
|
inline |
Returns the duration of the sequence in beats or seconds.
|
inline |
get text description of run-time errors detected, clear error
|
inline |
|
inline |
|
inline |
|
virtual |
the client should not create one of these, but these are returned from various track and seq operations. An Alg_event_list "knows" the Alg_track or Alg_seq that "owns" the events. All events in an Alg_event_list must belong to the same Alg_track or Alg_seq structure. When applied to an Alg_seq, events are enumerated track by track with increasing indices. This operation is not particularly fast on an Alg_seq.
|
inline |
|
inline |
Events are stored in time order, so when you change the time of an event, you must adjust the position. When you call set_start_time on an Alg_event_list, the Alg_event_list is not modified, but the Alg_track that "owns" the event is modified. If the owner is an Alg_seq, this may require searching the seq for the track containing the event. This will mean a logN search of every track in the seq (but if this turns out to be a problem, we can store each event's track owner in the Alg_event_list.)
|
protected |
every event list, track, and seq has a duration. Usually the duration is set when the list is constructed, e.g. when you extract from 10 to 15 seconds, the duration is 5 secs. The duration does not tell you when is the last note-off. duration is recorded in both beats and seconds:
|
protected |
the events are owned by an Alg_track or an Alg_seq
if this is an Alg_event_list,
|
staticprotected |
|
protected |
|
protected |
this sequence number is incremented whenever an edit is performed on an Alg_track or Alg_seq. When an Alg_event_list is created to contain pointers to a subset of an Alg_track or Alg_seq (the events_owner), the Alg_event_list gets a copy of the events_owner's sequence_number. If the events_owner is edited, the pointers in this Alg_event_list will become invalid. This is detected (for debugging) as differing sequence_numbers.
|
staticprotected |
to keep track of sequence numbers
|
protected |
'e' Alg_event_list, 't' Alg_track, 's' Alg_seq