From 5a6248518654ec97d95d2c463e3ffb4be7bbf456 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 13 May 2021 17:20:26 -0400 Subject: Initial commit --- src/labeller.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/labeller.h (limited to 'src/labeller.h') diff --git a/src/labeller.h b/src/labeller.h new file mode 100644 index 0000000..4248e2a --- /dev/null +++ b/src/labeller.h @@ -0,0 +1,32 @@ +#pragma once +#include +#include +#include +#include +#include + +namespace backend { + struct labeller_impl; + + struct label { + label() {} + label(const std::string& name, double time) : name(name), time(time) {} + std::string name; + double time; + }; + + class labeller { + public: + labeller(const std::filesystem::path& savepath); + std::pair getSurrounding(double time) const; + std::vector getLabels() const; + void applyLabel(std::string name, double time); + void deleteLabel(double time); // Deletes closest to time, last added if ties + void undo(); + void redo(); + void save() const; + + private: + std::shared_ptr data; + }; +} -- cgit v1.2.3