tentando obter playlist real do projeto mmp
This commit is contained in:
1 parent
b6023847c2
commit
f86bc02ba9
108 files changed
+942
-126
No files matched your search
Executable → Regular
BIN
Binary file not shown.
Executable → Regular
BIN
Binary file not shown.
Executable → Regular
BIN
Binary file not shown.
@@ -61,29 +61,32 @@ def parse_mmp_file(file_path):
|
||||
):
|
||||
tags["plugin"].append(plugin_name)
|
||||
|
||||
elif track_type == "1": # Bassline (aparentemente, correto)
|
||||
elif track_type == "1": # Bassline / Beat Editor
|
||||
bassline_info = parse_basslines(track)
|
||||
|
||||
if bassline_info:
|
||||
# 1. Extração dos Clipes para a Playlist (Timeline)
|
||||
playlist_clips = []
|
||||
bbtrack = track.find("bbtrack")
|
||||
if bbtrack is not None:
|
||||
trackcontent = bbtrack.find("trackcontent")
|
||||
if trackcontent is not None:
|
||||
# Estes patterns representam ONDE o bloco "Caixa" aparece na música
|
||||
for pattern in trackcontent.findall("pattern"):
|
||||
playlist_clips.append({
|
||||
"pos": int(pattern.attrib.get("pos", 0)),
|
||||
"len": int(pattern.attrib.get("len", 192)), # Padrão 1 bar
|
||||
"len": int(pattern.attrib.get("len", 192)),
|
||||
"steps": int(pattern.attrib.get("steps", 16)),
|
||||
"name": track_name # O clipe leva o nome da trilha
|
||||
"name": track_name
|
||||
})
|
||||
# Adiciona essa lista de clipes ao objeto final
|
||||
|
||||
# Injeta a lista de clipes no objeto JSON final
|
||||
bassline_info["playlist_clips"] = playlist_clips
|
||||
|
||||
# Garante que o tipo e nome estão corretos no nível superior
|
||||
# Garante metadados corretos
|
||||
bassline_info["type"] = "bassline"
|
||||
bassline_info["track_name"] = track_name
|
||||
|
||||
track_info.append(bassline_info)
|
||||
track_info.append(bassline_info)
|
||||
if bassline_info["tags"] is not None:
|
||||
if "bassline" not in tags["TAG"]: # certo
|
||||
|
||||
Reference in new issue
Block a user