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

Side by Side Diff: Source/modules/webaudio/AudioNode.h

Issue 886173004: Fix AudioNode.disconnect() to support selective disconnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comments and fixed exception messages Created 5 years, 10 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
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 unsigned numberOfInputs() const { return m_inputs.size(); } 132 unsigned numberOfInputs() const { return m_inputs.size(); }
133 unsigned numberOfOutputs() const { return m_outputs.size(); } 133 unsigned numberOfOutputs() const { return m_outputs.size(); }
134 134
135 AudioNodeInput* input(unsigned); 135 AudioNodeInput* input(unsigned);
136 AudioNodeOutput* output(unsigned); 136 AudioNodeOutput* output(unsigned);
137 137
138 // Called from main thread by corresponding JavaScript methods. 138 // Called from main thread by corresponding JavaScript methods.
139 virtual void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionState&); 139 virtual void connect(AudioNode*, unsigned outputIndex, unsigned inputIndex, ExceptionState&);
140 void connect(AudioParam*, unsigned outputIndex, ExceptionState&); 140 void connect(AudioParam*, unsigned outputIndex, ExceptionState&);
141
142 virtual void disconnect();
141 virtual void disconnect(unsigned outputIndex, ExceptionState&); 143 virtual void disconnect(unsigned outputIndex, ExceptionState&);
144 virtual void disconnect(AudioNode*, ExceptionState&);
145 virtual void disconnect(AudioNode*, unsigned outputIndex, ExceptionState&);
146 virtual void disconnect(AudioNode*, unsigned outputIndex, unsigned inputInde x, ExceptionState&);
147 virtual void disconnect(AudioParam*, ExceptionState&);
148 virtual void disconnect(AudioParam*, unsigned outputIndex, ExceptionState&);
149
142 // Like disconnect, but no exception is thrown if the outputIndex is invalid . Just do nothing 150 // Like disconnect, but no exception is thrown if the outputIndex is invalid . Just do nothing
143 // in that case. 151 // in that case.
144 virtual void disconnectWithoutException(unsigned outputIndex); 152 virtual void disconnectWithoutException(unsigned outputIndex);
145 153
146 virtual float sampleRate() const { return m_sampleRate; } 154 virtual float sampleRate() const { return m_sampleRate; }
147 155
148 // processIfNecessary() is called by our output(s) when the rendering graph needs this AudioNode to process. 156 // processIfNecessary() is called by our output(s) when the rendering graph needs this AudioNode to process.
149 // This method ensures that the AudioNode will only process once per renderi ng time quantum even if it's called repeatedly. 157 // This method ensures that the AudioNode will only process once per renderi ng time quantum even if it's called repeatedly.
150 // This handles the case of "fanout" where an output is connected to multipl e AudioNode inputs. 158 // This handles the case of "fanout" where an output is connected to multipl e AudioNode inputs.
151 // Called from context's audio thread. 159 // Called from context's audio thread.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 ChannelCountMode m_channelCountMode; 246 ChannelCountMode m_channelCountMode;
239 AudioBus::ChannelInterpretation m_channelInterpretation; 247 AudioBus::ChannelInterpretation m_channelInterpretation;
240 // The new channel count mode that will be used to set the actual mode in th e pre or post 248 // The new channel count mode that will be used to set the actual mode in th e pre or post
241 // rendering phase. 249 // rendering phase.
242 ChannelCountMode m_newChannelCountMode; 250 ChannelCountMode m_newChannelCountMode;
243 }; 251 };
244 252
245 } // namespace blink 253 } // namespace blink
246 254
247 #endif // AudioNode_h 255 #endif // AudioNode_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698