diff options
| author | Teddy Wing | 2018-10-29 00:47:32 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2018-10-29 00:47:32 +0100 | 
| commit | b0c0746c0b1449d0793630376493d9fad1b6f2bd (patch) | |
| tree | 4081f079c2f15fca89662c778f6473a13545ce15 /src | |
| parent | 55df340bd10b2b93f82d35b24d4d4be034b4dba1 (diff) | |
| download | dome-key-map-b0c0746c0b1449d0793630376493d9fad1b6f2bd.tar.bz2 | |
ffi::run_key_action(): Add `PlayAudio` argument
Mirror the `map::run_key_action()` function and add an extra `PlayAudio`
argument, which will control whether audio cues are played when a mode
is activated or deactivated.
The Objective-C code will pass in this value based on the value of a
`Config` setting, which will have come from a command line argument.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ffi.rs | 3 | ||||
| -rw-r--r-- | src/map.rs | 1 | 
2 files changed, 3 insertions, 1 deletions
| @@ -90,6 +90,7 @@ pub extern "C" fn dome_key_state_load_map_group(ptr: *mut State) {  pub extern "C" fn dome_key_run_key_action(      state: *mut State,      trigger: Trigger, +    play_audio: PlayAudio,  ) {      let trigger = unsafe {          assert!(!trigger.buttons.is_null()); @@ -102,7 +103,7 @@ pub extern "C" fn dome_key_run_key_action(          &mut *state      }; -    run_key_action(&mut state, trigger, PlayAudio::No); +    run_key_action(&mut state, trigger, play_audio);  }  #[no_mangle] @@ -6,6 +6,7 @@ use {Action, HeadphoneButton, MapAction, MapKind};  use ffi::State;  use sounds; +#[repr(C)]  pub enum PlayAudio {      Yes,      No, | 
