Skip to content

Commit

Permalink
Added API support for disabling auto lock and crank sound
Browse files Browse the repository at this point in the history
  • Loading branch information
FloppyDisck committed Oct 1, 2023
1 parent d4a2fe1 commit b48dca5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ impl System {
pd_func_caller!((*self.0).getCrankChange,)
}

pub fn set_crank_sound_disabled(&self, disable: bool) -> Result<bool, Error> {
let last = pd_func_caller!((*self.0).setCrankSoundsDisabled, disable as i32)?;
Ok(last != 0)
}

pub fn set_auto_lock_disabled(&self, disable: bool) -> Result<(), Error> {
pd_func_caller!((*self.0).setAutoLockDisabled, disable as i32)
}

pub fn log_to_console(text: &str) {
unsafe {
if SYSTEM.0 != ptr::null_mut() {
Expand Down

0 comments on commit b48dca5

Please sign in to comment.