blob: 4248e2ad0b67746660977cff49d6fe5f3f0d95f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;
};
}
|