mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-12 14:11:10 +02:00
Fix drawing MIDI channels with IDs greater than 16
PRL mentioned a while ago that it was possible to get channels greater than 16 via allegro files. This makes those channels correctly work with the CHANNEL_BIT macro (which was supposed to handle them this way before).
This commit is contained in:
parent
62ebb2f95d
commit
896d5d682b
@ -199,8 +199,10 @@ class AUDACITY_DLL_API NoteTrack final
|
|||||||
// map all channel numbers mod 16. This will have no effect
|
// map all channel numbers mod 16. This will have no effect
|
||||||
// on MIDI files, but it will allow users to at least select
|
// on MIDI files, but it will allow users to at least select
|
||||||
// all channels on non-MIDI event sequence data.
|
// all channels on non-MIDI event sequence data.
|
||||||
#define ALL_CHANNELS 0xFFFF
|
#define NUM_CHANNELS 16
|
||||||
#define CHANNEL_BIT(c) (1 << (c & ALL_CHANNELS))
|
// Bitmask with all NUM_CHANNELS bits set
|
||||||
|
#define ALL_CHANNELS (1 << NUM_CHANNELS) - 1
|
||||||
|
#define CHANNEL_BIT(c) (1 << (c % NUM_CHANNELS))
|
||||||
bool IsVisibleChan(int c) const {
|
bool IsVisibleChan(int c) const {
|
||||||
return (mVisibleChannels & CHANNEL_BIT(c)) != 0;
|
return (mVisibleChannels & CHANNEL_BIT(c)) != 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user