412 |
}; |
}; |
413 |
typedef std::vector<CopyAssignSchedEntry> CopyAssignSchedule; |
typedef std::vector<CopyAssignSchedEntry> CopyAssignSchedule; |
414 |
|
|
415 |
|
/** @brief Constrain @a dimCase according to @a rgn's dimension zones. |
416 |
|
* |
417 |
|
* To avoid @a dimCase being an invalid dimension region selection on @a rgn, |
418 |
|
* this function automatically wraps (if required) the individual dimension case |
419 |
|
* entries according to region's actual amount of dimension zones. |
420 |
|
* |
421 |
|
* @param dimCase - dimension case to be potentially corrected |
422 |
|
* @param rgn - the region upon @a dimCase shall be corrected for |
423 |
|
*/ |
424 |
|
static void wrapDimCase(DimensionCase& dimCase, gig::Region* rgn) { |
425 |
|
for (auto& it : dimCase) { |
426 |
|
gig::dimension_def_t* def = rgn->GetDimensionDefinition(it.first); |
427 |
|
const int zones = (def) ? def->zones : 1; |
428 |
|
it.second %= zones; |
429 |
|
} |
430 |
|
} |
431 |
|
|
432 |
/** @brief Schedule copying DimensionRegions from source Region to target Region. |
/** @brief Schedule copying DimensionRegions from source Region to target Region. |
433 |
* |
* |
434 |
* Schedules copying the entire articulation informations (including sample |
* Schedules copying the entire articulation informations (including sample |
473 |
uint dstDimValues[8] = {}; |
uint dstDimValues[8] = {}; |
474 |
DimensionCase srcDimCase = dimCase; |
DimensionCase srcDimCase = dimCase; |
475 |
DimensionCase dstDimCase = dimCase; |
DimensionCase dstDimCase = dimCase; |
476 |
|
|
477 |
|
// source might have less zones than destination, so to prevent output |
478 |
|
// instrument ending up with NULL samples in some of the dimension |
479 |
|
// zones, wrap here the source zone according to the amount of zones the |
480 |
|
// source really has |
481 |
|
wrapDimCase(srcDimCase, inRgn); |
482 |
|
|
483 |
srcDimCase[mainDim] = iSrcMainBit; |
srcDimCase[mainDim] = iSrcMainBit; |
484 |
dstDimCase[mainDim] = iDstMainBit; |
dstDimCase[mainDim] = iDstMainBit; |
485 |
|
|