Example #1
0
func (s *SystemPort) Close() error {
	if s.isOpen {
		s.isOpen = false
		s.stop <- true
		errNum := C.Pm_Close(s.stream)
		close(s.noteOns)
		close(s.noteOffs)
		close(s.controlChanges)
		return makePortMidiError(errNum)
	}
	return nil
}
Example #2
0
// Close closes the MIDI stream.
func (s *Stream) Close() error {
	if s.pmStream == nil {
		return nil
	}
	return convertToError(C.Pm_Close(unsafe.Pointer(s.pmStream)))
}