Some receivers and players expect the side pair (Ls/Rs) where the renderer puts the rear pair (Lrs/Rrs) and the other way round, and the layouts here follow the reference table, so the delivered PCM cannot match both. The new preference does the reorder on the way out: Ls with Lrs, Rs with Rrs, everything else untouched. Which channels to move is decided by name in the layout table, not by channel count. 7.1, 7.1.2, 7.1.4, 9.1.4 and 9.1.6 carry both pairs; 5.1.2 and 5.1.4 fill the last two slots with top channels and are left alone, and a layout that has no rear pair makes the swap a no-op. The decoder only enables it when the layout the core rendered is the one being delivered, so a binaural stream is never touched. The reorder happens once per read, before the float32 and the forced int24 delivery branch, so both formats carry it and the peak and clip accounting see the same samples as before. Decoding, object positions, the layout table and the rendering itself are unchanged. channel_swap_test checks the layout selection, the reorder, its inverse and the int24 packing order. The render harness gained --swap-side-rear and the text fit check now measures the new label in both languages. Verified on a 7.1 render: only channels 5-8 change, 5<->7 and 6<->8 byte-exactly, with float32 and int24 alike; a 5.1.2 render is identical with the switch on.
58 lines
2.2 KiB
C++
58 lines
2.2 KiB
C++
// Component settings: what the decoder renders and which HRTF it renders with.
|
|
//
|
|
// The HRTF source mirrors joc_task_config v2, which is the interface the
|
|
// reference CLI uses: a SOFA file, or a Rosella personalized model, are the
|
|
// user-facing inputs; a compiled .jochrtf is the advanced override; the filter
|
|
// bank tables are compiled into the library and are not a setting at all.
|
|
//
|
|
// Every value also has an environment override (JOC_*), which exists so the
|
|
// decoder can be exercised headlessly; an override is logged when used, so a test
|
|
// run cannot silently disagree with what the page shows.
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "joc_decode.h"
|
|
#include "lang.h"
|
|
|
|
namespace joc_settings {
|
|
|
|
// The file looked up in the default folder (next to the component) when no path
|
|
// is configured; same name the reference CLI uses.
|
|
const char* hrtf_default_file_name();
|
|
|
|
// The stored values, exactly as the preferences page shows them.
|
|
struct Values {
|
|
int output = 0; // 0 = binaural, 1 = speaker layout
|
|
std::string speaker_layout = "7.1";
|
|
// Empty means "the default file in the default folder".
|
|
std::string hrtf_file;
|
|
unsigned binaural_mode = 3; // JOC_BINAURAL_NEAR/FAR/MID = 1/2/3
|
|
bool gain_enabled = true;
|
|
double gain_db = 0.0;
|
|
double tail_seconds = 5.0;
|
|
// Deliver int24 instead of float32; see joc_decode::Settings::force_int24.
|
|
bool force_int24 = false;
|
|
// Swap Ls with Lrs and Rs with Rrs in the delivered speaker PCM; a layout
|
|
// without both pairs is delivered unchanged.
|
|
bool swap_side_rear = false;
|
|
unsigned object_delay_samples = 1473;
|
|
unsigned native_threads = 0;
|
|
std::string ffmpeg_path = "ffmpeg";
|
|
// Language of the page, the status lines and the messages; kSystem follows
|
|
// the Windows user-interface language. Decoding and rendering never read it.
|
|
joc_lang::Language language = joc_lang::Language::kSystem;
|
|
};
|
|
|
|
Values defaults();
|
|
Values read();
|
|
void write(const Values& values);
|
|
|
|
// Stored values plus environment overrides, as the decoder should use them.
|
|
joc_decode::Settings current();
|
|
|
|
std::string describe(const joc_decode::Settings& settings);
|
|
std::string describe(const Values& values);
|
|
|
|
} // namespace joc_settings
|