2 Copyright (C) 2013 Waves Audio Ltd.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __libardour_waves_midi_event_h__
21 #define __libardour_waves_midi_event_h__
24 #include <portmidi/portmidi.h>
25 #include "ardour/types.h"
38 WavesMidiEvent (PmTimestamp timestamp);
39 WavesMidiEvent (PmTimestamp timestamp, const uint8_t* data, size_t datalen);
40 WavesMidiEvent (const WavesMidiEvent& source);
43 WavesMidiEvent *append_data (const PmEvent &midi_event);
45 inline State state () const { return _state; };
46 inline size_t size () const { return _size; };
47 inline PmTimestamp timestamp () const { return _timestamp; };
48 inline void set_timestamp (PmTimestamp time_stamp) { _timestamp = time_stamp; };
49 inline const unsigned char* const_data () const { return _data; };
50 inline unsigned char* data () { return _data; };
51 inline bool operator< (const WavesMidiEvent &other) const { return timestamp () < other.timestamp (); };
52 inline bool sysex () const { return _data && (*_data == SYSEX); };
60 REAL_TIME_FIRST = 0xF8,
65 PmTimestamp _timestamp;
69 static size_t _midi_message_size (PmMessage midi_message);
75 #endif /* __libardour_waves_midi_event_h__ */