use bitflags::bitflags;
pub use spa_sys::spa_fraction as Fraction;
pub use spa_sys::spa_rectangle as Rectangle;
use crate::pod::CanonicalFixedSizedPod;
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Id(pub u32);
#[derive(Debug, Copy, Clone, PartialEq)]
#[repr(transparent)]
pub struct Fd(pub i64);
#[derive(Debug, PartialEq, Clone)]
pub struct Choice<T: CanonicalFixedSizedPod>(pub ChoiceFlags, pub ChoiceEnum<T>);
bitflags! {
pub struct ChoiceFlags: u32 {
#[doc(hidden)]
const _FAKE = 1;
}
}
#[derive(Debug, PartialEq, Clone)]
pub enum ChoiceEnum<T: CanonicalFixedSizedPod> {
None(T),
Range {
default: T,
min: T,
max: T,
},
Step {
default: T,
min: T,
max: T,
step: T,
},
Enum {
default: T,
alternatives: Vec<T>,
},
Flags {
default: T,
flags: Vec<T>,
},
}