]> git.sesse.net Git - nageru/blobdiff - clip_list.h
Make it possible to edit the description in the play list.
[nageru] / clip_list.h
index e97f04f56ed91759f9110a127be88dbc2b09632c..64d06cd29f19633da0b82c1f9355442c49bcb44f 100644 (file)
@@ -8,9 +8,11 @@
 #include <vector>
 #include <string>
 
+#include "defs.h"
+
 struct Clip {
-       int64_t pts_in = -1, pts_out = -1;
-       std::vector<std::string> descriptions;  // One per camera.
+       int64_t pts_in = -1, pts_out = -1;  // pts_in is inclusive, pts_out is exclusive.
+       std::string descriptions[NUM_CAMERAS];
        unsigned stream_idx = 0;  // For the playlist only.
 };
 
@@ -59,6 +61,8 @@ public:
        int columnCount(const QModelIndex &parent) const override;
        QVariant data(const QModelIndex &parent, int role) const override;
        QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
+       Qt::ItemFlags flags(const QModelIndex &index) const override;
+       bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
 
        void add_clip(const Clip &clip);
        size_t size() const { return clips.size(); }
@@ -96,6 +100,8 @@ public:
        int columnCount(const QModelIndex &parent) const override;
        QVariant data(const QModelIndex &parent, int role) const override;
        QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
+       Qt::ItemFlags flags(const QModelIndex &index) const override;
+       bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
 
        void add_clip(const Clip &clip);
        size_t size() const { return clips.size(); }