From e8ba4dc878a44f14e656664fa2e9d0ea362cbc10 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 28 Oct 2018 19:53:50 +0100 Subject: Add `play_audio()` function Create a new function that encapsulates the code we experimented with for playing audio. Clean up what we had and handle errors by passing them back in a `Result`. This allows us to encapsulate, audio playing so we can do it in a single action during mode switching. --- src/errors.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index f7f3d79..3426cac 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,11 +1,13 @@ use chrono; use magic_crypt; +use rodio; use xdg; error_chain! { foreign_links { Io(::std::io::Error); + Rodio(rodio::decoder::DecoderError); Xdg(xdg::BaseDirectoriesError); DateCrypt(DateCryptError); -- cgit v1.2.3