summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/midi_track.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-03-29 11:52:25 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-03-29 11:52:25 -0400
commit86f1b8c71f7cfae210d66bb97d3c513eade0c40e (patch)
treee3d0a2033a999614bdf99ad3e42e82a22d410edc /libs/ardour/ardour/midi_track.h
parentf1ce235b6bc10a336822a052cee517fa923def48 (diff)
major fixes for MIDI patch change and note undo/redo. Patch change handling was completely broken because of the use of absolute floating point comparisons for time comparison, and serialization/deserialization of patch change property changes was borked because of int/char conversions by stringstream. Note undo/redo would fail for note removal if a note had been moved and/or had its note number changed as the next operation after it was added, because time-based lookup would fail. Similar small changes made for sysex messages, which just needed the musical_time comparisons and nothing else
Diffstat (limited to 'libs/ardour/ardour/midi_track.h')
-rw-r--r--libs/ardour/ardour/midi_track.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h
index be209bc0f6..3b75c0a51b 100644
--- a/libs/ardour/ardour/midi_track.h
+++ b/libs/ardour/ardour/midi_track.h
@@ -180,18 +180,29 @@ private:
void filter_channels (BufferSet& bufs, ChannelMode mode, uint32_t mask);
+/* if mode is ForceChannel, force mask to the lowest set channel or 1 if no
+ * channels are set.
+ */
+#define force_mask(mode,mask) (((mode) == ForceChannel) ? (((mask) ? (1<<(ffs((mask))-1)) : 1)) : mask)
+
void _set_playback_channel_mode(ChannelMode mode, uint16_t mask) {
+ mask = force_mask (mode, mask);
g_atomic_int_set(&_playback_channel_mask, (uint32_t(mode) << 16) | uint32_t(mask));
}
void _set_playback_channel_mask (uint16_t mask) {
+ mask = force_mask (get_playback_channel_mode(), mask);
g_atomic_int_set(&_playback_channel_mask, (uint32_t(get_playback_channel_mode()) << 16) | uint32_t(mask));
}
void _set_capture_channel_mode(ChannelMode mode, uint16_t mask) {
+ mask = force_mask (mode, mask);
g_atomic_int_set(&_capture_channel_mask, (uint32_t(mode) << 16) | uint32_t(mask));
}
void _set_capture_channel_mask (uint16_t mask) {
+ mask = force_mask (get_capture_channel_mode(), mask);
g_atomic_int_set(&_capture_channel_mask, (uint32_t(get_capture_channel_mode()) << 16) | uint32_t(mask));
}
+
+#undef force_mask
};
} /* namespace ARDOUR*/