|
lmms
Cross-platform music production software
|
#include <allegro.h>
Public Member Functions | |
| ~Alg_iterator () | |
| long | length () |
| Alg_iterator (Alg_seq *s, bool note_off) | |
| void | begin_seq (Alg_seq *s, void *cookie=nullptr, double offset=0.0) |
| void | begin (void *cookie=nullptr) |
| Alg_event * | next (bool *note_on=nullptr, void **cookie_ptr=nullptr, double *offset_ptr=nullptr, double end_time=0) |
| void | request_note_off () |
| void | end () |
| clean up after enumerating events | |
Public Attributes | |
| bool | note_off_flag |
| Remembers if we are iterating over note-off events as well as note-on and update events. | |
Private Member Functions | |
| void | expand () |
| void | expand_to (int new_max) |
| void | show () |
| bool | earlier (int i, int j) |
| void | insert (Alg_events *events, long index, bool note_on, void *cookie, double offset) |
| bool | remove_next (Alg_events *&events, long &index, bool ¬e_on, void *&cookie, double &offset, double &time) |
| returns the info on the next pending event in the priority queue | |
Private Attributes | |
| long | maxlen |
| long | len |
| Alg_seq * | seq |
| Alg_pending_event * | pending_events |
| Alg_events * | events_ptr |
| the next four fields are mainly for request_note_off() | |
| long | index |
| remembers index of current event | |
| void * | cookie |
| remembers the cookie associated with next event | |
| double | offset |
|
inline |
|
inline |
|
inline |
Prepare to enumerate events in order. If note_off_flag is true, then iteration_next will merge note-off events into the sequence. If you call begin(), you should not normally call begin_seq(). See above.
| void Alg_iterator::begin_seq | ( | Alg_seq * | s, |
| void * | cookie = nullptr, | ||
| double | offset = 0.0 ) |
Normally, iteration is over the events in the one sequence used to instatiate the iterator (see above), but with this method, you can add more sequences to the iteration. Events are returned in time order, so effectively sequence events are merged. The optional offset is added to each event time of sequence s before merging/sorting. You should call begin_seq() for each sequence to be included in the iteration unless you call begin() (see below).
|
private |
| void Alg_iterator::end | ( | ) |
clean up after enumerating events
|
private |
|
private |
|
private |
|
inline |
| Alg_event * Alg_iterator::next | ( | bool * | note_on = nullptr, |
| void ** | cookie_ptr = nullptr, | ||
| double * | offset_ptr = nullptr, | ||
| double | end_time = 0 ) |
return next event (or nullptr). If iteration_begin was called with note_off_flag = true, and if note_on is not nullptr, then *note_on is set to true when the result value represents a note-on or update. (With note_off_flag, each Alg_note event is returned twice, once at the note-on time, with *note_on == true, and once at the note-off time, with *note_on == false. If a cookie_ptr is passed, then the cookie corresponding to the event is stored at that address If end_time is 0, iterate through the entire sequence, but if end_time is non_zero, stop iterating at the last event before end_time
|
private |
returns the info on the next pending event in the priority queue
| void Alg_iterator::request_note_off | ( | ) |
Sometimes, the caller wants to receive note-off events for a subset of the notes, typically the notes that are played and need to be turned off. In this case, when a note is turned on, the client should call request_note_off(). This will insert a note-off into the queue for the most recent note returned by next().
|
private |
|
private |
remembers the cookie associated with next event
|
private |
the next four fields are mainly for request_note_off()
remembers events containing current event
|
private |
remembers index of current event
|
private |
|
private |
| bool Alg_iterator::note_off_flag |
Remembers if we are iterating over note-off events as well as note-on and update events.
|
private |
|
private |
|
private |