addInput(adoptPtr(new AudioNodeInput(this)));
addOutput(adoptPtr(new AudioNodeOutput(this, 2)));
- m_distanceGain = AudioGain::create("distanceGain", 1.0, 0.0, 1.0);
- m_coneGain = AudioGain::create("coneGain", 1.0, 0.0, 1.0);
+ m_distanceGain = AudioGain::create(context, "distanceGain", 1.0, 0.0, 1.0);
+ m_coneGain = AudioGain::create(context, "coneGain", 1.0, 0.0, 1.0);
m_position = FloatPoint3D(0, 0, 0);
m_orientation = FloatPoint3D(1, 0, 0);
}
}
+void AudioPannerNode::setDistanceModel(unsigned short model, ExceptionCode& ec)
+{
+ switch (model) {
+ case DistanceEffect::ModelLinear:
+ case DistanceEffect::ModelInverse:
+ case DistanceEffect::ModelExponential:
+ m_distanceEffect.setModel(static_cast<DistanceEffect::ModelType>(model), true);
+ break;
+ default:
+ ec = NOT_SUPPORTED_ERR;
+ break;
+ }
+}
+
void AudioPannerNode::getAzimuthElevation(double* outAzimuth, double* outElevation)
{
// FIXME: we should cache azimuth and elevation (if possible), so we only re-calculate if a change has been made.