summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_model.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
committerDavid Robillard <d@drobilla.net>2014-11-22 04:05:42 -0500
commitc1cfa12d6e5136d2e3e5501e83ff74c5009a9e60 (patch)
tree56d2811bc8b9d6f2a5accfa8e497ddd5976c7c7a /libs/ardour/ardour/midi_model.h
parentcae74309a583c29dd6cc2081425c2e7b673ea13e (diff)
Wrap MusicalTime in a class.
This lets us get a more explicit handle on time conversions, and is the main step towards using actual beat:tick time and getting away from floating point precision problems.
Diffstat (limited to 'libs/ardour/ardour/midi_model.h')
-rw-r--r--libs/ardour/ardour/midi_model.h23
1 files changed, 8 insertions, 15 deletions
diff --git a/libs/ardour/ardour/midi_model.h b/libs/ardour/ardour/midi_model.h
index dc1c7af0e9..31df5ef040 100644
--- a/libs/ardour/ardour/midi_model.h
+++ b/libs/ardour/ardour/midi_model.h
@@ -116,16 +116,11 @@ public:
struct NoteChange {
NoteDiffCommand::Property property;
NotePtr note;
- uint32_t note_id;
-
- union {
- uint8_t old_value;
- TimeType old_time;
- };
- union {
- uint8_t new_value;
- TimeType new_time;
- };
+ uint32_t note_id;
+ uint8_t old_value; // or...
+ TimeType old_time; // this
+ uint8_t new_value; // or...
+ TimeType new_time; // this
};
typedef std::list<NoteChange> ChangeList;
@@ -209,16 +204,16 @@ public:
struct Change {
PatchChangePtr patch;
Property property;
- gint patch_id;
+ gint patch_id;
+ TimeType old_time;
union {
- TimeType old_time;
uint8_t old_channel;
int old_bank;
uint8_t old_program;
};
+ TimeType new_time;
union {
uint8_t new_channel;
- TimeType new_time;
uint8_t new_program;
int new_bank;
};
@@ -311,7 +306,5 @@ private:
} /* namespace ARDOUR */
-/* This is a very long comment and stuff oh my god it's so long what are we going to do oh no oh no*/
-
#endif /* __ardour_midi_model_h__ */