Debian Codegraph @

src/config-device-settings.c

raw symbols SCIP
1 // SPDX-FileCopyrightText: 2022-2025 Geoffrey D. Bennett <[email protected]>
2 // SPDX-License-Identifier: GPL-3.0-or-later
3
4 #include <gtk/gtk.h>
5
6 #include "alsa.h"
7 #include "config-helpers.h"
8 #include "widget-drop-down.h"
9 #include "window-configuration.h"
10 #include "config-device-settings.h"
11
12 void add_device_settings_tab(GtkWidget *notebook, struct alsa_card *card) {
13 struct alsa_elem *spdif_source = get_elem_by_name(
14 card->elems, "S/PDIF Source Capture Enum"
15 );
16
17 if (!spdif_source)
18 return;
19
20 GtkWidget *content = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
21 gtk_widget_set_margin_top(content, 20);
22 gtk_widget_set_margin_start(content, 20);
23 gtk_widget_set_margin_end(content, 20);
24 gtk_widget_set_margin_bottom(content, 20);
25
26 // S/PDIF Source control
27 gtk_box_append(GTK_BOX(content), config_bold_label("S/PDIF Source"));
28
29 GtkWidget *dropdown = make_drop_down_alsa_elem(spdif_source, NULL);
30 gtk_widget_set_halign(dropdown, GTK_ALIGN_START);
31 gtk_box_append(GTK_BOX(content), dropdown);
32
33 gtk_box_append(GTK_BOX(content), config_help_label(
34 "Select the S/PDIF input source: None to disable S/PDIF input,\n"
35 "Optical for the optical input, or RCA for the coaxial input."
36 ));
37
38 g_object_set_data(G_OBJECT(content), PAGE_ID_KEY, (gpointer)"device-settings");
39 gtk_notebook_append_page(
40 GTK_NOTEBOOK(notebook), content, gtk_label_new("Device Settings")
41 );
42 }