|
LMMS
|
#include <allegro.h>
Public Member Functions | |
| void | serialize_track () |
| void | unserialize_track () |
| Alg_event_ptr & | operator[] (int i) override |
| Alg_track () | |
| Alg_track (Alg_time_map *map, bool seconds) | |
| initialize empty track with a time map | |
| Alg_event_ptr | copy_event (Alg_event_ptr event) |
| make a complete copy | |
| Alg_track (Alg_track &track) | |
| Alg_track (Alg_event_list_ref event_list, Alg_time_map_ptr map, bool units_are_seconds) | |
| copy constructor: event_list is copied, map is installed and referenced | |
| ~Alg_track () override | |
| virtual void | serialize (void **buffer, long *bytes) |
| Alg_seq_ptr | to_alg_seq () |
| bool | get_units_are_seconds () |
| Are we using beats or seconds? | |
| virtual void | convert_to_beats () |
| Change units. | |
| virtual void | convert_to_seconds () |
| void | set_dur (double dur) |
| double | get_dur () |
| virtual void | set_time_map (Alg_time_map *map) |
| Alg_time_map * | get_time_map () |
| Alg_note * | create_note (double time, int channel, int identifier, float pitch, float loudness, double duration) |
| Alg_update * | create_update (double time, int channel, int identifier) |
| virtual void | add (Alg_event *event) |
| virtual Alg_track * | cut (double t, double len, bool all) |
| virtual Alg_track * | copy (double t, double len, bool all) |
| void | paste (double t, Alg_event_list *seq) |
| virtual void | merge (double t, Alg_event_list_ptr seq) |
| virtual void | clear (double t, double len, bool all) |
| virtual void | silence (double t, double len, bool all) |
| virtual void | insert_silence (double t, double len) |
| virtual Alg_event_list * | find (double t, double len, bool all, long channel_mask, long event_type_mask) |
| virtual void | set_in_use (bool flag) |
| Public Member Functions inherited from Alg_event_list | |
| 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) |
Static Public Member Functions | |
| static Alg_track * | unserialize (void *buffer, long len) |
Protected Member Functions | |
| char * | get_string (char **p, long *b) |
| long | get_int32 (char **p, long *b) |
| double | get_double (char **p, long *b) |
| float | get_float (char **p, long *b) |
| void | serialize_parameter (Alg_parameter *parm) |
| void | unserialize_parameter (Alg_parameter_ptr parm_ptr) |
Protected Attributes | |
| Alg_time_map * | time_map |
| bool | units_are_seconds |
| Protected Attributes inherited from Alg_event_list | |
| 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 Serial_read_buffer | ser_read_buf |
| static Serial_write_buffer | ser_write_buf |
| Static Protected Attributes inherited from Alg_event_list | |
| 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 |
|
inline |
| Alg_track::Alg_track | ( | Alg_time_map * | map, |
| bool | seconds ) |
initialize empty track with a time map
| Alg_track::Alg_track | ( | Alg_track & | track | ) |
copy constructor, does not copy time_map
| Alg_track::Alg_track | ( | Alg_event_list_ref | event_list, |
| Alg_time_map_ptr | map, | ||
| bool | units_are_seconds ) |
copy constructor: event_list is copied, map is installed and referenced
|
inlineoverride |
note: do not call set_time_map(nullptr)!
Adds a new event - it is automatically inserted into the correct order in the sequence based on its timestamp. The ownership passes from the caller to this Alg_seq. The event is not copied.
|
virtual |
Deletes and shifts notes to fill the gap. The tempo track is also modified accordingly. ONLY EVENTS THAT START WITHIN THE REGION ARE DELETED unless "all" is true, in which case all notes that intersect the region are cleared. NOTES THAT EXTEND FROM BEFORE THE REGION INTO THE REGION RETAIN THEIR DURATION IN EITHER BEATS OR SECONDS ACCORDING TO THE CURRENT UNITS OF this.
Reimplemented in Alg_seq.
|
virtual |
Like cut() but doesn't remove the notes from the original sequence. The Alg_events are copied, not shared. ONLY EVENTS THAT START WITHIN THE REGION ARE COPIED unless "all" is true in which case all notes that intersect the region are copied. COPIED NOTES MAY EXTEND BEYOND THE DURATION OF THE RESULTING SEQ. The return type is the same as this (may be Alg_seq).
Reimplemented in Alg_seq.
| Alg_event_ptr Alg_track::copy_event | ( | Alg_event_ptr | event | ) |
make a complete copy
| Alg_note * Alg_track::create_note | ( | double | time, |
| int | channel, | ||
| int | identifier, | ||
| float | pitch, | ||
| float | loudness, | ||
| double | duration ) |
Methods to create events. The returned event is owned by the caller. Use delete to get rid of it unless you call add() – see below.
| Alg_update * Alg_track::create_update | ( | double | time, |
| int | channel, | ||
| int | identifier ) |
Note: after create_update(), caller should use set_*_value() to initialize the attribute/value pair:
|
virtual |
Deletes the notes that start within the given region and returns them in a new sequence. The start times of the notes in the returned sequence are shifted by -t. The notes after the region get shifted over to fill the gap. In an Alg_seq, the tempo track is edited in a similar way and the cut tempo information is retained in the new seq. ONLY NOTES THAT START WITHIN THE REGION ARE CUT unless "all" is true in which case all notes that intersect the region are copied. CUT NOTES MAY EXTEND BEYOND THE DURATION OF THE RESULTING SEQ. The return type is the same as this (may be Alg_seq). All times including len are interpreted according to units_are_seconds in the track.
Reimplemented in Alg_seq.
|
virtual |
|
protected |
|
inline |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
Are we using beats or seconds?
|
virtual |
Simply shifts notes past time t over by len, which is given in either beats or seconds according to the units of this. The resulting interveal (t, t+len) may in fact contain notes that begin before t. The durations of notes are not changed. If this is an Alg_seq, the tempo track is expanded at t also.
Reimplemented in Alg_seq.
|
virtual |
Merges two sequences with a certain offset. The offset is interpreted as either beats or seconds according to the current units of this, and seq is converted to the same units as this. Except for a possible conversion to beats or seconds, the tempo track of seq (if any) is ignored. (There is no way to merge tempo tracks.) THE SEQ PARAMETER IS NOT MODIFIED, AND Alg_event's ARE COPIED, NOT SHARED. The type of seq must be Alg_seq if seq is an Alg_seq, or Alg_track if seq is an Alg_track or an Alg_event_list.
Reimplemented in Alg_seq.
|
inlineoverridevirtual |
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.
Reimplemented from Alg_event_list.
| void Alg_track::paste | ( | double | t, |
| Alg_event_list * | seq ) |
Inserts a sequence in the middle, shifting some notes over by the duration of the seq, which is first converted to the same units (seconds or beats) as this. (This makes a differece because the pasted data may change the tempo, and notes that overlap the borders will then experience a tempo change.) THE SEQ PARAMETER IS NOT MODIFIED, AND Alg_event's ARE COPIED, NOT SHARED. The type of seq must be Alg_seq if seq is an Alg_seq, or Alg_track if seq is an Alg_track or an Alg_event_list.
Returns a buffer containing a serialization of the file. It will be an ASCII representation unless text is true. *buffer gets a newly allocated buffer pointer. The caller must free it. *len gets the length of the serialized track
Reimplemented in Alg_seq.
|
protected |
| void Alg_track::serialize_track | ( | ) |
| void Alg_track::set_dur | ( | double | dur | ) |
|
virtual |
Every Alg_track may have an associated time_map. If no map is specified, or if you set_time_map(nullptr), then the behavior should be as if there is a constant tempo of 100 beats/minute (this constant is determined by ALG_DEFAULT_BPM). Recommendation: create a static global tempo map object. When any operation that needs a tempo map gets nullptr, use the global tempo map. (Exception: any operation that would modify the tempo map should raise an error – you don't want to change the default tempo map.)
Reimplemented in Alg_seq.
|
virtual |
Deletes notes but doesn't shift. If the "all" argument is true, deletes all notes that intersect the range at all, not just those that start within it. The tempo track is not affected.
Reimplemented in Alg_seq.
|
inline |
Try to read from a memory buffer. Automatically guess whether it's MIDI or text.
|
protected |
*buffer_ptr points to binary data, bytes_ptr points to how many bytes have been used so far, len is length of binary data
| void Alg_track::unserialize_track | ( | ) |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |