summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2016-08-11 13:19:44 -0400
committerThibault Saunier <thibault.saunier@osg.samsung.com>2016-09-26 13:33:00 -0300
commit1757ae2e5e84d63a0b738426d615d1f891377997 (patch)
treee8ae46936c387d404087855d870ee10861e6b503
parent3409719de5233f5df55793cd9123f60653b6078a (diff)
ges: Handle moving groups with effects inside
We were only concidering that we should let the group handle moving transitions when changing transitions but in fact as soon as a transition is happenning between two clips that are in a same group the group properly handles moving the transition, so let the group do its job. Fixes T7543 Differential Revision: https://phabricator.freedesktop.org/D1281
-rw-r--r--ges/ges-auto-transition.c2
-rw-r--r--tests/check/python/test_group.py52
2 files changed, 53 insertions, 1 deletions
diff --git a/ges/ges-auto-transition.c b/ges/ges-auto-transition.c
index 3961621f..d52d1c49 100644
--- a/ges/ges-auto-transition.c
+++ b/ges/ges-auto-transition.c
@@ -43,7 +43,7 @@ neighbour_changed_cb (GESClip * clip, GParamSpec * arg G_GNUC_UNUSED,
GESTimelineElement *parent =
ges_timeline_element_get_toplevel_parent (GES_TIMELINE_ELEMENT (clip));
- if (!g_strcmp0 (g_param_spec_get_name (arg), "priority") && parent) {
+ if (parent) {
GESTimelineElement *prev_topparent =
ges_timeline_element_get_toplevel_parent (GES_TIMELINE_ELEMENT
(self->next_source));
diff --git a/tests/check/python/test_group.py b/tests/check/python/test_group.py
index 87c097c7..5221f7e3 100644
--- a/tests/check/python/test_group.py
+++ b/tests/check/python/test_group.py
@@ -199,3 +199,55 @@ class TestGroup(unittest.TestCase):
self.assertEqual(len(layer.get_clips()), 2)
for clip in layer.get_clips():
self.assertEqual(clip.get_parent(), group)
+
+ def test_moving_group_with_transition(self):
+ self.timeline.props.auto_transition = True
+ clip1 = GES.TestClip.new()
+ clip1.props.start = 0
+ clip1.props.duration = 30
+
+ clip2 = GES.TestClip.new()
+ clip2.props.start = 20
+ clip2.props.duration = 20
+
+ self.layer.add_clip(clip1)
+ self.layer.add_clip(clip2)
+
+ clips = self.layer.get_clips()
+ self.assertEqual(len(clips), 4)
+
+ video_transition = None
+ audio_transition = None
+ for clip in clips:
+ if isinstance(clip, GES.TransitionClip):
+ if isinstance(clip.get_children(False)[0], GES.VideoTransition):
+ video_transition = clip
+ else:
+ audio_transition = clip
+ self.assertIsNotNone(audio_transition)
+ self.assertIsNotNone(video_transition)
+
+ self.assertEqual(video_transition.props.start, 20)
+ self.assertEqual(video_transition.props.duration, 10)
+ self.assertEqual(audio_transition.props.start, 20)
+ self.assertEqual(audio_transition.props.duration, 10)
+
+ group = GES.Container.group(clips)
+ self.assertIsNotNone(group)
+
+ self.assertTrue(clip2.edit(
+ self.timeline.get_layers(), 0,
+ GES.EditMode.EDIT_NORMAL, GES.Edge.EDGE_NONE, 25))
+ clip2.props.start = 25
+
+ clips = self.layer.get_clips()
+ self.assertEqual(len(clips), 4)
+ self.assertEqual(clip1.props.start, 5)
+ self.assertEqual(clip1.props.duration, 30)
+ self.assertEqual(clip2.props.start, 25)
+ self.assertEqual(clip2.props.duration, 20)
+
+ self.assertEqual(video_transition.props.start, 25)
+ self.assertEqual(video_transition.props.duration, 10)
+ self.assertEqual(audio_transition.props.start, 25)
+ self.assertEqual(audio_transition.props.duration, 10)