From e3f67a30678e5c1e6e60ee3c5f91cdb5d4fa1ae2 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 1 Oct 2016 20:49:55 +0200 Subject: [PATCH] Add preset todo in SettingsLoader --- src/Application/SettingsLoader.cpp | 6 ++++++ src/Surfaces/SurfaceManager.h | 6 ++++++ src/Surfaces/SurfaceStack.h | 7 ++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp index cd84684..4fcbd2f 100644 --- a/src/Application/SettingsLoader.cpp +++ b/src/Application/SettingsLoader.cpp @@ -29,6 +29,12 @@ bool SettingsLoader::load(SurfaceStack & surfaces, MediaServer & mediaServer, st return false; } + /* TODO: Add presets. + * Presets would be surface groups. Now we are using a single tag + * to store only one possible composition. We can multiply the container + * in order to get presets working. + */ + if(!xmlSettings->tagExists("surfaces")){ ofLogWarning("SettingsLoader::load()") << "XML settings is empty or has wrong markup"; return false; diff --git a/src/Surfaces/SurfaceManager.h b/src/Surfaces/SurfaceManager.h index 80ce0bd..98903ca 100644 --- a/src/Surfaces/SurfaceManager.h +++ b/src/Surfaces/SurfaceManager.h @@ -21,6 +21,12 @@ namespace piMapper { class SurfaceManager { + /* TODO: Add presets. + * This would be solved by adding multiple SurfaceStack instances. Depending on selected + * preset, it would draw and operate on a a specific surface stack. SurfaceManager would + * become kind of a state machine. + */ + public: SurfaceManager(); diff --git a/src/Surfaces/SurfaceStack.h b/src/Surfaces/SurfaceStack.h index 19e808d..94f5d86 100644 --- a/src/Surfaces/SurfaceStack.h +++ b/src/Surfaces/SurfaceStack.h @@ -6,9 +6,10 @@ namespace ofx { namespace piMapper { -// One can imagine this as a layers panel in an image editor. -// TODO: Make it singleton for easy access from commands. -// And refactor rest of the code to use it this way. +/* TODO: Do not use singleton here. + * For presets we need multiple instances of surface stacks. + */ + class SurfaceStack { public: static SurfaceStack * instance();