Polyphase Game Engine
Loading...
Searching...
No Matches
TimelineActions.h
Go to the documentation of this file.
1#pragma once
2
3#if EDITOR
4
5#include "ActionManager.h"
6#include "AssetRef.h"
7#include "Stream.h"
8
9class Timeline;
10class TimelineTrack;
11class TimelineClip;
12
13// ======= Add Track =======
14class ActionTimelineAddTrack : public Action
15{
16public:
17 DECLARE_ACTION_INTERFACE(TimelineAddTrack);
18
19 ActionTimelineAddTrack(Timeline* timeline, TypeId trackType);
20
21protected:
22 TimelineRef mTimeline;
23 TypeId mTrackType = INVALID_TYPE_ID;
24 int32_t mTrackIndex = -1;
25};
26
27// ======= Remove Track =======
28class ActionTimelineRemoveTrack : public Action
29{
30public:
31 DECLARE_ACTION_INTERFACE(TimelineRemoveTrack);
32
33 ActionTimelineRemoveTrack(Timeline* timeline, int32_t trackIndex);
34
35protected:
36 TimelineRef mTimeline;
37 int32_t mTrackIndex = -1;
38 std::vector<uint8_t> mSerializedData;
39 TypeId mTrackType = INVALID_TYPE_ID;
40};
41
42// ======= Add Clip =======
43class ActionTimelineAddClip : public Action
44{
45public:
46 DECLARE_ACTION_INTERFACE(TimelineAddClip);
47
48 ActionTimelineAddClip(Timeline* timeline, int32_t trackIndex, TypeId clipType, float startTime, float duration);
49
50protected:
51 TimelineRef mTimeline;
52 int32_t mTrackIndex = -1;
53 int32_t mClipIndex = -1;
54 TypeId mClipType = INVALID_TYPE_ID;
55 float mStartTime = 0.0f;
56 float mDuration = 1.0f;
57};
58
59// ======= Remove Clip =======
60class ActionTimelineRemoveClip : public Action
61{
62public:
63 DECLARE_ACTION_INTERFACE(TimelineRemoveClip);
64
65 ActionTimelineRemoveClip(Timeline* timeline, int32_t trackIndex, int32_t clipIndex);
66
67protected:
68 TimelineRef mTimeline;
69 int32_t mTrackIndex = -1;
70 int32_t mClipIndex = -1;
71 std::vector<uint8_t> mSerializedData;
72 TypeId mClipType = INVALID_TYPE_ID;
73};
74
75// ======= Move Clip =======
76class ActionTimelineMoveClip : public Action
77{
78public:
79 DECLARE_ACTION_INTERFACE(TimelineMoveClip);
80
81 ActionTimelineMoveClip(Timeline* timeline, int32_t trackIndex, int32_t clipIndex, float oldStartTime, float newStartTime);
82
83protected:
84 TimelineRef mTimeline;
85 int32_t mTrackIndex = -1;
86 int32_t mClipIndex = -1;
87 float mOldStartTime = 0.0f;
88 float mNewStartTime = 0.0f;
89};
90
91// ======= Bind Track (change target node) =======
92class ActionTimelineBindTrack : public Action
93{
94public:
95 DECLARE_ACTION_INTERFACE(TimelineBindTrack);
96
97 ActionTimelineBindTrack(Timeline* timeline, int32_t trackIndex, uint64_t oldUuid, uint64_t newUuid, const std::string& oldName, const std::string& newName);
98
99protected:
100 TimelineRef mTimeline;
101 int32_t mTrackIndex = -1;
102 uint64_t mOldUuid = 0;
103 uint64_t mNewUuid = 0;
104 std::string mOldName;
105 std::string mNewName;
106};
107
108#endif
#define DECLARE_ACTION_INTERFACE(Name)
Definition ActionManager.h:352
#define INVALID_TYPE_ID
Definition Constants.h:40
uint32_t TypeId
Definition EngineTypes.h:64
Definition ActionManager.h:134
Definition AssetRef.h:18
Definition TimelineClip.h:24
Definition TimelineTrack.h:25
Definition Timeline.h:10