예제 #1
0
        // Token: 0x060000D9 RID: 217 RVA: 0x00004C3C File Offset: 0x00002E3C
        public static SyncTrackEntry Parse(string entryStr)
        {
            Match          match = SyncTrackEntry.SyncTrackRegex.Match(entryStr);
            SyncTrackEntry result;

            if (!match.Success)
            {
                result = null;
            }
            else
            {
                SyncTrackEntry syncTrackEntry = new SyncTrackEntry();
                int            offset         = int.Parse(match.Groups["offset"].Value.Trim());
                string         text           = match.Groups["type"].Value.Trim();
                int            num;
                try
                {
                    num = int.Parse(match.Groups["value"].Value.Trim());
                }
                catch (OverflowException)
                {
                    num = int.MaxValue;
                }
                syncTrackEntry.Offset = offset;
                string text2 = text;
                if (text2 != null)
                {
                    if (!(text2 == "A"))
                    {
                        if (text2 == "TS")
                        {
                            syncTrackEntry.TimeSignature = num;
                            syncTrackEntry.Type          = SyncType.TimeSignature;
                            return(syncTrackEntry);
                        }
                        if (text2 == "B")
                        {
                            syncTrackEntry.BPM      = num;
                            syncTrackEntry.FloatBPM = (float)num / 1000f;
                            syncTrackEntry.Type     = SyncType.BPM;
                        }
                        return(syncTrackEntry);
                    }
                    else
                    {
                        syncTrackEntry.Anchor = num;
                        syncTrackEntry.Type   = SyncType.Anchor;
                    }
                }
                result = syncTrackEntry;
            }
            return(result);
        }
예제 #2
0
        // Token: 0x060000EF RID: 239 RVA: 0x000050EC File Offset: 0x000032EC
        private bool HandleSyncTrack(string entry)
        {
            SyncTrackEntry syncTrackEntry = SyncTrackEntry.Parse(entry);
            bool           result;

            if (syncTrackEntry == null)
            {
                result = false;
            }
            else
            {
                if (syncTrackEntry.Offset > this.LastIndex)
                {
                    this.LastIndex = syncTrackEntry.Offset;
                }
                this.SyncTrack.Add(syncTrackEntry);
                result = true;
            }
            return(result);
        }