From cc672193b82a4b314d59aa2e572a5e9667c34f1b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 9 Mar 2019 17:44:36 +0100 Subject: WIP: Port to serd1 --- src/server/UndoStack.hpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/server/UndoStack.hpp') diff --git a/src/server/UndoStack.hpp b/src/server/UndoStack.hpp index 04021b99..7d79e7fc 100644 --- a/src/server/UndoStack.hpp +++ b/src/server/UndoStack.hpp @@ -21,8 +21,7 @@ #include "ingen/ingen.h" #include "lv2/atom/atom.h" #include "lv2/atom/util.h" -#include "serd/serd.h" -#include "sratom/sratom.h" +#include "serd/serd.hpp" #include #include @@ -30,6 +29,9 @@ #include #include #include +#include + +namespace sratom { class Streamer; } namespace ingen { @@ -80,7 +82,10 @@ public: std::deque events; }; - UndoStack(URIs& uris, URIMap& map) : _uris(uris), _map(map), _depth(0) {} + UndoStack(serd::World& world, URIs& uris, URIMap& map) + : _world(world), _uris(uris), _map(map), _depth(0) + { + } int start_entry(); bool write(const LV2_Atom* msg, int32_t default_id=0) override; @@ -89,17 +94,18 @@ public: bool empty() const { return _stack.empty(); } Entry pop(); - void save(FILE* stream, const char* name="undo"); + void save(std::ofstream& stream, const char* name="undo"); private: bool ignore_later_event(const LV2_Atom* first, const LV2_Atom* second) const; - void write_entry(Sratom* sratom, - SerdWriter* writer, - const SerdNode* subject, - const Entry& entry); + void write_entry(sratom::Streamer& streamer, + serd::Writer& writer, + const serd::Node& subject, + const Entry& entry); + serd::World& _world; URIs& _uris; URIMap& _map; std::deque _stack; -- cgit v1.2.1