]> git.sesse.net Git - nageru/blobdiff - futatabi/clip_list.h
Fix an issue where the stop button would be disabled too soon.
[nageru] / futatabi / clip_list.h
index 6fe30966a5e01a89ed68551d6b5c0119d0534299..af3d1f524c42084ab77815f91cb4e30552cf5d07 100644 (file)
@@ -5,16 +5,19 @@
 #include "state.pb.h"
 
 #include <QAbstractTableModel>
-#include <stdint.h>
 #include <map>
+#include <stdint.h>
 #include <string>
 #include <vector>
 
 struct Clip {
        int64_t pts_in = -1, pts_out = -1;  // pts_in is inclusive, pts_out is exclusive.
        std::string descriptions[MAX_STREAMS];
-       unsigned stream_idx = 0;  // For the playlist only.
-       double fade_time_seconds = 0.5;  // For the playlist only.
+
+       // These are for the playlist only.
+       unsigned stream_idx = 0;
+       double fade_time_seconds = 0.5;
+       double speed = 0.5;
 };
 
 class DataChangedReceiver {
@@ -76,12 +79,12 @@ public:
 
        ClipListProto serialize() const;
 
-       void change_num_cameras(size_t num_cameras);  // Defaults to 1. Cannot decrease.
+       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) + num_cameras);
+               return (column >= int(Column::CAMERA_1) && column < int(Column::CAMERA_1) + int(num_cameras));
        }
 
 signals:
@@ -89,7 +92,7 @@ signals:
 
 private:
        std::vector<Clip> clips;
-       size_t num_cameras = 1;
+       size_t num_cameras = 2;
 };
 
 class PlayList : public QAbstractTableModel, public DataChangedReceiver {
@@ -106,6 +109,7 @@ public:
                CAMERA,
                DESCRIPTION,
                FADE_TIME,
+               SPEED,
                NUM_COLUMNS
        };
 
@@ -141,7 +145,7 @@ public:
 
        ClipListProto serialize() const;
 
-       void change_num_cameras(size_t num_cameras)  // Defaults to 1. Cannot decrease.
+       void change_num_cameras(size_t num_cameras)  // Defaults to 2. Cannot decrease.
        {
                this->num_cameras = num_cameras;
        }
@@ -156,7 +160,7 @@ private:
        int currently_playing_index = -1;
        double play_progress = 0.0;
        std::map<size_t, double> current_progress;
-       size_t num_cameras = 1;
+       size_t num_cameras = 2;
 };
 
 #endif  // !defined (_CLIP_LIST_H)