Skip to content

Handling of non-standard framerates provided as strings (and additonal exports for ease-of-use)#1

Merged
wfoxall merged 6 commits intomainfrom
dev
May 10, 2022
Merged

Handling of non-standard framerates provided as strings (and additonal exports for ease-of-use)#1
wfoxall merged 6 commits intomainfrom
dev

Conversation

@wfoxall
Copy link
Copy Markdown
Owner

@wfoxall wfoxall commented May 10, 2022

Non-standard framerates provided as strings

When constructing a Framerate with a string, any value that does not match a 'standard' framerate (e.g. "25", "29.97DF"...) is now tested to see if it can be interpretted as a number.

If it can, it is parsed as a float and the framerate constructed from that number.

Framerate getter

Since a Framerate or FramerateLike object must be specified when constructing a Timecode, it makes sense to allow that Framerate to be retrieved from the Timecode instance later via a new getter.

Additional exports

  • TimecodeError is exported so that consumers can test if an error is instanceof TimecodeError.
  • A new const array of strings called StandardFramerates which contains the supported standard framerates is exported. Internally, the type definition of type StandardFramerate is defined as any of the values in that array.

@wfoxall wfoxall added the enhancement New feature or request label May 10, 2022
@wfoxall wfoxall merged commit c891748 into main May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant