MCPcopy Create free account
hub / github.com/PerroEngine/Perro / clip

Method clip

perro_source/audio_stack/perro_pawdio/src/mic.rs:576–585  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

574
575/// Pick the device a cached name points at, else the default entry.
576///
577/// Backends reorder and renumber devices between scans, so a saved selection is
578/// matched by name and never by list position.
579pub fn resolve_mic_device<'a>(
580 devices: &'a [MicDevice],
581 wanted: Option<&str>,
582) -> Option<&'a MicDevice> {
583 if let Some(wanted) = wanted {
584 let names: Vec<&str> = devices.iter().map(|device| device.name.as_str()).collect();
585 if let Some(index) = match_device_index(&names, wanted) {
586 return devices.get(index);
587 }
588 }

Callers 1

mic_clipMethod · 0.45

Calls 1

clip_from_stateMethod · 0.80

Tested by

no test coverage detected