From 44554f8f355912c0d5eee05d9a1d37f1a3f387d8 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Sat, 20 Feb 2016 14:13:33 +0100 Subject: [PATCH] get sound fix --- .../jpexs/decompiler/flash/timeline/Timeline.java | 13 ++++++------- src/com/jpexs/decompiler/flash/gui/ImagePanel.java | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java index b1a37e2af..440952ac1 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java @@ -931,7 +931,7 @@ public class Timeline { FrameExporter.framesToHtmlCanvas(result, unitDivisor, this, frames, 0, null, 0, displayRect, null, null); } - public void getSounds(int frame, int time, DepthState stateUnderCursor, int mouseButton, List sounds, List soundClasses) { + public void getSounds(int frame, int time, ButtonTag mouseOverButton, int mouseButton, List sounds, List soundClasses) { Frame fr = getFrame(frame); sounds.addAll(fr.sounds); soundClasses.addAll(fr.soundClasses); @@ -944,11 +944,10 @@ public class Timeline { if (frameCount == 0) { continue; } - int dframe = (time + ds.time) % frameCount; + int dframe = time % frameCount; if (c instanceof ButtonTag) { - ButtonTag bt = (ButtonTag) c; dframe = ButtonTag.FRAME_UP; - if (stateUnderCursor == ds) { + if (mouseOverButton == c) { if (mouseButton > 0) { dframe = ButtonTag.FRAME_DOWN; } else { @@ -956,7 +955,7 @@ public class Timeline { } } } - ((Timelined) c).getTimeline().getSounds(dframe, time + ds.time, stateUnderCursor, mouseButton, sounds, soundClasses); + ((Timelined) c).getTimeline().getSounds(dframe, time, mouseOverButton, mouseButton, sounds, soundClasses); } } } @@ -994,7 +993,7 @@ public class Timeline { drawableFrameCount = 1; } - int dframe = (time + layer.time) % drawableFrameCount; + int dframe = time % drawableFrameCount; if (character instanceof ButtonTag) { dframe = ButtonTag.FRAME_UP; if (renderContext.cursorPosition != null) { @@ -1010,7 +1009,7 @@ public class Timeline { } } - Shape cshape = ((DrawableTag) character).getOutline(dframe, time + layer.time, layer.ratio, renderContext, m); + Shape cshape = ((DrawableTag) character).getOutline(dframe, time, layer.ratio, renderContext, m); Area addArea = new Area(cshape); if (currentClip != null) { Area a = new Area(new Rectangle(displayRect.Xmin, displayRect.Ymin, displayRect.getWidth(), displayRect.getHeight())); diff --git a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java index cc606b8af..06556c141 100644 --- a/src/com/jpexs/decompiler/flash/gui/ImagePanel.java +++ b/src/com/jpexs/decompiler/flash/gui/ImagePanel.java @@ -949,7 +949,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay { List sounds = new ArrayList<>(); List soundClasses = new ArrayList<>(); - timeline.getSounds(frame, time, null/*stateUnderCursor*/, mouseButton, sounds, soundClasses); + timeline.getSounds(frame, time, renderContext.mouseOverButton, mouseButton, sounds, soundClasses); for (int cid : swf.getCharacters().keySet()) { CharacterTag c = swf.getCharacter(cid); for (String cls : soundClasses) {