Merge pull request #128 from tomaka/sink-stop

Add Sink::stop()
This commit is contained in:
tomaka 2017-07-11 17:10:26 +02:00 committed by GitHub
commit 59bd1f66f7
2 changed files with 7 additions and 1 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "rodio"
version = "0.5.0"
version = "0.5.1"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
license = "Apache-2.0"
description = "Audio playback library"

View file

@ -116,6 +116,12 @@ impl Sink {
self.pause.load(Ordering::SeqCst)
}
/// Stops the sink by emptying the queue.
#[inline]
pub fn stop(&self) {
self.stopped.store(true, Ordering::SeqCst);
}
/// Destroys the sink without stopping the sounds that are still playing.
#[inline]
pub fn detach(mut self) {