mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-03 09:25:31 +00:00
Take scenes into account when splitting streamed sound
This commit is contained in:
@@ -25,7 +25,7 @@ All notable changes to this project will be documented in this file.
|
||||
- [#2131] Breakpoint list dialog
|
||||
- ExportAssets tag - show first item as description in the tree when there is only single item
|
||||
- [#2134] FLA Export - split main timeline into scenes when DefineSceneAndFrameLabelData tag is present
|
||||
- [#2132] Show and export streamed sound (SoundStreamHead/SoundStreamBlock) in frame ranges
|
||||
- [#2132] Show and export streamed sound (SoundStreamHead/SoundStreamBlock) in frame ranges (+ take scenes into account)
|
||||
- FLA export - show export time
|
||||
- [#2138] Morphshapes - detect classic easing
|
||||
- FLA export - option to disable fixing of shapes
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
|
||||
import com.jpexs.decompiler.flash.tags.DefineScalingGridTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSceneAndFrameLabelDataTag;
|
||||
import com.jpexs.decompiler.flash.tags.DefineSpriteTag;
|
||||
import com.jpexs.decompiler.flash.tags.DoActionTag;
|
||||
import com.jpexs.decompiler.flash.tags.DoInitActionTag;
|
||||
@@ -583,7 +584,14 @@ public class Timeline {
|
||||
boolean frameHasSound = false;
|
||||
int frame = 0;
|
||||
SoundStreamHeadTypeTag head = null;
|
||||
List<Integer> sceneOffsets = new ArrayList<>();
|
||||
for (Tag t : tags) {
|
||||
if (containerId == -1 && (t instanceof DefineSceneAndFrameLabelDataTag)) {
|
||||
DefineSceneAndFrameLabelDataTag sceneFrameData = (DefineSceneAndFrameLabelDataTag) t;
|
||||
for (Long offset : sceneFrameData.sceneOffsets) {
|
||||
sceneOffsets.add((int) (long) offset);
|
||||
}
|
||||
}
|
||||
if (t instanceof SoundStreamHeadTypeTag) {
|
||||
head = (SoundStreamHeadTypeTag) t;
|
||||
head.setCharacterId(containerId);
|
||||
@@ -608,12 +616,20 @@ public class Timeline {
|
||||
|
||||
if (t instanceof ShowFrameTag) {
|
||||
frame++;
|
||||
if (frameHasSound) {
|
||||
if (frameHasSound) {
|
||||
numFramesNoSound = 0;
|
||||
} else {
|
||||
numFramesNoSound++;
|
||||
}
|
||||
frameHasSound = false;
|
||||
if (sceneOffsets.contains(frame)) {
|
||||
if (range.endFrame > -1) {
|
||||
ranges.add(range);
|
||||
}
|
||||
range = new SoundStreamFrameRange(head);
|
||||
range.startFrame = -1;
|
||||
range.endFrame = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ranges == null) {
|
||||
|
||||
Reference in New Issue
Block a user