clipproperties+viewer: Clip out of bounds position
AbandonedPublic

Authored by stefanzzz on Jul 21 2017, 2:32 PM.

Details

Reviewers
thiblahute
aleb
Summary

When getting the value of a control binded source property, clip the
pipeline position if it is outside of the source range.

Depends on D1784

stefanzzz created this revision.Jul 21 2017, 2:32 PM
stefanzzz updated this revision to Diff 6101.Jul 21 2017, 2:34 PM
stefanzzz edited the summary of this revision. (Show Details)

Forgot a debug print in the code.

aleb added inline comments.Jul 21 2017, 7:20 PM
pitivi/viewer/move_scale_overlay.py
335

This line could be left as is

stefanzzz updated this revision to Diff 6152.Jul 27 2017, 7:33 AM
stefanzzz retitled this revision from clipproperties+viewer: Don't use control binding values when out of bounds to clipproperties+viewer: Clip out of bounds position.
stefanzzz edited the summary of this revision. (Show Details)

If the position is outside of the clip range, use the control binding
value (by clipping the position) instead of the get_source_property
value.

thiblahute accepted this revision.Jul 27 2017, 1:23 PM

In what case does that happen?

This revision is now accepted and ready to land.Jul 27 2017, 1:23 PM

In what case does that happen?

For the viewer, it happens when the size-allocate signal is emitted and the pipeline position is outside of the clip range. Also, in a later commit, I update the spin buttons and the viewer on position change. So, it's going to happen quite often.

aleb requested changes to this revision.Aug 13 2017, 7:09 PM

I think this should be abandoned and the changes moved to previous commits:
the clipproperties.py part in D1766
the move_scale_overlay.py part in D1771

pitivi/clipproperties.py
729

This should be start + duration - 1
While you are at it, you could remove this line, and add it below:

source_position = max(0, min(source_position, duration - 1))
This revision now requires changes to proceed.Aug 13 2017, 7:09 PM
stefanzzz added inline comments.Aug 14 2017, 2:16 PM
pitivi/clipproperties.py
729

I think start + duration is correct. For start=0, duration=1, it would make sense to have the clip lasting from timestamp 0 to timestamp 1, rather than 0->0.

stefanzzz updated this revision to Diff 6279.Aug 15 2017, 5:36 PM
stefanzzz marked 3 inline comments as done.

Made required changes. @aleb, I will move the changes in the previous
commits after you review the last diff, as it should be easier to review it
that way.

This revision is now accepted and ready to land.Aug 15 2017, 5:36 PM
stefanzzz requested review of this revision.Aug 15 2017, 5:38 PM
aleb abandoned this revision.Aug 28 2017, 10:07 PM