]> git.sesse.net Git - nageru/blob - mainwindow.h
Make it possible to change the camera angle in the playlist.
[nageru] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <stdbool.h>
5 #include <sys/types.h>
6 #include <QMainWindow>
7
8 #include "clip_list.h"
9
10 namespace Ui {
11 class MainWindow;
12 }  // namespace Ui
13
14 class Player;
15
16 class MainWindow : public QMainWindow
17 {
18         Q_OBJECT
19
20 public:
21         MainWindow();
22
23 //private:
24         Ui::MainWindow *ui;
25
26 private:
27         Player *preview_player, *live_player;
28
29         // State when doing a scrub operation on a timestamp with the mouse.
30         bool scrubbing = false;
31         int scrub_x_origin;  // In pixels on the viewport.
32         int64_t scrub_pts_origin;
33
34         // Which element (e.g. pts_in on clip 4) we are scrubbing.
35         enum ScrubType { SCRUBBING_CLIP_LIST, SCRUBBING_PLAYLIST } scrub_type;
36         int scrub_row;
37         int scrub_column;
38
39         // Used to keep track of small mouse wheel motions on the camera index in the playlist.
40         int last_mousewheel_camera_row = -1;
41         int leftover_angle_degrees = 0;
42
43         void cue_in_clicked();
44         void cue_out_clicked();
45         void queue_clicked();
46         void preview_clicked();
47         void preview_angle_clicked(unsigned stream_idx);
48         void play_clicked();
49         void live_player_clip_done();
50         void playlist_duplicate();
51         void playlist_remove();
52         void playlist_move(int delta);
53
54         enum Rounding { FIRST_AT_OR_AFTER, LAST_BEFORE };
55         void preview_single_frame(int64_t pts, unsigned stream_idx, Rounding rounding);
56
57         // Also covers when the playlist itself changes.
58         void playlist_selection_changed();
59
60         void resizeEvent(QResizeEvent *event) override;
61         bool eventFilter(QObject *watched, QEvent *event) override;
62
63 private slots:
64         void relayout();
65 };
66
67 extern MainWindow *global_mainwindow;
68
69 #endif
70