X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fmainwindow.h;h=669fc0e9e29e810c2ef27f91d9a9bfa8ccf3050d;hb=add8bb3a499cfeaad58bf5bdbda68391bab64059;hp=e21b3f38c181ef994f5120cffe4fd12b83a75812;hpb=eaba7288c4fb39ca195c9355970293bcaf088dbc;p=nageru diff --git a/futatabi/mainwindow.h b/futatabi/mainwindow.h index e21b3f3..669fc0e 100644 --- a/futatabi/mainwindow.h +++ b/futatabi/mainwindow.h @@ -5,10 +5,12 @@ #include "db.h" #include "state.pb.h" +#include #include #include #include #include +#include #include #include #include @@ -18,7 +20,11 @@ namespace Ui { class MainWindow; } // namespace Ui +struct FrameOnDisk; +class JPEGFrameView; class Player; +class QPushButton; +class QTableView; class MainWindow : public QMainWindow { Q_OBJECT @@ -30,13 +36,16 @@ public: // HTTP callback. TODO: Does perhaps not belong to MainWindow? std::pair get_queue_status() const; -//private: - Ui::MainWindow *ui; + void display_frame(unsigned stream_idx, const FrameOnDisk &frame); private: + Ui::MainWindow *ui; + QLabel *disk_free_label; std::unique_ptr preview_player, live_player; + std::map live_player_index_to_row; DB db; + unsigned num_cameras; // State when doing a scrub operation on a timestamp with the mouse. bool scrubbing = false; @@ -62,6 +71,9 @@ private: std::string deferred_change_id; StateProto deferred_state; + // NOTE: The undo stack always has the current state on top. + std::deque undo_stack, redo_stack; + // Before a change that should be deferred (see above), currently_deferring_model_changes // must be set to true, and current_change_id must be given contents describing what's // changed to avoid accidental grouping. @@ -71,12 +83,25 @@ private: mutable std::mutex queue_status_mu; std::string queue_status; // Under queue_status_mu. + struct FrameAndDisplay { + QFrame *frame; + JPEGFrameView *display; + QPushButton *preview_btn; + }; + std::vector displays; + + // Used to get tally information, if a tally URL is set. + QNetworkAccessManager http; + QNetworkReply *http_reply = nullptr; + + void change_num_cameras(); void cue_in_clicked(); void cue_out_clicked(); void queue_clicked(); void preview_clicked(); void preview_angle_clicked(unsigned stream_idx); void play_clicked(); + void stop_clicked(); void live_player_clip_done(); std::pair live_player_get_next_clip(); void live_player_clip_progress(const std::map &progress); @@ -88,6 +113,7 @@ private: void defer_timer_expired(); void content_changed(); // In clip_list or play_list. void state_changed(const StateProto &state); // Called post-filtering. + void save_settings(); enum Rounding { FIRST_AT_OR_AFTER, LAST_BEFORE }; void preview_single_frame(int64_t pts, unsigned stream_idx, Rounding rounding); @@ -106,9 +132,19 @@ private: void export_playlist_clip_interpolated_triggered(); void manual_triggered(); void about_triggered(); + void undo_triggered(); + void redo_triggered(); + void quality_toggled(int quality, bool checked); + void padding_toggled(double seconds, bool checked); void highlight_camera_input(int stream_idx); + template + void replace_model(QTableView *view, Model **model, Model *new_model); + + void start_tally(); + void tally_received(); + private slots: void relayout(); };