Skip to content

Commit 5047d46

Browse files
committed
Add documentation to AudioNode methods and AudioContextRegistration
1 parent 8a90410 commit 5047d46

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/context/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ impl From<u8> for AudioContextState {
8585

8686
/// Handle of the [`AudioNode`](crate::node::AudioNode) to its associated [`BaseAudioContext`].
8787
///
88-
/// This allows for communication with the render thread and lifetime management.
88+
/// Only when implementing the AudioNode trait manually, this struct is of any concern.
89+
///
90+
/// This object allows for communication with the render thread and dynamic lifetime management.
8991
//
9092
// The only way to construct this object is by calling [`BaseAudioContext::register`]
9193
pub struct AudioContextRegistration {

src/node/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl Default for AudioNodeOptions {
138138

139139
/// Config for up/down-mixing of input channels for audio nodes
140140
///
141-
/// Only when implementing the [`AudioNode`] trait manually, is this struct of any concern. The
141+
/// Only when implementing the [`AudioNode`] trait manually, this struct is of any concern. The
142142
/// methods `set_channel_count`, `set_channel_count_mode` and `set_channel_interpretation` from the
143143
/// audio node interface will use this struct to sync the required info to the render thread.
144144
///
@@ -284,8 +284,14 @@ impl From<AudioNodeOptions> for ChannelConfig {
284284
/// Note that the AudioNode is typically constructed together with an `AudioWorkletProcessor`
285285
/// (the object that lives the render thread). See the [`crate::worklet`] mod.
286286
pub trait AudioNode {
287+
/// Handle of the associated [`BaseAudioContext`](crate::context::BaseAudioContext).
288+
///
289+
/// Only when implementing the AudioNode trait manually, this struct is of any concern.
287290
fn registration(&self) -> &AudioContextRegistration;
288291

292+
/// Config for up/down-mixing of input channels for this node.
293+
///
294+
/// Only when implementing the [`AudioNode`] trait manually, this struct is of any concern.
289295
fn channel_config(&self) -> &ChannelConfig;
290296

291297
/// The [`BaseAudioContext`](crate::context::BaseAudioContext) concrete type which owns this

0 commit comments

Comments
 (0)