@@ -364,14 +364,6 @@ private void ParseHeightAndColor(ChuNote n, string str, List<Alert> alerts, int
364364 else if ( int . TryParse ( intervalStr , out var interval ) ) n . CrushInterval = interval ;
365365 else alerts . Add ( new Alert ( Warning , "解析Air-Crush的interval属性失败!" , n . Time , null , lineNum , FormatNoteRef ( n , str ) ) ) ;
366366 }
367- else if ( noteType is "C" && str . Length == 2 && Version < 8 )
368- {
369- var intervalStr = str . Last ( ) ;
370- str = str [ ..^ 1 ] + "N" ;
371- if ( intervalStr == 'Z' ) n . CrushInterval = 38400 ;
372- else if ( TryHToI ( intervalStr , out var interval ) ) n . CrushInterval = interval ;
373- else alerts . Add ( new Alert ( Warning , "解析Air-Crush的interval属性失败!" , n . Time , null , lineNum , FormatNoteRef ( n , str ) ) ) ;
374- }
375367
376368 // 剩的部分都满足:最后一位是颜色,前面是高度
377369 if ( str . Length > 0 )
@@ -544,25 +536,42 @@ private void ParseAirNote(string code, ChuNote note, List<Alert> alerts, int lin
544536 ParseHeightAndColor ( note , mainPart [ 2 ..] , alerts , lineNum , "a" ) ;
545537 }
546538
547- private static int ParseAirCrushNote ( string [ ] lines , int idx , string code , ChuNote previousNote , List < Alert > alerts , ChuChart chart )
539+ private int ParseAirCrushNote ( string [ ] lines , int idx , string code , ChuNote note , List < Alert > alerts , ChuChart chart )
548540 {
549- // TODO 尚未实现,所以先给个警告
550- alerts . Add ( new Alert ( Warning , "当前版本尚未实现对Air-Crush(UMIGURI的':C'或':T'音符)的解析。" ) { Line = idx , RelevantNote = lines [ idx ] } ) ;
541+ note . Type = "ALD" ;
542+ ParseCellWidth ( code , 1 , note , alerts , idx + 1 , chart ) ;
543+ if ( code . Length <= 3 ) alerts . Add ( new Alert ( Warning , "AirCrush缺少参数!" , note . Time , ( double ) chart . ToSecond ( note . Time ) , idx + 1 , lines [ idx ] ) ) ;
544+ else ParseHeightAndColor ( note , code [ 3 ..] , alerts , idx + 1 , "C" ) ;
551545
552546 bool foundFirst = false ;
547+ bool intervalSet = Version >= 8 ;
553548 while ( idx + 1 < lines . Length )
554- { // 循环处理所有的跟随行。idx始终指向上一条已经处理完的行。
549+ {
555550 var nextLine = lines [ idx + 1 ] . Trim ( ) ;
556- if ( ! TryParseFollowerLine ( nextLine , out var marker , out var duration , out _ , out _ , out _ , false ) )
551+ if ( ! TryParseFollowerLine ( nextLine , out var marker , out var endTick , out var endCell , out var endWidth , out var endHeight , Version >= 8 ) )
557552 {
558553 if ( nextLine . StartsWith ( '\' ' ) || nextLine . StartsWith ( '@' ) ) { idx ++ ; continue ; }
559554 break ;
560555 }
561556
562- // TODO 尚未实现
557+ if ( Version >= 8 && marker != "c" )
558+ alerts . Add ( new Alert ( Warning , $ "Air-Crush(v8)子行标记应为 'c',实际为 '{ marker } '", note . Time , ( double ) chart . ToSecond ( note . Time ) , idx + 1 , nextLine ) ) ;
559+
560+ if ( Version <= 6 && ! intervalSet && marker == "s" )
561+ {
562+ note . CrushInterval = endTick ;
563+ intervalSet = true ;
564+ }
565+
566+ note . Duration = new Rational ( endTick , RSL ) ;
567+ if ( endCell != null ) note . EndCell = endCell . Value ;
568+ if ( endWidth != null ) note . EndWidth = endWidth . Value ;
569+ if ( endHeight != null ) note . EndHeight = U2C_Height ( endHeight . Value ) ;
570+
563571 idx ++ ;
564572 foundFirst = true ;
565573 }
574+ chart . Notes . Add ( note ) ;
566575
567576 if ( ! foundFirst )
568577 alerts . Add ( new Alert ( Warning , $ "air-crush 音符缺少时长跟随行") { Line = idx + 1 , RelevantNote = lines [ idx ] } ) ;
0 commit comments