def get_count(): """gets the number of devices. pygame.midi.get_count(): return num_devices Device ids range from 0 to get_count() -1 """ _check_init() return _pypm.CountDevices()
def print_devices(InOrOut): for loop in range(pypm.CountDevices()): interf, name, inp, outp, opened = pypm.GetDeviceInfo(loop) if ((InOrOut == INPUT) & (inp == 1) | (InOrOut == OUTPUT) & (outp == 1)): print loop, name, " ", if (inp == 1): print "(input) ", else: print "(output) ", if (opened == 1): print "(opened)" else: print "(unopened)"
def get_count(): """ gets the number of devices. Device ids range from 0 to get_count() -1 """ return pypm.CountDevices()
def get_devices(): for i in range(pypm.CountDevices()): yield pypm.GetDeviceInfo(i)