From cca4f22141d64afce82fd8851cde8eb8ce597c9f Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Mon, 29 Dec 2008 00:19:18 +0000 Subject: [PATCH] * fixed bug introduced in revision 3335: Hibyte lost in channel mask when restoring state from XML git-svn-id: svn://localhost/ardour2/branches/3.0@4356 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_channel_selector.cc | 2 +- gtk2_ardour/midi_channel_selector.h | 2 +- libs/ardour/ardour/midi_ring_buffer.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/midi_channel_selector.cc b/gtk2_ardour/midi_channel_selector.cc index 4415a65f65..1b5baff7d5 100644 --- a/gtk2_ardour/midi_channel_selector.cc +++ b/gtk2_ardour/midi_channel_selector.cc @@ -160,7 +160,7 @@ MidiMultipleChannelSelector::~MidiMultipleChannelSelector() } void -MidiMultipleChannelSelector::set_channel_mode(ChannelMode mode, uint8_t mask) +MidiMultipleChannelSelector::set_channel_mode(ChannelMode mode, uint16_t mask) { switch (mode) { case AllChannels: diff --git a/gtk2_ardour/midi_channel_selector.h b/gtk2_ardour/midi_channel_selector.h index e026c12325..a72bea0cf1 100644 --- a/gtk2_ardour/midi_channel_selector.h +++ b/gtk2_ardour/midi_channel_selector.h @@ -72,7 +72,7 @@ public: virtual ~MidiMultipleChannelSelector(); - void set_channel_mode(ARDOUR::ChannelMode mode, uint8_t mask); + void set_channel_mode(ARDOUR::ChannelMode mode, uint16_t mask); /** * @return each bit in the returned word represents a midi channel, eg. diff --git a/libs/ardour/ardour/midi_ring_buffer.h b/libs/ardour/ardour/midi_ring_buffer.h index ec489ee5b6..7ffdcf3b8c 100644 --- a/libs/ardour/ardour/midi_ring_buffer.h +++ b/libs/ardour/ardour/midi_ring_buffer.h @@ -59,7 +59,7 @@ public: * be forced to while reading. */ void set_channel_mode(ChannelMode mode, uint16_t mask) { - g_atomic_int_set(&_channel_mask, ((uint16_t)mode << 16) | mask); + g_atomic_int_set(&_channel_mask, (uint32_t(mode) << 16) | uint32_t(mask)); } ChannelMode get_channel_mode() const { @@ -67,7 +67,7 @@ public: } uint16_t get_channel_mask() const { - return static_cast((g_atomic_int_get(&_channel_mask) & 0x0000FFFF)); + return g_atomic_int_get(&_channel_mask) & 0x0000FFFF; } protected: