X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fclip_list.h;h=af3d1f524c42084ab77815f91cb4e30552cf5d07;hb=4a9e97065dade428e373a83618bc973cd93cbe52;hp=8dead831106e74783704ad5fab8ea6b9eb9eb675;hpb=6e116a6bbeb2c047a3bfb084395ec601ce211e6c;p=nageru diff --git a/futatabi/clip_list.h b/futatabi/clip_list.h index 8dead83..af3d1f5 100644 --- a/futatabi/clip_list.h +++ b/futatabi/clip_list.h @@ -5,16 +5,19 @@ #include "state.pb.h" #include -#include #include +#include #include #include struct Clip { 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. - double fade_time_seconds = 0.5; // For the playlist only. + std::string descriptions[MAX_STREAMS]; + + // These are for the playlist only. + unsigned stream_idx = 0; + double fade_time_seconds = 0.5; + double speed = 0.5; }; class DataChangedReceiver { @@ -47,17 +50,14 @@ class ClipList : public QAbstractTableModel, public DataChangedReceiver { Q_OBJECT public: - explicit ClipList(const ClipListProto &serialized); + ClipList(const ClipListProto &serialized); enum class Column { IN, OUT, DURATION, - CAMERA_1, - CAMERA_2, - CAMERA_3, - CAMERA_4, - NUM_COLUMNS + CAMERA_1, // Then CAMERA_2, CAMERA_3, etc. as needed. + NUM_NON_CAMERA_COLUMNS = CAMERA_1 }; int rowCount(const QModelIndex &parent) const override; @@ -79,13 +79,20 @@ public: ClipListProto serialize() const; + void change_num_cameras(size_t num_cameras); // Defaults to 2. Cannot decrease. void emit_data_changed(size_t row) override; + bool is_camera_column(int column) const + { + return (column >= int(Column::CAMERA_1) && column < int(Column::CAMERA_1) + int(num_cameras)); + } + signals: void any_content_changed(); private: std::vector clips; + size_t num_cameras = 2; }; class PlayList : public QAbstractTableModel, public DataChangedReceiver { @@ -102,6 +109,7 @@ public: CAMERA, DESCRIPTION, FADE_TIME, + SPEED, NUM_COLUMNS }; @@ -137,6 +145,11 @@ public: ClipListProto serialize() const; + void change_num_cameras(size_t num_cameras) // Defaults to 2. Cannot decrease. + { + this->num_cameras = num_cameras; + } + void emit_data_changed(size_t row) override; signals: @@ -147,6 +160,7 @@ private: int currently_playing_index = -1; double play_progress = 0.0; std::map current_progress; + size_t num_cameras = 2; }; #endif // !defined (_CLIP_LIST_H)