CoreMIDI bug reporting available ports?
CoreMIDI bug reporting available ports?
- Subject: CoreMIDI bug reporting available ports?
- From: Gary Scavone <email@hidden>
- Date: Sun, 26 Aug 2012 21:12:17 -0400
Perhaps I am misunderstanding something but it appears that CoreMIDI does not correctly report new or closed ports once an application is running. Below is a simple C++ program to return the number of available MIDI sources and destinations. It blocks at the cin.get() function so that you can open or close programs that create ports (or plug or unplug physical devices). I've tried it in 10.7 and 10.8 and the number of sources and destinations is never correctly updated when I make changes to my available MIDI ports after the program is running.
Regards,
--gary
====================================
#include <CoreMIDI/CoreMIDI.h>
#include <iostream>
#include <cstdlib>
int main()
{
int counter = 0;
do {
uint32_t nPorts = MIDIGetNumberOfSources();
std::cout << "# of sources = " << nPorts << std::endl;
nPorts = MIDIGetNumberOfDestinations();
std::cout << "# of destinations = " << nPorts << std::endl;
nPorts = MIDIGetNumberOfDevices();
std::cout << "# of devices = " << nPorts << std::endl;
char input;
std::cout << "hit <return>" << std::endl;
std::cin.get(input);
counter++;
} while ( counter < 5 );
return 0;
}
====================================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden