diff --git a/content/media/webaudio/AudioParam.cpp b/content/media/webaudio/AudioParam.cpp index 397a0f4c9b1..6993d4c8e23 100644 --- a/content/media/webaudio/AudioParam.cpp +++ b/content/media/webaudio/AudioParam.cpp @@ -20,19 +20,12 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AudioParam, Release) AudioParam::AudioParam(AudioNode* aNode, AudioParam::CallbackType aCallback, - float aDefaultValue, - float aMinValue, - float aMaxValue) + float aDefaultValue) : AudioParamTimeline(aDefaultValue) , mNode(aNode) , mCallback(aCallback) , mDefaultValue(aDefaultValue) - , mMinValue(aMinValue) - , mMaxValue(aMaxValue) { - MOZ_ASSERT(aDefaultValue >= aMinValue); - MOZ_ASSERT(aDefaultValue <= aMaxValue); - MOZ_ASSERT(aMinValue < aMaxValue); SetIsDOMBinding(); } diff --git a/content/media/webaudio/AudioParam.h b/content/media/webaudio/AudioParam.h index 8d5012732e0..7c68201422b 100644 --- a/content/media/webaudio/AudioParam.h +++ b/content/media/webaudio/AudioParam.h @@ -34,9 +34,7 @@ public: AudioParam(AudioNode* aNode, CallbackType aCallback, - float aDefaultValue, - float aMinValue, - float aMaxValue); + float aDefaultValue); virtual ~AudioParam(); NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AudioParam) @@ -96,16 +94,6 @@ public: mCallback(mNode); } - float MinValue() const - { - return mMinValue; - } - - float MaxValue() const - { - return mMaxValue; - } - float DefaultValue() const { return mDefaultValue; @@ -115,8 +103,6 @@ private: nsRefPtr mNode; CallbackType mCallback; const float mDefaultValue; - const float mMinValue; - const float mMaxValue; }; } diff --git a/content/media/webaudio/BiquadFilterNode.cpp b/content/media/webaudio/BiquadFilterNode.cpp index b494081ce6f..5f07136d407 100644 --- a/content/media/webaudio/BiquadFilterNode.cpp +++ b/content/media/webaudio/BiquadFilterNode.cpp @@ -96,18 +96,12 @@ private: AudioParamTimeline mGain; }; -static float -Nyquist(AudioContext* aContext) -{ - return 0.5f * aContext->SampleRate(); -} - BiquadFilterNode::BiquadFilterNode(AudioContext* aContext) : AudioNode(aContext) , mType(BiquadTypeEnum::LOWPASS) - , mFrequency(new AudioParam(this, SendFrequencyToStream, 350.f, 10.f, Nyquist(aContext))) - , mQ(new AudioParam(this, SendQToStream, 1.f, 0.0001f, 1000.f)) - , mGain(new AudioParam(this, SendGainToStream, 0.f, -40.f, 40.f)) + , mFrequency(new AudioParam(this, SendFrequencyToStream, 350.f)) + , mQ(new AudioParam(this, SendQToStream, 1.f)) + , mGain(new AudioParam(this, SendGainToStream, 0.f)) { BiquadFilterNodeEngine* engine = new BiquadFilterNodeEngine(aContext->Destination()); mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM); diff --git a/content/media/webaudio/DelayNode.cpp b/content/media/webaudio/DelayNode.cpp index 47d98d9678d..96137989e9e 100644 --- a/content/media/webaudio/DelayNode.cpp +++ b/content/media/webaudio/DelayNode.cpp @@ -201,7 +201,7 @@ public: DelayNode::DelayNode(AudioContext* aContext, double aMaxDelay) : AudioNode(aContext) - , mDelay(new AudioParam(this, SendDelayToStream, 0.0f, 0.0f, float(aMaxDelay))) + , mDelay(new AudioParam(this, SendDelayToStream, 0.0f)) { DelayNodeEngine* engine = new DelayNodeEngine(aContext->Destination()); mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM); diff --git a/content/media/webaudio/DynamicsCompressorNode.cpp b/content/media/webaudio/DynamicsCompressorNode.cpp index b844b88712e..221a9fd6597 100644 --- a/content/media/webaudio/DynamicsCompressorNode.cpp +++ b/content/media/webaudio/DynamicsCompressorNode.cpp @@ -113,12 +113,12 @@ private: DynamicsCompressorNode::DynamicsCompressorNode(AudioContext* aContext) : AudioNode(aContext) - , mThreshold(new AudioParam(this, SendThresholdToStream, -24.f, -100.f, 0.f)) - , mKnee(new AudioParam(this, SendKneeToStream, 30.f, 0.f, 40.f)) - , mRatio(new AudioParam(this, SendRatioToStream, 12.f, 1.f, 20.f)) - , mReduction(new AudioParam(this, SendReductionToStream, 0.f, -20.f, 0.f)) - , mAttack(new AudioParam(this, SendAttackToStream, 0.003f, 0.f, 1.f)) - , mRelease(new AudioParam(this, SendReleaseToStream, 0.25f, 0.f, 1.f)) + , mThreshold(new AudioParam(this, SendThresholdToStream, -24.f)) + , mKnee(new AudioParam(this, SendKneeToStream, 30.f)) + , mRatio(new AudioParam(this, SendRatioToStream, 12.f)) + , mReduction(new AudioParam(this, SendReductionToStream, 0.f)) + , mAttack(new AudioParam(this, SendAttackToStream, 0.003f)) + , mRelease(new AudioParam(this, SendReleaseToStream, 0.25f)) { DynamicsCompressorNodeEngine* engine = new DynamicsCompressorNodeEngine(aContext->Destination()); mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM); diff --git a/content/media/webaudio/GainNode.cpp b/content/media/webaudio/GainNode.cpp index 67738b8895c..8997fa49a98 100644 --- a/content/media/webaudio/GainNode.cpp +++ b/content/media/webaudio/GainNode.cpp @@ -95,7 +95,7 @@ public: GainNode::GainNode(AudioContext* aContext) : AudioNode(aContext) - , mGain(new AudioParam(this, SendGainToStream, 1.0f, 0.0f, 1.0f)) + , mGain(new AudioParam(this, SendGainToStream, 1.0f)) { GainNodeEngine* engine = new GainNodeEngine(aContext->Destination()); mStream = aContext->Graph()->CreateAudioNodeStream(engine, MediaStreamGraph::INTERNAL_STREAM); diff --git a/content/media/webaudio/test/test_biquadFilterNode.html b/content/media/webaudio/test/test_biquadFilterNode.html index de6e029cb57..6a765afc03c 100644 --- a/content/media/webaudio/test/test_biquadFilterNode.html +++ b/content/media/webaudio/test/test_biquadFilterNode.html @@ -37,14 +37,8 @@ addLoadEvent(function() { // Verify default values is(filter.type, 0, "Correct default value for type"); - near(filter.frequency.minValue, 10, "Correct min value for filter frequency"); - near(filter.frequency.maxValue, context.sampleRate/2, "Correct max value for filter frequency"); near(filter.frequency.defaultValue, 350, "Correct default value for filter frequency"); - near(filter.Q.minValue, 0.001, "Correct min value for filter Q"); - near(filter.Q.maxValue, 1000, "Correct max value for filter Q"); near(filter.Q.defaultValue, 1, "Correct default value for filter Q"); - near(filter.gain.minValue, -40, "Correct min value for filter gain"); - near(filter.gain.maxValue, 40, "Correct max value for filter gain"); near(filter.gain.defaultValue, 0, "Correct default value for filter gain"); // Make sure that we can set all of the valid type values diff --git a/content/media/webaudio/test/test_delayNode.html b/content/media/webaudio/test/test_delayNode.html index 5a5e8a2fd91..f22f0240b54 100644 --- a/content/media/webaudio/test/test_delayNode.html +++ b/content/media/webaudio/test/test_delayNode.html @@ -34,24 +34,16 @@ addLoadEvent(function() { ok(delay.delayTime, "The audioparam member must exist"); is(delay.delayTime.value, 0, "Correct initial value"); is(delay.delayTime.defaultValue, 0, "Correct default value"); - is(delay.delayTime.minValue, 0, "Correct min value"); - is(delay.delayTime.maxValue, 1.0, "Correct max value"); delay.delayTime.value = 0.5; is(delay.delayTime.value, 0.5, "Correct initial value"); is(delay.delayTime.defaultValue, 0, "Correct default value"); - is(delay.delayTime.minValue, 0, "Correct min value"); - is(delay.delayTime.maxValue, 1.0, "Correct max value"); var delay2 = context.createDelay(2); is(delay2.delayTime.value, 0, "Correct initial value"); is(delay2.delayTime.defaultValue, 0, "Correct default value"); - is(delay2.delayTime.minValue, 0, "Correct min value"); - is(delay2.delayTime.maxValue, 2.0, "Correct max value"); delay2.delayTime.value = 0.5; is(delay2.delayTime.value, 0.5, "Correct initial value"); is(delay2.delayTime.defaultValue, 0, "Correct default value"); - is(delay2.delayTime.minValue, 0, "Correct min value"); - is(delay2.delayTime.maxValue, 2.0, "Correct max value"); expectException(function() { context.createDelay(0); diff --git a/content/media/webaudio/test/test_dynamicsCompressorNode.html b/content/media/webaudio/test/test_dynamicsCompressorNode.html index 96266647eab..7477d7c4b24 100644 --- a/content/media/webaudio/test/test_dynamicsCompressorNode.html +++ b/content/media/webaudio/test/test_dynamicsCompressorNode.html @@ -44,22 +44,6 @@ addLoadEvent(function() { near(release.defaultValue, 0.25, "Correct default value for release"); } - // Verify min/max values - with (compressor) { - near(threshold.minValue, -100, "Correct min value for threshold"); - near(knee.minValue, 0, "Correct min value for knee"); - near(ratio.minValue, 1, "Correct min value for ratio"); - near(reduction.minValue, -20, "Correct min value for reduction"); - near(attack.minValue, 0, "Correct min value for attack"); - near(release.minValue, 0, "Correct min value for release"); - near(threshold.maxValue, 0, "Correct max value for threshold"); - near(knee.maxValue, 40, "Correct max value for knee"); - near(ratio.maxValue, 20, "Correct max value for ratio"); - near(reduction.maxValue, 0, "Correct max value for reduction"); - near(attack.maxValue, 1, "Correct max value for attack"); - near(release.maxValue, 1, "Correct max value for release"); - } - source.start(0); SimpleTest.executeSoon(function() { source.stop(0); diff --git a/content/media/webaudio/test/test_gainNode.html b/content/media/webaudio/test/test_gainNode.html index ebec5c4ccfb..51545c9e57a 100644 --- a/content/media/webaudio/test/test_gainNode.html +++ b/content/media/webaudio/test/test_gainNode.html @@ -33,13 +33,9 @@ addLoadEvent(function() { ok(gain.gain, "The audioparam member must exist"); is(gain.gain.value, 1.0, "Correct initial value"); is(gain.gain.defaultValue, 1.0, "Correct default value"); - is(gain.gain.minValue, 0, "Correct min value"); - is(gain.gain.maxValue, 1.0, "Correct max value"); gain.gain.value = 0.5; is(gain.gain.value, 0.5, "Correct initial value"); is(gain.gain.defaultValue, 1.0, "Correct default value"); - is(gain.gain.minValue, 0, "Correct min value"); - is(gain.gain.maxValue, 1.0, "Correct max value"); source.start(0); SimpleTest.executeSoon(function() { diff --git a/dom/webidl/AudioParam.webidl b/dom/webidl/AudioParam.webidl index f3094485ce1..38376f592db 100644 --- a/dom/webidl/AudioParam.webidl +++ b/dom/webidl/AudioParam.webidl @@ -14,9 +14,6 @@ interface AudioParam { attribute float value; - // readonly attribute float computedValue; - readonly attribute float minValue; - readonly attribute float maxValue; readonly attribute float defaultValue; // Parameter automation.