diff --git a/content/media/webaudio/AudioNode.cpp b/content/media/webaudio/AudioNode.cpp index 424fe98c0d5..6f660c7db8b 100644 --- a/content/media/webaudio/AudioNode.cpp +++ b/content/media/webaudio/AudioNode.cpp @@ -175,6 +175,30 @@ AudioNode::Connect(AudioNode& aDestination, uint32_t aOutput, } } +void +AudioNode::SendDoubleParameterToStream(uint32_t aIndex, double aValue) +{ + AudioNodeStream* ns = static_cast(mStream.get()); + MOZ_ASSERT(ns, "How come we don't have a stream here?"); + ns->SetDoubleParameter(aIndex, aValue); +} + +void +AudioNode::SendInt32ParameterToStream(uint32_t aIndex, int32_t aValue) +{ + AudioNodeStream* ns = static_cast(mStream.get()); + MOZ_ASSERT(ns, "How come we don't have a stream here?"); + ns->SetInt32Parameter(aIndex, aValue); +} + +void +AudioNode::SendThreeDPointParameterToStream(uint32_t aIndex, const ThreeDPoint& aValue) +{ + AudioNodeStream* ns = static_cast(mStream.get()); + MOZ_ASSERT(ns, "How come we don't have a stream here?"); + ns->SetThreeDPointParameter(aIndex, aValue); +} + void AudioNode::Disconnect(uint32_t aOutput, ErrorResult& aRv) { diff --git a/content/media/webaudio/AudioNode.h b/content/media/webaudio/AudioNode.h index 418d95d0b16..e20aa48be28 100644 --- a/content/media/webaudio/AudioNode.h +++ b/content/media/webaudio/AudioNode.h @@ -23,6 +23,8 @@ class ErrorResult; namespace dom { +struct ThreeDPoint; + /** * The DOM object representing a Web Audio AudioNode. * @@ -135,6 +137,11 @@ public: protected: static void Callback(AudioNode* aNode) { /* not implemented */ } + // Helpers for sending different value types to streams + void SendDoubleParameterToStream(uint32_t aIndex, double aValue); + void SendInt32ParameterToStream(uint32_t aIndex, int32_t aValue); + void SendThreeDPointParameterToStream(uint32_t aIndex, const ThreeDPoint& aValue); + private: nsRefPtr mContext;