File: testcapi.c

package info (click to toggle)
rtmidi 6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,392 kB
  • sloc: cpp: 5,370; xml: 240; sh: 229; makefile: 92; ansic: 19; java: 16
file content (26 lines) | stat: -rw-r--r-- 667 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#include <stdio.h>
#include "rtmidi_c.h"

/* Test that the C API for RtMidi is working. */

struct RtMidiWrapper *midiin;
struct RtMidiWrapper *midiout;

int main() {
    if ((midiin = rtmidi_in_create_default())) {
        unsigned int ports = rtmidi_get_port_count(midiin);
        printf("MIDI input ports found: %u\n", ports);
        rtmidi_close_port(midiin);
        rtmidi_in_free(midiin);
    }

    if ((midiout = rtmidi_out_create_default())) {
        unsigned int ports = rtmidi_get_port_count(midiout);
        printf("MIDI output ports found: %u\n", ports);
        rtmidi_close_port(midiout);
        rtmidi_out_free(midiout);
    }

    return 0;
}