]> git.sesse.net Git - nageru/blob - mainwindow.h
Add some playlist manipulation controls.
[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 preview_angle_clicked(unsigned stream_idx);
44         void play_clicked();
45         void live_player_clip_done();
46         void playlist_duplicate();
47         void playlist_remove();
48         void playlist_move(int delta);
49
50         enum Rounding { FIRST_AT_OR_AFTER, LAST_BEFORE };
51         void preview_single_frame(int64_t pts, unsigned stream_idx, Rounding rounding);
52
53         // Also covers when the playlist itself changes.
54         void playlist_selection_changed();
55
56         void resizeEvent(QResizeEvent *event) override;
57         bool eventFilter(QObject *watched, QEvent *event) override;
58
59 private slots:
60         void relayout();
61 };
62
63 extern MainWindow *global_mainwindow;
64
65 #endif
66