Added some docs

This commit is contained in:
Jamie Hardt
2018-12-07 10:00:03 -08:00
parent c2c83d826a
commit 703ba1140a

View File

@@ -1,4 +1,14 @@
class CmxEvent:
"""Represents a source-record event.
Aside from exposing properites related to the raw CMX event itself,
(the `source_start`, `source_finish`, `transition` etc.) the event
also contains contextual information from the parsed CMX list, such as
`clip_name` and the frame counting mode in effect on the event.
"""
def __init__(self,title,number,clip_name,source_name,channels,
transition,source_start,source_finish,
record_start, record_finish, fcm_drop, remarks = [] ,
@@ -20,10 +30,8 @@ class CmxEvent:
self.aux_source = (source_name == 'AX')
def can_accept(self):
return {'AudioExt','Remark','SourceFile','ClipName','EffectsName'}
def accept_statement(self, statement):
"""Used by the parser to attach clip names and notes to this event."""
statement_type = type(statement).__name__
if statement_type == 'AudioExt':
self.channels.appendExt(statement)
@@ -46,6 +54,7 @@ fcm_drop={self.fcm_drop},remarks={self.remarks})"""
class CmxTransition:
"""Represents a CMX transition, a wipe, dissolve or cut."""
def __init__(self, transition, operand):
self.transition = transition
self.operand = operand
@@ -53,24 +62,32 @@ class CmxTransition:
@property
def cut(self):
"`True` if this transition is a cut."
return self.transition == 'C'
@property
def dissolve(self):
"`True` if this traansition is a dissolve."
return self.transition == 'D'
@property
def wipe(self):
"`True` if this transition is a wipe."
return self.transition.startswith('W')
@property
def effect_duration(self):
""""`The duration of this transition, in frames of the record target.
In the event of a key event, this is the duration of the fade in.
"""
return int(self.operand)
@property
def wipe_number(self):
"Wipes are identified by a particular number."
if self.wipe:
return int(self.transition[1:])
else:
@@ -78,14 +95,17 @@ class CmxTransition:
@property
def key_background(self):
"`True` if this is a key background event."
return self.transition == 'KB'
@property
def key_foreground(self):
"`True` if this is a key foreground event."
return self.transition == 'K'
@property
def key_out(self):
"`True` if this is a key out event."
return self.transition == 'KO'
def __repr__(self):