docs: add missing + fix docs in wrong place

This commit is contained in:
github-actions[bot] 2024-09-16 23:45:24 +02:00
parent 22d90e71d8
commit e116660568
No known key found for this signature in database
GPG key ID: F687E89FC7894F98
6 changed files with 16 additions and 8 deletions

View file

@ -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
@ -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 {

View file

@ -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,

View file

@ -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,
@ -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;
}

View file

@ -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()>,
}
@ -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,
}
}

View file

@ -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}")]

View file

@ -4,7 +4,7 @@ use crate::{Sample, Source};
use super::SeekError;
/// This is the same as [`skippable`](crate::source::skippable) see its docs
/// This is the same as [`skippable`](crate::source::skippable) see its docs
pub fn stoppable<I>(source: I) -> Stoppable<I> {
Stoppable {
input: source,
@ -12,7 +12,7 @@ pub fn stoppable<I>(source: I) -> Stoppable<I> {
}
}
/// This is the same as [`Skippable`](crate::source::Skippable) see its docs
/// This is the same as [`Skippable`](crate::source::Skippable) see its docs
#[derive(Clone, Debug)]
pub struct Stoppable<I> {
input: I,