mirror of
https://github.com/RustAudio/rodio
synced 2024-11-10 06:04:16 +00:00
docs: add missing + fix docs in wrong place
This commit is contained in:
parent
22d90e71d8
commit
e116660568
6 changed files with 16 additions and 8 deletions
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
@ -49,7 +52,7 @@ where
|
|||
}
|
||||
|
||||
/// Sets the volume for a given channel number. Will panic if channel number
|
||||
/// was invalid.
|
||||
/// is invalid.
|
||||
pub fn set_volume(&mut self, channel: usize, volume: f32) {
|
||||
self.channel_volumes[channel] = volume;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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}")]
|
||||
|
|
Loading…
Reference in a new issue