| 269 | } |
| 270 | |
| 271 | void AudioBus::sumFrom(const AudioBus & sourceBus, ChannelInterpretation channelInterpretation) |
| 272 | { |
| 273 | if (&sourceBus == this) return; |
| 274 | |
| 275 | int numberOfSourceChannels = sourceBus.numberOfChannels(); |
| 276 | int numberOfDestinationChannels = numberOfChannels(); |
| 277 | |
| 278 | if (numberOfDestinationChannels == numberOfSourceChannels) |
| 279 | { |
| 280 | for (int i = 0; i < numberOfSourceChannels; ++i) |
| 281 | { |
| 282 | channel(i)->sumFrom(sourceBus.channel(i)); |
| 283 | } |
| 284 | } |
| 285 | else |
| 286 | { |
| 287 | switch (channelInterpretation) |
| 288 | { |
| 289 | case ChannelInterpretation::Speakers: speakersSumFrom(sourceBus); break; |
| 290 | case ChannelInterpretation::Discrete: discreteSumFrom(sourceBus); break; |
| 291 | default: |
| 292 | ASSERT_NOT_REACHED(); |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | void AudioBus::speakersCopyFrom(const AudioBus & sourceBus) |
| 298 | { |
no test coverage detected