globally remove all trailing whitespace from ardour code base.
[ardour.git] / libs / backends / wavesaudio / waves_midiport.h
1 /*
2     Copyright (C) 2013 Waves Audio Ltd.
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __libardour_waves_midiport_h__
21 #define __libardour_waves_midiport_h__
22
23 #include "waves_dataport.h"
24 #include "waves_midi_buffer.h"
25
26 namespace ARDOUR {
27
28 class WavesMidiEvent;
29 class WavesMidiDevice;
30 class WavesMidiEvent;
31
32 class WavesMidiPort : public WavesDataPort {
33 public:
34     enum BufferSize {
35         // This value has nothing to do with reality as buffer of MIDI Port is not a flat array.
36         // It's an iterated list.
37         MAX_BUFFER_SIZE_BYTES = 8192
38     };
39
40     WavesMidiPort (const std::string& port_name, PortFlags flags);
41     virtual ~WavesMidiPort (){};
42
43     virtual DataType type () const {    return DataType::MIDI; };
44
45     virtual void* get_buffer (pframes_t nframes);
46
47     inline WavesMidiBuffer& buffer () { return _waves_midi_buffer; }
48     inline const WavesMidiBuffer& const_buffer () const { return _waves_midi_buffer; }
49
50     inline void set_midi_device (WavesMidiDevice* midi_device) { _midi_device = midi_device; };
51     inline WavesMidiDevice* midi_device () const { return _midi_device; };
52
53 protected:
54         virtual void _wipe_buffer();
55
56 private:
57     WavesMidiDevice * _midi_device;
58     WavesMidiBuffer _waves_midi_buffer;
59 };
60
61 } // namespace
62
63 #endif /* __libardour_waves_midiport_h__ */
64