X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=clip_list.h;h=126d1d5bc340e2fb1b04b85ee26361ab5f328acb;hb=530f3b3aa10aafaf22da10e53d3d243df26bf174;hp=9db4d07bf6ddfc0bca414472a912c88eaf5d8530;hpb=4ee7c0cbe14d845a4174852e0fb10292763a5a88;p=nageru diff --git a/clip_list.h b/clip_list.h index 9db4d07..126d1d5 100644 --- a/clip_list.h +++ b/clip_list.h @@ -11,7 +11,7 @@ #include "defs.h" struct Clip { - int64_t pts_in = -1, pts_out = -1; + 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. }; @@ -100,8 +100,17 @@ 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); + + // is inclusive in all of these. + void duplicate_clips(size_t first, size_t last); + void erase_clips(size_t first, size_t last); + // is -1 to move upwards, +1 to move downwards. + void move_clips(size_t first, size_t last, int delta); + size_t size() const { return clips.size(); } bool empty() const { return clips.empty(); }