mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 06:21:16 +00:00
Issue #684 Fixed sound streams inside DefineSprites, fixed sound stream blocks handling
This commit is contained in:
@@ -70,9 +70,13 @@ public class SoundTagPlayer implements MediaDisplay {
|
||||
this.tag = tag;
|
||||
this.loops = loops;
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
byte[] soundData = tag.getRawSoundData();
|
||||
List<byte[]> soundData = tag.getRawSoundData();
|
||||
SWF swf = ((Tag) tag).getSwf();
|
||||
tag.getSoundFormat().createWav(new SWFInputStream(swf, soundData), baos);
|
||||
List<SWFInputStream> siss=new ArrayList<>();
|
||||
for(byte[] data:soundData){
|
||||
siss.add(new SWFInputStream(swf,data));
|
||||
}
|
||||
tag.getSoundFormat().createWav(siss, baos);
|
||||
player = new SoundPlayer(new ByteArrayInputStream(baos.toByteArray()));
|
||||
}
|
||||
|
||||
|
||||
@@ -106,6 +106,17 @@ public class TagTreeModel implements TreeModel {
|
||||
return mainFrame.translate(key);
|
||||
}
|
||||
|
||||
|
||||
private List<TreeNode> getSoundStreams(DefineSpriteTag sprite){
|
||||
List<TreeNode> ret=new ArrayList<>();
|
||||
for(Tag t:sprite.subTags){
|
||||
if(t instanceof SoundStreamHeadTypeTag){
|
||||
ret.add(new TagNode(t));
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private List<TreeNode> createTagList(List<Tag> list, SWF swf, SWFNode swfNode, ClassesListTreeModel classTreeModel) {
|
||||
boolean hasAbc = swf.abcList != null && !swf.abcList.isEmpty();
|
||||
|
||||
@@ -138,6 +149,7 @@ public class TagTreeModel implements TreeModel {
|
||||
break;
|
||||
case SPRITE:
|
||||
sprites.add(new TagNode(t));
|
||||
sounds.addAll(getSoundStreams((DefineSpriteTag)t));
|
||||
break;
|
||||
case BUTTON:
|
||||
buttons.add(new TagNode(t));
|
||||
|
||||
Reference in New Issue
Block a user