mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 879014 - Part 1: Implement the alternate enum values for PannerNode; r=roc
This commit is contained in:
parent
b867c07c1b
commit
5e015adfe7
@ -68,6 +68,9 @@ public:
|
||||
case PanningModelType::HRTF:
|
||||
mPanningModelFunction = &PannerNodeEngine::HRTFPanningFunction;
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("We should never see the alternate names here");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PannerNode::DISTANCE_MODEL:
|
||||
@ -82,6 +85,9 @@ public:
|
||||
case DistanceModelType::Exponential:
|
||||
mDistanceModelFunction = &PannerNodeEngine::ExponentialGainFunction;
|
||||
break;
|
||||
default:
|
||||
NS_NOTREACHED("We should never see the alternate names here");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -42,6 +42,15 @@ public:
|
||||
}
|
||||
void SetPanningModel(PanningModelType aPanningModel)
|
||||
{
|
||||
// Handle the alternate enum values
|
||||
switch (aPanningModel) {
|
||||
case PanningModelType::_0: aPanningModel = PanningModelType::Equalpower; break;
|
||||
case PanningModelType::_1: aPanningModel = PanningModelType::HRTF; break;
|
||||
default:
|
||||
// Shut up the compiler warning
|
||||
break;
|
||||
}
|
||||
|
||||
mPanningModel = aPanningModel;
|
||||
SendInt32ParameterToStream(PANNING_MODEL, int32_t(mPanningModel));
|
||||
}
|
||||
@ -52,6 +61,16 @@ public:
|
||||
}
|
||||
void SetDistanceModel(DistanceModelType aDistanceModel)
|
||||
{
|
||||
// Handle the alternate enum values
|
||||
switch (aDistanceModel) {
|
||||
case DistanceModelType::_0: aDistanceModel = DistanceModelType::Linear; break;
|
||||
case DistanceModelType::_1: aDistanceModel = DistanceModelType::Inverse; break;
|
||||
case DistanceModelType::_2: aDistanceModel = DistanceModelType::Exponential; break;
|
||||
default:
|
||||
// Shut up the compiler warning
|
||||
break;
|
||||
}
|
||||
|
||||
mDistanceModel = aDistanceModel;
|
||||
SendInt32ParameterToStream(DISTANCE_MODEL, int32_t(mDistanceModel));
|
||||
}
|
||||
|
@ -47,6 +47,17 @@ addLoadEvent(function() {
|
||||
is(panner.channelCountMode, "clamped-max", "Correct channelCountMode for the panner node");
|
||||
is(panner.channelInterpretation, "speakers", "Correct channelCountInterpretation for the panner node");
|
||||
|
||||
panner.panningModel = panner.EQUALPOWER;
|
||||
is(panner.panningModel, "equalpower", "Correct alternate panningModel enum value");
|
||||
panner.panningModel = panner.HRTF;
|
||||
is(panner.panningModel, "HRTF", "Correct alternate panningModel enum value");
|
||||
panner.distanceModel = panner.LINEAR_DISTANCE;
|
||||
is(panner.distanceModel, "linear", "Correct alternate distanceModel enum value");
|
||||
panner.distanceModel = panner.INVERSE_DISTANCE;
|
||||
is(panner.distanceModel, "inverse", "Correct alternate distanceModel enum value");
|
||||
panner.distanceModel = panner.EXPONENTIAL_DISTANCE;
|
||||
is(panner.distanceModel, "exponential", "Correct alternate distanceModel enum value");
|
||||
|
||||
panner.setPosition(1, 1, 1);
|
||||
panner.setOrientation(1, 1, 1);
|
||||
panner.setVelocity(1, 1, 1);
|
||||
|
@ -11,11 +11,17 @@
|
||||
*/
|
||||
|
||||
enum PanningModelType {
|
||||
// Hack: Use numbers to support alternate enum values
|
||||
"0", "1",
|
||||
|
||||
"equalpower",
|
||||
"HRTF"
|
||||
};
|
||||
|
||||
enum DistanceModelType {
|
||||
// Hack: Use numbers to support alternate enum values
|
||||
"0", "1", "2",
|
||||
|
||||
"linear",
|
||||
"inverse",
|
||||
"exponential"
|
||||
@ -45,3 +51,17 @@ interface PannerNode : AudioNode {
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* The origin of this IDL file is
|
||||
* https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AlternateNames
|
||||
*/
|
||||
[PrefControlled]
|
||||
partial interface PannerNode {
|
||||
const unsigned short EQUALPOWER = 0;
|
||||
const unsigned short HRTF = 1;
|
||||
|
||||
const unsigned short LINEAR_DISTANCE = 0;
|
||||
const unsigned short INVERSE_DISTANCE = 1;
|
||||
const unsigned short EXPONENTIAL_DISTANCE = 2;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user