OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "config.h" | 25 #include "config.h" |
26 | 26 |
27 #if ENABLE(WEB_AUDIO) | 27 #if ENABLE(WEB_AUDIO) |
28 | 28 |
29 #include "modules/webaudio/ChannelSplitterNode.h" | 29 #include "modules/webaudio/ChannelSplitterNode.h" |
30 | 30 |
31 #include "modules/webaudio/AudioContext.h" | 31 #include "modules/webaudio/AudioContext.h" |
32 #include "modules/webaudio/AudioNodeInput.h" | 32 #include "modules/webaudio/AudioNodeInput.h" |
33 #include "modules/webaudio/AudioNodeOutput.h" | 33 #include "modules/webaudio/AudioNodeOutput.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace blink { |
36 | 36 |
37 PassRefPtrWillBeRawPtr<ChannelSplitterNode> ChannelSplitterNode::create(AudioCon
text* context, float sampleRate, unsigned numberOfOutputs) | 37 PassRefPtrWillBeRawPtr<ChannelSplitterNode> ChannelSplitterNode::create(AudioCon
text* context, float sampleRate, unsigned numberOfOutputs) |
38 { | 38 { |
39 if (!numberOfOutputs || numberOfOutputs > AudioContext::maxNumberOfChannels(
)) | 39 if (!numberOfOutputs || numberOfOutputs > AudioContext::maxNumberOfChannels(
)) |
40 return nullptr; | 40 return nullptr; |
41 | 41 |
42 return adoptRefWillBeNoop(new ChannelSplitterNode(context, sampleRate, numbe
rOfOutputs)); | 42 return adoptRefWillBeNoop(new ChannelSplitterNode(context, sampleRate, numbe
rOfOutputs)); |
43 } | 43 } |
44 | 44 |
45 ChannelSplitterNode::ChannelSplitterNode(AudioContext* context, float sampleRate
, unsigned numberOfOutputs) | 45 ChannelSplitterNode::ChannelSplitterNode(AudioContext* context, float sampleRate
, unsigned numberOfOutputs) |
(...skipping 26 matching lines...) Expand all Loading... |
72 // Split the channel out if it exists in the source. | 72 // Split the channel out if it exists in the source. |
73 // It would be nice to avoid the copy and simply pass along pointers
, but this becomes extremely difficult with fanout and fanin. | 73 // It would be nice to avoid the copy and simply pass along pointers
, but this becomes extremely difficult with fanout and fanin. |
74 destination->channel(0)->copyFrom(source->channel(i)); | 74 destination->channel(0)->copyFrom(source->channel(i)); |
75 } else if (output(i)->renderingFanOutCount() > 0) { | 75 } else if (output(i)->renderingFanOutCount() > 0) { |
76 // Only bother zeroing out the destination if it's connected to anyt
hing | 76 // Only bother zeroing out the destination if it's connected to anyt
hing |
77 destination->zero(); | 77 destination->zero(); |
78 } | 78 } |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 } // namespace WebCore | 82 } // namespace blink |
83 | 83 |
84 #endif // ENABLE(WEB_AUDIO) | 84 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |