diff options
Diffstat (limited to 'libs/backends/wavesaudio/waves_midi_device_manager.cc')
-rw-r--r-- | libs/backends/wavesaudio/waves_midi_device_manager.cc | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/libs/backends/wavesaudio/waves_midi_device_manager.cc b/libs/backends/wavesaudio/waves_midi_device_manager.cc index dcc5fa0f03..344deeeea9 100644 --- a/libs/backends/wavesaudio/waves_midi_device_manager.cc +++ b/libs/backends/wavesaudio/waves_midi_device_manager.cc @@ -54,7 +54,7 @@ WavesMidiDeviceManager::~WavesMidiDeviceManager () int WavesMidiDeviceManager::start () { - // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::stream ():" << std::endl; + // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::start ():" << std::endl; if ( _active == true ) { return -1; } @@ -77,7 +77,7 @@ WavesMidiDeviceManager::start () int WavesMidiDeviceManager::stream (bool yn) { - // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::stream ():" << std::endl; + // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::stream (" << (yn?"true":"false") << "):" << std::endl; if (!_active) { std::cerr << "WavesMidiDeviceManager::stream (): the midi device manager is not started up !" << std::endl; return -1; @@ -88,7 +88,8 @@ WavesMidiDeviceManager::stream (bool yn) } if (yn) { - if ( Pt_Start (1, __portmidi_callback, this) != ptNoError) { + // __portmidi_callback will be called once per 50 msec + if ( Pt_Start (50, __portmidi_callback, this) != ptNoError) { std::cerr << "WavesMidiDeviceManager::stream (): Pt_Start () failed!" << std::endl; return -1; } @@ -130,7 +131,7 @@ WavesMidiDeviceManager::stop () void WavesMidiDeviceManager::__portmidi_callback (PtTimestamp timestamp, void * userData) { - // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::__portmidi_callback ():" << std::endl; + // COMMENTED FREQUENT DBG LOGS */ std::cout << "WavesMidiDeviceManager::__portmidi_callback ():" << std::endl; WavesMidiDeviceManager *dm = (WavesMidiDeviceManager *)userData; if (dm == NULL) { @@ -149,8 +150,10 @@ WavesMidiDeviceManager::_portmidi_callback (PtTimestamp timestamp) if ((_input_device_count != midiInGetNumDevs ()) || (_output_device_count != midiOutGetNumDevs ())) { _audiobackend._changed_midi_devices (); - return; - } + // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::_portmidi_callback ():" << std::endl; + // COMMENTED DBG LOGS */ std::cout << " _input_device_count ?= midiInGetNumDevs () :" << _input_device_count << " ?= " << midiInGetNumDevs () << std::endl; + // COMMENTED DBG LOGS */ std::cout << " _output_device_count ?= midiOutGetNumDevs () :" << _output_device_count << " ?= " << midiOutGetNumDevs () << std::endl; + } } void WavesMidiDeviceManager::do_read () @@ -178,6 +181,7 @@ WavesMidiDeviceManager::__get_time_ms (void *time_info) WavesMidiDevice* WavesMidiDeviceManager::_get_device (const std::string& name) { + // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::_get_device ():" << std::endl; for (size_t i = 0; i < _devices.size (); i++) { if (name == _devices[i]->name ()) { return _devices[i]; @@ -190,12 +194,23 @@ WavesMidiDevice* WavesMidiDeviceManager::_get_device (const std::string& name) int WavesMidiDeviceManager::_create_devices () { + // COMMENTED DBG LOGS */ std::cout << "WavesMidiDeviceManager::_create_devices () :" << std::endl; int count = Pm_CountDevices (); for (int i = 0; i < count; i++) { const PmDeviceInfo* pm_device_info = Pm_GetDeviceInfo (i); - + // COMMENTED DBG LOGS */ std::cout << " interf : " << pm_device_info->interf << std::endl; + // COMMENTED DBG LOGS */ std::cout << " name : " << pm_device_info->name << std::endl; + // COMMENTED DBG LOGS */ std::cout << " input : " << pm_device_info->input << std::endl; + // COMMENTED DBG LOGS */ std::cout << " output : " << pm_device_info->output << std::endl; + // COMMENTED DBG LOGS */ std::cout << " opened : " << pm_device_info->opened << std::endl; +#if defined (PLATFORM_WINDOWS) + if (strncmp (pm_device_info->name, "Microsoft", strlen ("Microsoft")) == 0) { + // COMMENTED DBG LOGS */ std::cout << " skipping anything from Microsoft :" << pm_device_info->name << std::endl; + continue; + } +#endif if (pm_device_info == NULL) { std::cerr << "WavesMidiDeviceManager::_create_devices (): Pm_GetDeviceInfo (" << i << ") failed!" << std::endl; continue; |