summaryrefslogtreecommitdiff
path: root/ges/ges-enums.c
diff options
context:
space:
mode:
authorHenry Wilkes <hwilkes@igalia.com>2020-04-27 13:58:38 +0100
committerHenry Wilkes <hwilkes@igalia.com>2020-05-07 09:37:15 +0100
commit39097f55746cd760242b4194a408e54bc1bb4c1b (patch)
tree73735183fcdee4bc4de1dab1459aac5df76bb78d /ges/ges-enums.c
parenta6b13ce61990f5b5e014b7bc294929beaa981815 (diff)
timeline-tree: simplify and fix editing
Editing has been simplified by breaking down each edit into a combination of three basic single-element edits: MOVE, TRIM_START, and TRIM_END. Each edit follows these steps: + Determine which elements are to be edited and under which basic mode + Determine which track elements will move as a result + Snap the edit position to one of the edges of the main edited element, (or the edge of one of its descendants, in the case of MOVE), avoiding moving elements. NOTE: in particular, we can *not* snap to the edge of a neighbouring element in a roll edit. This was previously possible, even though the neighbour was moving! + Determine the edit positions for clips (or track elements with no parent) using the snapped value. In addition, we replace any edits of a group with an edit of its descendant clips. If any value would be out of bounds (e.g. negative start) we do not edit. NOTE: this is now done *after* checking the snapping. This allows the edit to succeed if snapping would cause it to go from being invalid to valid! + Determine whether the collection of edits would result in a valid timeline-configuration which does not break the rules for sources overlapping. + If all this succeeds, we emit snapping-started on the timeline. + We then perform all the edits. At this point they should all succeed. The simplification/unification should make it easier to make other changes. Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/97 Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/issues/98 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/169>
Diffstat (limited to 'ges/ges-enums.c')
-rw-r--r--ges/ges-enums.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/ges/ges-enums.c b/ges/ges-enums.c
index fe261cac..8a684161 100644
--- a/ges/ges-enums.c
+++ b/ges/ges-enums.c
@@ -144,6 +144,25 @@ register_ges_edit_mode (GType * id)
*id = g_enum_register_static ("GESEditMode", edit_mode);
}
+const gchar *
+ges_edit_mode_name (GESEditMode mode)
+{
+ switch (mode) {
+ case GES_EDIT_MODE_NORMAL:
+ return "normal";
+ case GES_EDIT_MODE_RIPPLE:
+ return "ripple";
+ case GES_EDIT_MODE_ROLL:
+ return "roll";
+ case GES_EDIT_MODE_TRIM:
+ return "trim";
+ case GES_EDIT_MODE_SLIDE:
+ return "slide";
+ default:
+ return "unknown";
+ }
+}
+
GType
ges_edit_mode_get_type (void)
{