Added GFX - DefineExternalSound and DefineExternalStreamSound playback

This commit is contained in:
Jindra Petřík
2023-01-09 21:37:06 +01:00
parent 1447e92289
commit 52c17de7b2
13 changed files with 299 additions and 57 deletions
@@ -2246,7 +2246,6 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
}
updatingScrollBars = true;
double zoomDouble = ImagePanel.this.zoom.fit ? getZoomToFit() : ImagePanel.this.zoom.value;
RECT timRect = timelined.getRect();
updateScrollBarMinMax();
//horizontalScrollBar.setVisible(horizontalScrollBar.getVisibleAmount() < horizontalScrollBar.getMaximum() - horizontalScrollBar.getMinimum());
//verticalScrollBar.setVisible(verticalScrollBar.getVisibleAmount() < verticalScrollBar.getMaximum() - verticalScrollBar.getMinimum());
@@ -2266,7 +2265,6 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
return;
}
updatingScrollBars = true;
RECT timRect = timelined.getRect();
double zoomDouble = ImagePanel.this.zoom.fit ? getZoomToFit() : ImagePanel.this.zoom.value;
updateScrollBarMinMax();
//horizontalScrollBar.setVisible(horizontalScrollBar.getVisibleAmount() < horizontalScrollBar.getMaximum() - horizontalScrollBar.getMinimum());
@@ -2407,6 +2405,11 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
private void updateScrollBarMinMax() {
if (timelined == null) {
horizontalScrollBar.setVisible(false);
verticalScrollBar.setVisible(false);
return;
}
RECT timRect = timelined.getRect();
/*
@@ -182,6 +182,7 @@ import com.jpexs.decompiler.flash.tags.base.TextImportErrorHandler;
import com.jpexs.decompiler.flash.tags.base.TextTag;
import com.jpexs.decompiler.flash.tags.base.UnsupportedSamplingRateException;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalImage2;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalStreamSound;
import com.jpexs.decompiler.flash.tags.gfx.DefineSubImage;
import com.jpexs.decompiler.flash.tags.text.TextParseException;
import com.jpexs.decompiler.flash.timeline.DepthState;
@@ -4941,7 +4942,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
previewPanel.showImagePanel(timelinedContainer, swf, frame, true, Configuration.autoPlayPreviews.get(), !Configuration.animateSubsprites.get(), false, !Configuration.playFrameSounds.get(), true, false);
} else if ((treeItem instanceof SoundTag)) { //&& isInternalFlashViewerSelected() && (Arrays.asList("mp3", "wav").contains(((SoundTag) tagObj).getExportFormat())))) {
previewPanel.showImagePanel(new SerializableImage(View.loadImage("sound32")));
previewPanel.setImageReplaceButtonVisible(false, false, false, !((Tag) treeItem).isReadOnly() && (treeItem instanceof SoundTag), false, false);
previewPanel.setImageReplaceButtonVisible(false, false, false, !((Tag) treeItem).isReadOnly() && ((SoundTag)treeItem).importSupported(), false, false);
try {
SoundTagPlayer soundThread = new SoundTagPlayer(null, (SoundTag) treeItem, Configuration.loopMedia.get() ? Integer.MAX_VALUE : 1, true);
if (!Configuration.autoPlaySounds.get()) {
@@ -5681,7 +5682,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
List<Tag> tags = tim.getTags().toArrayList();
Map<Integer, List<CharacterIdTag>> nestedTags = new HashMap<>();
for (Tag t : tags) {
if ((t instanceof CharacterIdTag) && !(t instanceof CharacterTag) && !(t instanceof SoundStreamHeadTypeTag)) {
if ((t instanceof CharacterIdTag) && !(t instanceof CharacterTag) && !(t instanceof SoundStreamHeadTypeTag) && !(t instanceof DefineExternalStreamSound)) {
int characterId = ((CharacterIdTag) t).getCharacterId();
if (!nestedTags.containsKey(characterId)) {
nestedTags.put(characterId, new ArrayList<>());
@@ -5689,7 +5690,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
nestedTags.get(characterId).add((CharacterIdTag) t);
}
if (!(t instanceof CharacterTag) && !(t instanceof SoundStreamHeadTypeTag)) {
if (!(t instanceof CharacterTag) && !(t instanceof SoundStreamHeadTypeTag) && !(t instanceof DefineExternalStreamSound)) {
int characterId = -1;
if (t instanceof CharacterIdTag) {
characterId = ((CharacterIdTag) t).getCharacterId();
@@ -82,6 +82,8 @@ import com.jpexs.decompiler.flash.tags.base.ShapeTag;
import com.jpexs.decompiler.flash.tags.base.SymbolClassTypeTag;
import com.jpexs.decompiler.flash.tags.base.TextTag;
import com.jpexs.decompiler.flash.tags.gfx.DefineCompactedFont;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalSound;
import com.jpexs.decompiler.flash.tags.gfx.DefineExternalStreamSound;
import com.jpexs.decompiler.flash.timeline.AS2Package;
import com.jpexs.decompiler.flash.timeline.AS3Package;
import com.jpexs.decompiler.flash.timeline.Frame;
@@ -280,7 +282,11 @@ public abstract class AbstractTagTree extends JTree {
return TreeNodeType.MOVIE;
}
if ((t instanceof DefineSoundTag) || (t instanceof SoundStreamHeadTag) || (t instanceof SoundStreamHead2Tag)) {
if ((t instanceof DefineSoundTag) ||
(t instanceof SoundStreamHeadTag) ||
(t instanceof SoundStreamHead2Tag) ||
(t instanceof DefineExternalSound) ||
(t instanceof DefineExternalStreamSound)) {
return TreeNodeType.SOUND;
}