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 int _delete_devices ();
50 static void __portmidi_callback (PtTimestamp timestamp, void * userData);
51 void _portmidi_callback (PtTimestamp timestamp);
52 /** __get_time_ms is given to Pm_Open functions (see WavesMidiDevice.cc)
53 * to provide the time in milliseconds using the time of audio
55 * time_info is a pointer on the backend instance, which agregates the
56 * audio and miditransports. It's not checked for correctness to consume
59 static PmTimestamp __get_time_ms (void *time_info);
61 WavesMidiDevice* _get_device (const std::string& name);
63 std::vector<WavesMidiDevice*> _devices; // Vector for midi devices
67 size_t _input_device_count;
68 size_t _output_device_count;
69 WavesAudioBackend& _audiobackend;
74 #endif /* __libardour_waves_midi_device_manager_h__ */