147 |
// rebuild ActiveKeyGroups map with key groups of current |
// rebuild ActiveKeyGroups map with key groups of current |
148 |
// instrument and set the round robin pointers to use one |
// instrument and set the round robin pointers to use one |
149 |
// counter for each region |
// counter for each region |
150 |
int region = 0; |
size_t region = 0; |
151 |
for (::gig::Region* pRegion = newInstrument->GetFirstRegion(); pRegion; pRegion = newInstrument->GetNextRegion()) { |
for (::gig::Region* pRegion = newInstrument->GetRegionAt(region); |
152 |
|
pRegion; pRegion = newInstrument->GetRegionAt(++region)) |
153 |
|
{ |
154 |
AddGroup(pRegion->KeyGroup); |
AddGroup(pRegion->KeyGroup); |
155 |
|
|
156 |
RoundRobinIndexes[region] = 0; |
RoundRobinIndexes[region] = 0; |
157 |
for (int iKey = pRegion->KeyRange.low; iKey <= pRegion->KeyRange.high; iKey++) { |
for (int iKey = pRegion->KeyRange.low; iKey <= pRegion->KeyRange.high; iKey++) { |
158 |
pMIDIKeyInfo[iKey].pRoundRobinIndex = &RoundRobinIndexes[region]; |
pMIDIKeyInfo[iKey].pRoundRobinIndex = &RoundRobinIndexes[region]; |
159 |
} |
} |
|
region++; |
|
160 |
} |
} |
161 |
|
|
162 |
InstrumentIdxName = newInstrument->pInfo->Name; |
InstrumentIdxName = newInstrument->pInfo->Name; |