TheAcharya / MarkersExtractor

Extract Markers from Final Cut Pro FCPXML
MIT License
36 stars 2 forks source link

Add API call to return list of all roles used in a FCPXML project #69

Closed orchetect closed 9 months ago

orchetect commented 10 months ago

Add API call to return list of all roles used in a FCPXML project.

orchetect commented 9 months ago

The logic is complete for this. Just need to add an API call to MarkersExtractor to return them.

orchetect commented 9 months ago

@milanvarady roles extraction API has been added. Will be in 0.3.0.

There is a new extractor class called RolesExtractor. Give it a FCPXMLFile, similar to the MarkersExtractor class.

https://github.com/TheAcharya/MarkersExtractor/blob/4f79d0b8051d01b7f27a440762e1dbca030c008e/Sources/MarkersExtractor/RolesExtractor/RolesExtractor.swift#L11-L18

Then call extract() and an array of roles will be returned.

https://github.com/TheAcharya/MarkersExtractor/blob/4f79d0b8051d01b7f27a440762e1dbca030c008e/Sources/MarkersExtractor/RolesExtractor/RolesExtractor.swift#L34

FinalCutPro.FCPXML.AnyRole is a type-erased container for one of three concrete role types:

You don't really need to unwrap the AnyRole, you can get its role name and type just by using properties on it.