| 1003 | } |
| 1004 | |
| 1005 | void Looper::SampleDropped(int x, int y, Sample* sample) |
| 1006 | { |
| 1007 | assert(sample); |
| 1008 | int numSamples = sample->LengthInSamples(); |
| 1009 | |
| 1010 | if (numSamples <= 0) |
| 1011 | return; |
| 1012 | |
| 1013 | if (sample->GetNumBars() > 0) |
| 1014 | SetNumBars(sample->GetNumBars()); |
| 1015 | |
| 1016 | float lengthRatio = float(numSamples) / mLoopLength; |
| 1017 | mBuffer->SetNumActiveChannels(sample->NumChannels()); |
| 1018 | for (int i = 0; i < mLoopLength; ++i) |
| 1019 | { |
| 1020 | float offset = i * lengthRatio; |
| 1021 | for (int ch = 0; ch < sample->NumChannels(); ++ch) |
| 1022 | mBuffer->GetChannel(ch)[i] = GetInterpolatedSample(offset, sample->Data()->GetChannel(ch), numSamples); |
| 1023 | } |
| 1024 | } |
| 1025 | |
| 1026 | void Looper::GetModuleDimensions(float& width, float& height) |
| 1027 | { |
nothing calls this directly
no test coverage detected