-
Notifications
You must be signed in to change notification settings - Fork 338
#841 Track range_of_all_children applies TimeEffect effect to duratio… #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
a2bfebf
67046c5
c3bea68
7567875
489c071
553e112
1a8b2aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
|
|
||
| #include "opentimelineio/version.h" | ||
| #include "opentimelineio/timeEffect.h" | ||
| #include "opentime/timeRange.h" | ||
|
|
||
| namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { | ||
|
|
||
|
|
@@ -27,6 +28,10 @@ class LinearTimeWarp : public TimeEffect { | |
| _time_scalar = time_scalar; | ||
| } | ||
|
|
||
| virtual TimeRange output_range(TimeRange input_range, ErrorStatus* error_status) const { | ||
| return TimeRange(input_range.start_time(), input_range.duration() / _time_scalar); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you could construct a Also, another thing to consider is what happens when |
||
| } | ||
|
|
||
| protected: | ||
| virtual ~LinearTimeWarp(); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| #include "opentimelineio/transition.h" | ||
| #include "opentimelineio/gap.h" | ||
| #include "opentimelineio/vectorIndexing.h" | ||
| #include "opentimelineio/timeEffect.h" | ||
|
|
||
| namespace opentimelineio { namespace OPENTIMELINEIO_VERSION { | ||
|
|
||
|
|
@@ -196,7 +197,13 @@ std::map<Composable*, TimeRange> Track::range_of_all_children(ErrorStatus* error | |
| transition->out_offset() + transition->in_offset()); | ||
| } | ||
| else if (auto item = dynamic_cast<Item*>(child.value)) { | ||
| auto last_range = TimeRange(last_end_time, item->trimmed_range(error_status).duration()); | ||
| auto output_range = TimeRange(RationalTime(0), item->trimmed_range(error_status).duration()); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since considerable work is potentially being done in the following |
||
| for (auto effect: item->effects()) { | ||
| if (auto time_effect = dynamic_cast<TimeEffect*>(effect.value)) { | ||
| output_range = time_effect->output_range(output_range, error_status); | ||
| } | ||
| } | ||
| auto last_range = TimeRange(last_end_time, output_range.duration()); | ||
| result[child] = last_range; | ||
| last_end_time = last_range.end_time_exclusive(); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We originally omitted overloading
/and*operators forRationalTImebecause we felt that the meaning of division and multiplication in the context of RationalTime could potentially be ambiguous. Instead we providedTimeTransformto make sure it was explicit how these operations work.