Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: Source/modules/webaudio/ChannelSplitterNode.cpp

Issue 1023113002: Web Audio: Change the argument of AudioNode::addOutput(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 29 matching lines...) Expand all
40 return new ChannelSplitterNode(context, sampleRate, numberOfOutputs); 40 return new ChannelSplitterNode(context, sampleRate, numberOfOutputs);
41 } 41 }
42 42
43 ChannelSplitterNode::ChannelSplitterNode(AudioContext* context, float sampleRate , unsigned numberOfOutputs) 43 ChannelSplitterNode::ChannelSplitterNode(AudioContext* context, float sampleRate , unsigned numberOfOutputs)
44 : AudioNode(NodeTypeChannelSplitter, context, sampleRate) 44 : AudioNode(NodeTypeChannelSplitter, context, sampleRate)
45 { 45 {
46 addInput(); 46 addInput();
47 47
48 // Create a fixed number of outputs (able to handle the maximum number of ch annels fed to an input). 48 // Create a fixed number of outputs (able to handle the maximum number of ch annels fed to an input).
49 for (unsigned i = 0; i < numberOfOutputs; ++i) 49 for (unsigned i = 0; i < numberOfOutputs; ++i)
50 addOutput(AudioNodeOutput::create(this, 1)); 50 addOutput(1);
51 51
52 initialize(); 52 initialize();
53 } 53 }
54 54
55 void ChannelSplitterNode::process(size_t framesToProcess) 55 void ChannelSplitterNode::process(size_t framesToProcess)
56 { 56 {
57 AudioBus* source = input(0)->bus(); 57 AudioBus* source = input(0)->bus();
58 ASSERT(source); 58 ASSERT(source);
59 ASSERT_UNUSED(framesToProcess, framesToProcess == source->length()); 59 ASSERT_UNUSED(framesToProcess, framesToProcess == source->length());
60 60
(...skipping 10 matching lines...) Expand all
71 } else if (output(i)->renderingFanOutCount() > 0) { 71 } else if (output(i)->renderingFanOutCount() > 0) {
72 // Only bother zeroing out the destination if it's connected to anyt hing 72 // Only bother zeroing out the destination if it's connected to anyt hing
73 destination->zero(); 73 destination->zero();
74 } 74 }
75 } 75 }
76 } 76 }
77 77
78 } // namespace blink 78 } // namespace blink
79 79
80 #endif // ENABLE(WEB_AUDIO) 80 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/ChannelMergerNode.cpp ('k') | Source/modules/webaudio/ConvolverNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698