Move label into boolean controls and use button state to show status
Rather than having a label "Air" and the button toggle between "Off" and "On", have the button just be "Air" and no separate label.
This commit is contained in:
@@ -156,36 +156,36 @@ static void create_input_link_control(
|
|||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "Off", "On");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "Link", NULL);
|
||||||
|
|
||||||
int from, to;
|
int from, to;
|
||||||
get_two_num_from_string(elem->name, &from, &to);
|
get_two_num_from_string(elem->name, &from, &to);
|
||||||
if (to == -1)
|
if (to == -1)
|
||||||
to = from;
|
to = from;
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, from, current_row, to - from + 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, from - 1, current_row, to - from + 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_gain_control(
|
static void create_input_gain_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_gain_alsa_elem(elem, 0, WIDGET_GAIN_TAPER_LINEAR);
|
GtkWidget *w = make_gain_alsa_elem(elem, 0, WIDGET_GAIN_TAPER_LINEAR);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_autogain_control(
|
static void create_input_autogain_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "Off", "On");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "Autogain", NULL);
|
||||||
gtk_widget_set_tooltip_text(
|
gtk_widget_set_tooltip_text(
|
||||||
w,
|
w,
|
||||||
"Autogain will listen to the input signal for 10 seconds and "
|
"Autogain will listen to the input signal for 10 seconds and "
|
||||||
@@ -193,95 +193,95 @@ static void create_input_autogain_control(
|
|||||||
"best signal level."
|
"best signal level."
|
||||||
);
|
);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_autogain_status_control(
|
static void create_input_autogain_status_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_label_alsa_elem(elem);
|
GtkWidget *w = make_label_alsa_elem(elem);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_safe_control(
|
static void create_input_safe_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "Off", "On");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "Safe", NULL);
|
||||||
gtk_widget_set_tooltip_text(
|
gtk_widget_set_tooltip_text(
|
||||||
w,
|
w,
|
||||||
"Enabling Safe Mode prevents the input from clipping by "
|
"Enabling Safe Mode prevents the input from clipping by "
|
||||||
"automatically reducing the gain if the signal is too hot."
|
"automatically reducing the gain if the signal is too hot."
|
||||||
);
|
);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_level_control(
|
static void create_input_level_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "Line", "Inst");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "Inst", NULL);
|
||||||
gtk_widget_set_tooltip_text(w, level_descr);
|
gtk_widget_set_tooltip_text(w, level_descr);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_air_switch_control(
|
static void create_input_air_switch_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "Off", "On");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "Air", NULL);
|
||||||
gtk_widget_set_tooltip_text(w, air_descr);
|
gtk_widget_set_tooltip_text(w, air_descr);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_air_enum_control(
|
static void create_input_air_enum_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_combo_box_alsa_elem(elem);
|
GtkWidget *w = make_combo_box_alsa_elem(elem);
|
||||||
gtk_widget_set_tooltip_text(w, air_descr);
|
gtk_widget_set_tooltip_text(w, air_descr);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_pad_control(
|
static void create_input_pad_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "Off", "On");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "Pad", NULL);
|
||||||
gtk_widget_set_tooltip_text(
|
gtk_widget_set_tooltip_text(
|
||||||
w,
|
w,
|
||||||
"Enabling Pad engages a 10dB attenuator in the channel, giving "
|
"Enabling Pad engages a 10dB attenuator in the channel, giving "
|
||||||
"you more headroom for very hot signals."
|
"you more headroom for very hot signals."
|
||||||
);
|
);
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, line_num, current_row, 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, column_num, current_row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_phantom_control(
|
static void create_input_phantom_control(
|
||||||
struct alsa_elem *elem,
|
struct alsa_elem *elem,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int current_row,
|
int current_row,
|
||||||
int line_num
|
int column_num
|
||||||
) {
|
) {
|
||||||
GtkWidget *w = make_boolean_alsa_elem(elem, "48V Off", "48V On");
|
GtkWidget *w = make_boolean_alsa_elem(elem, "48V", NULL);
|
||||||
gtk_widget_set_tooltip_text(w, phantom_descr);
|
gtk_widget_set_tooltip_text(w, phantom_descr);
|
||||||
|
|
||||||
int from, to;
|
int from, to;
|
||||||
@@ -289,18 +289,17 @@ static void create_input_phantom_control(
|
|||||||
if (to == -1)
|
if (to == -1)
|
||||||
to = from;
|
to = from;
|
||||||
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), w, from, current_row, to - from + 1, 1);
|
gtk_grid_attach(GTK_GRID(grid), w, from - 1, current_row, to - from + 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_input_controls_by_type(
|
static void create_input_controls_by_type(
|
||||||
GArray *elems,
|
GArray *elems,
|
||||||
GtkWidget *grid,
|
GtkWidget *grid,
|
||||||
int *current_row,
|
int *current_row,
|
||||||
char *label,
|
|
||||||
char *control,
|
char *control,
|
||||||
void (*create_func)(struct alsa_elem *, GtkWidget *, int, int)
|
void (*create_func)(struct alsa_elem *, GtkWidget *, int, int)
|
||||||
) {
|
) {
|
||||||
GtkWidget *l = NULL;
|
int count = 0;
|
||||||
|
|
||||||
for (int i = 0; i < elems->len; i++) {
|
for (int i = 0; i < elems->len; i++) {
|
||||||
struct alsa_elem *elem = &g_array_index(elems, struct alsa_elem, i);
|
struct alsa_elem *elem = &g_array_index(elems, struct alsa_elem, i);
|
||||||
@@ -312,17 +311,13 @@ static void create_input_controls_by_type(
|
|||||||
if (!strstr(elem->name, control))
|
if (!strstr(elem->name, control))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int line_num = get_num_from_string(elem->name);
|
int column_num = get_num_from_string(elem->name) - 1;
|
||||||
|
create_func(elem, grid, *current_row, column_num);
|
||||||
|
|
||||||
if (!l) {
|
count++;
|
||||||
l = gtk_label_new(label);
|
|
||||||
gtk_grid_attach(GTK_GRID(grid), l, 0, *current_row, 1, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
create_func(elem, grid, *current_row, line_num);
|
if (count)
|
||||||
}
|
|
||||||
|
|
||||||
if (l)
|
|
||||||
(*current_row)++;
|
(*current_row)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,50 +362,49 @@ static void create_input_controls(
|
|||||||
snprintf(s, 20, "%d", i);
|
snprintf(s, 20, "%d", i);
|
||||||
label = gtk_label_new(s);
|
label = gtk_label_new(s);
|
||||||
}
|
}
|
||||||
gtk_grid_attach(GTK_GRID(input_grid), label, i, 0, 1, 1);
|
gtk_grid_attach(GTK_GRID(input_grid), label, i - 1, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int current_row = 1;
|
int current_row = 1;
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Link", "Link Capture Switch", create_input_link_control
|
"Link Capture Switch", create_input_link_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Gain", "Gain Capture Volume", create_input_gain_control
|
"Gain Capture Volume", create_input_gain_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Autogain", "Autogain Capture Switch", create_input_autogain_control
|
"Autogain Capture Switch", create_input_autogain_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Autogain Status", "Autogain Status Capture Enum",
|
"Autogain Status Capture Enum", create_input_autogain_status_control
|
||||||
create_input_autogain_status_control
|
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Safe", "Safe Capture Switch", create_input_safe_control
|
"Safe Capture Switch", create_input_safe_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Level", "Level Capture Enum", create_input_level_control
|
"Level Capture Enum", create_input_level_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Air", "Air Capture Switch", create_input_air_switch_control
|
"Air Capture Switch", create_input_air_switch_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Air", "Air Capture Enum", create_input_air_enum_control
|
"Air Capture Enum", create_input_air_enum_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
"Pad", "Pad Capture Switch", create_input_pad_control
|
"Pad Capture Switch", create_input_pad_control
|
||||||
);
|
);
|
||||||
create_input_controls_by_type(
|
create_input_controls_by_type(
|
||||||
elems, input_grid, ¤t_row,
|
elems, input_grid, ¤t_row,
|
||||||
NULL, "Phantom Power Capture Switch", create_input_phantom_control
|
"Phantom Power Capture Switch", create_input_phantom_control
|
||||||
);
|
);
|
||||||
|
|
||||||
(*x)++;
|
(*x)++;
|
||||||
|
|||||||
@@ -67,23 +67,21 @@ GtkWidget *create_iface_no_mixer_main(struct alsa_card *card) {
|
|||||||
int line_num = get_num_from_string(elem->name);
|
int line_num = get_num_from_string(elem->name);
|
||||||
|
|
||||||
if (strstr(elem->name, "Level Capture Enum")) {
|
if (strstr(elem->name, "Level Capture Enum")) {
|
||||||
w = make_boolean_alsa_elem(elem, "Line", "Inst");
|
w = make_boolean_alsa_elem(elem, "Inst", NULL);
|
||||||
gtk_widget_set_tooltip_text(w, level_descr);
|
gtk_widget_set_tooltip_text(w, level_descr);
|
||||||
gtk_grid_attach(GTK_GRID(input_grid), w, line_num - 1, 1, 1, 1);
|
gtk_grid_attach(GTK_GRID(input_grid), w, line_num - 1, 1, 1, 1);
|
||||||
} else if (strstr(elem->name, "Air Capture Switch")) {
|
} else if (strstr(elem->name, "Air Capture Switch")) {
|
||||||
w = make_boolean_alsa_elem(elem, "Air Off", "Air On");
|
w = make_boolean_alsa_elem(elem, "Air", NULL);
|
||||||
gtk_widget_set_tooltip_text(w, air_descr);
|
gtk_widget_set_tooltip_text(w, air_descr);
|
||||||
gtk_grid_attach(
|
gtk_grid_attach(
|
||||||
GTK_GRID(input_grid), w, line_num - 1, 1 + !is_solo, 1, 1
|
GTK_GRID(input_grid), w, line_num - 1, 1 + !is_solo, 1, 1
|
||||||
);
|
);
|
||||||
} else if (strstr(elem->name, "Phantom Power Capture Switch")) {
|
} else if (strstr(elem->name, "Phantom Power Capture Switch")) {
|
||||||
w = make_boolean_alsa_elem(elem, "48V Off", "48V On");
|
w = make_boolean_alsa_elem(elem, "48V", NULL);
|
||||||
gtk_widget_set_tooltip_text(w, phantom_descr);
|
gtk_widget_set_tooltip_text(w, phantom_descr);
|
||||||
gtk_grid_attach(GTK_GRID(input_grid), w, 0, 3, 1 + !is_solo, 1);
|
gtk_grid_attach(GTK_GRID(input_grid), w, 0, 3, 1 + !is_solo, 1);
|
||||||
} else if (strcmp(elem->name, "Direct Monitor Playback Switch") == 0) {
|
} else if (strcmp(elem->name, "Direct Monitor Playback Switch") == 0) {
|
||||||
w = make_boolean_alsa_elem(
|
w = make_boolean_alsa_elem(elem, "Direct Monitor", NULL);
|
||||||
elem, "Direct Monitor Off", "Direct Monitor On"
|
|
||||||
);
|
|
||||||
gtk_widget_set_tooltip_text(
|
gtk_widget_set_tooltip_text(
|
||||||
w,
|
w,
|
||||||
"Direct Monitor sends the analogue input signals to the "
|
"Direct Monitor sends the analogue input signals to the "
|
||||||
|
|||||||
Reference in New Issue
Block a user