| 490 | } |
| 491 | |
| 492 | void AudioBus::discreteCopyFrom(const AudioBus & sourceBus) |
| 493 | { |
| 494 | const int numberOfSourceChannels = sourceBus.numberOfChannels(); |
| 495 | const int numberOfDestinationChannels = numberOfChannels(); |
| 496 | |
| 497 | if (numberOfDestinationChannels < numberOfSourceChannels) |
| 498 | { |
| 499 | // Down-mix by copying channels and dropping the remaining. |
| 500 | for (int i = 0; i < numberOfDestinationChannels; ++i) |
| 501 | { |
| 502 | channel(i)->copyFrom(sourceBus.channel(i)); |
| 503 | } |
| 504 | } |
| 505 | else if (numberOfDestinationChannels > numberOfSourceChannels) |
| 506 | { |
| 507 | // Up-mix by copying as many channels as we have, then zeroing remaining channels. |
| 508 | for (int i = 0; i < numberOfSourceChannels; ++i) |
| 509 | { |
| 510 | channel(i)->copyFrom(sourceBus.channel(i)); |
| 511 | } |
| 512 | |
| 513 | for (int i = numberOfSourceChannels; i < numberOfDestinationChannels; ++i) |
| 514 | { |
| 515 | channel(i)->zero(); |
| 516 | } |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | void AudioBus::discreteSumFrom(const AudioBus & sourceBus) |
| 521 | { |
nothing calls this directly
no test coverage detected