Files
video-shader-toys/apps/LoopThroughWithOpenGLCompositing/runtime/RuntimeStore.h
Aiden 27dbb55f7b
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 2m36s
CI / Windows Release Package (push) Successful in 2m48s
OSC seperation
2026-05-11 00:26:59 +10:00

57 lines
2.8 KiB
C++

#pragma once
#include "RuntimeHost.h"
#include <filesystem>
#include <string>
class RuntimeStore
{
public:
explicit RuntimeStore(RuntimeHost& runtimeHost);
bool InitializeStore(std::string& error);
std::string BuildPersistentStateJson() const;
bool CreateStoredLayer(const std::string& shaderId, std::string& error);
bool DeleteStoredLayer(const std::string& layerId, std::string& error);
bool MoveStoredLayer(const std::string& layerId, int direction, std::string& error);
bool MoveStoredLayerToIndex(const std::string& layerId, std::size_t targetIndex, std::string& error);
bool SetStoredLayerBypassState(const std::string& layerId, bool bypassed, std::string& error);
bool SetStoredLayerShaderSelection(const std::string& layerId, const std::string& shaderId, std::string& error);
bool SetStoredParameterValue(const std::string& layerId, const std::string& parameterId, const JsonValue& newValue, std::string& error);
bool SetStoredParameterValueByControlKey(const std::string& layerKey, const std::string& parameterKey, const JsonValue& newValue, std::string& error);
bool SetStoredParameterValueByControlKey(const std::string& layerKey, const std::string& parameterKey, const JsonValue& newValue, bool persistState, std::string& error);
bool ResetStoredLayerParameterValues(const std::string& layerId, std::string& error);
bool SaveStackPresetSnapshot(const std::string& presetName, std::string& error) const;
bool LoadStackPresetSnapshot(const std::string& presetName, std::string& error);
const std::filesystem::path& GetRuntimeRepositoryRoot() const;
const std::filesystem::path& GetRuntimeUiRoot() const;
const std::filesystem::path& GetRuntimeDocsRoot() const;
const std::filesystem::path& GetRuntimeDataRoot() const;
unsigned short GetConfiguredControlServerPort() const;
unsigned short GetConfiguredOscPort() const;
const std::string& GetConfiguredOscBindAddress() const;
double GetConfiguredOscSmoothing() const;
unsigned GetConfiguredMaxTemporalHistoryFrames() const;
unsigned GetConfiguredPreviewFps() const;
bool IsExternalKeyingConfigured() const;
const std::string& GetConfiguredInputVideoFormat() const;
const std::string& GetConfiguredInputFrameRate() const;
const std::string& GetConfiguredOutputVideoFormat() const;
const std::string& GetConfiguredOutputFrameRate() const;
void SetCompileStatus(bool succeeded, const std::string& message);
void ClearReloadRequest();
private:
bool TryResolveStoredLayerAndParameterByControlKeyLocked(const std::string& layerKey, const std::string& parameterKey,
RuntimeHost::LayerPersistentState*& matchedLayer, const ShaderPackage*& matchedPackage,
std::vector<ShaderParameterDefinition>::const_iterator& parameterIt, std::string& error) const;
JsonValue BuildRuntimeStateValue() const;
JsonValue SerializeLayerStack() const;
RuntimeHost& mRuntimeHost;
};