From 4721d1e65d3301cb812bd8ebf3095b761a2fc1bd Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Wed, 9 Oct 2019 17:47:53 +0300 Subject: [PATCH] WIP Reader writer headers --- .../codecs/include/ftl/codecs/reader.hpp | 28 +++++++++++++++++++ .../codecs/include/ftl/codecs/writer.hpp | 26 +++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 components/codecs/include/ftl/codecs/reader.hpp create mode 100644 components/codecs/include/ftl/codecs/writer.hpp diff --git a/components/codecs/include/ftl/codecs/reader.hpp b/components/codecs/include/ftl/codecs/reader.hpp new file mode 100644 index 000000000..0b34af31f --- /dev/null +++ b/components/codecs/include/ftl/codecs/reader.hpp @@ -0,0 +1,28 @@ +#ifndef _FTL_CODECS_READER_HPP_ +#define _FTL_CODECS_READER_HPP_ + +namespace ftl { +namespace codecs { + +class Reader { + public: + Reader(); + ~Reader(); + + bool open(const std::string &filename); + + bool start(const std::function<void(const ftl::codecs::StreamPacket &, const ftl::codecs::Packet &)> &); + void stop(); + void pause(bool); + bool paused(); + + void loop(bool); + bool looping(); + + +}; + +} +} + +#endif // _FTL_CODECS_READER_HPP_ diff --git a/components/codecs/include/ftl/codecs/writer.hpp b/components/codecs/include/ftl/codecs/writer.hpp new file mode 100644 index 000000000..b45be7936 --- /dev/null +++ b/components/codecs/include/ftl/codecs/writer.hpp @@ -0,0 +1,26 @@ +#ifndef _FTL_CODECS_WRITER_HPP_ +#define _FTL_CODECS_WRITER_HPP_ + +namespace ftl { +namespace codecs { + +class Writer { + public: + Writer(); + ~Writer(); + + bool open(const std::string &filename); + + bool write(const ftl::codecs::StreamPacket &, const ftl::codecs::Packet &); + + bool write(const ftl::codecs::StreamPacket &, const std::string &json); + bool write(const ftl::codecs::StreamPacket &, const Eigen::Matrix4d &m); + + private: + std::ofstream file_; +}; + +} +} + +#endif // _FTL_CODECS_WRITER_HPP_ -- GitLab