]> git.sesse.net Git - nageru/blobdiff - futatabi/mainwindow.h
Only enable the preview button if we can actually preview something.
[nageru] / futatabi / mainwindow.h
index 669fc0e9e29e810c2ef27f91d9a9bfa8ccf3050d..d7e037c37ee7205a6c177d22509ce25f85fa990b 100644 (file)
@@ -5,15 +5,15 @@
 #include "db.h"
 #include "state.pb.h"
 
-#include <deque>
-#include <memory>
-#include <mutex>
 #include <QLabel>
 #include <QMainWindow>
 #include <QNetworkAccessManager>
+#include <deque>
+#include <memory>
+#include <mutex>
 #include <stdbool.h>
-#include <sys/types.h>
 #include <string>
+#include <sys/types.h>
 #include <utility>
 
 namespace Ui {
@@ -43,7 +43,6 @@ private:
 
        QLabel *disk_free_label;
        std::unique_ptr<Player> preview_player, live_player;
-       std::map<size_t, size_t> live_player_index_to_row;
        DB db;
        unsigned num_cameras;
 
@@ -53,7 +52,8 @@ private:
        int64_t scrub_pts_origin;
 
        // Which element (e.g. pts_in on clip 4) we are scrubbing.
-       enum ScrubType { SCRUBBING_CLIP_LIST, SCRUBBING_PLAYLIST } scrub_type;
+       enum ScrubType { SCRUBBING_CLIP_LIST,
+                        SCRUBBING_PLAYLIST } scrub_type;
        int scrub_row;
        int scrub_column;
 
@@ -102,9 +102,8 @@ private:
        void preview_angle_clicked(unsigned stream_idx);
        void play_clicked();
        void stop_clicked();
-       void live_player_clip_done();
-       std::pair<Clip, size_t> live_player_get_next_clip();
-       void live_player_clip_progress(const std::map<size_t, double> &progress);
+       void live_player_done();
+       void live_player_clip_progress(const std::map<uint64_t, double> &progress, double time_remaining);
        void set_output_status(const std::string &status);
        void playlist_duplicate();
        void playlist_remove();
@@ -115,7 +114,8 @@ private:
        void state_changed(const StateProto &state);  // Called post-filtering.
        void save_settings();
 
-       enum Rounding { FIRST_AT_OR_AFTER, LAST_BEFORE };
+       enum Rounding { FIRST_AT_OR_AFTER,
+                       LAST_BEFORE };
        void preview_single_frame(int64_t pts, unsigned stream_idx, Rounding rounding);
 
        // Also covers when the playlist itself changes.
@@ -138,8 +138,9 @@ private:
        void padding_toggled(double seconds, bool checked);
 
        void highlight_camera_input(int stream_idx);
+       void enable_or_disable_preview_button();
 
-       template <class Model>
+       template<class Model>
        void replace_model(QTableView *view, Model **model, Model *new_model);
 
        void start_tally();