diff --git a/cidre/src/cat/audio/base_types.rs b/cidre/src/cat/audio/base_types.rs index 1241d2da..3b232753 100644 --- a/cidre/src/cat/audio/base_types.rs +++ b/cidre/src/cat/audio/base_types.rs @@ -3,7 +3,7 @@ use std::{ ptr::{slice_from_raw_parts, slice_from_raw_parts_mut}, }; -use crate::{define_opts, os}; +use crate::{define_opts, four_cc_to_str, os}; #[cfg(feature = "ns")] use crate::ns; @@ -164,10 +164,20 @@ impl BufList { /// A four char code indicating the general kind of data in the stream. #[doc(alias = "AudioFromatID")] -#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] +#[derive(Clone, Copy, PartialEq, Eq, Default)] #[repr(transparent)] pub struct Format(pub u32); +impl std::fmt::Debug for Format { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let mut be = self.0.to_be_bytes(); + f.debug_struct("Format") + .field("raw", &self.0) + .field("fcc", &four_cc_to_str(&mut be)) + .finish() + } +} + /// The AudioFormatIDs used to identify individual formats of audio data. impl Format { /// Linear PCM, uses the standard flags.