-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathtimelinecontainer.h
More file actions
72 lines (54 loc) · 1.72 KB
/
timelinecontainer.h
File metadata and controls
72 lines (54 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef TIMELINECONTAINER_H
#define TIMELINECONTAINER_H
#include <QWidget>
#include "timeline.h"
#include "selection.h"
namespace Ui {
class TimelineContainer;
}
class QScrollArea;
class QVBoxLayout;
class TimelineWidget;
class PlaybackWidget;
class QMediaContent;
// controller and view container
class TimelineContainer : public QWidget
{
Q_OBJECT
public:
explicit TimelineContainer(QWidget *parent = 0);
~TimelineContainer();
double cursor() const;
double cursorSnapped() const;
inline std::shared_ptr<Timeline> timeline() { return mTimeline; }
void setTimeline(const std::shared_ptr<Timeline>& timeline);
bool dirty() const;
protected:
void wheelEvent(QWheelEvent* ev) /* override */;
void keyPressEvent(QKeyEvent* ev) /* override */;
signals:
void currentLayerChanged(int idx); // idx == -1 if no layer is selected.
void currentSelectionChanged(const Selection& selection);
void snapIntervalChanged(double interval);
public slots:
void createLayer();
void removeCurrentLayer();
void addEventToCurrentLayer(const std::shared_ptr<TimelineEvent>& event);
void removeSelectionInCurrentLayer();
private slots:
void insertLayerWidget(int idx, std::shared_ptr<TimelineLayer> layer);
void removeLayerWidget(int idx);
private:
int currentLayerIdx() const;
const Selection& currentSelection() const;
std::shared_ptr<TimelineLayer> currentLayer();
void setCurrentLayerIdx(int idx);
Ui::TimelineContainer *ui;
QScrollArea* mLayerScrollArea;
QVBoxLayout* mLayerLayout;
PlaybackWidget* mPlaybackWidget;
TimelineWidget* mTimelineWidget;
int mCurrentLayerIdx;
std::shared_ptr<Timeline> mTimeline;
};
#endif // TIMELINECONTAINER_H