| 1 | // SPDX-FileCopyrightText: 2022-2025 Geoffrey D. Bennett <[email protected]> |
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "alsa.h" |
| 7 | |
| 8 | // Structure to store mixer gain widget and its coordinates |
| 9 | struct mixer_gain_widget { |
| 10 | GtkWidget *widget; |
| 11 | int mix_num; // 0-based mix number (A=0, B=1, etc.) |
| 12 | int input_num; // 0-based input number |
| 13 | struct routing_snk *r_snk; // routing sink for this input (for level lookup) |
| 14 | struct alsa_elem *elem; // alsa element for gain value (for post-gain level) |
| 15 | |
| 16 | // Stereo support: track multiple elements and sinks for stereo widgets |
| 17 | struct alsa_elem *elems[4]; // array of controlled elements |
| 18 | int elem_count; // number of elements (1 = mono, >1 = stereo) |
| 19 | struct routing_snk *r_snks[2]; // routing sinks for level lookup (L and R) |
| 20 | int r_snk_count; // number of routing sinks |
| 21 | }; |
| 22 | |
| 23 | GtkWidget *create_mixer_controls(struct alsa_card *card); |
| 24 | void update_mixer_labels(struct alsa_card *card); |
| 25 | void rebuild_mixer_grid(struct alsa_card *card); |
| 26 | void update_mixer_availability(struct alsa_card *card, int available); |
| 27 | |
| 28 | // Recreate mixer widgets when stereo state changes |
| 29 | // This destroys existing widgets and creates new ones based on current stereo |
| 30 | void recreate_mixer_widgets(struct alsa_card *card); |