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_manager_h__
21 #define __libardour_waves_midi_device_manager_h__
23 #include "waves_midi_device.h"
27 class WavesAudioBackend;
29 class WavesMidiDeviceManager {
31 WavesMidiDeviceManager (WavesAudioBackend& audiobackend);
32 ~WavesMidiDeviceManager ();
34 inline const std::vector<WavesMidiDevice *>& devices () const
42 int is_streaming () { return _streaming; }
48 int _create_devices ();
49 void _close_devices ();
51 int _delete_devices ();
52 static void __portmidi_callback (PtTimestamp timestamp, void * userData);
53 void _portmidi_callback (PtTimestamp timestamp);
54 /** __get_time_ms is given to Pm_Open functions (see WavesMidiDevice.cc)
55 * to provide the time in milliseconds using the time of audio
57 * time_info is a pointer on the backend instance, which agregates the
58 * audio and miditransports. It's not checked for correctness to consume
61 static PmTimestamp __get_time_ms (void *time_info);
63 WavesMidiDevice* _get_device (const std::string& name);
65 std::vector<WavesMidiDevice*> _devices; // Vector for midi devices
69 size_t _input_device_count;
70 size_t _output_device_count;
71 WavesAudioBackend& _audiobackend;
76 #endif /* __libardour_waves_midi_device_manager_h__ */