]> git.sesse.net Git - nageru/blobdiff - futatabi/clip_list.h
Prefix all the Futatabi Prometheus metrics by futatabi_ instead of nageru_.
[nageru] / futatabi / clip_list.h
index d2c7f83cd66795b3a2172a4b4c79e01f7826cd1d..6bd0fbb1274f0cc2b4270270af4768f68bfd4301 100644 (file)
 
 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,7 +50,7 @@ class ClipList : public QAbstractTableModel, public DataChangedReceiver {
        Q_OBJECT
 
 public:
-       explicit ClipList(const ClipListProto &serialized);
+       ClipList(const ClipListProto &serialized);
 
        enum class Column {
                IN,
@@ -76,11 +79,12 @@ 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;
 
-       static bool is_camera_column(int column)
+       bool is_camera_column(int column) const
        {
-               return (column >= int(Column::CAMERA_1) && column < int(Column::CAMERA_1) + NUM_CAMERAS);
+               return (column >= int(Column::CAMERA_1) && column < int(Column::CAMERA_1) + int(num_cameras));
        }
 
 signals:
@@ -88,6 +92,7 @@ signals:
 
 private:
        std::vector<Clip> clips;
+       size_t num_cameras = 2;
 };
 
 class PlayList : public QAbstractTableModel, public DataChangedReceiver {
@@ -104,6 +109,7 @@ public:
                CAMERA,
                DESCRIPTION,
                FADE_TIME,
+               SPEED,
                NUM_COLUMNS
        };
 
@@ -139,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:
@@ -149,6 +160,7 @@ private:
        int currently_playing_index = -1;
        double play_progress = 0.0;
        std::map<size_t, double> current_progress;
+       size_t num_cameras = 2;
 };
 
 #endif  // !defined (_CLIP_LIST_H)