diff options
author | Your Name <you@example.com> | 2021-05-13 17:20:26 -0400 |
---|---|---|
committer | Your Name <you@example.com> | 2021-05-13 17:20:26 -0400 |
commit | 5a6248518654ec97d95d2c463e3ffb4be7bbf456 (patch) | |
tree | a6ebb6bb26ba2a6b4abc3829a81c58ae97fd2e05 /src/labeller.h | |
download | annotator-5a6248518654ec97d95d2c463e3ffb4be7bbf456.tar.gz annotator-5a6248518654ec97d95d2c463e3ffb4be7bbf456.tar.bz2 annotator-5a6248518654ec97d95d2c463e3ffb4be7bbf456.zip |
Initial commit
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; + }; +} |