Fixed volume and panning for ninjam override.
This commit is contained in:
1 parent
b45f800489
commit
d3bcbbeacf
11 files changed
+412
-170
No files matched your search
@@ -64,9 +64,19 @@ func TestNinjamOverrideTerminalPresentation(t *testing.T) {
|
||||
if got := paint(1, "0.0dB center", "<Username> new"); !slices.Equal(got, []string{"Master Volume and pan 0.0dB center", "<Username> new"}) {
|
||||
t.Fatal(got)
|
||||
}
|
||||
if got := paint(1, "-0.5dB center", "<Username> new"); !slices.Equal(got, []string{"Master Volume and pan -0.5dB center"}) {
|
||||
if got := paint(1, "-0.5dB center", "<Username> new"); !slices.Equal(got, []string{"minus 0.5dB"}) {
|
||||
t.Fatal(got)
|
||||
}
|
||||
for _, trial := range []struct{ value, want string }{
|
||||
{"-0.5dB 1%L", "1 percent left"},
|
||||
{"-0.5dB center", "center"},
|
||||
{"-0.5dB 1%R", "1 percent right"},
|
||||
{"+0.5dB 1%R", "plus 0.5dB"},
|
||||
} {
|
||||
if got := paint(1, trial.value, "<Username> new"); !slices.Equal(got, []string{trial.want}) {
|
||||
t.Fatal(trial.value, got)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
"syscall"
|
||||
"testing"
|
||||
@@ -214,13 +215,13 @@ func TestNinjamLiveOverride(t *testing.T) {
|
||||
start = len(output)
|
||||
send("\x1bOA")
|
||||
waitFor("edited volume", 2*time.Second, func() bool {
|
||||
return focus() != oldValue && strings.Contains(focus(), "Master Volume and pan") && strings.Contains(strings.Join(output[start:], "\n"), focus())
|
||||
return focus() != oldValue && strings.Contains(focus(), "Master Volume and pan") && slices.Contains(output[start:], "plus 0.5dB")
|
||||
})
|
||||
oldValue = focus()
|
||||
start = len(output)
|
||||
send("\x1bOD")
|
||||
waitFor("edited pan", 2*time.Second, func() bool {
|
||||
return focus() != oldValue && strings.Contains(focus(), "Master Volume and pan") && strings.Contains(strings.Join(output[start:], "\n"), focus())
|
||||
return focus() != oldValue && strings.Contains(focus(), "Master Volume and pan") && slices.Contains(output[start:], "1 percent left")
|
||||
})
|
||||
send("\r")
|
||||
start = len(output)
|
||||
|
||||
Reference in new issue
Block a user