From 2b9ad3fbcbea86bd2cf702ff4c6e603c33492e45 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 25 Jul 2024 14:39:16 +0200 Subject: core/participant: implement basic serialization --- core/include/turns/core/participant.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/include') diff --git a/core/include/turns/core/participant.hpp b/core/include/turns/core/participant.hpp index 8568b03..cd99fbb 100644 --- a/core/include/turns/core/participant.hpp +++ b/core/include/turns/core/participant.hpp @@ -8,6 +8,8 @@ #include #include +#include + #include namespace turns::core @@ -15,6 +17,7 @@ namespace turns::core struct participant : Glib::Object { auto static create(Glib::ustring name, float priority, disposition disposition) -> Glib::RefPtr; + auto static create(nlohmann::json const & serialized) -> Glib::RefPtr; participant(); participant(Glib::ustring name, float priority, disposition disposition); @@ -45,6 +48,8 @@ namespace turns::core return self.m_priority.get_proxy(); } + auto serialize() -> nlohmann::json; + private: Glib::Property m_disposition{*this, "disposition", core::disposition::neutral}; Glib::Property m_is_active{*this, "active", false}; -- cgit v1.2.3