initial commit
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
constexpr uint32_t DefaultGridCols = 2;
|
||||
constexpr uint32_t DefaultGridRows = 2;
|
||||
constexpr uint32_t MaxFeedCount = 16;
|
||||
constexpr const char* AppName = "MXL Multiviewer";
|
||||
constexpr uint32_t AppVersionMajor = 0;
|
||||
constexpr uint32_t AppVersionMinor = 1;
|
||||
constexpr uint32_t AppVersionPatch = 0;
|
||||
|
||||
enum class FeedKind
|
||||
{
|
||||
NoSignal,
|
||||
MxlPlaceholder,
|
||||
SmpteBars,
|
||||
MxlSdk
|
||||
};
|
||||
|
||||
enum class PresentModeConfig
|
||||
{
|
||||
Fifo,
|
||||
Mailbox,
|
||||
Immediate
|
||||
};
|
||||
|
||||
struct FeedConfig
|
||||
{
|
||||
FeedKind kind = FeedKind::NoSignal;
|
||||
std::string mxlDomain;
|
||||
std::string mxlFlowId;
|
||||
};
|
||||
|
||||
struct AppConfig
|
||||
{
|
||||
bool logFps = true;
|
||||
bool logPerf = false;
|
||||
bool verbose = false;
|
||||
uint32_t fpsCap = 60;
|
||||
uint32_t gridCols = DefaultGridCols;
|
||||
uint32_t gridRows = DefaultGridRows;
|
||||
PresentModeConfig presentMode = PresentModeConfig::Mailbox;
|
||||
std::vector<FeedConfig> feeds;
|
||||
};
|
||||
|
||||
std::optional<FeedKind> parseFeedKind(std::string_view text);
|
||||
std::string_view feedKindName(FeedKind kind);
|
||||
|
||||
void printUsage(const char* executableName);
|
||||
|
||||
struct ConfigParseResult
|
||||
{
|
||||
AppConfig config;
|
||||
bool shouldExit = false;
|
||||
int exitCode = 0;
|
||||
};
|
||||
|
||||
ConfigParseResult parseAppConfig(
|
||||
int argc,
|
||||
char* argv[]);
|
||||
Reference in New Issue
Block a user