Exemple #1
0
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()
Exemple #2
0
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)"
Exemple #3
0
def get_count():
    """ gets the number of devices.
        Device ids range from 0 to get_count() -1
    """
    return pypm.CountDevices()
Exemple #4
0
def get_devices():
    for i in range(pypm.CountDevices()):
        yield pypm.GetDeviceInfo(i)