19 class MainWindow : public QMainWindow
30 QLabel *disk_free_label;
31 Player *preview_player, *live_player;
34 // State when doing a scrub operation on a timestamp with the mouse.
35 bool scrubbing = false;
36 int scrub_x_origin; // In pixels on the viewport.
37 int64_t scrub_pts_origin;
39 // Which element (e.g. pts_in on clip 4) we are scrubbing.
40 enum ScrubType { SCRUBBING_CLIP_LIST, SCRUBBING_PLAYLIST } scrub_type;
44 // Used to keep track of small mouse wheel motions on the camera index in the playlist.
45 int last_mousewheel_camera_row = -1;
46 int leftover_angle_degrees = 0;
48 // Some operations, notably scrubbing and scrolling, happen in so large increments
49 // that we want to group them instead of saving to disk every single time.
50 // If they happen (ie., we get a callback from the model that it's changed) while
51 // currently_deferring_model_changes, we fire off this timer. If it manages to elapse
52 // before some other event happens, we count the event. (If the other event is of the
53 // same kind, we just fire off the timer anew instead of taking any action.)
54 QTimer *defer_timeout;
55 std::string deferred_change_id;
56 StateProto deferred_state;
58 // Before a change that should be deferred (see above), currently_deferring_model_changes
59 // must be set to true, and current_change_id must be given contents describing what's
60 // changed to avoid accidental grouping.
61 bool currently_deferring_model_changes = false;
62 std::string current_change_id;
64 void cue_in_clicked();
65 void cue_out_clicked();
67 void preview_clicked();
68 void preview_angle_clicked(unsigned stream_idx);
70 void live_player_clip_done();
71 void live_player_clip_progress(double played_this_clip, double total_length);
72 void playlist_duplicate();
73 void playlist_remove();
74 void playlist_move(int delta);
76 void defer_timer_expired();
77 void content_changed(); // In clip_list or play_list.
78 void state_changed(const StateProto &state); // Called post-filtering.
80 enum Rounding { FIRST_AT_OR_AFTER, LAST_BEFORE };
81 void preview_single_frame(int64_t pts, unsigned stream_idx, Rounding rounding);
83 // Also covers when the playlist itself changes.
84 void playlist_selection_changed();
86 void resizeEvent(QResizeEvent *event) override;
87 bool eventFilter(QObject *watched, QEvent *event) override;
89 void report_disk_space(off_t free_bytes, double estimated_seconds_left);
95 extern MainWindow *global_mainwindow;