Add the 4.0 Surround and 4.0 Quad speaker layouts to the kernel
ci / ubuntu-latest (push) Failing after 14s
ci / macos-latest (push) Has been cancelled
ci / windows-latest (push) Has been cancelled
ci / release (push) Has been cancelled

This commit is contained in:
TheM14 committed 2026-10-27 23:44:51 +08:00
1 parent 7b83358eb5
commit d2d6ac0e6f
7 files changed
+126 -9

No files matched your search

+15
View File
@@ -15,6 +15,8 @@ struct FrozenLayout {
constexpr FrozenLayout kLayouts[kLayoutCount] = {
{"2.0", 0, 1},
{"3.1", 3, 7},
{"4.0 Surround", 0xFF, 35},
{"4.0 Quad", 0xFF, 9},
{"5.1", 7, 15},
{"7.1", 11, 31},
{"5.1.2", 13, 1039},
@@ -25,6 +27,14 @@ constexpr FrozenLayout kLayouts[kLayoutCount] = {
{"9.1.6", 20, 3743},
};
// Spellings accepted in addition to the names above.
constexpr struct {
const char* alias;
const char* name;
} kAliases[] = {
{"4.0", "4.0 Surround"},
};
void fill(const FrozenLayout& source, LayoutInfo* out) {
out->name = source.name;
out->out_ch_config = source.out_ch_config;
@@ -52,6 +62,11 @@ bool layout_by_name(const char* name, LayoutInfo* out) {
return true;
}
}
for (const auto& alias : kAliases) {
if (std::strcmp(name, alias.alias) == 0) {
return layout_by_name(alias.name, out);
}
}
return false;
}