From 882370838e16d63e6304036bae8ed8ad15d9c6b2 Mon Sep 17 00:00:00 2001 From: Leandro Ferreira Date: Sat, 26 Oct 2024 08:44:13 -0300 Subject: [PATCH] feat(midi): add ClientMIDI interface for managing MIDI client operations Define an interface for MIDI operations, including device listing, selection, event capturing, and stopping the client. Added basic usage documentation. --- internal/contracts/midi/midi.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/contracts/midi/midi.go b/internal/contracts/midi/midi.go index 227cdbc..5252d92 100644 --- a/internal/contracts/midi/midi.go +++ b/internal/contracts/midi/midi.go @@ -2,9 +2,10 @@ package midi import "github.com/leandrodaf/midi-client/internal/entity" +// ClientMIDI defines an interface for managing MIDI client operations. type ClientMIDI interface { - Stop() error - ListDevices() ([]entity.DeviceInfo, error) - SelectDevice(deviceID int) error - StartCapture(eventChannel chan entity.MIDI) + Stop() error // Stops the MIDI client and disconnects any active device. + ListDevices() ([]entity.DeviceInfo, error) // Lists available MIDI devices. + SelectDevice(deviceID int) error // Selects a MIDI device by its ID. + StartCapture(eventChannel chan entity.MIDI) // Starts capturing MIDI events and sends them to the specified channel. }