void Graph_MapControl(Graph* inGraph, uint32 inIndex, uint32 inBus) { if (inIndex >= GRAPHDEF(inGraph)->mNumControls) return; World *world = inGraph->mNode.mWorld; if (inBus >= 0x80000000) { inGraph->mControlRates[inIndex] = 0; inGraph->mMapControls[inIndex] = inGraph->mControls + inIndex; } else if (inBus < world->mNumControlBusChannels) { inGraph->mControlRates[inIndex] = 1; inGraph->mMapControls[inIndex] = world->mControlBus + inBus; } }
void Graph_MapAudioControl(Graph* inGraph, uint32 inIndex, uint32 inBus) { if (inIndex >= GRAPHDEF(inGraph)->mNumControls) return; World *world = inGraph->mNode.mWorld; /* what is the below doing??? it is unmapping by looking for negative ints */ if (inBus >= 0x80000000) { inGraph->mControlRates[inIndex] = 0; inGraph->mMapControls[inIndex] = inGraph->mControls + inIndex; } else if (inBus < world->mNumAudioBusChannels) { inGraph->mControlRates[inIndex] = 2; inGraph->mMapControls[inIndex] = world->mAudioBus + (inBus * world->mBufLength); } }
int Graph_GetControl(Graph* inGraph, uint32 inIndex, float& outValue) { if (inIndex >= GRAPHDEF(inGraph)->mNumControls) return kSCErr_IndexOutOfRange; outValue = inGraph->mControls[inIndex]; return kSCErr_None; }