Example #1
0
def quit():
    """ Call this to quit the midi module.

        Called automatically atexit if you don't call it.
    """
    global _init, pypm
    if _init:
        # TODO: find all Input and Output classes and close them first?
        pypm.Terminate()
        _init = False
        del pypm
        del pygame.pypm
Example #2
0
def quit():  # pylint: disable=redefined-builtin
    """uninitialize the midi module
    pygame.midi.quit(): return None


    Called automatically atexit if you don't call it.

    It is safe to call this function more than once.
    """
    if _module_init():
        # TODO: find all Input and Output classes and close them first?
        _pypm.Terminate()
        _module_init(False)
Example #3
0
    def __init__(self, input_device=None, output_device=None):
        pypm.Terminate(
        )  #restart pypm--so that users can try to reattach a vMeter if it was disconnected
        pypm.Initialize()

        self._in = None
        self._out = None
        self.connect(input_device, output_device)

        # controller mappings
        # TODO: update from read_settings()
        self.ctrl_out_on_off = 17
        self.ctrl_out_pressure = 18
        self.ctrl_out_touch_pos = 20
        self.ctrl_in_light = 20
        self.ctrl_in_brightness = 21

        self.handlers = {}