How to use the mido.backends.portmidi_init.lib.Pm_GetErrorText function in mido

To help you get started, we’ve selected a few mido examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mido / mido / mido / backends / portmidi.py View on Github external
def _check_error(return_value):
    """Raise IOError if return_value < 0.

    The exception will be raised with the error message from PortMidi.
    """
    if return_value < 0:
        raise IOError(pm.lib.Pm_GetErrorText(return_value))
github mido / mido / mido / backends / portmidi.py View on Github external
def _check_error(return_value):
    """Raise IOError if return_value < 0.

    The exception will be raised with the error message from PortMidi.
    """
    if return_value == pm.pmHostError:
        raise IOError('PortMidi Host Error: '
                      '{}'.format(pm.get_host_error_message()))
    elif return_value < 0:
        raise IOError(pm.lib.Pm_GetErrorText(return_value))