summaryrefslogtreecommitdiff
path: root/state.cpp
diff options
context:
space:
mode:
authorDylam De La Torre <DyXel04@gmail.com>2021-11-23 05:21:56 +0100
committerGitHub <noreply@github.com>2021-11-23 04:21:56 +0000
commita51a54bc5979a2491f152abc47ad54e6b63f27c8 (patch)
treece67092b2f6df366033a65a6111e4650866766b2 /state.cpp
parentd88079000a79e6bcbe51c5a2868d57b303b5fcb6 (diff)
downloadabaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.tar.gz
abaddon-portaudio-a51a54bc5979a2491f152abc47ad54e6b63f27c8.zip
Restructure source and resource files (#46)
importantly, res is now res/res and css is now res/css
Diffstat (limited to 'state.cpp')
-rw-r--r--state.cpp37
1 files changed, 0 insertions, 37 deletions
diff --git a/state.cpp b/state.cpp
deleted file mode 100644
index 043d181..0000000
--- a/state.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-#include "state.hpp"
-
-void to_json(nlohmann::json &j, const ExpansionStateRoot &m) {
- if (m.Children.empty()) {
- j = nlohmann::json::object();
- } else {
- for (const auto &[id, state] : m.Children)
- j[std::to_string(id)] = state;
- }
-}
-
-void from_json(const nlohmann::json &j, ExpansionStateRoot &m) {
- for (const auto &[key, value] : j.items())
- m.Children[key] = value;
-}
-
-void to_json(nlohmann::json &j, const ExpansionState &m) {
- j["e"] = m.IsExpanded;
- j["c"] = m.Children;
-}
-
-void from_json(const nlohmann::json &j, ExpansionState &m) {
- j.at("e").get_to(m.IsExpanded);
- j.at("c").get_to(m.Children);
-}
-
-void to_json(nlohmann::json &j, const AbaddonApplicationState &m) {
- j["active_channel"] = m.ActiveChannel;
- j["expansion"] = m.Expansion;
-}
-
-void from_json(const nlohmann::json &j, AbaddonApplicationState &m) {
- if (j.contains("active_channel"))
- j.at("active_channel").get_to(m.ActiveChannel);
- if (j.contains("expansion"))
- j.at("expansion").get_to(m.Expansion);
-}