コード例 #1
0
ファイル: MIDIReader.cs プロジェクト: ExileLord/Open-GHTCP
 public static MIDIReader smethod_0(string fileLocation)
 {
     MIDIReader result;
     using (FileStream fileStream = new FileStream(fileLocation, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
     {
         result = new MIDIReader(fileStream);
     }
     return result;
 }
コード例 #2
0
ファイル: MIDIReader.cs プロジェクト: no1mann/Open-GHTCP
        public static MIDIReader smethod_0(string fileLocation)
        {
            MIDIReader result;

            using (FileStream fileStream = new FileStream(fileLocation, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            {
                result = new MIDIReader(fileStream);
            }
            return(result);
        }
コード例 #3
0
ファイル: MIDIParser.cs プロジェクト: ExileLord/Open-GHTCP
 public ChartParser method_0()
 {
     string name = "";
     name = name + new FileInfo(this.fileLocation).Name + ":\n";
     try
     {
         this.midiReader = MIDIReader.smethod_0(this.fileLocation);
     }
     catch (Exception)
     {
         throw new IOException(name + "Unknown Error: Could not parse MIDI sequence.");
     }
     foreach (MIDILine current in this.midiReader.getMidiLineList())
     {
         if (current.method_2().Equals("PART GUITAR"))
         {
             this.isPartGuitar = true;
         }
         else if (current.method_2().Equals("EVENTS"))
         {
             this.isEvents = true;
         }
     }
     if (this.midiReader.getMidiLineList().Count == 1 && !this.isPartGuitar)
     {
         this.midiReader.getMidiLineList()[0].method_3("PART GUITAR");
         this.isPartGuitar = true;
     }
     if (!this.isPartGuitar)
     {
         throw new IOException(name + "PART GUITAR not found. No chart created.");
     }
     ChartParser chartParser = new ChartParser();
     this.bpmInterpreter = chartParser.bpmInterpreter;
     this.sectionInterpreter = chartParser.sectionInterpreter;
     chartParser.difficultyWithNotes.Add("EasySingle", this.easySingle);
     chartParser.difficultyWithNotes.Add("MediumSingle", this.mediumSingle);
     chartParser.difficultyWithNotes.Add("HardSingle", this.hardSingle);
     chartParser.difficultyWithNotes.Add("ExpertSingle", this.expertSingle);
     chartParser.difficultyWithNotes.Add("EasyDoubleGuitar", this.easyDoubleGuitar);
     chartParser.difficultyWithNotes.Add("MediumDoubleGuitar", this.mediumDoubleGuitar);
     chartParser.difficultyWithNotes.Add("HardDoubleGuitar", this.hardDoubleGuitar);
     chartParser.difficultyWithNotes.Add("ExpertDoubleGuitar", this.expertDoubleGuitar);
     chartParser.difficultyWithNotes.Add("EasyDoubleBass", this.easyDoubleBass);
     chartParser.difficultyWithNotes.Add("MediumDoubleBass", this.mediumDoubleBass);
     chartParser.difficultyWithNotes.Add("HardDoubleBass", this.hardDoubleBass);
     chartParser.difficultyWithNotes.Add("ExpertDoubleBass", this.expertDoubleBass);
     chartParser.instrumentList.Add("EasyDrums", this.easyDrums);
     chartParser.instrumentList.Add("MediumDrums", this.mediumDrums);
     chartParser.instrumentList.Add("HardDrums", this.hardDrums);
     chartParser.instrumentList.Add("ExpertDrums", this.expertDrums);
     chartParser.instrumentList.Add("EasyKeyboard", this.easyKeyboard);
     chartParser.instrumentList.Add("MediumKeyboard", this.mediumKeyboard);
     chartParser.instrumentList.Add("HardKeyboard", this.hardKeyboard);
     chartParser.instrumentList.Add("ExpertKeyboard", this.expertKeyboard);
     chartParser.constant480 = 480;
     this.resolution = 480.0 / (double)this.midiReader.method_0();
     object obj = name;
     name = string.Concat(new object[]
     {
         obj,
         "NumTracks = ",
         this.midiReader.getMidiLineList().Count,
         "\n"
     });
     this.method_1(this.midiReader.getMidiLineList()[0]);
     foreach (MIDILine midiLine in this.midiReader.getMidiLineList())
     {
         if (midiLine.method_2().Equals("PART GUITAR"))
         {
             this.getNotes(midiLine, 0);
         }
         else if (midiLine.method_2().Equals("T1 GEMS"))
         {
             this.getNotes(midiLine, 0);
         }
         else if (midiLine.method_2().Equals("PART GUITAR COOP"))
         {
             this.getNotes(midiLine, 1);
         }
         else if (midiLine.method_2().Equals("PART RHYTHM"))
         {
             this.notBass = true;
             this.getNotes(midiLine, 3);
         }
         else if (midiLine.method_2().Equals("PART BASS"))
         {
             this.getNotes(midiLine, 3);
         }
         else if (midiLine.method_2().Equals("EVENTS"))
         {
             this.getNotes(midiLine, 4);
         }
         else if (midiLine.method_2().Equals("BAND DRUMS"))
         {
             this.getNotes(midiLine, 5);
         }
         else if (midiLine.method_2().Equals("BAND KEYS"))
         {
             this.getNotes(midiLine, 7);
         }
         else
         {
             name = name + "Track (" + midiLine.method_2() + ") ignored.\n";
         }
     }
     chartParser.gh3SongInfo.title = this.songTitle;
     chartParser.gh3SongInfo.not_bass = this.notBass;
     name += "Conversion Complete!";
     Console.WriteLine(name);
     chartParser.removeEmptyParts();
     return chartParser;
 }