]> git.sesse.net Git - nageru/blob - clip_list.h
Start working on a clip list.
[nageru] / clip_list.h
1 #ifndef _CLIP_LIST_H
2 #define _CLIP_LIST_H 1
3
4 #include <QAbstractTableModel>
5
6 #include <stdint.h>
7
8 #include <vector>
9 #include <string>
10
11 struct Clip {
12         int64_t pts_in = -1, pts_out = -1;
13         std::vector<std::string> descriptions;  // One per camera.
14 };
15
16 class ClipList : public QAbstractTableModel {
17         Q_OBJECT
18
19 public:
20         int rowCount(const QModelIndex &parent) const override;
21         int columnCount(const QModelIndex &parent) const override;
22         QVariant data(const QModelIndex &parent, int role) const override;
23         QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
24
25         void add_clip(int64_t pts_in);
26         size_t size() const { return clips.size(); }
27
28 private:
29         std::vector<Clip> clips;
30 };
31
32 #endif  // !defined (_CLIP_LIST_H)