diff options
Diffstat (limited to 'src/labeller.h')
-rw-r--r-- | src/labeller.h | 32 |
1 files changed, 32 insertions, 0 deletions
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 <memory> +#include <vector> +#include <string> +#include <utility> +#include <filesystem> + +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<label, label> getSurrounding(double time) const; + std::vector<std::string> 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<labeller_impl> data; + }; +} |