* fixed bug introduced in revision 3335: Hibyte lost in channel mask when restoring...
authorHans Baier <hansfbaier@googlemail.com>
Mon, 29 Dec 2008 00:19:18 +0000 (00:19 +0000)
committerHans Baier <hansfbaier@googlemail.com>
Mon, 29 Dec 2008 00:19:18 +0000 (00:19 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4356 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/midi_channel_selector.cc
gtk2_ardour/midi_channel_selector.h
libs/ardour/ardour/midi_ring_buffer.h

index 4415a65f6539ee6fabbf29940d67295cc7c0bf68..1b5baff7d5e86b097519b9fccb0c9ac946916031 100644 (file)
@@ -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:
index e026c1232527d69983ffc3a8a226d40fe56f8094..a72bea0cf13688aaf4af43dbc93d4e7169bd7792 100644 (file)
@@ -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. 
index ec489ee5b6dc5c292fd31d3a97bfbb06b0183397..7ffdcf3b8c899387c5f4ccff790aa8f670688395 100644 (file)
@@ -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<ChannelMode>((g_atomic_int_get(&_channel_mask) & 0x0000FFFF));
+               return g_atomic_int_get(&_channel_mask) & 0x0000FFFF;
        }
        
 protected: