1use lazy_static::lazy_static;
2use num::rational::Ratio;
3use num::Rational64;
4use regex::Regex;
5
6pub(super) const SECONDS_PER_MINUTE: Rational64 = Rational64::new_raw(60, 1);
8pub(super) const SECONDS_PER_HOUR: Rational64 = Rational64::new_raw(60 * 60, 1);
10
11pub(super) const PERFS_PER_FOOT_35: i64 = 64;
13
14pub(super) const PERFS_PER_6INCHES_16: i64 = 20;
18
19pub(super) const PREMIERE_TICKS_PER_SECOND: Ratio<i128> = Ratio::<i128>::new_raw(254016000000, 1);
21
22pub(super) const SECONDS_PER_MINUTE_I64: i64 = 60;
24pub(super) const SECONDS_PER_HOUR_I64: i64 = SECONDS_PER_MINUTE_I64 * 60;
26
27lazy_static! {
28 pub(super) static ref TIMECODE_REGEX: Regex = regex::Regex::new(
30 r"^(?P<negative>-)?((?P<section1>[0-9]+)[:|;])?((?P<section2>[0-9]+)[:|;])?((?P<section3>[0-9]+)[:|;])?(?P<frames>[0-9]+)$"
31 ).unwrap();
32}
33
34lazy_static! {
35 pub(super) static ref FEET_AND_FRAMES_REGEX: Regex = regex::Regex::new(
37 r"^(?P<negative>-)?(?P<feet>[0-9]+)\+(?P<frames>[0-9]+)(\.(?P<perf>[0-9]))?$",
38 ).unwrap();
39}
40
41lazy_static! {
42 pub(super) static ref RUNTIME_REGEX: Regex = regex::Regex::new(
44 r"^(?P<negative>-)?((?P<section1>[0-9]+)[:|;])?((?P<section2>[0-9]+)[:|;])?(?P<seconds>[0-9]+(\.[0-9]+)?)$",
45 ).unwrap();
46}