private void WriteStrmMsg(ref int prevticks, clsFileStream.clsEvStrm evstrm) { if (evstrm is clsFileStream.clsEvBeat) { return; } int delta = evstrm.Ticks - prevticks; prevticks = evstrm.Ticks; evstrm = evstrm.Transpose(); evstrm.WriteMsg(this, delta); //return delta; }
private void ReadStreamChord(out List <byte> bytes, out clsMTime.clsBBT bbtbeat) { //* read Strm until pitime changes clsFileStream.clsEvStrm ev = Strm[StrmPos]; int ticks = ev.Ticks; bytes = new List <byte>(36); bbtbeat = null; //Debug.WriteLine("clsQIPlay.ReadStrm: QIThis = " + QIThis); while (ev.Ticks == ticks) { if (!clsFileStream.clsPlay.BypassEv(FileStream, Mute, ev)) //muted evs etc. //* process evtempo/evshort msgs for current ticks/qi { if (ev is clsFileStream.clsEvBeat) { bbtbeat = ((clsFileStream.clsEvBeat)ev).BBT; } else if (ev is clsFileStream.clsEvTempo) { MidiTempo = ((clsFileStream.clsEvTempo)ev).MidiTempo; TempoFactor = -1; //force tmepo recalc } else if (ev is clsFileStream.clsEvShort) { ev = ev.Transpose(); clsFileStream.clsEvShort evshort = (clsFileStream.clsEvShort)ev; if (bytes == null) { bytes = new List <byte>(36); } bytes.Add(0); //deltatime - always zero (ignored by BASS_MIDI_StreamEvents) bytes.Add(evshort.Status); bytes.Add(evshort.Msg); int statuspre = (evshort.Status & 0xf0); if (statuspre != 0xc0 && statuspre != 0xd0) { bytes.Add(evshort.Data); } } } if (++StrmPos >= Strm.Length) { return; //return false; } ev = Strm[StrmPos]; } //return (ev.PITime <= P.F.MaxPITime); }