Exemplo n.º 1
0
 public void RemoveIndex(int indexIndex)
 {
     for (int i = indexIndex; i < m_Indices.Length - 1; i++)
     {
         m_Indices[i] = m_Indices[i + 1];
     }
     m_Indices = (Index[])CueSheet.ResizeArray(m_Indices, m_Indices.Length - 1);
 }
Exemplo n.º 2
0
 public void AddComment(string comment)
 {
     if (comment.Trim() != "")
     {
         m_Comments = (string[])CueSheet.ResizeArray(m_Comments, m_Comments.Length + 1);
         m_Comments[m_Comments.Length - 1] = comment;
     }
 }
Exemplo n.º 3
0
 public void AddGarbage(string garbage)
 {
     if (garbage.Trim() != "")
     {
         m_Garbage = (string[])CueSheet.ResizeArray(m_Garbage, m_Garbage.Length + 1);
         m_Garbage[m_Garbage.Length - 1] = garbage;
     }
 }
Exemplo n.º 4
0
 public void AddFlag(Flags flag)
 {
     //if it's not a none tag
     //and if the tags hasn't already been added
     if (flag != Flags.NONE && NewFlag(flag) == true)
     {
         m_TrackFlags = (Flags[])CueSheet.ResizeArray(m_TrackFlags, m_TrackFlags.Length + 1);
         m_TrackFlags[m_TrackFlags.Length - 1] = flag;
     }
 }
Exemplo n.º 5
0
        private static void DoGdiConversion(string workingDir, string cueFilename)
        {
            DirectoryInfo workingDirectory = new DirectoryInfo(workingDir);
            CueSheet      cueSheet         = new CueSheet(cueFilename);
            int           currentSector    = 0;
            StringWriter  gdiOutput        = new StringWriter();

            gdiOutput.WriteLine(cueSheet.Tracks.Length.ToString());
            for (int i = 0; i < cueSheet.Tracks.Length; i++)
            {
                Track  currentTrack        = cueSheet.Tracks[i];
                string inputTrackFilePath  = Path.Combine(workingDirectory.FullName, currentTrack.DataFile.Filename);
                bool   canPerformFullCopy  = currentTrack.Indices.Length == 1;
                string outputTrackFileName = string.Format(
                    "track{0}.{1}",
                    currentTrack.TrackNumber,
                    currentTrack.TrackDataType == DataType.AUDIO ? "raw" : "bin");
                string outputTrackFilePath = Path.Combine(workingDirectory.FullName, outputTrackFileName);
                int    sectorAmount;
                if (canPerformFullCopy)
                {
                    File.Copy(inputTrackFilePath, outputTrackFilePath);
                    sectorAmount = (int)(new FileInfo(inputTrackFilePath).Length / 2352);
                }
                else
                {
                    int gapOffset = CountIndexFrames(currentTrack.Indices[1]);
                    sectorAmount   = CopyFileWithGapOffset(inputTrackFilePath, outputTrackFilePath, gapOffset);
                    currentSector += gapOffset;
                }

                int gap = 0;

                gdiOutput.WriteLine("{0} {1} {2} 2352 {3} {4}",
                                    currentTrack.TrackNumber,
                                    currentSector,
                                    currentTrack.TrackDataType == DataType.AUDIO ? "0" : "4",
                                    outputTrackFileName,
                                    gap);

                currentSector += sectorAmount;

                if (currentTrack.Comments.Contains("HIGH-DENSITY AREA"))
                {
                    if (currentSector < 45000)
                    {
                        currentSector = 45000;
                    }
                }
            }

            string gdiOutputPath = Path.Combine(workingDirectory.FullName, "disc.gdi");

            File.WriteAllText(gdiOutputPath, gdiOutput.ToString());
        }
Exemplo n.º 6
0
        public void AddIndex(int number, int minutes, int seconds, int frames)
        {
            m_Indices = (Index[])CueSheet.ResizeArray(m_Indices, m_Indices.Length + 1);

            m_Indices[m_Indices.Length - 1] = new Index(number, minutes, seconds, frames);
        }