|
|
@@ -26,6 +26,17 @@ MPEZoneLayout::MPEZoneLayout() noexcept |
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
MPEZoneLayout::MPEZoneLayout (const MPEZoneLayout& other)
|
|
|
|
: zones (other.zones)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
MPEZoneLayout& MPEZoneLayout::operator= (const MPEZoneLayout& other)
|
|
|
|
{
|
|
|
|
zones = other.zones;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
bool MPEZoneLayout::addZone (MPEZone newZone)
|
|
|
|
{
|
|
|
@@ -46,6 +57,7 @@ bool MPEZoneLayout::addZone (MPEZone newZone) |
|
|
|
}
|
|
|
|
|
|
|
|
zones.add (newZone);
|
|
|
|
listeners.call (&MPEZoneLayout::Listener::zoneLayoutChanged, *this);
|
|
|
|
return noOtherZonesModified;
|
|
|
|
}
|
|
|
|
|
|
|
@@ -66,6 +78,7 @@ MPEZone* MPEZoneLayout::getZoneByIndex (int index) const noexcept |
|
|
|
void MPEZoneLayout::clearAllZones()
|
|
|
|
{
|
|
|
|
zones.clear();
|
|
|
|
listeners.call (&MPEZoneLayout::Listener::zoneLayoutChanged, *this);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
@@ -106,12 +119,20 @@ void MPEZoneLayout::processPitchbendRangeRpnMessage (MidiRPNMessage rpn) |
|
|
|
{
|
|
|
|
if (MPEZone* zone = getZoneByFirstNoteChannel (rpn.channel))
|
|
|
|
{
|
|
|
|
zone->setPerNotePitchbendRange (rpn.value);
|
|
|
|
return;
|
|
|
|
if (zone->getPerNotePitchbendRange() != rpn.value)
|
|
|
|
{
|
|
|
|
zone->setPerNotePitchbendRange (rpn.value);
|
|
|
|
listeners.call (&MPEZoneLayout::Listener::zoneLayoutChanged, *this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (MPEZone* zone = getZoneByMasterChannel (rpn.channel))
|
|
|
|
{
|
|
|
|
if (zone->getMasterPitchbendRange() != rpn.value)
|
|
|
|
{
|
|
|
|
zone->setMasterPitchbendRange (rpn.value);
|
|
|
|
listeners.call (&MPEZoneLayout::Listener::zoneLayoutChanged, *this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (MPEZone* zone = getZoneByMasterChannel (rpn.channel))
|
|
|
|
zone->setMasterPitchbendRange (rpn.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
@@ -162,6 +183,25 @@ MPEZone* MPEZoneLayout::getZoneByNoteChannel (int channel) const noexcept |
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
void MPEZoneLayout::addListener (Listener* const listenerToAdd) noexcept
|
|
|
|
{
|
|
|
|
listeners.add (listenerToAdd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void MPEZoneLayout::removeListener (Listener* const listenerToRemove) noexcept
|
|
|
|
{
|
|
|
|
listeners.remove (listenerToRemove);
|
|
|
|
}
|
|
|
|
|
|
|
|
MPEZoneLayout::Listener::Listener()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
MPEZoneLayout::Listener::~Listener()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
//==============================================================================
|
|
|
|
#if JUCE_UNIT_TESTS
|
|
|
|