add convenience method for casting payloads

This commit is contained in:
Joel Wetzell
2026-03-02 12:06:42 -06:00
parent af39c16f30
commit df14024012
38 changed files with 54 additions and 40 deletions

View File

@@ -45,7 +45,7 @@ type MIDIPitchBend struct {
}
func (mmu *MIDIMessageUnpack) Process(ctx context.Context, payload any) (any, error) {
payloadMidi, ok := payload.(midi.Message)
payloadMidi, ok := GetAnyAs[midi.Message](payload)
if !ok {
return nil, errors.New("midi.message.unpack processor only accepts a midi.Message")