89 bool isLowerZone()
const noexcept {
return lowerZone; }
90 bool isUpperZone()
const noexcept {
return ! lowerZone; }
92 bool isActive()
const noexcept {
return numMemberChannels > 0; }
94 int getMasterChannel()
const noexcept {
return lowerZone ? 1 : 16; }
95 int getFirstMemberChannel()
const noexcept {
return lowerZone ? 2 : 15; }
96 int getLastMemberChannel()
const noexcept {
return lowerZone ? (1 + numMemberChannels)
97 : (16 - numMemberChannels); }
99 bool isUsingChannelAsMemberChannel (
int channel)
const noexcept
101 return lowerZone ? (channel > 1 && channel <= 1 + numMemberChannels)
102 : (channel < 16 && channel >= 16 - numMemberChannels);
105 bool operator== (
const Zone& other)
const noexcept {
return lowerZone == other.lowerZone
106 && numMemberChannels == other.numMemberChannels
107 && perNotePitchbendRange == other.perNotePitchbendRange
108 && masterPitchbendRange == other.masterPitchbendRange; }
110 bool operator!= (
const Zone& other)
const noexcept {
return ! operator== (other); }
112 int numMemberChannels;
113 int perNotePitchbendRange;
114 int masterPitchbendRange;
119 Zone (
bool lower,
int memberChans = 0,
int perNotePb = 48,
int masterPb = 2) noexcept
120 : numMemberChannels (memberChans),
121 perNotePitchbendRange (perNotePb),
122 masterPitchbendRange (masterPb),
131 void setLowerZone (
int numMemberChannels = 0,
132 int perNotePitchbendRange = 48,
133 int masterPitchbendRange = 2) noexcept;
136 void setUpperZone (
int numMemberChannels = 0,
137 int perNotePitchbendRange = 48,
138 int masterPitchbendRange = 2) noexcept;
149 void clearAllZones();
163 void processNextMidiEvent (
const MidiMessage& message);
176 void processNextMidiBuffer (
const MidiBuffer& buffer);
192 virtual void zoneLayoutChanged (
const MPEZoneLayout& layout) = 0;
197 void addListener (
Listener*
const listenerToAdd) noexcept;
200 void removeListener (
Listener*
const listenerToRemove) noexcept;
204 Zone lowerZone {
true, 0 };
205 Zone upperZone {
false, 0 };
211 void setZone (
bool,
int,
int,
int) noexcept;
217 void updateMasterPitchbend (
Zone&,
int);
218 void updatePerNotePitchbendRange (
Zone&,
int);
220 void sendLayoutChangeMessage();
221 void checkAndLimitZoneParameters (
int,
int,
int&) noexcept;
#define JUCE_API
This macro is added to all JUCE public class declarations.
This class represents the current MPE zone layout of a device capable of handling MPE...
Encapsulates a MIDI message.
This struct represents an MPE zone.
const Zone getUpperZone() const noexcept
Returns a struct representing the upper MPE zone.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
const Zone getLowerZone() const noexcept
Returns a struct representing the lower MPE zone.
Represents a MIDI RPN (registered parameter number) or NRPN (non-registered parameter number) message...
Holds a sequence of time-stamped midi events.
Parses a stream of MIDI data to assemble RPN and NRPN messages from their constituent MIDI CC message...