annotate data/midi/MIDIInput.h @ 559:32d156c75df7

* midi stubs (this revision will not compile)
author Chris Cannam
date Mon, 23 Feb 2009 11:41:28 +0000
parents
children 2e50d95cf621
rev   line source
Chris@559 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@559 2
Chris@559 3 /*
Chris@559 4 Sonic Visualiser
Chris@559 5 An audio file viewer and annotation editor.
Chris@559 6 Centre for Digital Music, Queen Mary, University of London.
Chris@559 7 This file copyright 2006-2009 Chris Cannam and QMUL.
Chris@559 8
Chris@559 9 This program is free software; you can redistribute it and/or
Chris@559 10 modify it under the terms of the GNU General Public License as
Chris@559 11 published by the Free Software Foundation; either version 2 of the
Chris@559 12 License, or (at your option) any later version. See the file
Chris@559 13 COPYING included with this distribution for more information.
Chris@559 14 */
Chris@559 15
Chris@559 16 #ifndef _MIDI_INPUT_H_
Chris@559 17 #define _MIDI_INPUT_H_
Chris@559 18
Chris@559 19 #include <QObject>
Chris@559 20 #include "MIDIEvent.h"
Chris@559 21
Chris@559 22 class RtMidi;
Chris@559 23
Chris@559 24 class MIDIInput : public QObject
Chris@559 25 {
Chris@559 26 Q_OBJECT
Chris@559 27
Chris@559 28 public:
Chris@559 29 MIDIInput();
Chris@559 30 virtual ~MIDIInput();
Chris@559 31
Chris@559 32 bool isOK() const;
Chris@559 33
Chris@559 34 bool isEmpty() const { return getEventsAvailable() == 0; }
Chris@559 35 size_t getEventsAvailable() const;
Chris@559 36 MIDIEvent readEvent();
Chris@559 37
Chris@559 38 signals:
Chris@559 39 void eventsAvailable();
Chris@559 40
Chris@559 41 protected:
Chris@559 42 RtMidi *m_rtmidi;
Chris@559 43
Chris@559 44 static void callback(double, std::vector<unsigned char> *, void *);
Chris@559 45 void callback(double, std::vector<unsigned char> *);
Chris@559 46
Chris@559 47 void postEvent(MIDIEvent);
Chris@559 48 RingBuffer<MIDIEvent *> m_buffer;
Chris@559 49 };
Chris@559 50
Chris@559 51 #endif
Chris@559 52