Skip to content

Commit

Permalink
for column major devices, mix stride = smi
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Aug 25, 2021
1 parent a29c0a2 commit 80a9167
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
15 changes: 15 additions & 0 deletions .ccls
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
gcc
%c -std=c11
-Irobtk/widgets
-Irobtk
-I/usr/include/pango-1.0
-I/usr/include/fribidi
-I/usr/include/cairo
-I/usr/include/pixman-1
-I/usr/include/uuid
-I/usr/include/freetype2
-I/usr/include/libpng16
-I/usr/include/harfbuzz
-I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include
--include=robtk/robtk.h
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ scarlett-mixer
*.swp
cscope.*
tags
src/.ccls-cache
.ccls-cache
26 changes: 13 additions & 13 deletions src/scarlett_mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,6 @@ static int open_mixer (RobTkApp* ui, const char* card, int opts)
assert (last > 0 && last <= 20);
if (last > d.smo) {
d.smo = last;

d.matrix_mix_stride = d.smo;
d.matrix_in_stride = d.smo + 1;
}
d.matrix_mix_column_major = true;
}
Expand All @@ -631,6 +628,10 @@ static int open_mixer (RobTkApp* ui, const char* card, int opts)
assert (i <= cnt);
}

if ((opts & OPT_DETECT) && d.matrix_mix_column_major) {
d.matrix_mix_stride = d.smi;
}

if ((opts & OPT_DETECT) && rv == 0 && ui->device) {
if (verbose > 1) {
printf ("CMP %d\n", memcmp (ui->device, &d, sizeof (Device)));
Expand Down Expand Up @@ -1180,7 +1181,7 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {

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

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

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

ui->out_lbl[o] = robtk_lbl_new (out_gain_label (ui, o));
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);
Expand All @@ -1343,8 +1344,8 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {

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

ui->aux_lbl[o] = robtk_lbl_new (aux_gain_label (ui, o));
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);
Expand All @@ -1369,9 +1370,9 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {
}

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

int row = 0; // beware of bleed into Hi-Z, Pads
int oc = o + ui->device->samo;

ui->sel_lbl[o] = robtk_lbl_new (out_select_label (ui, o));
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);
Expand Down Expand Up @@ -1410,9 +1411,8 @@ static RobWidget* toplevel (RobTkApp* ui, void* const top) {

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

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

0 comments on commit 80a9167

Please sign in to comment.