mdb.core¶
Layer 1 base – objects with names.
Layer 0 (mdb.bento) hands back entries keyed by number. This layer
gives each object a Python class chosen by its OMFI:ObjID 4CC, decodes
values on demand, and resolves object references into live objects.
Two rules shape the design, both learned from the format itself:
Unknown classes must still parse. An unrecognised 4CC becomes a
MDBObject with every property readable by its OMF name. Media
Composer adds classes; a reader that raises on them is a reader that breaks
on next year’s files.
Properties can repeat. MOBJ:MobID is written twice with identical
content, a WINL can carry two different FL:PathNameUTF8 values, and
DIDD:VideoLineMap genuinely is a multi-value property. Attribute access
gives you the last value (what Media Composer appears to use); values()
gives you all of them.
- class PropertyDef(name, omf_name, deref=False, enum=None, doc='', multi=False)[source]¶
Bases:
objectBinds a Python attribute name to an OMF property name.
derefturnsomfi:ObjRef/omfi:ObjRefArrayvalues into objects.enumnames a table inmdb.enumssoobj.track_kind_nameworks alongside the rawobj.track_kind.- name¶
- omf_name¶
- deref¶
- enum¶
- doc¶
- multi¶
- class MDBObject(root, object_id, entries)[source]¶
Bases:
objectOne object: a set of TOC entries sharing an object ID.
Access properties three ways, in increasing order of rawness:
mob.name # typed attribute, per propertydefs mob["OMFI:CPNT:Name"] # by OMF property name mob.values("OMFI:MOBJ:MobID") # every value, duplicates included
-
propertydefs:
Sequence[PropertyDef] = ()¶
-
structural_properties:
Sequence[str] = ()¶ OMF property names this class reads structurally rather than through a
PropertyDef– the parallel per-point, per-band and per-keyframe columns, and the numerator/denominator pairs that make up a rectangle. They have no single sensible attribute name (there are n of each), so a method assembles them instead; listing them here keeps them visible toknown_properties()and to the coverage tests, so a property cannot be quietly forgotten.
- object_id¶
- values(omf_name)[source]¶
Every value written for
omf_name, in file order.Duplicates are normal in this format; this is how you see them.
- get(omf_name, default=None, deref=False)[source]¶
The last value written for
omf_name, ordefault.- Return type:
- classmethod known_properties()[source]¶
Every OMF property name this class understands, typed or structural.
-
propertydefs: