| 7605 | } |
| 7606 | |
| 7607 | void ScriptingObjects::ScriptFFT::copyToWorkBuffer(var inputData, int offset, int channel) |
| 7608 | { |
| 7609 | if (auto a = inputData.getArray()) |
| 7610 | { |
| 7611 | if (channel != 0) |
| 7612 | { |
| 7613 | reportScriptError("Illegal nested arrays"); |
| 7614 | } |
| 7615 | |
| 7616 | for (auto& b : *a) |
| 7617 | { |
| 7618 | copyToWorkBuffer(b, offset, channel); |
| 7619 | channel++; |
| 7620 | } |
| 7621 | } |
| 7622 | else if (auto b = inputData.getBuffer()) |
| 7623 | { |
| 7624 | if (auto dst = scratchBuffers[channel].chunkInput) |
| 7625 | { |
| 7626 | dst->clear(); |
| 7627 | int numToCopy = jmin(b->size - offset, maxNumSamples); |
| 7628 | dst->buffer.copyFrom(0, 0, b->buffer, 0, offset, numToCopy); |
| 7629 | } |
| 7630 | else |
| 7631 | { |
| 7632 | reportScriptError("channel mismatch"); |
| 7633 | } |
| 7634 | } |
| 7635 | } |
| 7636 | |
| 7637 | void ScriptingObjects::ScriptFFT::copyFromWorkBuffer(int offset, int channel) |
| 7638 | { |