use crate::bind;
#[derive(Debug, Clone, Copy)]
#[non_exhaustive]
pub enum PowerLevel {
Unknown,
Empty,
Low,
Medium,
Full,
Wired,
}
impl From<bind::SDL_JoystickPowerLevel> for PowerLevel {
fn from(raw: bind::SDL_JoystickPowerLevel) -> Self {
match raw {
bind::SDL_JOYSTICK_POWER_EMPTY => PowerLevel::Empty,
bind::SDL_JOYSTICK_POWER_LOW => PowerLevel::Low,
bind::SDL_JOYSTICK_POWER_MEDIUM => PowerLevel::Medium,
bind::SDL_JOYSTICK_POWER_FULL => PowerLevel::Full,
bind::SDL_JOYSTICK_POWER_WIRED => PowerLevel::Wired,
_ => PowerLevel::Unknown,
}
}
}