File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ public virtual void Sort()
106106 BpmList . AddRange ( sortedBpms ) ;
107107
108108 MetList = MetList . OrderBy ( x => x . Time ) . ToList ( ) ;
109+ SflList = SflList . OrderBy ( x => x . Time ) . ToList ( ) ;
110+ if ( ExplicitClocks != null ) ExplicitClocks = ExplicitClocks . Order ( ) . ToList ( ) ;
111+
109112 Notes = SortNotes ( ) . ToList ( ) ; // LINQ OrderBy 是稳定排序
110113 }
111114
@@ -136,6 +139,12 @@ public virtual void Shift(Rational offset, decimal? bpm = null)
136139 . Skip ( MetList . Count ( x => x . Time <= 0 ) - 1 )
137140 . Select ( ( x , i ) => i == 0 ? x with { Time = 0 } : x ) . ToList ( ) ;
138141
142+ // 对SflList和ExplicitClocks的处理:加上offset后,只保留>=0的项
143+ SflList = SflList . Select ( x => x with { Time = x . Time + offset } )
144+ . Where ( x => x . Time >= 0 ) . ToList ( ) ;
145+ if ( ExplicitClocks != null )
146+ ExplicitClocks = ExplicitClocks . Select ( x => x + offset ) . Where ( x => x >= 0 ) . ToList ( ) ;
147+
139148 // Notes,时间加上offset,但注意需要对children进行递归操作
140149 HashSet < BaseNote > processed = [ ] ;
141150 Notes = Notes . Where ( x => addOffset ( x ) . Time >= 0 ) . ToList ( ) ;
You can’t perform that action at this time.
0 commit comments