mirror of
https://github.com/iluvcapra/ptulsconv.git
synced 2026-01-01 17:30:47 +00:00
Adapting existing tests to new parser
This commit is contained in:
@@ -81,6 +81,10 @@ class DocParserVisitor(NodeVisitor):
|
||||
clips=clips
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def visit_frame_rate(node, _):
|
||||
return node.text
|
||||
|
||||
@staticmethod
|
||||
def visit_track_listing(_, visited_children):
|
||||
return visited_children[1]
|
||||
|
||||
@@ -7,11 +7,12 @@ protools_text_export_grammar = Grammar(
|
||||
"SAMPLE RATE:" fs float_value rs
|
||||
"BIT DEPTH:" fs integer_value "-bit" rs
|
||||
"SESSION START TIMECODE:" fs string_value rs
|
||||
"TIMECODE FORMAT:" fs float_value " Drop"? " Frame" rs
|
||||
"TIMECODE FORMAT:" fs frame_rate " Drop"? " Frame" rs
|
||||
"# OF AUDIO TRACKS:" fs integer_value rs
|
||||
"# OF AUDIO CLIPS:" fs integer_value rs
|
||||
"# OF AUDIO FILES:" fs integer_value rs block_ending
|
||||
|
||||
|
||||
frame_rate = ("60" / "59.94" / "30" / "29.97" / "24" / "23.976")
|
||||
files_section = files_header files_column_header file_record* block_ending
|
||||
files_header = "F I L E S I N S E S S I O N" rs
|
||||
files_column_header = "Filename" isp fs "Location" rs
|
||||
|
||||
@@ -36,8 +36,8 @@ class TagCompiler:
|
||||
track_comment_tags: dict,
|
||||
timespan_tags: dict,
|
||||
marker_tags: dict, session_tags: dict):
|
||||
|
||||
effective_tags = session_tags
|
||||
effective_tags = dict()
|
||||
effective_tags.update(session_tags)
|
||||
effective_tags.update(marker_tags)
|
||||
effective_tags.update(timespan_tags)
|
||||
effective_tags.update(track_comment_tags)
|
||||
@@ -99,7 +99,7 @@ class TagCompiler:
|
||||
@staticmethod
|
||||
def _time_span_tags(at_time: Fraction, applicable_spans) -> dict:
|
||||
retval = dict()
|
||||
for tags in [a[0] for a in applicable_spans if a.start <= at_time <= a.finish]:
|
||||
for tags in [a[0] for a in applicable_spans if a[1] <= at_time <= a[2]]:
|
||||
retval.update(tags)
|
||||
|
||||
return retval
|
||||
|
||||
Reference in New Issue
Block a user