implements the OS2L finder and improve behaviors of finders

This commit is contained in:
2025-11-12 13:42:38 +01:00
parent 121a14ac61
commit 1b63698059
6 changed files with 183 additions and 82 deletions

View File

@@ -6,7 +6,6 @@ import (
"time"
"github.com/rs/zerolog/log"
"github.com/wailsapp/wails/v2/pkg/runtime"
)
// OS2LPeripheral contains the data of an OS2L peripheral
@@ -29,11 +28,9 @@ func NewOS2LPeripheral(peripheralData PeripheralInfo) (*OS2LPeripheral, error) {
// Connect connects the MIDI peripheral
func (p *OS2LPeripheral) Connect(ctx context.Context) error {
log.Info().Str("file", "OS2LPeripheral").Msg("OS2L peripheral connected")
go func() {
runtime.EventsEmit(ctx, string(PeripheralStatusUpdated), p.info, "connecting")
time.Sleep(5 * time.Second)
runtime.EventsEmit(ctx, string(PeripheralStatusUpdated), p.info, "disconnected")
}()
time.Sleep(5 * time.Second)
return nil
}
@@ -102,3 +99,8 @@ func (p *OS2LPeripheral) GetSettings() map[string]interface{} {
func (p *OS2LPeripheral) GetInfo() PeripheralInfo {
return p.info
}
// WaitStop stops the peripheral
func (p *OS2LPeripheral) WaitStop() error {
return nil
}