Exemple #1
0
        public string GetFreeDBDiscID()
        {
            int numTracks = GetNumTracks();
            int t         = 0,
                n         = 0;

            for (int i = 0; i < numTracks; i++)
            {
                n = n + cddb_sum((Toc.TrackData[i].Address_1 * 60) + Toc.TrackData[i].Address_2);
            }

            Win32Functions.TRACK_DATA last  = Toc.TrackData[numTracks];
            Win32Functions.TRACK_DATA first = Toc.TrackData[0];

            t = ((last.Address_1 * 60) + last.Address_2) -
                ((first.Address_1 * 60) + first.Address_2);

            int lDiscId = ((n % 0xff) << 24 | t << 8 | numTracks);

            string sDiscId = String.Format("{0:X}", lDiscId);

            if (sDiscId.Length < 8)
            {
                for (int j = sDiscId.Length; j < 8; j++)
                {
                    sDiscId = "0" + sDiscId;
                }
            }

            return(sDiscId);
        }
Exemple #2
0
 protected int GetEndSector(int track)
 {
     if (TocValid && (track >= Toc.FirstTrack) && (track <= Toc.LastTrack))
     {
         Win32Functions.TRACK_DATA td = Toc.TrackData[track];
         return((td.Address_1 * 60 * 75 + td.Address_2 * 75 + td.Address_3) - 151);
     }
     else
     {
         return(-1);
     }
 }
Exemple #3
0
 protected int GetStartMinute(int track)
 {
     if (TocValid && (track >= Toc.FirstTrack) && (track <= Toc.LastTrack))
     {
         Win32Functions.TRACK_DATA td = Toc.TrackData[track - 1];
         return(td.Address_1 * 60 * 75);
     }
     else
     {
         return(-1);
     }
 }