Poly *PartialManager::assignPolyToPart(Part *part) { if (firstFreePolyIndex < synth->getPartialCount()) { Poly *poly = freePolys[firstFreePolyIndex]; freePolys[firstFreePolyIndex] = NULL; firstFreePolyIndex++; poly->setPart(part); return poly; } return NULL; }