| 236 | } |
| 237 | |
| 238 | int32_t Framebuffer_initialise(CSOUND *csound, Framebuffer *self) |
| 239 | { |
| 240 | self->inputType = Framebuffer_getArgumentType(csound, self->inputArgument); |
| 241 | self->outputType = Framebuffer_getArgumentType(csound, self->outputArgument); |
| 242 | self->elementCount = *self->sizeArgument; |
| 243 | self->ksmps = csound->GetKsmps(csound); |
| 244 | |
| 245 | Framebuffer_checkArgumentSanity(csound, self); |
| 246 | |
| 247 | csound->AuxAlloc(csound, self->elementCount * sizeof(MYFLT), |
| 248 | &self->bufferMemory); |
| 249 | self->buffer = self->bufferMemory.auxp; |
| 250 | |
| 251 | if (self->outputType == KRATE_ARRAY) { |
| 252 | |
| 253 | ARRAYDAT *array = (ARRAYDAT *) self->outputArgument; |
| 254 | array->sizes = csound->Calloc(csound, sizeof(int32_t)); |
| 255 | array->sizes[0] = self->elementCount; |
| 256 | array->dimensions = 1; |
| 257 | CS_VARIABLE *var = array->arrayType->createVariable(csound, NULL); |
| 258 | array->arrayMemberSize = var->memBlockSize; |
| 259 | array->data = csound->Calloc(csound, |
| 260 | var->memBlockSize * self->elementCount); |
| 261 | } |
| 262 | |
| 263 | return OK; |
| 264 | } |
| 265 | |
| 266 | void Framebuffer_writeBuffer(CSOUND *csound, Framebuffer *self, |
| 267 | MYFLT *inputSamples, int32_t inputSamplesCount) |
nothing calls this directly
no test coverage detected