avm2: Stub `SoundChannel.position`.
This also comes with an ignored test for `position`, because I originally believed this to be implementable.
This commit is contained in:
parent
4e77f89e0f
commit
6b7609ff4e
|
@ -49,6 +49,15 @@ pub fn right_peak<'gc>(
|
|||
Err("Sound.rightPeak is a stub.".into())
|
||||
}
|
||||
|
||||
/// Impl `SoundChannel.position`
|
||||
pub fn position<'gc>(
|
||||
_activation: &mut Activation<'_, 'gc, '_>,
|
||||
_this: Option<Object<'gc>>,
|
||||
_args: &[Value<'gc>],
|
||||
) -> Result<Value<'gc>, Error> {
|
||||
Err("Sound.position is a stub.".into())
|
||||
}
|
||||
|
||||
/// Construct `SoundChannel`'s class.
|
||||
pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>> {
|
||||
let class = Class::new(
|
||||
|
@ -71,6 +80,7 @@ pub fn create_class<'gc>(mc: MutationContext<'gc, '_>) -> GcCell<'gc, Class<'gc>
|
|||
)] = &[
|
||||
("leftPeak", Some(left_peak), None),
|
||||
("rightPeak", Some(right_peak), None),
|
||||
("position", Some(position), None),
|
||||
];
|
||||
write.define_public_builtin_instance_properties(mc, PUBLIC_INSTANCE_PROPERTIES);
|
||||
|
||||
|
|
|
@ -659,6 +659,7 @@ swf_tests! {
|
|||
(as3_simplebutton_soundtransform, "avm2/simplebutton_soundtransform", 49),
|
||||
(as3_soundmixer_soundtransform, "avm2/soundmixer_soundtransform", 49),
|
||||
(as3_sound_play, "avm2/sound_play", 1),
|
||||
#[ignore] (as3_soundchannel_position, "avm2/soundchannel_position", 75),
|
||||
}
|
||||
|
||||
// TODO: These tests have some inaccuracies currently, so we use approx_eq to test that numeric values are close enough.
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,136 @@
|
|||
Attempting to launch and connect to Player using URL I:\Code\ruffle\tests\tests\swfs\avm2\soundchannel_position\test.swf
|
||||
[SWF] I:\Code\ruffle\tests\tests\swfs\avm2\soundchannel_position\test.swf - 31029 bytes after decompression
|
||||
///var silence = new Silence();
|
||||
///var silence_channel = silence.play();
|
||||
///silence_channel.position
|
||||
0
|
||||
///silence_channel.position
|
||||
0
|
||||
///silence_channel.position
|
||||
23.219954648526077
|
||||
///silence_channel.position
|
||||
92.87981859410431
|
||||
///silence_channel.position
|
||||
116.09977324263038
|
||||
///silence_channel.position
|
||||
162.53968253968253
|
||||
///silence_channel.position
|
||||
208.9795918367347
|
||||
///silence_channel.position
|
||||
255.41950113378684
|
||||
///silence_channel.position
|
||||
278.6394557823129
|
||||
///silence_channel.position
|
||||
325.07936507936506
|
||||
///silence_channel.position
|
||||
348.29931972789115
|
||||
///silence_channel.position
|
||||
394.7392290249433
|
||||
///silence_channel.position
|
||||
441.1791383219954
|
||||
///silence_channel.position
|
||||
487.6190476190476
|
||||
///silence_channel.position
|
||||
534.0589569160998
|
||||
///silence_channel.position
|
||||
580.4988662131519
|
||||
///silence_channel.position
|
||||
603.718820861678
|
||||
///silence_channel.position
|
||||
650.1587301587301
|
||||
///silence_channel.position
|
||||
673.3786848072563
|
||||
///silence_channel.position
|
||||
743.0385487528345
|
||||
///silence_channel.position
|
||||
766.2585034013605
|
||||
///silence_channel.position
|
||||
812.6984126984127
|
||||
///silence_channel.position
|
||||
859.1383219954648
|
||||
///silence_channel.position
|
||||
905.578231292517
|
||||
///silence_channel.position
|
||||
928.798185941043
|
||||
///silence_channel.position
|
||||
975.2380952380952
|
||||
///silence_channel.position
|
||||
1021.6780045351474
|
||||
///silence_channel.position
|
||||
1044.8979591836735
|
||||
///silence_channel.position
|
||||
1044.8979591836735
|
||||
///silence_channel.position
|
||||
1044.8979591836735
|
||||
///silence_channel.position
|
||||
1044.8979591836735
|
||||
///silence_channel.position
|
||||
1044.8979591836735
|
||||
///silence_channel.position
|
||||
1044.8979591836735
|
||||
///var lofisilence = new LofiSilence();
|
||||
///var lofisilence_channel = lofisilence.play();
|
||||
///lofisilence_channel.position
|
||||
0
|
||||
///lofisilence_channel.position
|
||||
69.65986394557822
|
||||
///lofisilence_channel.position
|
||||
92.87981859410431
|
||||
///lofisilence_channel.position
|
||||
139.31972789115645
|
||||
///lofisilence_channel.position
|
||||
185.75963718820861
|
||||
///lofisilence_channel.position
|
||||
208.9795918367347
|
||||
///lofisilence_channel.position
|
||||
255.41950113378684
|
||||
///lofisilence_channel.position
|
||||
301.859410430839
|
||||
///lofisilence_channel.position
|
||||
348.29931972789115
|
||||
///lofisilence_channel.position
|
||||
394.7392290249433
|
||||
///lofisilence_channel.position
|
||||
417.9591836734694
|
||||
///lofisilence_channel.position
|
||||
464.3990929705215
|
||||
///lofisilence_channel.position
|
||||
510.8390022675737
|
||||
///lofisilence_channel.position
|
||||
557.2789115646258
|
||||
///lofisilence_channel.position
|
||||
580.4988662131519
|
||||
///lofisilence_channel.position
|
||||
626.9387755102041
|
||||
///lofisilence_channel.position
|
||||
673.3786848072563
|
||||
///lofisilence_channel.position
|
||||
719.8185941043083
|
||||
///lofisilence_channel.position
|
||||
766.2585034013605
|
||||
///lofisilence_channel.position
|
||||
812.6984126984127
|
||||
///lofisilence_channel.position
|
||||
835.9183673469388
|
||||
///lofisilence_channel.position
|
||||
882.3582766439908
|
||||
///lofisilence_channel.position
|
||||
928.798185941043
|
||||
///lofisilence_channel.position
|
||||
975.2380952380952
|
||||
///lofisilence_channel.position
|
||||
998.4580498866213
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
||||
///lofisilence_channel.position
|
||||
1044.8979591836735
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue