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_device_h__
21 #define __libardour_waves_midi_device_h__
23 #include <portmidi/portmidi.h>
24 #include <portmidi/pmutil.h>
25 #include <portmidi/porttime.h>
27 #include "ardour/types.h"
33 class WavesMidiDevice {
35 WavesMidiDevice (const std::string& name);
38 inline const std::string& name () const { return _name; }
40 int open (PmTimeProcPtr time_proc, void* time_info);
46 int enqueue_output_waves_midi_event (const WavesMidiEvent* waves_midi_event);
47 WavesMidiEvent* dequeue_input_waves_midi_event ();
49 inline bool is_input () const { return _pm_input_id != pmNoDevice; };
50 inline bool is_output () const { return _pm_output_id != pmNoDevice; };
55 PmDeviceID _pm_input_id;
56 PmDeviceID _pm_output_id;
57 const std::string _name;
60 PmQueue* _input_queue;
61 PmQueue* _output_queue;
63 PmStream* _input_pm_stream;
64 PmStream* _output_pm_stream;
65 WavesMidiEvent *_incomplete_waves_midi_event;
70 #endif /* __libardour_waves_midi_device_h__ */