summaryrefslogtreecommitdiff
path: root/example3.c
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-10-07 17:41:54 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-10-07 17:41:54 +0200
commit1eeba03da0222a117054eca53e7be8ee1e8bd970 (patch)
treee2afe1a9361bba0d7a979e6905f49143347b221e /example3.c
parent988f5d2b5343850e19ad1512cefe6c53953aa02e (diff)
downloadttdaw-1eeba03da0222a117054eca53e7be8ee1e8bd970.tar.gz
Added ALSA MIDI example
Diffstat (limited to 'example3.c')
-rw-r--r--example3.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/example3.c b/example3.c
index 9dea995..a2103f2 100644
--- a/example3.c
+++ b/example3.c
@@ -20,12 +20,12 @@ int main() {
}
/* // Open a MIDI input device */
- /* stream = Pm_OpenInput(&err, NULL, NULL, NUM_INPUTS, NULL, 0); */
- /* if (err != pmNoError) { */
- /* fprintf(stderr, "Error opening MIDI input device: %s\n", Pm_GetErrorText(err)); */
- /* Pm_Terminate(); */
- /* exit(1); */
- /* } */
+ stream = (PortMidiStream *)Pm_OpenInput(&err, NULL, NULL, NUM_INPUTS, NULL, 0);
+ if (err != pmNoError) {
+ fprintf(stderr, "Error opening MIDI input device: %s\n", Pm_GetErrorText(err));
+ Pm_Terminate();
+ exit(1);
+ }
/* // Read MIDI messages from the input device */
/* while (1) { */
@@ -43,7 +43,7 @@ int main() {
/* } */
/* // Close the MIDI input device */
- /* Pm_Close(stream); */
+ Pm_Close(stream);
// Terminate PortMIDI
Pm_Terminate();