Beispiel #1
0
    private void ParseCue(string[] file)
    {
      //-1 means still global,
      //all others are track specific
      int trackOn = -1;
      AudioFile currentFile = new AudioFile();

      for (int i = 0; i < file.Length; i++)
      {
        file[i] = file[i].Trim();
        string prefix = "";
        if (file[i].Length > 1)
        {
          prefix = file[i].Substring(0, file[i].IndexOf(' ')).ToUpperInvariant();
        }

        switch (prefix)
        {
          case "CATALOG":
            ParseString(file[i], trackOn);
            break;
          case "CDTEXTFILE":
            ParseString(file[i], trackOn);
            break;
          case "FILE":
            currentFile = ParseFile(file[i], trackOn);
            break;
          case "FLAGS":
            ParseFlags(file[i], trackOn);
            break;
          case "INDEX":
            ParseIndex(file[i], trackOn);
            break;
          case "ISRC":
            ParseString(file[i], trackOn);
            break;
          case "PERFORMER":
            ParseString(file[i], trackOn);
            break;
          case "POSTGAP":
            ParseIndex(file[i], trackOn);
            break;
          case "PREGAP":
            ParseIndex(file[i], trackOn);
            break;
          case "REM":
            ParseComment(file[i], trackOn);
            break;
          case "SONGWRITER":
            ParseString(file[i], trackOn);
            break;
          case "TITLE":
            ParseString(file[i], trackOn);
            break;
          case "TRACK":
            trackOn++;
            ParseTrack(file[i], trackOn);
            if (currentFile.Filename != null)
            {
              m_Tracks[trackOn].DataFile = currentFile;
            }
            break;
          default:
            ParseGarbage(file[i], trackOn);
            //save discarded junk and place string[] with track it was found in
            break;
        }
      }
    }
Beispiel #2
0
    public Track(int tracknumber, string datatype)
    {
      m_TrackNumber = tracknumber;

      switch (datatype.Trim().ToUpperInvariant())
      {
        case "AUDIO":
          m_TrackDataType = DataType.AUDIO;
          break;
        case "CDG":
          m_TrackDataType = DataType.CDG;
          break;
        case "MODE1/2048":
          m_TrackDataType = DataType.MODE1_2048;
          break;
        case "MODE1/2352":
          m_TrackDataType = DataType.MODE1_2352;
          break;
        case "MODE2/2336":
          m_TrackDataType = DataType.MODE2_2336;
          break;
        case "MODE2/2352":
          m_TrackDataType = DataType.MODE2_2352;
          break;
        case "CDI/2336":
          m_TrackDataType = DataType.CDI_2336;
          break;
        case "CDI/2352":
          m_TrackDataType = DataType.CDI_2352;
          break;
        default:
          m_TrackDataType = DataType.AUDIO;
          break;
      }

      m_TrackFlags = new Flags[0];
      m_Songwriter = "";
      m_Title = "";
      m_ISRC = "";
      m_Performer = "";
      m_Indices = new Index[0];
      m_Garbage = new string[0];
      m_Comments = new string[0];
      m_PreGap = new Index(-1, 0, 0, 0);
      m_PostGap = new Index(-1, 0, 0, 0);
      m_DataFile = new AudioFile();
    }
Beispiel #3
0
    public Track(int tracknumber, DataType datatype)
    {
      m_TrackNumber = tracknumber;
      m_TrackDataType = datatype;

      m_TrackFlags = new Flags[0];
      m_Songwriter = "";
      m_Title = "";
      m_ISRC = "";
      m_Performer = "";
      m_Indices = new Index[0];
      m_Garbage = new string[0];
      m_Comments = new string[0];
      m_PreGap = new Index(-1, 0, 0, 0);
      m_PostGap = new Index(-1, 0, 0, 0);
      m_DataFile = new AudioFile();
    }
Beispiel #4
0
        private void ParseCue(string[] file)
        {
            //-1 means still global,
            //all others are track specific
            int       trackOn     = -1;
            AudioFile currentFile = new AudioFile();

            for (int i = 0; i < file.Length; i++)
            {
                file[i] = file[i].Trim();
                string prefix = "";
                if (file[i].Length > 1)
                {
                    prefix = file[i].Substring(0, file[i].IndexOf(' ')).ToUpperInvariant();
                }

                switch (prefix)
                {
                case "CATALOG":
                    ParseString(file[i], trackOn);
                    break;

                case "CDTEXTFILE":
                    ParseString(file[i], trackOn);
                    break;

                case "FILE":
                    currentFile = ParseFile(file[i], trackOn);
                    break;

                case "FLAGS":
                    ParseFlags(file[i], trackOn);
                    break;

                case "INDEX":
                    ParseIndex(file[i], trackOn);
                    break;

                case "ISRC":
                    ParseString(file[i], trackOn);
                    break;

                case "PERFORMER":
                    ParseString(file[i], trackOn);
                    break;

                case "POSTGAP":
                    ParseIndex(file[i], trackOn);
                    break;

                case "PREGAP":
                    ParseIndex(file[i], trackOn);
                    break;

                case "REM":
                    ParseComment(file[i], trackOn);
                    break;

                case "SONGWRITER":
                    ParseString(file[i], trackOn);
                    break;

                case "TITLE":
                    ParseString(file[i], trackOn);
                    break;

                case "TRACK":
                    trackOn++;
                    ParseTrack(file[i], trackOn);
                    if (currentFile.Filename != null)
                    {
                        m_Tracks[trackOn].DataFile = currentFile;
                    }
                    break;

                default:
                    ParseGarbage(file[i], trackOn);
                    //save discarded junk and place string[] with track it was found in
                    break;
                }
            }
        }