| 518 | } |
| 519 | |
| 520 | void AudioBus::discreteSumFrom(const AudioBus & sourceBus) |
| 521 | { |
| 522 | const int numberOfSourceChannels = sourceBus.numberOfChannels(); |
| 523 | const int numberOfDestinationChannels = numberOfChannels(); |
| 524 | |
| 525 | if (numberOfDestinationChannels < numberOfSourceChannels) |
| 526 | { |
| 527 | // Down-mix by summing channels and dropping the remaining. |
| 528 | for (int i = 0; i < numberOfDestinationChannels; ++i) |
| 529 | { |
| 530 | channel(i)->sumFrom(sourceBus.channel(i)); |
| 531 | } |
| 532 | } |
| 533 | else if (numberOfDestinationChannels > numberOfSourceChannels) |
| 534 | { |
| 535 | // Up-mix by summing as many channels as we have. |
| 536 | for (int i = 0; i < numberOfSourceChannels; ++i) |
| 537 | { |
| 538 | channel(i)->sumFrom(sourceBus.channel(i)); |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | |
| 543 | void AudioBus::copyWithGainFrom(const AudioBus & sourceBus, float * lastMixGain, float targetGain) |
| 544 | { |
nothing calls this directly
no test coverage detected