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