Skip to content

Commit cb48a43

Browse files
committed
Experiment: derive Clone for AudioParam, could help the node bindings
1 parent 74b58e0 commit cb48a43

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/param.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,9 @@ impl AudioParamEventTimeline {
201201
}
202202

203203
/// AudioParam controls an individual aspect of an AudioNode's functionality, such as volume.
204+
#[derive(Clone)]
204205
pub struct AudioParam {
205-
registration: AudioContextRegistration,
206+
registration: Arc<AudioContextRegistration>,
206207
raw_parts: AudioParamRaw,
207208
}
208209

@@ -558,7 +559,7 @@ impl AudioParam {
558559
raw_parts: AudioParamRaw,
559560
) -> Self {
560561
Self {
561-
registration,
562+
registration: registration.into(),
562563
raw_parts,
563564
}
564565
}
@@ -1602,7 +1603,7 @@ pub(crate) fn audio_param_pair(
16021603
let shared_parts = Arc::new(AudioParamShared::new(default_value, automation_rate));
16031604

16041605
let param = AudioParam {
1605-
registration,
1606+
registration: registration.into(),
16061607
raw_parts: AudioParamRaw {
16071608
default_value,
16081609
max_value,

0 commit comments

Comments
 (0)