Make the Level Meter check compatible with alsa-sim.c

Rather than retrieving the firmware version in alsa_scan_cards(), use
get_elem_by_name() to check if the control is present.

Update alsa-sim.c alsa_config_to_new_elem() to read iface=CARD
controls.
This commit is contained in:
Geoffrey D. Bennett
2023-11-30 00:43:00 +10:30
parent 5b9ff7d457
commit 9890b4939b
4 changed files with 7 additions and 13 deletions

View File

@@ -210,7 +210,10 @@ void add_mixer_action_map(struct alsa_card *card) {
card
);
if (card->firmware_version) {
// Hide the levels menu item if there is no "Firmware Version"
// control (working kernel support for level meters was added in the
// same version as the "Firmware Version" control)
if (get_elem_by_name(card->elems, "Firmware Version")) {
g_action_map_add_action_entries(
G_ACTION_MAP(card->window_main),
levels_entries,