fn detect_default_source(host: &Host) -> Option<Device>Expand description
Pick the best autodetect source for a music visualizer.
Order of preference, mirroring what a user expects after double-clicking the binary while music is already playing:
- Monitor of the host’s default output sink (so the visualizer reacts to whatever the user is listening to).
- Any other
.monitorsource (covers headphones-only or USB-DAC setups where the “default” sink is something unexpected). - Host default input (typically the microphone) — preserves
the historical behaviour when no monitor source is available
(e.g. ALSA without
module-loopback).