/// <summary> /// Replace all the IUniqueDefs from startMsPosition to (not including) endMsPosition by a single rest. /// </summary> public void Erase(int startMsPosition, int endMsPosition) { int beginIndex = FindIndexAtMsPositionReFirstIUD(startMsPosition); int endIndex = FindIndexAtMsPositionReFirstIUD(endMsPosition); for (int i = beginIndex; i < endIndex; ++i) { if (this[i] is IUniqueDef iud) { RestDef restDef = new MidiRestDef(iud.MsPositionReFirstUD, iud.MsDuration); RemoveAt(i); Insert(i, restDef); } } AgglomerateRests(); AssertConsistency(); }
public override object Clone() { MidiRestDef umrd = new MidiRestDef(this.MsPositionReFirstUD, this.MsDuration); return(umrd); }