diff data/midi/MIDIInput.h @ 561:863ad4b1f841

* a few more midi bits, attempt to fix vertical-black-bar-misplacement-on-mac
author Chris Cannam
date Mon, 23 Feb 2009 14:40:17 +0000
parents 2e50d95cf621
children ecce042cc374
line wrap: on
line diff
--- a/data/midi/MIDIInput.h	Mon Feb 23 11:43:55 2009 +0000
+++ b/data/midi/MIDIInput.h	Mon Feb 23 14:40:17 2009 +0000
@@ -22,7 +22,7 @@
 #include <vector>
 #include "base/RingBuffer.h"
 
-class RtMidi;
+class RtMidiIn;
 
 class MIDIInput : public QObject
 {
@@ -32,19 +32,19 @@
     MIDIInput();
     virtual ~MIDIInput();
 
-    bool isOK() const;
+    bool isOK() const { return m_rtmidi != 0; }
 
     bool isEmpty() const { return getEventsAvailable() == 0; }
-    size_t getEventsAvailable() const;
+    size_t getEventsAvailable() const { return m_buffer.getReadSpace(); }
     MIDIEvent readEvent();
 
 signals:
     void eventsAvailable();
 
 protected:
-    RtMidi *m_rtmidi;
+    RtMidiIn *m_rtmidi;
 
-    static void callback(double, std::vector<unsigned char> *, void *);
+    static void staticCallback(double, std::vector<unsigned char> *, void *);
     void callback(double, std::vector<unsigned char> *);
 
     void postEvent(MIDIEvent);