summaryrefslogtreecommitdiffstats
path: root/third_party/rust/coremidi-sys/examples
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/coremidi-sys/examples')
-rw-r--r--third_party/rust/coremidi-sys/examples/print_midi_device_count.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/third_party/rust/coremidi-sys/examples/print_midi_device_count.rs b/third_party/rust/coremidi-sys/examples/print_midi_device_count.rs
new file mode 100644
index 0000000000..fe88d8994f
--- /dev/null
+++ b/third_party/rust/coremidi-sys/examples/print_midi_device_count.rs
@@ -0,0 +1,10 @@
+extern crate coremidi_sys as cm;
+
+fn main()
+{
+ let src: u64 = unsafe { cm::MIDIGetNumberOfSources() };
+ let dest: u64 = unsafe { cm::MIDIGetNumberOfDestinations() };
+
+ println!("Number of MIDI sources: {}", src);
+ println!("Number of MIDI destinations: {}", dest);
+}