public void Convert(SmfContainer input) { this.output = new List <SequenceItem>(); this.info = new SequenceInfo() { Resolution = input.Resolution, EndOfTick = input.MaxTick, LoopBeginTick = this.DetectLoopBegin(input) }; this.ResetHandles(); foreach (Event @event in input.Tracks.SelectMany(t => t.Events).OrderBy(e => e.Tick)) { this.nowTick = @event.Tick; if (@event is MidiEvent) { this.ConvertHandles((MidiEvent)@event); } else if (@event is MetaEvent) { MetaEvent metaevent = (MetaEvent)@event; if (metaevent.MetaType == MetaType.Tempo) { this.AddTempo(metaevent.GetTempo()); } } } }
public Sequencer(IEnumerable<SequenceItem> handles, SequenceInfo info) { if (handles == null) throw new ArgumentNullException("handles"); this.handles = new List<SequenceItem>(handles); this.info = info; this.tick = -info.Resolution; this.RecalcTickTime(); }
public Sequencer(IEnumerable <SequenceItem> handles, SequenceInfo info) { if (handles == null) { throw new ArgumentNullException("handles"); } this.handles = new List <SequenceItem>(handles); this.info = info; this.tick = -info.Resolution; this.RecalcTickTime(); }
public void Convert(SmfContainer input) { this.output = new List<SequenceItem>(); this.info = new SequenceInfo() { Resolution = input.Resolution, EndOfTick = input.MaxTick, LoopBeginTick = this.DetectLoopBegin(input) }; this.ResetHandles(); foreach (Event @event in input.Tracks.SelectMany(t => t.Events).OrderBy(e => e.Tick)) { this.nowTick = @event.Tick; if (@event is MidiEvent) this.ConvertHandles((MidiEvent)@event); else if (@event is MetaEvent) { MetaEvent metaevent = (MetaEvent)@event; if (metaevent.MetaType == MetaType.Tempo) this.AddTempo(metaevent.GetTempo()); } } }