summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/CDTrackInfo.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/CDTrackInfo.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/CDTrackInfo.java')
-rw-r--r--NET/worlds/scape/CDTrackInfo.java85
1 files changed, 85 insertions, 0 deletions
diff --git a/NET/worlds/scape/CDTrackInfo.java b/NET/worlds/scape/CDTrackInfo.java
new file mode 100644
index 0000000..75326f7
--- /dev/null
+++ b/NET/worlds/scape/CDTrackInfo.java
@@ -0,0 +1,85 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import java.io.PrintStream;
+/* */
+/* */
+/* */
+/* */ public class CDTrackInfo
+/* */ {
+/* */ private int[] pos;
+/* */ private int[] len;
+/* */
+/* */ public CDTrackInfo(int numTracks)
+/* */ {
+/* 14 */ this.pos = new int[numTracks];
+/* 15 */ this.len = new int[numTracks];
+/* */ }
+/* */
+/* 18 */ public int getNumTracks() { return this.pos.length; }
+/* */
+/* */ public int getStartFrames(int track)
+/* */ {
+/* 22 */ return getPosM(track) * 60 * 75 + getPosS(track) * 75 + getPosF(track);
+/* */ }
+/* */
+/* */ public int getEndFrames(int track)
+/* */ {
+/* 27 */ if (track == this.pos.length - 1)
+/* 28 */ return getStartFrames(track) +
+/* 29 */ getLenM(track) * 60 * 75 + getLenS(track) * 75 +
+/* 30 */ getLenF(track);
+/* 31 */ return getStartFrames(track + 1) - 1;
+/* */ }
+/* */
+/* 34 */ public int getPosM(int track) { return minutes(this.pos[track]); }
+/* 35 */ public int getPosS(int track) { return seconds(this.pos[track]); }
+/* 36 */ public int getPosF(int track) { return frames(this.pos[track]); }
+/* */
+/* 38 */ public int getLenM(int track) { return minutes(this.len[track]); }
+/* 39 */ public int getLenS(int track) { return seconds(this.len[track]); }
+/* 40 */ public int getLenF(int track) { return frames(this.len[track]); }
+/* */
+/* */ private static int minutes(int packed)
+/* */ {
+/* 44 */ return packed & 0xFF;
+/* */ }
+/* */
+/* */ private static int seconds(int packed)
+/* */ {
+/* 49 */ return packed >> 8 & 0xFF;
+/* */ }
+/* */
+/* */ private static int frames(int packed)
+/* */ {
+/* 54 */ return packed >> 16 & 0xFF;
+/* */ }
+/* */
+/* */ private static String format2(int val)
+/* */ {
+/* 59 */ String result = "";
+/* 60 */ if (val < 10)
+/* 61 */ result = "0";
+/* 62 */ return result + val;
+/* */ }
+/* */
+/* */ private static String format(int packed)
+/* */ {
+/* 67 */ return
+/* 68 */ minutes(packed) + ":" + format2(seconds(packed)) + ":" + format2(frames(packed));
+/* */ }
+/* */
+/* */ public void dump()
+/* */ {
+/* 73 */ System.out.println("Tracks: " + this.pos.length);
+/* 74 */ for (int i = 0; i < this.pos.length; i++) {
+/* 75 */ System.out.println("Track " + i + " " + "start " + format(this.pos[i]) +
+/* 76 */ " length " + format(this.len[i]));
+/* */ }
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\CDTrackInfo.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file