-
-
Save Pokechu22/19cb535340ffb3b2feea474ac8799fe1 to your computer and use it in GitHub Desktop.
Portmidi test program that works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "portmidi.h" | |
#include <iostream> | |
void writeDevice(PmDeviceID id) { | |
std::cout << "Device #" << id << ":\n"; | |
const PmDeviceInfo* device = Pm_GetDeviceInfo(id); | |
std::cout << "\tstructVersion: " << device->structVersion << "\n"; | |
std::cout << "\tinterf: " << device->interf << "\n"; | |
std::cout << "\tname: " << device->name << "\n"; | |
std::cout << "\tinput: " << device->input << "\n"; | |
std::cout << "\toutput: " << device->output << "\n"; | |
std::cout << "\topened: " << device->opened << "\n"; | |
std::cout << std::endl; | |
} | |
int main() { | |
Pm_Initialize(); | |
int numDev = Pm_CountDevices(); | |
std::cout << "There are " << numDev << " devices" << std::endl; | |
for (int i = 0; i < numDev; i++) { | |
writeDevice(i); | |
} | |
std::cout << "Default in: " << Pm_GetDefaultInputDeviceID() << "\n"; | |
std::cout << "Default out: " << Pm_GetDefaultOutputDeviceID() << std::endl; | |
Pm_Terminate(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output on my pi: