X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/54fc21708c9121409560731f90b91e59699f4ddc..2fb25de49daca6ddff6f5af13bcf7c314aafafb3:/m17app/src/soundcard.rs?ds=inline diff --git a/m17app/src/soundcard.rs b/m17app/src/soundcard.rs index 3914632..f89d9f4 100644 --- a/m17app/src/soundcard.rs +++ b/m17app/src/soundcard.rs @@ -12,7 +12,7 @@ use cpal::{ }; use crate::{ - error::M17Error, + error::{M17Error, SoundmodemError}, soundmodem::{InputSource, OutputBuffer, OutputSink, SoundmodemEvent}, }; @@ -118,12 +118,12 @@ pub struct SoundcardInputSource { } impl InputSource for SoundcardInputSource { - fn start(&self, samples: SyncSender) { - let _ = self.event_tx.send(SoundcardEvent::StartInput { samples }); + fn start(&self, samples: SyncSender) -> Result<(), SoundmodemError> { + Ok(self.event_tx.send(SoundcardEvent::StartInput { samples })?) } - fn close(&self) { - let _ = self.event_tx.send(SoundcardEvent::CloseInput); + fn close(&self) -> Result<(), SoundmodemError> { + Ok(self.event_tx.send(SoundcardEvent::CloseInput)?) } } @@ -132,14 +132,18 @@ pub struct SoundcardOutputSink { } impl OutputSink for SoundcardOutputSink { - fn start(&self, event_tx: SyncSender, buffer: Arc>) { - let _ = self + fn start( + &self, + event_tx: SyncSender, + buffer: Arc>, + ) -> Result<(), SoundmodemError> { + Ok(self .event_tx - .send(SoundcardEvent::StartOutput { event_tx, buffer }); + .send(SoundcardEvent::StartOutput { event_tx, buffer })?) } - fn close(&self) { - let _ = self.event_tx.send(SoundcardEvent::CloseOutput); + fn close(&self) -> Result<(), SoundmodemError> { + Ok(self.event_tx.send(SoundcardEvent::CloseOutput)?) } }