Hello there DaniWeb!
I am currently trying to implement RtMidi into a project of mine, or i am actually currently trying to make the project, but it is highly in need of RtMidi to succeed. (Or just some other MIDI library, with MIDI I/O)
When i try to initialize RtMidi with this code:
#include <iostream>
#include <cstdlib>
#include "RtMidi.h"
int main()
{
RtMidiIn *midiin = 0;
RtMidiOut *midiout = 0;
// RtMidiIn constructor
try {
midiin = new RtMidiIn();
}
catch ( RtError &error ) {
error.printMessage();
exit( EXIT_FAILURE );
}
// Check inputs.
unsigned int nPorts = midiin->getPortCount();
std::cout << "\nThere are " << nPorts << " MIDI input sources available.\n";
std::string portName;
for ( unsigned int i=0; i<nPorts; i++ ) {
try {
portName = midiin->getPortName(i);
}
catch ( RtError &error ) {
error.printMessage();
goto cleanup;
}
std::cout << " Input Port #" << i+1 << ": " << portName << '\n';
}
// RtMidiOut constructor
try {
midiout = new RtMidiOut();
}
catch ( RtError &error ) {
error.printMessage();
exit( EXIT_FAILURE );
}
// Check outputs.
nPorts = midiout->getPortCount();
std::cout << "\nThere are " << nPorts << " MIDI output ports available.\n";
for ( unsigned int i=0; i<nPorts; i++ ) {
try {
portName = midiout->getPortName(i);
}
catch (RtError &error) {
error.printMessage();
goto cleanup;
}
std::cout << " Output Port #" << i+1 << ": " << portName << '\n';
}
std::cout << '\n';
// Clean up
cleanup:
delete midiin;
delete midiout;
return 0;
}
(Basic example from the RtMidi tutorial) it only initialize the Dummy Mode.
When i then try to edit the
// RtMidiIn constructor
try {
midiin = new RtMidiIn();
}
into
// RtMidiIn constructor
try {
midiin = new RtMidiIn(RtMidi::WINDOWS_MM);
}
it says that the speciefied API isn't available/compiled.
Any ideas?