Skip to content

Commit 4ff4ed0

Browse files
authored
Add support for send_events_u32 to clib (#115)
1 parent ad2bbb2 commit 4ff4ed0

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["core", "clib", "soundfonts", "realtime", "render", "kdmapi"]
44

55
[workspace.package]
6-
version = "0.3.2"
6+
version = "0.3.3"
77
license = "LGPL-3.0"
88
edition = "2021"
99
homepage = "https://github.com/BlackMIDIDevs/xsynth"
@@ -24,6 +24,6 @@ inherits = "release"
2424
debug = true
2525

2626
[workspace.dependencies]
27-
xsynth-core = { version = "0.3.2", path = "core" }
28-
xsynth-realtime = { version = "0.3.2", path = "realtime" }
29-
xsynth-soundfonts = { version = "0.3.2", path = "soundfonts" }
27+
xsynth-core = { version = "0.3.3", path = "core" }
28+
xsynth-realtime = { version = "0.3.3", path = "realtime" }
29+
xsynth-soundfonts = { version = "0.3.3", path = "soundfonts" }

clib/src/realtime.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ pub extern "C" fn XSynth_Realtime_Create(config: XSynth_RealtimeConfig) -> XSynt
8484
XSynth_RealtimeSynth::from(new)
8585
}
8686

87+
/// Sends an raw u32 event to the desired realtime synth instance.
88+
///
89+
/// --Parameters--
90+
/// - handle: The handle of the realtime synthesizer instance
91+
/// - event: The raw u32 event to be sent
92+
#[no_mangle]
93+
pub extern "C" fn XSynth_Realtime_SendEventU32(handle: XSynth_RealtimeSynth, event: u32) {
94+
handle.as_mut().send_event_u32(event);
95+
}
96+
8797
/// Sends an audio event to a specific channel of the desired realtime synth instance.
8898
///
8999
/// --Parameters--

realtime/src/realtime_synth.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ impl RealtimeSynth {
295295
data.event_senders.send_event(event);
296296
}
297297

298+
/// Sends a u32 event to the realtime synthesizer.
299+
pub fn send_event_u32(&mut self, event: u32) {
300+
let data = self.data.as_mut().unwrap();
301+
data.event_senders.send_event_u32(event);
302+
}
303+
298304
/// Returns a reference to the event sender of the realtime synthesizer.
299305
/// This can be used to clone the sender so it can be passed in threads.
300306
///

0 commit comments

Comments
 (0)