Skip to content

Commit

Permalink
rename PerPoint to PointProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
markreidvfx committed Jul 5, 2022
1 parent f0f6396 commit ffe95d2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
34 changes: 17 additions & 17 deletions src/avb/_ext.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ cdef extern from "_ext_core.cpp" nogil:

cdef struct IntData:
const char *name
bint is_signed;
bint is_signed
IntDataValue data

cdef struct IntArrayData:
Expand All @@ -78,31 +78,31 @@ cdef extern from "_ext_core.cpp" nogil:
bint data

cdef struct StringData:
const char *name;
const char *name
StringType type
vector[uint8_t] data

cdef struct BytesData:
const char *name;
const char *name
vector[uint8_t] data

cdef struct RefListData:
const char *name
vector[uint32_t] data

cdef struct PerPoint:
int16_t code;
cdef struct ControlPointProperty:
int16_t code
ControlPointValueType type
uint32_t value;
double double_value;
uint32_t value
double double_value

cdef struct ControlPoint:
int32_t offset_num;
int32_t offset_den;
int32_t timescale;
uint32_t value;
double double_value;
vector[PerPoint] pp;
int32_t offset_num
int32_t offset_den
int32_t timescale
uint32_t value
double double_value
vector[ControlPointProperty] pp

cdef struct ControlPointData:
const char *name
Expand Down Expand Up @@ -133,7 +133,7 @@ cdef extern from "_ext_core.cpp" nogil:
vector[StringData] strings
vector[BytesData] mob_ids
vector[RefListData] reflists
vector[ChildData] children;
vector[ChildData] children
vector[ControlPointData] control_points
vector[IntArrayData] arrays
vector[BytesData] bytearrays
Expand Down Expand Up @@ -189,7 +189,7 @@ cdef void controlpoints2dict(object root, dict d, Properties* p):

cdef ControlPointData item
cdef ControlPoint cp
cdef PerPoint pp
cdef ControlPointProperty pp
cdef bytes name
cdef list control_point_list
cdef list pp_list
Expand All @@ -203,10 +203,10 @@ cdef void controlpoints2dict(object root, dict d, Properties* p):
for item in p.control_points:
if item.type == ParamControlPointType:
obj_class = utils.AVBClassName_dict['ParamControlPoint']
pp_obj_class = utils.AVBClassName_dict['ParamPerPoint']
pp_obj_class = utils.AVBClassName_dict['ParamControlPointProperty']
else:
obj_class = utils.AVBClassName_dict['ControlPoint']
pp_obj_class = utils.AVBClassName_dict['PerPoint']
pp_obj_class = utils.AVBClassName_dict['ControlPointProperty']

control_point_list = []
for cp in item.data:
Expand Down
6 changes: 3 additions & 3 deletions src/avb/_ext_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ struct BytesData {
vector<uint8_t> data;
};

struct PerPoint {
struct ControlPointProperty {
int16_t code;
ControlPointValueType type;
uint32_t value;
Expand All @@ -115,7 +115,7 @@ struct ControlPoint {

uint32_t value;
double double_value;
vector<PerPoint> pp;
vector<ControlPointProperty> pp;
};

struct ControlPointData {
Expand Down Expand Up @@ -572,7 +572,7 @@ static int read_paramclip(Buffer *f, Properties *p)
uint16_t pp_count = read_u16le(f);
cp->pp.resize(pp_count);
for(int j = 0; j < pp_count; j++) {
PerPoint *pp = &cp->pp[j];
ControlPointProperty *pp = &cp->pp[j];
pp->code = (int16_t)read_u16le(f);
pp->type = (ControlPointValueType)read_u16le(f);
switch (pp->type) {
Expand Down
8 changes: 4 additions & 4 deletions src/avb/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def tangents(self):


@utils.register_helper_class
class ParamPerPoint(core.AVBObject):
class ParamControlPointProperty(core.AVBObject):
propertydefs_dict = {}
propertydefs = [
AVBPropertyDef('code', 'OMFI:PRCL:PPCode', 'int16'),
Expand Down Expand Up @@ -584,7 +584,7 @@ def read(self, f):
assert pp_count >= 0
cp.pp = []
for j in range(pp_count):
pp = ParamPerPoint.__new__(ParamPerPoint, root=self.root)
pp = ParamControlPointProperty.__new__(ParamControlPointProperty, root=self.root)
pp.code = ctx.read_s16(f)
pp.type = ctx.read_s16(f)

Expand Down Expand Up @@ -832,7 +832,7 @@ class ControlPoint(core.AVBObject):
__slots__ = ()

@utils.register_helper_class
class PerPoint(core.AVBObject):
class ControlPointProperty(core.AVBObject):
propertydefs_dict = {}
propertydefs = [
AVBPropertyDef('code', 'OMFI:CTRL:PPCode', 'int16'),
Expand Down Expand Up @@ -882,7 +882,7 @@ def read(self, f):
pp_count = ctx.read_s16(f)
assert pp_count >= 0
for j in range(pp_count):
pp = PerPoint.__new__(PerPoint, root=self.root)
pp = ControlPointProperty.__new__(ControlPointProperty, root=self.root)
pp.code = ctx.read_s16(f)
a = ctx.read_s32(f)
b = ctx.read_s32(f)
Expand Down

0 comments on commit ffe95d2

Please sign in to comment.