]> git.sesse.net Git - nageru/blobdiff - clip_list.h
Allow symlinked frame files. Useful for testing.
[nageru] / clip_list.h
index c853263c13e28047048fcaa7c53aa59df6253d41..8dead831106e74783704ad5fab8ea6b9eb9eb675 100644 (file)
@@ -1,15 +1,14 @@
 #ifndef _CLIP_LIST_H
 #define _CLIP_LIST_H 1
 
-#include <QAbstractTableModel>
+#include "defs.h"
+#include "state.pb.h"
 
+#include <QAbstractTableModel>
 #include <stdint.h>
-
-#include <vector>
+#include <map>
 #include <string>
-
-#include "defs.h"
-#include "state.pb.h"
+#include <vector>
 
 struct Clip {
        int64_t pts_in = -1, pts_out = -1;  // pts_in is inclusive, pts_out is exclusive.
@@ -20,6 +19,7 @@ struct Clip {
 
 class DataChangedReceiver {
 public:
+       virtual ~DataChangedReceiver() {}
        virtual void emit_data_changed(size_t row) = 0;
 };
 
@@ -28,7 +28,8 @@ struct ClipProxy {
 public:
        ClipProxy(Clip &clip, DataChangedReceiver *clip_list, size_t row)
                : clip(clip), clip_list(clip_list), row(row) {}
-       ~ClipProxy() {
+       ~ClipProxy()
+       {
                if (clip_list != nullptr) {
                        clip_list->emit_data_changed(row);
                }
@@ -132,6 +133,8 @@ public:
        void set_currently_playing(int index, double progress);  // -1 = none.
        int get_currently_playing() const { return currently_playing_index; }
 
+       void set_progress(const std::map<size_t, double> &progress);
+
        ClipListProto serialize() const;
 
        void emit_data_changed(size_t row) override;
@@ -143,6 +146,7 @@ private:
        std::vector<Clip> clips;
        int currently_playing_index = -1;
        double play_progress = 0.0;
+       std::map<size_t, double> current_progress;
 };
 
 #endif  // !defined (_CLIP_LIST_H)