]> git.sesse.net Git - nageru/blob - mainwindow.h
Move some lambdas out into functions.
[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         void cue_in_clicked();
40         void cue_out_clicked();
41         void queue_clicked();
42         void preview_clicked();
43         void play_clicked();
44         void live_player_clip_done();
45
46         enum Rounding { FIRST_AT_OR_AFTER, LAST_BEFORE };
47         void preview_single_frame(int64_t pts, unsigned stream_idx, Rounding rounding);
48
49         void resizeEvent(QResizeEvent *event) override;
50         bool eventFilter(QObject *watched, QEvent *event) override;
51
52 private slots:
53         void relayout();
54 };
55
56 extern MainWindow *global_mainwindow;
57
58 #endif
59