|
lmms
Cross-platform music production software
|
Abstract superclass of Alg_note and Alg_update. More...
#include <allegro.h>
Public Member Functions | |
| virtual void | show ()=0 |
| bool | is_note () |
| Check whether an Alg_event is a note. | |
| bool | is_update () |
| Check whether an Alg_event is a parameter update. | |
| char | get_type () |
| int | get_type_code () |
| bool | get_selected () |
| void | set_selected (bool b) |
| long | get_identifier () |
| get MIDI key or note identifier of note or update | |
| void | set_identifier (long i) |
| void | set_parameter (Alg_parameter *new_parameter) |
| void | set_string_value (const char *attr, const char *value) |
| void | set_real_value (const char *attr, double value) |
| void | set_logical_value (const char *attr, bool value) |
| void | set_integer_value (const char *attr, int32_t value) |
| void | set_atom_value (const char *attr, const char *atom) |
| float | get_pitch () |
| get pitch in steps – use this even for MIDI | |
| float | get_loud () |
| get loudness (MIDI velocity) | |
| double | get_start_time () |
| get start time in seconds or beats | |
| double | get_end_time () |
| get end time in seconds or beats | |
| double | get_duration () |
| get duration in seconds or beats | |
| void | set_pitch (float) |
| void | set_loud (float) |
| void | set_duration (double) |
| bool | has_attribute (const char *attr) |
| Test if note has attribute/value pair. | |
| char | get_attribute_type (const char *attr) |
| Get the associated attribute type. | |
| const char * | get_string_value (const char *attr, const char *value=nullptr) |
| Get the string value. | |
| double | get_real_value (const char *attr, double value=0.0) |
| Get the real value. | |
| bool | get_logical_value (const char *attr, bool value=false) |
| Get the logical value. | |
| long | get_integer_value (const char *attr, int32_t value=0) |
| Get the integer value. | |
| const char * | get_atom_value (const char *attr, const char *value=nullptr) |
| Get the atom value. | |
| void | delete_attribute (const char *attr) |
| Delete an attribute/value pair. | |
| const char * | get_attribute () |
| get the update's attribute (string) | |
| char | get_update_type () |
| Get the update's type. | |
| const char * | get_string_value () |
| Get the update's string value. | |
| double | get_real_value () |
| get the update's real value | |
| bool | get_logical_value () |
| get the update's logical value | |
| int32_t | get_integer_value () |
| get the update's integer value | |
| const char * | get_atom_value () |
| Get the update's atom value. | |
| bool | overlap (double t, double len, bool all) |
| const char * | GetDescription () |
| Computes a text description of this event. | |
| Alg_event () | |
| virtual | ~Alg_event ()=default |
Public Attributes | |
| double | time |
| long | chan |
Protected Attributes | |
| bool | selected |
| char | type |
| 'e' event, 'n' note, 'u' update | |
| long | key |
| note identifier | |
Static Protected Attributes | |
| static const char * | description |
| static buffer for debugging (in Alg_event) | |
Abstract superclass of Alg_note and Alg_update.
|
inline |
|
virtualdefault |
| void Alg_event::delete_attribute | ( | const char * | attr | ) |
Delete an attribute/value pair.
(ignore if no matching attribute/value pair exists)
| const char * Alg_event::get_atom_value | ( | ) |
Get the update's atom value.
Caller does not own the return value. Do not modify. The return value's lifetime is forever.
| const char * Alg_event::get_atom_value | ( | const char * | attr, |
| const char * | value = nullptr ) |
Get the atom value.
| const char * Alg_event::get_attribute | ( | ) |
get the update's attribute (string)
Some attribute/value methods. These fail if this is not an update. Attributes are converted to/from strings to avoid explicit use of Alg_attribute types.
| char Alg_event::get_attribute_type | ( | const char * | attr | ) |
Get the associated attribute type.
's' = string, 'r' = real (double), 'l' = logical (bool), 'i' = integer (int32_t), 'a' = atom (char*), a unique string stored in Alg_seq
| double Alg_event::get_duration | ( | ) |
get duration in seconds or beats
| double Alg_event::get_end_time | ( | ) |
get end time in seconds or beats
|
inline |
get MIDI key or note identifier of note or update
| int32_t Alg_event::get_integer_value | ( | ) |
get the update's integer value
| long Alg_event::get_integer_value | ( | const char * | attr, |
| int32_t | value = 0 ) |
Get the integer value.
| bool Alg_event::get_logical_value | ( | ) |
get the update's logical value
| bool Alg_event::get_logical_value | ( | const char * | attr, |
| bool | value = false ) |
Get the logical value.
| float Alg_event::get_loud | ( | ) |
get loudness (MIDI velocity)
| float Alg_event::get_pitch | ( | ) |
get pitch in steps – use this even for MIDI
| double Alg_event::get_real_value | ( | ) |
get the update's real value
| double Alg_event::get_real_value | ( | const char * | attr, |
| double | value = 0.0 ) |
Get the real value.
|
inline |
| double Alg_event::get_start_time | ( | ) |
get start time in seconds or beats
| const char * Alg_event::get_string_value | ( | ) |
Get the update's string value.
Caller does not own the return value. Do not modify. Do not use after underlying Alg_seq is modified.
| const char * Alg_event::get_string_value | ( | const char * | attr, |
| const char * | value = nullptr ) |
Get the string value.
|
inline |
| int Alg_event::get_type_code | ( | ) |
1 = volume change, 2 = pitch bend, 3 = control change, 4 = program change, 5 = pressure change, 6 = key signature, 7 = time sig numerator, 8 = time sig denominator
| char Alg_event::get_update_type | ( | ) |
Get the update's type.
's' = string, 'r' = real (double), 'l' = logical (bool), 'i' = integer (int32_t), 'a' = atom (char*), a unique string stored in Alg_seq
| const char * Alg_event::GetDescription | ( | ) |
Computes a text description of this event.
The result is in a static buffer, not thread-safe, for debugging purposes only.
| bool Alg_event::has_attribute | ( | const char * | attr | ) |
Test if note has attribute/value pair.
Notes have lists of attribute values. Attributes are converted to/from strings in this API to avoid explicit use of Alg_attribute types. Attribute names end with a type designation: 's', 'r', 'l', 'i', or 'a'.
|
inline |
Check whether an Alg_event is a note.
|
inline |
Check whether an Alg_event is a parameter update.
| bool Alg_event::overlap | ( | double | t, |
| double | len, | ||
| bool | all ) |
Auxiliary function to aid in editing tracks Returns true if the event overlaps the given region
| void Alg_event::set_atom_value | ( | const char * | attr, |
| const char * | atom ) |
| void Alg_event::set_duration | ( | double | d | ) |
|
inline |
set the identifier
| void Alg_event::set_integer_value | ( | const char * | attr, |
| int32_t | value ) |
| void Alg_event::set_logical_value | ( | const char * | attr, |
| bool | value ) |
| void Alg_event::set_loud | ( | float | l | ) |
| void Alg_event::set_parameter | ( | Alg_parameter * | new_parameter | ) |
In all of these set_ methods, strings are owned by the caller and copied as necessary by the callee. For notes, an attribute/value pair is added to the parameters list. For updates, the single attribute/value parameter pair is overwritten. In all cases, the attribute (first argument) must agree in type with the second arg. The last letter of the attribute implies the type (see below).
| void Alg_event::set_pitch | ( | float | p | ) |
| void Alg_event::set_real_value | ( | const char * | attr, |
| double | value ) |
|
inline |
| void Alg_event::set_string_value | ( | const char * | attr, |
| const char * | value ) |
|
pure virtual |
Implemented in Alg_note, and Alg_update.
| long Alg_event::chan |
|
staticprotected |
static buffer for debugging (in Alg_event)
|
protected |
note identifier
|
protected |
| double Alg_event::time |
|
protected |
'e' event, 'n' note, 'u' update