Skip to content

Add the markers argument to the Track constructor. - #2053

Closed
peter-targett wants to merge 3 commits into
AcademySoftwareFoundation:mainfrom
peter-targett:track-markers
Closed

peter-targett wants to merge 3 commits into
AcademySoftwareFoundation:mainfrom
peter-targett:track-markers

Conversation

@peter-targett

Copy link
Copy Markdown
Contributor

Now any markers assigned at the track level item are initialised.

Moved the markers argument ahead of color to try and maintain some consistency with the parent class.

Simple test added.

Changed required because otherwise there is no way to assign markers to a track in the C++ API - motivated by recent changes to the AAF adapter to add write-marker support.

Now any markers assigned at the track level item are
initialised.

Moved the markers argument ahead of color to try and
maintain some consistency with the parent class.

Simple test added.

Signed-off-by: Peter Targett <petert@filmlight.ltd.uk>
@jminor

jminor commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

It looks like this API change causes some tests to fail. This change would require users of OTIO to update their code. For most API changes we try to deprecate the old way, but still support it for a release. Unlike Python where keyword arguments can be in any order, this is tricky to do with a C++ constructor. As much as I'd like to keep the argument order consistent with the parent class, it might not be worth the hassle in this case.

For your use case, are you able to construct a Track and then assign markers to it afterwards?

@peter-targett

peter-targett commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

As much as I'd like to keep the argument order consistent with the parent class, it might not be worth the hassle in this case.

I thought this would be a possible issue, I will change it.

For your use case, are you able to construct a Track and then assign markers to it afterwards?

As mentioned, it's motivated by the AAF adapter updates, it only looks for markers in the track. In the C++ API there is no way to assign markers after constructor use, you can only query the markers after the fact.

Update test.

Signed-off-by: Peter Targett <petert@filmlight.ltd.uk>
@codecov-commenter

codecov-commenter commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.52%. Comparing base (696150b) to head (dca9c9f).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2053   +/-   ##
=======================================
  Coverage   83.52%   83.52%           
=======================================
  Files         182      182           
  Lines       13533    13532    -1     
  Branches     1255     1255           
=======================================
  Hits        11303    11303           
+ Misses       2057     2056    -1     
  Partials      173      173           
Flag Coverage Δ
py-unittests 83.52% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/opentimelineio/track.cpp 91.20% <100.00%> (-0.07%) ⬇️
src/opentimelineio/track.h 100.00% <ø> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 696150b...dca9c9f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jminor

jminor commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Track inherits from Item, so you can modify the list of markers like this:

SerializableObject::Retainer<Track> track = new Track();
SerializableObject::Retainer<Marker> marker(new Marker("my_marker", TimeRange()));
track->markers().push_back(marker);

Here's an example in the Raven source code that works to add markers to a Clip or Track or Stack (though Raven seems to have a bug in displaying track markers...) https://github.com/OpenTimelineIO/raven/blob/624951e89bb531a376327e0233c0e6ed6dffccb7/editing.cpp#L190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants