@@ -21,12 +21,23 @@ enum class ReferencePoint
21
21
// ^ ^
22
22
// | C |
23
23
//
24
- // item = item to overwrite (usually a clip)
24
+ // item = item to overwrite (usually a clip) -- C in the diagram.
25
25
// composition = usually a track item.
26
26
// range = time range to overwrite.
27
27
// remove_transitions = whether to remove transitions within range.
28
- // fill_template = item to fill in (usually a gap),
29
- // when range > composition's time.
28
+ // fill_template = item to fill in (usually a gap).
29
+ //
30
+ // If overwrite range starts after B's end, a gap hole is filled with
31
+ // fill_template and then then C is appended.
32
+ //
33
+ // If overwrite range starts before B's end and extends after, B is partitioned
34
+ // and C is appended at the end.
35
+ //
36
+ // If overwrite range starts before A and partially overlaps it, C is
37
+ // added at the beginning and A is partitioned.
38
+ //
39
+ // If overwrite range starts and ends before A, a gap hole is filled with
40
+ // fill_template.
30
41
void overwrite (
31
42
Item* item,
32
43
Composition* composition,
@@ -47,6 +58,10 @@ void overwrite(
47
58
// remove_transitions = whether to remove transitions that intersect time.
48
59
// fill_template = item to fill in (usually a gap),
49
60
// when time > composition's time.
61
+ //
62
+ // If A and B's length is L1 and C's length is L2, the end result is L1 + L2.
63
+ // A is split.
64
+ //
50
65
void insert (
51
66
Item* const item,
52
67
Composition* composition,
@@ -68,6 +83,11 @@ void insert(
68
83
// source_range().end_time_exclusive() will be adjusted by
69
84
// fill_template = item to fill in (usually a gap),
70
85
// when time > composition's time.
86
+ //
87
+ // Do not affect other clips.
88
+ // Fill now-"empty" time with gap or template
89
+ // Unless item is meeting a Gap, then, existing Gap's duration will be augmented
90
+ //
71
91
void trim (
72
92
Item* item,
73
93
RationalTime const & delta_in,
@@ -95,17 +115,24 @@ void slice(
95
115
//
96
116
// item = item to slip (usually a clip)
97
117
// delta = +/- rational time to slip the item by.
118
+ //
119
+ // Do not affect item duration.
120
+ // Do not affect surrounding items.
121
+ // Clamp to available_range of media (if available)
98
122
void slip (Item* item, RationalTime const & delta);
99
123
100
124
//
101
- // Slide an item start_time by + or -, moving the previous item's duration.
125
+ // Slide an item start_time by + or -, adjusting the previous item's duration.
102
126
// Clamps previous item's duration to available_range if available.
103
127
//
104
128
// | A | B | C | -> | A | B | C |
105
129
// *--->
106
130
//
107
131
// item = item to slip (usually a clip)
108
132
// delta = +/- rational time to slide the item by.
133
+ //
134
+ // If item is the first clip, it does nothing.
135
+ //
109
136
void slide (Item* item, RationalTime const & delta);
110
137
111
138
//
@@ -178,6 +205,8 @@ void fill(
178
205
// fill = whether to fill the hole with fill_template.
179
206
// fill_template = if nullptr, use a gap to fill the hole.
180
207
//
208
+ // if fill is not set, A and B become concatenated, with no fill.
209
+ //
181
210
void remove (
182
211
Composition* composition,
183
212
RationalTime const & time,
0 commit comments