| 363 | } |
| 364 | |
| 365 | bool LoudnessBase::StoreBufferBlock( |
| 366 | WaveChannel& track, size_t nChannels, sampleCount pos, size_t len) |
| 367 | { |
| 368 | size_t idx = 0; |
| 369 | const auto setOne = [&](WaveChannel& channel) { |
| 370 | // Copy the newly-changed samples back onto the track. |
| 371 | return channel.SetFloats(mTrackBuffer[idx].get(), pos, len); |
| 372 | }; |
| 373 | |
| 374 | if (nChannels == 1) |
| 375 | return setOne(track); |
| 376 | else |
| 377 | { |
| 378 | for (auto channel : track.GetTrack().Channels()) |
| 379 | { |
| 380 | if (!setOne(*channel)) |
| 381 | return false; |
| 382 | ++idx; |
| 383 | } |
| 384 | return true; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | bool LoudnessBase::UpdateProgress() |
| 389 | { |