Skip to content

Commit

Permalink
Rename io_s24 to io_i32_s24
Browse files Browse the repository at this point in the history
  • Loading branch information
diwic committed Oct 24, 2024
1 parent 604dd3c commit 4c6d3af
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,16 @@ impl PCM {
pub fn io_u8(&self) -> Result<IO<u8>> { self.io_checked() }
pub fn io_i16(&self) -> Result<IO<i16>> { self.io_checked() }
pub fn io_u16(&self) -> Result<IO<u16>> { self.io_checked() }
pub fn io_s24(&self) -> Result<IO<i32>> { self.verify_format(Format::s24()).map(|_| IO::new(self)) }
pub fn io_i32(&self) -> Result<IO<i32>> { self.io_checked() }
pub fn io_u32(&self) -> Result<IO<u32>> { self.io_checked() }
pub fn io_f32(&self) -> Result<IO<f32>> { self.io_checked() }
pub fn io_f64(&self) -> Result<IO<f64>> { self.io_checked() }

/// For the `s24` format, represented by i32
pub fn io_i32_s24(&self) -> Result<IO<i32>> { self.verify_format(Format::s24()).map(|_| IO::new(self)) }
/// For the `u24` format, represented by u32
pub fn io_u32_u24(&self) -> Result<IO<u32>> { self.verify_format(Format::u24()).map(|_| IO::new(self)) }

pub fn io_checked<S: IoFormat>(&self) -> Result<IO<S>> {
self.verify_format(S::FORMAT).map(|_| IO::new(self))
}
Expand Down Expand Up @@ -1237,7 +1241,7 @@ fn open_s24() {
hwp.set_access(Access::RWInterleaved).unwrap();
pcm.hw_params(&hwp).unwrap();
assert_eq!(Format::s24().physical_width(), Ok(32));
let _io = pcm.io_s24().unwrap();
let _io = pcm.io_i32_s24().unwrap();
}

#[test]
Expand Down

0 comments on commit 4c6d3af

Please sign in to comment.