changeset 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
files data/data.pro data/midi/MIDIInput.h
diffstat 2 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data/data.pro	Mon Feb 23 11:43:55 2009 +0000
+++ b/data/data.pro	Mon Feb 23 14:40:17 2009 +0000
@@ -103,6 +103,7 @@
            fileio/ResamplingWavFileReader.cpp \
            fileio/WavFileReader.cpp \
            fileio/WavFileWriter.cpp \
+           midi/MIDIInput.cpp \
            model/AggregateWaveModel.cpp \
            model/AlignmentModel.cpp \
            model/Dense3DModelPeakCache.cpp \
--- 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);