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

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

Issue 886173004: Fix AudioNode.disconnect() to support selective disconnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Conflict solved. 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
« no previous file with comments | « Source/modules/webaudio/AudioNode.idl ('k') | Source/modules/webaudio/AudioNodeOutput.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Called from context's audio thread. 59 // Called from context's audio thread.
60 AudioBus* bus() const; 60 AudioBus* bus() const;
61 61
62 // renderingFanOutCount() is the number of AudioNodeInputs that we're connec ted to during rendering. 62 // renderingFanOutCount() is the number of AudioNodeInputs that we're connec ted to during rendering.
63 // Unlike fanOutCount() it will not change during the course of a render qua ntum. 63 // Unlike fanOutCount() it will not change during the course of a render qua ntum.
64 unsigned renderingFanOutCount() const; 64 unsigned renderingFanOutCount() const;
65 65
66 // Must be called with the context's graph lock. 66 // Must be called with the context's graph lock.
67 void disconnectAll(); 67 void disconnectAll();
68 68
69 // Disconnect a specific input or AudioParam.
70 void disconnectInput(AudioNodeInput &);
71 void disconnectAudioParam(AudioParam &);
72
69 void setNumberOfChannels(unsigned); 73 void setNumberOfChannels(unsigned);
70 unsigned numberOfChannels() const { return m_numberOfChannels; } 74 unsigned numberOfChannels() const { return m_numberOfChannels; }
71 bool isChannelCountKnown() const { return numberOfChannels() > 0; } 75 bool isChannelCountKnown() const { return numberOfChannels() > 0; }
72 76
73 bool isConnected() { return fanOutCount() > 0 || paramFanOutCount() > 0; } 77 bool isConnected() { return fanOutCount() > 0 || paramFanOutCount() > 0; }
74 78
79 // Probe if the output node is connected with a certain input or AudioParam
80 bool isConnectedToInput(AudioNodeInput &);
81 bool isConnectedToAudioParam(AudioParam &);
82
75 // Disable/Enable happens when there are still JavaScript references to a no de, but it has otherwise "finished" its work. 83 // Disable/Enable happens when there are still JavaScript references to a no de, but it has otherwise "finished" its work.
76 // For example, when a note has finished playing. It is kept around, becaus e it may be played again at a later time. 84 // For example, when a note has finished playing. It is kept around, becaus e it may be played again at a later time.
77 // They must be called with the context's graph lock. 85 // They must be called with the context's graph lock.
78 void disable(); 86 void disable();
79 void enable(); 87 void enable();
80 88
81 // updateRenderingState() is called in the audio thread at the start or end of the render quantum to handle any recent changes to the graph state. 89 // updateRenderingState() is called in the audio thread at the start or end of the render quantum to handle any recent changes to the graph state.
82 // It must be called with the context's graph lock. 90 // It must be called with the context's graph lock.
83 void updateRenderingState(); 91 void updateRenderingState();
84 92
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // These value should only be changed at the very start or end of the render ing quantum. 157 // These value should only be changed at the very start or end of the render ing quantum.
150 unsigned m_renderingFanOutCount; 158 unsigned m_renderingFanOutCount;
151 unsigned m_renderingParamFanOutCount; 159 unsigned m_renderingParamFanOutCount;
152 160
153 HeapHashSet<Member<AudioParam>> m_params; 161 HeapHashSet<Member<AudioParam>> m_params;
154 }; 162 };
155 163
156 } // namespace blink 164 } // namespace blink
157 165
158 #endif // AudioNodeOutput_h 166 #endif // AudioNodeOutput_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioNode.idl ('k') | Source/modules/webaudio/AudioNodeOutput.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698