[][src]Function rportaudio::hostapi_device_index_to_device_index

pub fn hostapi_device_index_to_device_index(
    hostapi: u32,
    hostapi_device_index: u32
) -> Result<u32, PaError>

Converts a device index from a specific host API to a global device index

Returns Err(InvalidHostApi) when the host_api is out of range, and Err(InvalidDevice) when host_api_device_index is out of range.

// We retrieve the index of device 3 of api 1
let device_index = match rportaudio::hostapi_device_index_to_device_index(1, 3) {
  Ok(n) => n,
  Err(e) => { println!("Error: {:?}", e); return; }
};