mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 16:28:10 +00:00
framerate is float
This commit is contained in:
@@ -225,7 +225,7 @@ public class HeaderInfoPanel extends JPanel implements TagEditorPanel {
|
||||
swf.compression = getCompression();
|
||||
swf.version = getVersionNumber();
|
||||
swf.gfx = gfxCheckBox.isSelected();
|
||||
swf.frameRate = (int) frameRateEditor.getModel().getValue();
|
||||
swf.frameRate = ((Number) (frameRateEditor.getModel().getValue())).floatValue();
|
||||
swf.displayRect.Xmin = (int) xMinEditor.getModel().getValue();
|
||||
swf.displayRect.Xmax = (int) xMaxEditor.getModel().getValue();
|
||||
swf.displayRect.Ymin = (int) yMinEditor.getModel().getValue();
|
||||
@@ -266,7 +266,7 @@ public class HeaderInfoPanel extends JPanel implements TagEditorPanel {
|
||||
|
||||
fileSizeLabel.setText(Long.toString(swf.fileSize));
|
||||
|
||||
frameRateLabel.setText(Integer.toString(swf.frameRate));
|
||||
frameRateLabel.setText(Float.toString(swf.frameRate));
|
||||
frameRateEditor.setModel(new SpinnerNumberModel(swf.frameRate, -0x80000000, 0x7fffffff, 1));
|
||||
|
||||
frameCountLabel.setText("" + swf.frameCount);
|
||||
|
||||
@@ -958,8 +958,8 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
|
||||
private void startTimer(Timeline timeline, boolean playing) {
|
||||
|
||||
int frameRate = timeline.frameRate;
|
||||
int msPerFrame = frameRate == 0 ? 1000 : 1000 / frameRate;
|
||||
float frameRate = timeline.frameRate;
|
||||
int msPerFrame = frameRate == 0 ? 1000 : (int) (1000.0 / frameRate);
|
||||
final boolean singleFrame = !playing || (timeline.getRealFrameCount() <= 1 && timeline.isSingleFrame());
|
||||
|
||||
timer = new Timer();
|
||||
@@ -1043,7 +1043,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized int getFrameRate() {
|
||||
public synchronized float getFrameRate() {
|
||||
if (timelined == null) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3293,7 +3293,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
private void initTimeline(Timeline timeline) {
|
||||
if (tag instanceof MorphShapeTag) {
|
||||
tim.frameRate = MORPH_SHAPE_ANIMATION_FRAME_RATE;
|
||||
int framesCnt = tim.frameRate * MORPH_SHAPE_ANIMATION_LENGTH;
|
||||
int framesCnt = (int) (tim.frameRate * MORPH_SHAPE_ANIMATION_LENGTH);
|
||||
for (int i = 0; i < framesCnt; i++) {
|
||||
Frame f = new Frame(tim, i);
|
||||
DepthState ds = new DepthState(tag.getSwf(), f);
|
||||
|
||||
@@ -618,7 +618,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
}
|
||||
|
||||
int frameCount = 1;
|
||||
int frameRate = swf.frameRate;
|
||||
float frameRate = swf.frameRate;
|
||||
HashMap<Integer, VideoFrameTag> videoFrames = new HashMap<>();
|
||||
if (tagObj instanceof DefineVideoStreamTag) {
|
||||
DefineVideoStreamTag vs = (DefineVideoStreamTag) tagObj;
|
||||
@@ -634,7 +634,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
|
||||
if ((tagObj instanceof DefineMorphShapeTag) || (tagObj instanceof DefineMorphShape2Tag)) {
|
||||
frameRate = MainPanel.MORPH_SHAPE_ANIMATION_FRAME_RATE;
|
||||
frameCount = MainPanel.MORPH_SHAPE_ANIMATION_LENGTH * frameRate;
|
||||
frameCount = (int) (MainPanel.MORPH_SHAPE_ANIMATION_LENGTH * frameRate);
|
||||
}
|
||||
|
||||
if (tagObj instanceof DefineSoundTag) {
|
||||
@@ -660,8 +660,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
int height = outrect.getHeight();
|
||||
|
||||
sos2.writeRECT(outrect);
|
||||
sos2.writeUI8(0);
|
||||
sos2.writeUI8(frameRate);
|
||||
sos2.writeFIXED8(frameRate);
|
||||
sos2.writeUI16(frameCount); //framecnt
|
||||
|
||||
/*FileAttributesTag fa = new FileAttributesTag();
|
||||
|
||||
@@ -299,7 +299,7 @@ public class SoundTagPlayer implements MediaDisplay {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFrameRate() {
|
||||
public float getFrameRate() {
|
||||
return (int) (1000000L / FRAME_DIVISOR);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public interface MediaDisplay extends Closeable {
|
||||
|
||||
public void setBackground(Color color);
|
||||
|
||||
public int getFrameRate();
|
||||
public float getFrameRate();
|
||||
|
||||
public boolean isLoaded();
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
|
||||
if (currentFrame >= totalFrames) {
|
||||
currentFrame = totalFrames - 1;
|
||||
}
|
||||
int frameRate = display.getFrameRate();
|
||||
float frameRate = display.getFrameRate();
|
||||
if (totalFrames == 0) {
|
||||
progress.setIndeterminate(true);
|
||||
} else {
|
||||
@@ -360,8 +360,8 @@ public class PlayerControls extends JPanel implements MediaDisplayListener {
|
||||
frameLabel.setText(("" + (currentFrame + 1)));
|
||||
totalFrameLabel.setText("" + totalFrames);
|
||||
if (frameRate != 0) {
|
||||
timeLabel.setText("(" + formatMs((currentFrame * 1000) / frameRate) + ")");
|
||||
totalTimeLabel.setText("(" + formatMs((totalFrames * 1000) / frameRate) + ")");
|
||||
timeLabel.setText("(" + formatMs((int) (currentFrame * 1000.0 / frameRate)) + ")");
|
||||
totalTimeLabel.setText("(" + formatMs((int) (totalFrames * 1000.0 / frameRate)) + ")");
|
||||
}
|
||||
if (totalFrames <= 1 && playbackControls.isVisible()) {
|
||||
playbackControls.setVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user