Expose more AudioParam methods

This commit is contained in:
Fernando Jiménez Moreno 2018-06-29 11:55:45 +02:00
parent 97aa142993
commit 986c2f7842
3 changed files with 35 additions and 3 deletions

View file

@ -19,6 +19,8 @@ pub trait AudioParamImpl: JSTraceable + MallocSizeOf {
fn set_value_at_time(&self, value: f32, start_time: f64);
fn ramp_to_value_at_time(&self, ramp_kind: RampKind, value: f32, end_time: f64);
fn set_target_at_time(&self, value: f32, start_time: f64, time_constant: f32);
fn cancel_scheduled_values(&self, cancel_time: f64);
fn cancel_and_hold_at_time(&self, cancel_time: f64);
}
#[dom_struct]
@ -118,4 +120,14 @@ impl AudioParamMethods for AudioParam {
self.param_impl.set_target_at_time(*target, *start_time, *time_constant);
DomRoot::from_ref(self)
}
fn CancelScheduledValues(&self, cancel_time: Finite<f64>) -> DomRoot<AudioParam> {
self.param_impl.cancel_scheduled_values(*cancel_time);
DomRoot::from_ref(self)
}
fn CancelAndHoldAtTime(&self, cancel_time: Finite<f64>) -> DomRoot<AudioParam> {
self.param_impl.cancel_and_hold_at_time(*cancel_time);
DomRoot::from_ref(self)
}
}