Skip to content

Commit 59a1c80

Browse files
committed
stringify DeviceType
1 parent b35e2e9 commit 59a1c80

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

midi.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ const (
1717
DeviceDuplex
1818
)
1919

20+
func (t DeviceType) String() string {
21+
switch t {
22+
case DeviceInput:
23+
return "INPUT"
24+
case DeviceOutput:
25+
return "OUTPUT"
26+
case DeviceDuplex:
27+
return "DUPLEX"
28+
default:
29+
panic("unrecognized device type")
30+
}
31+
}
32+
2033
// Note represents a MIDI note.
2134
type Note struct {
2235
Number int

0 commit comments

Comments
 (0)