Skip to content

Commit

Permalink
docs: add missing + fix docs in wrong place
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 16, 2024
1 parent 22d90e7 commit 61a04d9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/decoder/symphonia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ impl Source for SymphoniaDecoder {
}
}

/// Error returned when the try_seek implementation of the symphonia decoder fails.
#[derive(Debug, thiserror::Error)]
pub enum SeekError {
/// Could not get next packet while refining seek position
Expand All @@ -225,7 +226,7 @@ pub enum SeekError {
}

impl SymphoniaDecoder {
/// note frame offset must be set after
/// Note frame offset must be set after
fn refine_position(&mut self, seek_res: SeekedTo) -> Result<(), source::SeekError> {
let mut samples_to_pass = seek_res.required_ts - seek_res.actual_ts;
let packet = loop {
Expand Down
1 change: 1 addition & 0 deletions src/source/blt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ where
}
}

/// This applies an audio filter, it can be a high or low pass filter.
#[derive(Clone, Debug)]
pub struct BltFilter<I> {
input: I,
Expand Down
7 changes: 5 additions & 2 deletions src/source/channel_volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ where
I: Source,
I::Item: Sample,
{
/// Wrap the input source and make it mono. Play that mono sound to each
/// channel at the volume set by the user. The volume can be changed using
/// [`ChannelVolume::set_volume`].
pub fn new(mut input: I, channel_volumes: Vec<f32>) -> ChannelVolume<I>
where
I: Source,
Expand All @@ -48,8 +51,8 @@ where
}
}

/// Sets the volume for a given channel number. Will panic if channel number
/// was invalid.
/// Sets the volume for a given channel number. Will panic if channel number
/// is invalid.
pub fn set_volume(&mut self, channel: usize, volume: f32) {
self.channel_volumes[channel] = volume;
}
Expand Down
4 changes: 2 additions & 2 deletions src/source/empty_callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use super::SeekError;

/// An empty source which executes a callback function
pub struct EmptyCallback<S> {
#[allow(missing_docs)] // See: https://github.com/RustAudio/rodio/issues/615
pub phantom_data: PhantomData<S>,
#[allow(missing_docs)] // See: https://github.com/RustAudio/rodio/issues/615
pub callback: Box<dyn Send + Fn()>,
}

Expand All @@ -19,9 +21,7 @@ impl<S> EmptyCallback<S> {
/// Detect and do something when the source before this one has ended.
pub fn new(callback: Box<dyn Send + Fn()>) -> EmptyCallback<S> {
EmptyCallback {
#[allow(missing_docs)] // See: https://github.com/RustAudio/rodio/issues/615
phantom_data: PhantomData,
#[allow(missing_docs)] // See: https://github.com/RustAudio/rodio/issues/615
callback,
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/source/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ where
pub enum SeekError {
/// On of the underlying sources does not support seeking
#[error("Seeking is not supported by source: {underlying_source}")]
NotSupported { underlying_source: &'static str },
NotSupported {
/// The source that did not support seek
underlying_source: &'static str
},
#[cfg(feature = "symphonia")]
/// The symphonia decoder ran into an issue
#[error("Error seeking: {0}")]
Expand Down

0 comments on commit 61a04d9

Please sign in to comment.