mirror of
https://github.com/RustAudio/rodio
synced 2024-12-13 13:42:34 +00:00
Merge pull request #97 from tomaka/pauseable
Rename Pauseable to Pausable
This commit is contained in:
commit
e1eb0c1379
3 changed files with 9 additions and 9 deletions
|
@ -50,7 +50,7 @@ impl Sink {
|
|||
S::Item: Sample,
|
||||
S::Item: Send
|
||||
{
|
||||
let source = source::Pauseable::new(source, self.pause.clone(), 5);
|
||||
let source = source::Pausable::new(source, self.pause.clone(), 5);
|
||||
let source = source::Stoppable::new(source, self.stopped.clone(), 5);
|
||||
let source = source::VolumeFilter::new(source, self.volume.clone(), 5);
|
||||
let source = source::SamplesConverter::new(source);
|
||||
|
|
|
@ -8,7 +8,7 @@ pub use self::delay::Delay;
|
|||
pub use self::empty::Empty;
|
||||
pub use self::fadein::FadeIn;
|
||||
pub use self::mix::Mix;
|
||||
pub use self::pauseable::Pauseable;
|
||||
pub use self::pausable::Pausable;
|
||||
pub use self::repeat::Repeat;
|
||||
pub use self::samples_converter::SamplesConverter;
|
||||
pub use self::sine::SineWave;
|
||||
|
@ -25,7 +25,7 @@ mod delay;
|
|||
mod empty;
|
||||
mod fadein;
|
||||
mod mix;
|
||||
mod pauseable;
|
||||
mod pausable;
|
||||
mod repeat;
|
||||
mod samples_converter;
|
||||
mod sine;
|
||||
|
|
|
@ -7,7 +7,7 @@ use Source;
|
|||
|
||||
/// Filter that allows another thread to pause the stream.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Pauseable<I>
|
||||
pub struct Pausable<I>
|
||||
where I: Source,
|
||||
I::Item: Sample
|
||||
{
|
||||
|
@ -26,14 +26,14 @@ pub struct Pauseable<I>
|
|||
samples_until_update: u32,
|
||||
}
|
||||
|
||||
impl<I> Pauseable<I>
|
||||
impl<I> Pausable<I>
|
||||
where I: Source,
|
||||
I::Item: Sample
|
||||
{
|
||||
pub fn new(source: I, remote_paused: Arc<AtomicBool>, update_ms: u32) -> Pauseable<I> {
|
||||
pub fn new(source: I, remote_paused: Arc<AtomicBool>, update_ms: u32) -> Pausable<I> {
|
||||
// TODO: handle the fact that the samples rate can change
|
||||
let update_frequency = (update_ms * source.get_samples_rate()) / 1000;
|
||||
Pauseable {
|
||||
Pausable {
|
||||
input: source,
|
||||
local_paused: remote_paused.load(Ordering::Relaxed),
|
||||
remote_paused: remote_paused,
|
||||
|
@ -43,7 +43,7 @@ impl<I> Pauseable<I>
|
|||
}
|
||||
}
|
||||
|
||||
impl<I> Iterator for Pauseable<I>
|
||||
impl<I> Iterator for Pausable<I>
|
||||
where I: Source,
|
||||
I::Item: Sample
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ impl<I> Iterator for Pauseable<I>
|
|||
}
|
||||
}
|
||||
|
||||
impl<I> Source for Pauseable<I>
|
||||
impl<I> Source for Pausable<I>
|
||||
where I: Source,
|
||||
I::Item: Sample
|
||||
{
|
Loading…
Reference in a new issue