MCPcopy Create free account
hub / github.com/csound/csound / Framebuffer_initialise

Function Framebuffer_initialise

Opcodes/framebuffer.c:238–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238int32_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
266void Framebuffer_writeBuffer(CSOUND *csound, Framebuffer *self,
267 MYFLT *inputSamples, int32_t inputSamplesCount)

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected