|
LMMS
|
#include <cassert>#include <cstdint>#include <cstring>#include <iostream>Go to the source code of this file.
Classes | |
| class | Alg_atoms |
| class | Alg_parameter |
| class | Alg_parameters |
| a list of attribute/value pairs More... | |
| class | Alg_event |
| abstract superclass of Alg_note and Alg_update: More... | |
| class | Alg_note |
| class | Alg_update |
| class | Alg_events |
| a sequence of Alg_event objects More... | |
| class | Alg_event_list |
| class | Alg_beat |
| Alg_beat is used to contruct a tempo map. More... | |
| class | Alg_beats |
| Alg_beats is a list of Alg_beat objects used in Alg_seq. More... | |
| class | Alg_time_map |
| class | Serial_buffer |
| class | Serial_read_buffer |
| class | Serial_write_buffer |
| class | Alg_track |
| class | Alg_time_sig |
| class | Alg_time_sigs |
| Alg_time_sigs is a dynamic array of time signatures. More... | |
| class | Alg_tracks |
| a sequence of Alg_events objects More... | |
| struct | Alg_pending_event |
| class | Alg_iterator |
| class | Alg_seq |
Macros | |
| #define | ALG_EPS 0.000001 |
| epsilon | |
| #define | ALG_DEFAULT_BPM 100.0 |
| default tempo | |
| #define | alg_attr_name(a) |
| #define | alg_attr_type(a) |
| #define | DLLEXPORT |
| #define | ALG_NOTE 0 |
| This is a note, not an update. | |
| #define | ALG_GATE 1 |
| "gate" | |
| #define | ALG_BEND 2 |
| "bend" | |
| #define | ALG_CONTROL 3 |
| "control" | |
| #define | ALG_PROGRAM 4 |
| "program" | |
| #define | ALG_PRESSURE 5 |
| "pressure" | |
| #define | ALG_KEYSIG 6 |
| "keysig" | |
| #define | ALG_TIMESIG_NUM 7 |
| "timesig_num" | |
| #define | ALG_TIMESIG_DEN 8 |
| "timesig_den" | |
| #define | ALG_OTHER 9 |
| any other value | |
Enumerations | |
| enum | Alg_error { alg_no_error = 0 , alg_error_open = -800 , alg_error_syntax } |
Functions | |
| bool | within (double d1, double d2, double epsilon) |
| are d1 and d2 within epsilon of each other? | |
| char * | heapify (const char *s) |
| put a string on the heap | |
Variables | |
| DLLEXPORT Alg_atoms | symbol_table |
Portsmf (also known as Allegro): music representation system, with extensible in-memory sequence structure upward compatible with MIDI implementations in C++ and Serpent external, text-based representation compatible with Aura
SERIALBUFFER CLASS
The Serial_buffer class is defined to support serialization and unserialization. A Serial_buffer is just a block of memory with a length and a read/write pointer. When writing, it can expand.
SERIALIZATION
The Alg_track class has static members: ser_buf – a Serial_buffer When objects are serialized, they are first written to ser_buf, which is expanded whenever necessary. Then, when the length is known, new memory is allocated and the data is copied to a correctly-sized buffer and returned to caller. The "external" (callable from outside the library) serialization functions are: Alg_track::serialize() Alg_seq::serialize() The "internal" serialization functions to be called from within the library are: Alg_track::serialize_track(bool text) Alg_seq::serialize_seq(bool text) Alg_track::serialize_parameter( Alg_parameter *parm, bool text) These internal serialize functions append data to ser_buf The text flag says to write an ascii representation as opposed to binary.
UNSERIALIZATION:
The Alg_track class has a static member: unserialize(char *buffer, long len) that will unserialize anything – an Alg_track or an Alg_seq. No other function should be called from outside the library. Internal unserialize functions are: Alg_seq::unserialize_seq() Alg_track::unserialize_track() Alg_track::unserialize_parameter(Alg_parameter_ptr parm_ptr) Just as serialization uses ser_buf for output, unserialization uses unser_buf for reading. unser_buf is another static member of Alg_track.
| #define ALG_BEND 2 |
"bend"
| #define ALG_CONTROL 3 |
"control"
| #define ALG_DEFAULT_BPM 100.0 |
default tempo
| #define ALG_EPS 0.000001 |
epsilon
| #define ALG_GATE 1 |
"gate"
| #define ALG_KEYSIG 6 |
"keysig"
| #define ALG_NOTE 0 |
This is a note, not an update.
| #define ALG_OTHER 9 |
any other value
| #define ALG_PRESSURE 5 |
"pressure"
| #define ALG_PROGRAM 4 |
"program"
| #define ALG_TIMESIG_DEN 8 |
"timesig_den"
| #define ALG_TIMESIG_NUM 7 |
"timesig_num"
| #define DLLEXPORT |
| typedef const char* Alg_attribute |
Alg_attribute is an atom in the symbol table with the special addition that the last character is prefixed to the string; thus, the attribute 'tempor' (a real) is stored as 'rtempor'. To get the string name, just use attribute+1.
| typedef class Alg_beat * Alg_beat_ptr |
Alg_beat is used to contruct a tempo map.
| typedef class Alg_beats * Alg_beats_ptr |
| typedef Alg_event_list * Alg_event_list_ptr |
| typedef Alg_event_list & Alg_event_list_ref |
| typedef class Alg_event * Alg_event_ptr |
abstract superclass of Alg_note and Alg_update:
| typedef class Alg_events * Alg_events_ptr |
a sequence of Alg_event objects
| typedef class Alg_iterator * Alg_iterator_ptr |
| typedef Alg_note * Alg_note_ptr |
| typedef class Alg_parameter * Alg_parameter_ptr |
an attribute/value pair. Since Alg_attribute names imply type, we try to keep attributes and values packaged together as Alg_parameter class
| typedef class Alg_parameters * Alg_parameters_ptr |
a list of attribute/value pairs
| typedef struct Alg_pending_event * Alg_pending_event_ptr |
| typedef Alg_seq * Alg_seq_ptr |
An Alg_seq is an array of Alg_events, each a sequence of Alg_event, with a tempo map and a sequence of time signatures
| typedef Alg_seq & Alg_seq_ref |
| typedef class Alg_time_map * Alg_time_map_ptr |
| typedef class Alg_time_sig * Alg_time_sig_ptr |
Alg_time_sig represents a single time signature; although not recommended, time_signatures may have arbitrary floating point values, e.g. 4.5 beats per measure
| typedef Alg_track * Alg_track_ptr |
| typedef Alg_track & Alg_track_ref |
| typedef class Alg_tracks * Alg_tracks_ptr |
a sequence of Alg_events objects
| typedef Alg_update * Alg_update_ptr |
| typedef Serial_read_buffer * Serial_read_buffer_ptr |
| typedef Serial_write_buffer * Serial_write_buffer_ptr |
| enum Alg_error |
| char * heapify | ( | const char * | s | ) |
put a string on the heap
| bool within | ( | double | d1, |
| double | d2, | ||
| double | epsilon ) |
are d1 and d2 within epsilon of each other?