/* */ 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 */