]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/midi/pd.py
All PDs: Consistently use singular/plural for annotation classes/rows.
[libsigrokdecode.git] / decoders / midi / pd.py
index 21c402477cc392cc3f55a3f1b9c6a77c1845a692..60bfd2ebc543de8e03baa124412d9391a0a80bf4 100644 (file)
@@ -25,18 +25,19 @@ RX = 0
 TX = 1
 
 class Decoder(srd.Decoder):
-    api_version = 2
+    api_version = 3
     id = 'midi'
     name = 'MIDI'
     longname = 'Musical Instrument Digital Interface'
     desc = 'Musical Instrument Digital Interface (MIDI) protocol.'
     license = 'gplv2+'
     inputs = ['uart']
-    outputs = ['midi']
+    outputs = []
+    tags = ['Audio', 'PC']
     annotations = (
-        ('text-verbose', 'Human-readable text (verbose)'),
-        ('text-sysreal-verbose', 'Human-readable SysReal text (verbose)'),
-        ('text-error', 'Human-readable Error text'),
+        ('text-verbose', 'Text (verbose)'),
+        ('text-sysreal-verbose', 'SysReal text (verbose)'),
+        ('text-error', 'Error text'),
     )
     annotation_rows = (
         ('normal', 'Normal', (0, 2)),
@@ -44,6 +45,9 @@ class Decoder(srd.Decoder):
     )
 
     def __init__(self):
+        self.reset()
+
+    def reset(self):
         self.state = 'IDLE'
         self.status_byte = 0
         self.explicit_status_byte = False