MCPcopy Create free account
hub / github.com/celtera/libremidi / main

Function main

examples/midi2_interop.cpp:334–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332};
333
334int main()
335try
336{
337#if defined(_WIN32) && __has_include(<winrt/base.h>)
338 // Necessary for using WinUWP and WinMIDI, must be done as early as possible in your main()
339 winrt::init_apartment();
340#endif
341
342 midi_ci_processor processor;
343
344 processor.open();
345 midi::muid_t my_muid = rand() % 0xFFFFEFF;
346 std::cerr << "muid: " << my_muid << "\n";
347 midi::ci::identity_t id{
348 .manufacturer = midi::manufacturer::atari,
349 .family = 0x0102,
350 .model = 0x0304,
351 .revision = 0x00000506};
352
353 for (;;)
354 {
355 // 128 minimum, 512 for property exchange as per MIDI-CI v1.2 5.5.3
356 auto inquiry = midi::ci::make_discovery_inquiry(my_muid, id, 0x02, 512);
357
358 processor.midiout.send_ump(inquiry);
359 sleep(2);
360 }
361
362 char input;
363 std::cin.get(input);
364}
365catch (const std::exception& error)
366{
367 std::cerr << error.what() << std::endl;
368 return EXIT_FAILURE;
369}

Callers

nothing calls this directly

Calls 3

openMethod · 0.80
send_umpMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected