Пример #1
0
        private Tab ReadStructTab(Tab tab)
        {
            tab.Version = ReadStruct <Version>(ReadStructVersion).Value;
            Skip(0x06); // TODO Learn
            tab.Meta            = ReadStruct <TabMeta>(ReadStructTabMeta).Value;
            tab.LyricsTrack     = Int32;
            tab.LyricsArray     = ReadStruct <LyricsList>(ReadStructLyricsList);
            tab.RSEMasterEffect = ReadStruct <RSEMasterEffect>(ReadMasterEffect);
            tab.Template        = ReadStruct <Template>(ReadStructTemplate).Value;
            tab.Moderate        = Int32;
            tab.HideTempo       = Boolean;
            Skip(0x05); // TODO Learn
            for (_trackMetaIterator = 0; _trackMetaIterator < 64; _trackMetaIterator++)
            {
                // TODO Rename to MIDIChannel
                TrackMetaArray.Add(ReadStruct <TrackMeta>(ReadStructTrackMeta).Value);
            }

            Skip(0x26);        // TODO Learn
            var unk13 = Int32; // TODO Learn

            tab.BarCount    = Int32;
            tab.TracksCount = Int32;
            var unk12 = Byte; // TODO Learn

            tab.Up   = Byte;
            tab.Down = Byte;

            tab.KeySigns   = this << 2;
            tab.Link8Notes = this << 4;

            Console.WriteLine("{0:X5}, {1}", BaseStream.Position, Path);
            return(tab);

            switch (Path)
            {
            case "re.gp5":
                Skip(0x14);
                break;

            default:
                Debugger.Break();
                break;
            }

            tab.Bookmarks.Add(ReadStruct <Bookmark>(ReadStructBookmark).Value);

            return(tab);

            for (var i = 0; i < tab.TracksCount; i++)
            {
                tab.AddTrack(ReadStruct <Track>(ReadStructTrack).Value);
            }

            Skip(5);

            var xx = 0;

            while (!AtEnd)
            {
                xx++;
                tab.Chords.Add(ReadStruct <Chord>(ReadStructChord).Value);
            }

            Close();
            Dispose();
            Debugger.Break();
        }