bug 1191649 add notification of input node changes r=padenot

This commit is contained in:
Karl Tomlinson 2015-08-06 19:25:53 +12:00
parent 5c590ce86f
commit 2f5bde5f34
2 changed files with 6 additions and 0 deletions

View File

@ -227,6 +227,7 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput,
static_cast<uint16_t>(aInput),
static_cast<uint16_t>(aOutput));
}
aDestination.NotifyInputsChanged();
// This connection may have connected a panner and a source.
Context()->UpdatePannerSource();
@ -351,6 +352,7 @@ AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv)
// could be for different output ports.
nsRefPtr<AudioNode> output = mOutputNodes[i].forget();
mOutputNodes.RemoveElementAt(i);
output->NotifyInputsChanged();
if (mStream) {
nsRefPtr<nsIRunnable> runnable = new RunnableRelease(output.forget());
mStream->RunAfterPendingUpdates(runnable.forget());

View File

@ -97,6 +97,10 @@ public:
virtual void Disconnect(uint32_t aOutput, ErrorResult& aRv);
// Called after input nodes have been explicitly added or removed through
// the Connect() or Disconnect() methods.
virtual void NotifyInputsChanged() {}
// The following two virtual methods must be implemented by each node type
// to provide their number of input and output ports. These numbers are
// constant for the lifetime of the node. Both default to 1.