(self, stop_time=None, block=True)
Ends capture and truncates the captured sequence at `stop_time`.

    Args:
      stop_time: The float time in seconds to stop the capture, or None if it
         should be stopped now. May be in the past, in which case the captured
         sequence will be truncated appropriately.
      block: If True, blocks until the thread terminates.
    Raises:
      MidiHubError: When called multiple times with a `stop_time`.
Ends capture and truncates the captured sequence at `stop_time`.
Ends capture and truncates the captured sequence at stop_time .
def stop(self, stop_time=None, block=True):
    """Ends capture and truncates the captured sequence at `stop_time`.

    Args:
      stop_time: The float time in seconds to stop the capture, or None if it
         should be stopped now. May be in the past, in which case the captured
         sequence will be truncated appropriately.
      block: If True, blocks until the thread terminates.
    Raises:
      MidiHubError: When called multiple times with a `stop_time`.
    """
    with self._lock:
      if self._stop_signal.is_set():
        if stop_time is not None:
          raise MidiHubError(
              '`stop` must not be called multiple times with a `stop_time` on '
              'MidiCaptor.')
      else:
        self._stop_signal.set()
        self._stop_time = time.time() if stop_time is None else stop_time
        # Force the thread to wake since we've updated the stop time.
        self._receive_queue.put(MidiCaptor._WAKE_MESSAGE)
    if block:
      self.join()
def stop ( self , stop_time = None , block = True ) : with self . _lock : if self . _stop_signal . is_set ( ) : if stop_time is not None : raise MidiHubError ( '`stop` must not be called multiple times with a `stop_time` on ' 'MidiCaptor.' ) else : self . _stop_signal . set ( ) self . _stop_time = time . time ( ) if stop_time is None else stop_time # Force the thread to wake since we've updated the stop time. self . _receive_queue . put ( MidiCaptor . _WAKE_MESSAGE ) if block : self . join ( )