Skip to content

Commit 80a9167

Browse files
author
Yatao Li
committed
for column major devices, mix stride = smi
1 parent a29c0a2 commit 80a9167

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

.ccls

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
gcc
2+
%c -std=c11
3+
-Irobtk/widgets
4+
-Irobtk
5+
-I/usr/include/pango-1.0
6+
-I/usr/include/fribidi
7+
-I/usr/include/cairo
8+
-I/usr/include/pixman-1
9+
-I/usr/include/uuid
10+
-I/usr/include/freetype2
11+
-I/usr/include/libpng16
12+
-I/usr/include/harfbuzz
13+
-I/usr/include/glib-2.0
14+
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include
15+
--include=robtk/robtk.h

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ scarlett-mixer
33
*.swp
44
cscope.*
55
tags
6+
src/.ccls-cache
7+
.ccls-cache

src/scarlett_mixer.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,6 @@ static int open_mixer (RobTkApp* ui, const char* card, int opts)
611611
assert (last > 0 && last <= 20);
612612
if (last > d.smo) {
613613
d.smo = last;
614-
615-
d.matrix_mix_stride = d.smo;
616-
d.matrix_in_stride = d.smo + 1;
617614
}
618615
d.matrix_mix_column_major = true;
619616
}
@@ -631,6 +628,10 @@ static int open_mixer (RobTkApp* ui, const char* card, int opts)
631628
assert (i <= cnt);
632629
}
633630

631+
if ((opts & OPT_DETECT) && d.matrix_mix_column_major) {
632+
d.matrix_mix_stride = d.smi;
633+
}
634+
634635
if ((opts & OPT_DETECT) && rv == 0 && ui->device) {
635636
if (verbose > 1) {
636637
printf ("CMP %d\n", memcmp (ui->device, &d, sizeof (Device)));
@@ -1180,7 +1181,7 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {
11801181

11811182
/* table layout. NB: these are min sizes, table grows if needed */
11821183
ui->matrix = rob_table_new (/*rows*/rb, /*cols*/ 5 + ui->device->smo, FALSE);
1183-
ui->output = rob_table_new (/*rows*/4, /*cols*/ 2 + 3 * ui->device->smst, FALSE);
1184+
ui->output = rob_table_new (/*rows*/6, /*cols*/ 2 + 3 * (ui->device->smst + ui->device->samo), FALSE);
11841185

11851186
/* headings */
11861187
ui->heading[0] = robtk_lbl_new ("Capture");
@@ -1315,8 +1316,8 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {
13151316

13161317
/* output level + labels */
13171318
for (unsigned int o = 0; o < ui->device->smst; ++o) {
1318-
int row = 4 * floor (o / 5); // beware of bleed into Hi-Z, Pads
1319-
int oc = o % 5;
1319+
int row = 0; // beware of bleed into Hi-Z, Pads
1320+
int oc = o;
13201321

13211322
ui->out_lbl[o] = robtk_lbl_new (out_gain_label (ui, o));
13221323
rob_table_attach (ui->output, robtk_lbl_widget (ui->out_lbl[o]), 3 * oc + 2, 3 * oc + 5, row, row + 1, 2, 2, RTK_SHRINK, RTK_SHRINK);
@@ -1343,8 +1344,8 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {
13431344

13441345
/* aux mono outputs & labels */
13451346
for (unsigned int o = 0; o < ui->device->samo; ++o) {
1346-
int row = 4 * floor (o / 5); // beware of bleed into Hi-Z, Pads
1347-
int oc = o % 5;
1347+
int row = 0; // beware of bleed into Hi-Z, Pads
1348+
int oc = o;
13481349

13491350
ui->aux_lbl[o] = robtk_lbl_new (aux_gain_label (ui, o));
13501351
rob_table_attach (ui->output, robtk_lbl_widget (ui->aux_lbl[o]), 3 * oc + 2, 3 * oc + 5, row, row + 1, 2, 2, RTK_SHRINK, RTK_SHRINK);
@@ -1369,9 +1370,9 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {
13691370
}
13701371

13711372
for (unsigned int o = 0; o < ui->device->sout - ui->device->samo - (ui->device->smst * 2); ++o) {
1372-
int row_base = (o + ui->device->samo + (ui->device->smst * 2));
1373-
int row = 4 * floor (row_base / 6); // beware of bleed into Hi-Z, Pads
1374-
int oc = row_base % 6;
1373+
1374+
int row = 0; // beware of bleed into Hi-Z, Pads
1375+
int oc = o + ui->device->samo;
13751376

13761377
ui->sel_lbl[o] = robtk_lbl_new (out_select_label (ui, o));
13771378
rob_table_attach (ui->output, robtk_lbl_widget (ui->sel_lbl[o]), 3 * oc + 2, 3 * oc + 5, row, row + 1, 2, 2, RTK_SHRINK, RTK_SHRINK);
@@ -1410,9 +1411,8 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {
14101411

14111412
/* output selectors */
14121413
for (unsigned int o = 0; o < ui->device->sout; ++o) {
1413-
int row = 4 * floor (o / 10); // beware of bleed into Hi-Z, Pads
1414+
int row = 0; // beware of bleed into Hi-Z, Pads
14141415
int pc = 3 * (o / 2); /* stereo-pair column */
1415-
pc %= 15;
14161416

14171417
ui->out_sel[o] = robtk_select_new ();
14181418
Mctrl* sctrl = out_sel (ui, o);

0 commit comments

Comments
 (0)