# HG changeset patch # User Robert McIntyre # Date 1319569381 25200 # Node ID edaa7e7806e40dd7c742dd2be9258eee7ea3a6d7 # Parent a92de00f0414f6823e9c7b05b430b72571c5100a migrated IsoTimer diff -r a92de00f0414 -r edaa7e7806e4 src/com/aurellem/capture/AbstractVideoRecorder.java --- a/src/com/aurellem/capture/AbstractVideoRecorder.java Tue Oct 25 11:55:55 2011 -0700 +++ b/src/com/aurellem/capture/AbstractVideoRecorder.java Tue Oct 25 12:03:01 2011 -0700 @@ -13,7 +13,6 @@ import com.jme3.renderer.RenderManager; import com.jme3.renderer.ViewPort; import com.jme3.renderer.queue.RenderQueue; -import com.jme3.system.IsoTimer; import com.jme3.texture.FrameBuffer; import com.jme3.util.BufferUtils; import com.jme3.util.Screenshots; diff -r a92de00f0414 -r edaa7e7806e4 src/com/aurellem/capture/IsoTimer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/com/aurellem/capture/IsoTimer.java Tue Oct 25 12:03:01 2011 -0700 @@ -0,0 +1,30 @@ +package com.aurellem.capture; + +import com.jme3.system.Timer; + +public class IsoTimer extends Timer { + + private float framerate; + private int ticks; + + public IsoTimer(float framerate){ + this.framerate = framerate; + this.ticks = 0;} + + public long getTime() { + return (long) (this.ticks / this.framerate);} + + public long getResolution() { + return 1000000000L;} + + public float getFrameRate() { + return this.framerate;} + + public float getTimePerFrame() { + return (float) (1.0f / this.framerate);} + + public void update() {this.ticks++;} + + public void reset() {this.ticks = 0;} + +} diff -r a92de00f0414 -r edaa7e7806e4 src/com/aurellem/capture/PrintTimer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/com/aurellem/capture/PrintTimer.java Tue Oct 25 12:03:01 2011 -0700 @@ -0,0 +1,17 @@ +package com.aurellem.capture; + +import com.jme3.system.NanoTimer; + +public class PrintTimer extends NanoTimer{ + + public PrintTimer(){ + super(); + System.out.println("hi");} + + + public float getTimePerFrame() { + System.out.println("RLM: I'm a timer!"); + return super.getTimePerFrame(); + } + +} diff -r a92de00f0414 -r edaa7e7806e4 src/com/aurellem/capture/hello/HelloAudio.java --- a/src/com/aurellem/capture/hello/HelloAudio.java Tue Oct 25 11:55:55 2011 -0700 +++ b/src/com/aurellem/capture/hello/HelloAudio.java Tue Oct 25 12:03:01 2011 -0700 @@ -4,6 +4,7 @@ import java.util.logging.Level; import java.util.logging.Logger; +import com.aurellem.capture.IsoTimer; import com.aurellem.capture.MultiListener; import com.aurellem.capture.WaveFileWriter; import com.jme3.app.SimpleApplication; @@ -18,7 +19,6 @@ import com.jme3.scene.Geometry; import com.jme3.scene.shape.Box; import com.jme3.system.AppSettings; -import com.jme3.system.IsoTimer; /** Sample 11 - playing 3D audio. */ public class HelloAudio extends SimpleApplication { diff -r a92de00f0414 -r edaa7e7806e4 src/com/aurellem/capture/hello/HelloVideo.java --- a/src/com/aurellem/capture/hello/HelloVideo.java Tue Oct 25 11:55:55 2011 -0700 +++ b/src/com/aurellem/capture/hello/HelloVideo.java Tue Oct 25 12:03:01 2011 -0700 @@ -6,6 +6,7 @@ import com.aurellem.capture.AVIVideoRecorder; import com.aurellem.capture.AbstractVideoRecorder; import com.aurellem.capture.Capture; +import com.aurellem.capture.IsoTimer; import com.jme3.app.SimpleApplication; import com.jme3.material.Material; import com.jme3.math.ColorRGBA; @@ -13,7 +14,6 @@ import com.jme3.renderer.ViewPort; import com.jme3.scene.Geometry; import com.jme3.scene.shape.Box; -import com.jme3.system.IsoTimer; /** Recording Video from an application suitable for upload to youtube.*/ public class HelloVideo extends SimpleApplication {