use bitflags::bitflags;
bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(
feature = "quickcheck",
derive(::quickcheck_richderive::Arbitrary),
quickcheck(arbitrary = "crate::quickcheck_helpers::coded::track_disposition")
)]
pub struct TrackDisposition: u32 {
const DEFAULT = 0x0000_0001;
const DUB = 0x0000_0002;
const ORIGINAL = 0x0000_0004;
const COMMENT = 0x0000_0008;
const LYRICS = 0x0000_0010;
const KARAOKE = 0x0000_0020;
const FORCED = 0x0000_0040;
const HEARING_IMPAIRED = 0x0000_0080;
const VISUAL_IMPAIRED = 0x0000_0100;
const CLEAN_EFFECTS = 0x0000_0200;
const ATTACHED_PIC = 0x0000_0400;
const TIMED_THUMBNAILS = 0x0000_0800;
const NON_DIEGETIC = 0x0000_1000;
const CAPTIONS = 0x0001_0000;
const DESCRIPTIONS = 0x0002_0000;
const METADATA = 0x0004_0000;
const DEPENDENT = 0x0008_0000;
const STILL_IMAGE = 0x0010_0000;
}
}
impl TrackDisposition {
#[inline]
pub const fn new() -> Self {
Self::empty()
}
}
impl Default for TrackDisposition {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl TrackDisposition {
#[inline]
pub const fn to_u32(self) -> u32 {
self.bits()
}
#[inline]
pub const fn from_u32(v: u32) -> Self {
Self::from_bits_retain(v)
}
}
#[cfg(test)]
mod tests;