diff options
Diffstat (limited to 'libs/backends/wavesaudio/waves_midi_device.cc')
-rw-r--r-- | libs/backends/wavesaudio/waves_midi_device.cc | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/libs/backends/wavesaudio/waves_midi_device.cc b/libs/backends/wavesaudio/waves_midi_device.cc index 04570218b0..342e1293a1 100644 --- a/libs/backends/wavesaudio/waves_midi_device.cc +++ b/libs/backends/wavesaudio/waves_midi_device.cc @@ -38,7 +38,25 @@ WavesMidiDevice::WavesMidiDevice (const std::string& device_name) , _output_pm_stream (NULL) , _incomplete_waves_midi_event (NULL) { - validate (); + _pm_input_id = _pm_output_id = pmNoDevice; + int count = Pm_CountDevices (); + + for (int i = 0; i < count; i++) { + + const PmDeviceInfo* pm_device_info = Pm_GetDeviceInfo (i); + + if (pm_device_info == NULL) { + continue; + } + if (name () == pm_device_info->name) { + if (pm_device_info->input){ + _pm_input_id = i; + } + if (pm_device_info->output){ + _pm_output_id = i; + } + } + } } WavesMidiDevice::~WavesMidiDevice () @@ -47,31 +65,6 @@ WavesMidiDevice::~WavesMidiDevice () close (); } -void -WavesMidiDevice::validate () -{ - _pm_input_id = - _pm_output_id = pmNoDevice; - int count = Pm_CountDevices (); - - for (int i = 0; i < count; i++) { - - const PmDeviceInfo* pm_device_info = Pm_GetDeviceInfo (i); - - if (pm_device_info == NULL) { - continue; - } - if (name () == pm_device_info->name) { - if (pm_device_info->input){ - _pm_input_id = i; - } - if (pm_device_info->output){ - _pm_output_id = i; - } - } - } -} - int WavesMidiDevice::open (PmTimeProcPtr time_proc, void* time_info) { |