mirror of
https://github.com/iluvcapra/pycmx.git
synced 2026-01-02 01:40:58 +00:00
Added some docs
This commit is contained in:
@@ -1,4 +1,14 @@
|
|||||||
class CmxEvent:
|
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,
|
def __init__(self,title,number,clip_name,source_name,channels,
|
||||||
transition,source_start,source_finish,
|
transition,source_start,source_finish,
|
||||||
record_start, record_finish, fcm_drop, remarks = [] ,
|
record_start, record_finish, fcm_drop, remarks = [] ,
|
||||||
@@ -20,10 +30,8 @@ class CmxEvent:
|
|||||||
self.aux_source = (source_name == 'AX')
|
self.aux_source = (source_name == 'AX')
|
||||||
|
|
||||||
|
|
||||||
def can_accept(self):
|
|
||||||
return {'AudioExt','Remark','SourceFile','ClipName','EffectsName'}
|
|
||||||
|
|
||||||
def accept_statement(self, statement):
|
def accept_statement(self, statement):
|
||||||
|
"""Used by the parser to attach clip names and notes to this event."""
|
||||||
statement_type = type(statement).__name__
|
statement_type = type(statement).__name__
|
||||||
if statement_type == 'AudioExt':
|
if statement_type == 'AudioExt':
|
||||||
self.channels.appendExt(statement)
|
self.channels.appendExt(statement)
|
||||||
@@ -46,6 +54,7 @@ fcm_drop={self.fcm_drop},remarks={self.remarks})"""
|
|||||||
|
|
||||||
|
|
||||||
class CmxTransition:
|
class CmxTransition:
|
||||||
|
"""Represents a CMX transition, a wipe, dissolve or cut."""
|
||||||
def __init__(self, transition, operand):
|
def __init__(self, transition, operand):
|
||||||
self.transition = transition
|
self.transition = transition
|
||||||
self.operand = operand
|
self.operand = operand
|
||||||
@@ -53,24 +62,32 @@ class CmxTransition:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def cut(self):
|
def cut(self):
|
||||||
|
"`True` if this transition is a cut."
|
||||||
return self.transition == 'C'
|
return self.transition == 'C'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dissolve(self):
|
def dissolve(self):
|
||||||
|
"`True` if this traansition is a dissolve."
|
||||||
return self.transition == 'D'
|
return self.transition == 'D'
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def wipe(self):
|
def wipe(self):
|
||||||
|
"`True` if this transition is a wipe."
|
||||||
return self.transition.startswith('W')
|
return self.transition.startswith('W')
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def effect_duration(self):
|
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)
|
return int(self.operand)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def wipe_number(self):
|
def wipe_number(self):
|
||||||
|
"Wipes are identified by a particular number."
|
||||||
if self.wipe:
|
if self.wipe:
|
||||||
return int(self.transition[1:])
|
return int(self.transition[1:])
|
||||||
else:
|
else:
|
||||||
@@ -78,14 +95,17 @@ class CmxTransition:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def key_background(self):
|
def key_background(self):
|
||||||
|
"`True` if this is a key background event."
|
||||||
return self.transition == 'KB'
|
return self.transition == 'KB'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def key_foreground(self):
|
def key_foreground(self):
|
||||||
|
"`True` if this is a key foreground event."
|
||||||
return self.transition == 'K'
|
return self.transition == 'K'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def key_out(self):
|
def key_out(self):
|
||||||
|
"`True` if this is a key out event."
|
||||||
return self.transition == 'KO'
|
return self.transition == 'KO'
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user