docs: Added godoc comments

This commit is contained in:
2025-08-09 17:23:39 +02:00
parent ff859d6bf7
commit ce0f466a0e
4 changed files with 37 additions and 0 deletions

View File

@@ -6,12 +6,16 @@ import (
_ "gitlab.com/gomidi/midi/v2/drivers/rtmididrv"
)
// A MidiInput represents a MIDI input and provides a channel to read incoming
// Messages, as well as a Stop function to terminate the connection.
type MidiInput struct {
input drivers.In
Messages chan midi.Message
Stop func()
}
// NewMidiInput initialises a MidiInput object connected to the MIDI port specified
// by portName. Retuns an error if the connection fails.
func NewMidiInput(portName string) (*MidiInput, error) {
input, err := midi.FindInPort(portName)
if err != nil {