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 isUsing (
int channel)
const noexcept
107 return isUsingChannelAsMemberChannel (channel) || channel == getMasterChannel();
110 bool operator== (
const Zone& other)
const noexcept {
return lowerZone == other.lowerZone
111 && numMemberChannels == other.numMemberChannels
112 && perNotePitchbendRange == other.perNotePitchbendRange
113 && masterPitchbendRange == other.masterPitchbendRange; }
115 bool operator!= (
const Zone& other)
const noexcept {
return ! operator== (other); }
117 int numMemberChannels;
118 int perNotePitchbendRange;
119 int masterPitchbendRange;
124 Zone (
bool lower,
int memberChans = 0,
int perNotePb = 48,
int masterPb = 2) noexcept
125 : numMemberChannels (memberChans),
126 perNotePitchbendRange (perNotePb),
127 masterPitchbendRange (masterPb),
136 void setLowerZone (
int numMemberChannels = 0,
137 int perNotePitchbendRange = 48,
138 int masterPitchbendRange = 2) noexcept;
141 void setUpperZone (
int numMemberChannels = 0,
142 int perNotePitchbendRange = 48,
143 int masterPitchbendRange = 2) noexcept;
154 void clearAllZones();
168 void processNextMidiEvent (
const MidiMessage& message);
181 void processNextMidiBuffer (
const MidiBuffer& buffer);
197 virtual void zoneLayoutChanged (
const MPEZoneLayout& layout) = 0;
202 void addListener (
Listener*
const listenerToAdd) noexcept;
205 void removeListener (
Listener*
const listenerToRemove) noexcept;
209 Zone lowerZone {
true, 0 };
210 Zone upperZone {
false, 0 };
216 void setZone (
bool,
int,
int,
int) noexcept;
222 void updateMasterPitchbend (
Zone&,
int);
223 void updatePerNotePitchbendRange (
Zone&,
int);
225 void sendLayoutChangeMessage();
226 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...