示例#1
0
Partial *PartialManager::allocPartial(int partNum) {
	Partial *outPartial = NULL;

	// Get the first inactive partial
	for (int partialNum = 0; partialNum < MT32EMU_MAX_PARTIALS; partialNum++) {
		if (!partialTable[partialNum]->isActive()) {
			outPartial = partialTable[partialNum];
			break;
		}
	}
	if (outPartial != NULL) {
		outPartial->activate(partNum);
	}
	return outPartial;
}
示例#2
0
Partial *PartialManager::allocPartial(int partNum) {
	Partial *outPartial = NULL;

	// Get the first inactive partial
	for (unsigned int partialNum = 0; partialNum < synth->getPartialCount(); partialNum++) {
		if (!partialTable[partialNum]->isActive()) {
			outPartial = partialTable[partialNum];
			break;
		}
	}
	if (outPartial != NULL) {
		outPartial->activate(partNum);
	}
	return outPartial;
}
示例#3
0
Partial *PartialManager::allocPartial(int partNum) {
	Partial *outPartial = NULL;

	// Use the first inactive partial reserved for the specified part (if there are any)
	// Otherwise, use the last inactive partial, if any
	for (int i = 0; i < MT32EMU_MAX_PARTIALS; i++) {
		if (!partialTable[i]->isActive()) {
			outPartial = partialTable[i];
			if (partialReserveTable[i] == partNum)
				break;
		}
	}
	if (outPartial != NULL) {
		outPartial->activate(partNum);
		outPartial->age = 0;
	}
	return outPartial;
}