[Summary] Audio Backend code cleanup - PORTION B

Conflicts:
	libs/backends/wavesaudio/waves_midi_device.cc
This commit is contained in:
Valeriy Kamyshniy 2015-03-02 20:19:50 +02:00 committed by Paul Davis
parent 91f5eb9fef
commit 83001e7e52
6 changed files with 29 additions and 51 deletions

View file

@ -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)
{