Skip to content

Commit

Permalink
scripts/serato_markers2: Add support for Playback/Censor FLIP subentries
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Aug 20, 2020
1 parent fb8c5e9 commit 26cbdf2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/serato_markers2.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def dump(self):
class FlipEntry(Entry):
NAME = 'FLIP'
FMT1 = 'cB?'
FMT2 = '>?I'
FMT2 = '>BI'
FMT3 = '>BI16s'
FIELDS = ('field1', 'index', 'enabled', 'name', 'loop', 'num_actions',
'actions')
Expand All @@ -145,10 +145,13 @@ def load(cls, data):
for i in range(num_actions):
type_id, size = struct.unpack(cls.FMT2, action_data[:info2_size])
action_data = action_data[info2_size:]
assert type_id == 0
payload = struct.unpack('>dd', action_data[:size])
if type_id == 0:
payload = struct.unpack('>dd', action_data[:size])
actions.append(("JUMP", *payload))
elif type_id == 1:
payload = struct.unpack('>ddd', action_data[:size])
actions.append(("CENSOR", *payload))
action_data = action_data[size:]
actions.append(payload)
assert action_data == b''

return cls(*info1, name.decode('utf-8'), loop, num_actions, actions)
Expand Down

0 comments on commit 26cbdf2

Please sign in to comment.