Added config editor in front end
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "AppConfigProvider.h"
|
||||
#include "AppConfigJson.h"
|
||||
#include "DeckLinkDisplayMode.h"
|
||||
|
||||
#include <chrono>
|
||||
@@ -51,7 +52,8 @@ std::filesystem::path WriteConfigFixture()
|
||||
<< " \"autoReload\": false,\n"
|
||||
<< " \"maxTemporalHistoryFrames\": 8,\n"
|
||||
<< " \"previewEnabled\": true,\n"
|
||||
<< " \"previewFps\": 24\n"
|
||||
<< " \"previewFps\": 24,\n"
|
||||
<< " \"runtimeShaderId\": \"solid-color\"\n"
|
||||
<< "}\n";
|
||||
return path;
|
||||
}
|
||||
@@ -87,6 +89,7 @@ void TestLoadsRuntimeHostConfig()
|
||||
Expect(config.maxTemporalHistoryFrames == 8, "history length loads");
|
||||
Expect(config.previewEnabled, "preview enabled toggle loads");
|
||||
Expect(config.previewFps == 24.0, "preview fps loads");
|
||||
Expect(config.runtimeShaderId == "solid-color", "runtime shader id loads");
|
||||
Expect(config.output.externalKeyingEnabled, "external keying loads");
|
||||
Expect(config.output.outputAlphaRequired, "output alpha requirement loads");
|
||||
|
||||
@@ -121,6 +124,31 @@ void TestPreviewDefaultsAreOptIn()
|
||||
Expect(config.previewFps == 60.0, "preview fps default is 60");
|
||||
}
|
||||
|
||||
void TestConfigJsonRoundTrip()
|
||||
{
|
||||
using namespace RenderCadenceCompositor;
|
||||
|
||||
AppConfig config = DefaultAppConfig();
|
||||
config.shaderLibrary = "custom-shaders";
|
||||
config.output.backend = "ndi";
|
||||
config.output.device = "Program";
|
||||
config.output.pixelFormat = "uyvy8";
|
||||
config.previewEnabled = true;
|
||||
config.runtimeShaderId = "solid-color";
|
||||
|
||||
const std::string json = AppConfigToJson(config);
|
||||
AppConfig parsed;
|
||||
std::string error;
|
||||
Expect(ParseAppConfigJson(json, parsed, error), "serialized config parses");
|
||||
Expect(error.empty(), "serialized config parse has no error");
|
||||
Expect(parsed.shaderLibrary == "custom-shaders", "shader library round trips");
|
||||
Expect(parsed.output.backend == "ndi", "output backend round trips");
|
||||
Expect(parsed.output.device == "Program", "output device round trips");
|
||||
Expect(parsed.output.pixelFormat == "uyvy8", "output pixel format round trips");
|
||||
Expect(parsed.previewEnabled, "preview enabled round trips");
|
||||
Expect(parsed.runtimeShaderId == "solid-color", "runtime shader id round trips");
|
||||
}
|
||||
|
||||
void TestHelpers()
|
||||
{
|
||||
using namespace RenderCadenceCompositor;
|
||||
@@ -149,6 +177,7 @@ int main()
|
||||
TestLoadsRuntimeHostConfig();
|
||||
TestCommandLineOverrides();
|
||||
TestPreviewDefaultsAreOptIn();
|
||||
TestConfigJsonRoundTrip();
|
||||
TestHelpers();
|
||||
|
||||
if (gFailures != 0)
|
||||
|
||||
Reference in New Issue
Block a user