From 81f2e1c893e8f44ff499d3e25ffcace2b057241b Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Sun, 14 Jul 2024 19:01:25 +0100 Subject: [PATCH 1/3] Use P1 inverted color to mark selected bar in editor --- src/base/UDraw.pas | 32 +++++++++++++++++----- src/base/UGraphic.pas | 8 ++++++ src/screens/UScreenEditSub.pas | 38 +++++++++++++-------------- src/screens/views/UScreenSingView.pas | 9 +++++++ 4 files changed, 62 insertions(+), 25 deletions(-) diff --git a/src/base/UDraw.pas b/src/base/UDraw.pas index 4a242a95c..80fb5c25b 100644 --- a/src/base/UDraw.pas +++ b/src/base/UDraw.pas @@ -1661,11 +1661,17 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ Rec.Bottom := Rec.Top + 2 * NotesH[0]; If (NoteType = ntRap) or (NoteType = ntRapGolden) then begin - glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap[Color].TexNum); + If Color = 99 then + glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap_Inv.TexNum) + else + glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap[Color].TexNum) end else begin - glBindTexture(GL_TEXTURE_2D, Tex_Left[Color].TexNum); + If Color = 99 then + glBindTexture(GL_TEXTURE_2D, Tex_Left_Inv.TexNum) + else + glBindTexture(GL_TEXTURE_2D, Tex_Left[Color].TexNum) end; glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top); @@ -1681,11 +1687,17 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ If (NoteType = ntRap) or (NoteType = ntRapGolden) then begin - glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap[Color].TexNum); + If Color = 99 then + glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap_Inv.TexNum) + else + glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap[Color].TexNum) end else begin - glBindTexture(GL_TEXTURE_2D, Tex_Mid[Color].TexNum); + If Color = 99 then + glBindTexture(GL_TEXTURE_2D, Tex_Mid_Inv.TexNum) + else + glBindTexture(GL_TEXTURE_2D, Tex_Mid[Color].TexNum) end; glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top); @@ -1700,11 +1712,19 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ If (NoteType = ntRap) or (NoteType = ntRapGolden) then begin - glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap[Color].TexNum); + If Color = 99 then + glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap_Inv.TexNum) + else + glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap[Color].TexNum) end else begin - glBindTexture(GL_TEXTURE_2D, Tex_Right[Color].TexNum); + If Color = 99 then + begin + glBindTexture(GL_TEXTURE_2D, Tex_Right_Inv.TexNum); + end + else + glBindTexture(GL_TEXTURE_2D, Tex_Right[Color].TexNum) end; glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2f(Rec.Left, Rec.Top); diff --git a/src/base/UGraphic.pas b/src/base/UGraphic.pas index 1178c974f..0e4803871 100644 --- a/src/base/UGraphic.pas +++ b/src/base/UGraphic.pas @@ -229,6 +229,14 @@ TRecR = record Tex_BG_Mid_Rap: array[1..UIni.IMaxPlayerCount] of TTexture; //rename to tex_noteglow_mid Tex_BG_Right_Rap: array[1..UIni.IMaxPlayerCount] of TTexture; //rename to tex_noteglow_right + // Inversions of first player colors used to mark selected note in editor + Tex_Left_Inv: TTexture; + Tex_Mid_Inv: TTexture; + Tex_Right_Inv: TTexture; + Tex_Left_Rap_Inv: TTexture; + Tex_Mid_Rap_Inv: TTexture; + Tex_Right_Rap_Inv: TTexture; + Tex_Note_Star: TTexture; Tex_Note_Perfect_Star: TTexture; diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas index 5f0ac3439..d5d808f57 100644 --- a/src/screens/UScreenEditSub.pas +++ b/src/screens/UScreenEditSub.pas @@ -687,7 +687,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre while (CurrentNote[CurrentTrack] <= Tracks[CurrentTrack].Lines[LineIndex].HighNote) and (CurrentBeat > Tracks[CurrentTrack].Lines[LineIndex].Notes[CurrentNote[CurrentTrack]].EndBeat) do Inc(CurrentNote[CurrentTrack]); - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -826,7 +826,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre begin Tracks[CurrentTrack].CurrentLine := MedleyNotes.end_.line; CurrentNote[CurrentTrack] := MedleyNotes.end_.note; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -849,7 +849,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre begin Tracks[CurrentTrack].CurrentLine := MedleyNotes.start.line; CurrentNote[CurrentTrack] := MedleyNotes.start.note; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -1793,7 +1793,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Tracks[CurrentTrack].CurrentLine := LineIndex; ShowInteractiveBackground; CurrentNote[CurrentTrack] := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -1817,7 +1817,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 1; CurrentNote[CurrentTrack] := NoteIndex; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; //play current note playonewithmidi PlaySentenceMidi := false; @@ -1898,7 +1898,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Inc(CurrentNote[CurrentTrack]); if CurrentNote[CurrentTrack] > Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote then CurrentNote[CurrentTrack] := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -1976,7 +1976,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Dec(CurrentNote[CurrentTrack]); if CurrentNote[CurrentTrack] = -1 then CurrentNote[CurrentTrack] := Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -3115,7 +3115,7 @@ procedure TScreenEditSub.DivideSentence; end; Refresh; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -3187,7 +3187,7 @@ procedure TScreenEditSub.JoinSentence; end; Refresh; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -3205,7 +3205,7 @@ procedure TScreenEditSub.NextSentence; CurrentNote[CurrentTrack] := 0; if Tracks[CurrentTrack].CurrentLine > Tracks[CurrentTrack].High then Tracks[CurrentTrack].CurrentLine := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -3232,7 +3232,7 @@ procedure TScreenEditSub.PreviousSentence; CurrentNote[CurrentTrack] := 0; if Tracks[CurrentTrack].CurrentLine = -1 then Tracks[CurrentTrack].CurrentLine := Tracks[CurrentTrack].High; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -3340,7 +3340,7 @@ procedure TScreenEditSub.DeleteNote; EndBeat := Notes[HighNote].StartBeat + Notes[HighNote].Duration; end; - Tracks[CurrentTrack].Lines[CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; end // Last Note of current Sentence Deleted - > Delete Sentence // if there are more than two left @@ -3362,7 +3362,7 @@ procedure TScreenEditSub.DeleteNote; else Tracks[CurrentTrack].CurrentLine := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; end; // update lyric display @@ -3396,7 +3396,7 @@ procedure TScreenEditSub.DeleteSentence; Refresh; //SelectPrevNote(); //SelectNextNote(); - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); end; @@ -3511,7 +3511,7 @@ procedure TScreenEditSub.CopySentence(SrcTrack, SrcLine, DstTrack, DstLine: Inte Tracks[DstTrack].Lines[DstLine].EndBeat := Tracks[DstTrack].Lines[DstLine].Notes[NoteIndex].StartBeat + Tracks[DstTrack].Lines[DstLine].Notes[NoteIndex].Duration; Refresh; - Tracks[DstTrack].Lines[DstLine].Notes[CurrentNote[DstTrack]].Color := 2; + Tracks[DstTrack].Lines[DstLine].Notes[CurrentNote[DstTrack]].Color := 99; EditorLyrics[DstTrack].AddLine(DstTrack, Tracks[DstTrack].CurrentLine); end; @@ -3563,7 +3563,7 @@ procedure TScreenEditSub.MakeSolo; CurrentTrack := 0; Refresh; CurrentNote[CurrentTrack] := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); end; @@ -3710,7 +3710,7 @@ function TScreenEditSub.DuetCopyLine: boolean; EditorLyrics[DstTrack].AddLine(DstTrack, Tracks[DstTrack].CurrentLine); EditorLyrics[DstTrack].Selected := 0; CurrentNote[DstTrack] := 0; - Tracks[SrcTrack].Lines[SrcLine].Notes[CurrentNote[SrcTrack]].Color := 2; + Tracks[SrcTrack].Lines[SrcLine].Notes[CurrentNote[SrcTrack]].Color := 99; Result := true; end; @@ -4930,7 +4930,7 @@ procedure TScreenEditSub.OnShow; begin Tracks[TrackIndex].CurrentLine := 0; CurrentNote[TrackIndex] := 0; - Tracks[TrackIndex].Lines[0].Notes[0].Color := 2; + Tracks[TrackIndex].Lines[0].Notes[0].Color := 99; end; AudioPlayBack.Open(CurrentSong.Path.Append(CurrentSong.Mp3)); @@ -5090,7 +5090,7 @@ function TScreenEditSub.Draw: boolean; Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 1; CurrentNote[CurrentTrack] := NoteIndex; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; end; //if end; //for NoteIndex} end; //end move cursor diff --git a/src/screens/views/UScreenSingView.pas b/src/screens/views/UScreenSingView.pas index e9d186152..0f9d87f70 100644 --- a/src/screens/views/UScreenSingView.pas +++ b/src/screens/views/UScreenSingView.pas @@ -620,6 +620,15 @@ constructor TScreenSingView.Create; Tex_ScoreBG[I - 1] := Texture.LoadTexture(Skin.GetTextureFileName('ScoreBG'), TEXTURE_TYPE_COLORIZED, Color); end; + // Inversions of first player colors used to mark selected note in editor + Color := RGBFloatToInt(1 - Col[1].R, 1 - Col[1].G, 1 - Col[1].B); + Tex_Left_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayLeft'), TEXTURE_TYPE_COLORIZED, Color); + Tex_Mid_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayMid'), TEXTURE_TYPE_COLORIZED, Color); + Tex_Right_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayRight'), TEXTURE_TYPE_COLORIZED, Color); + Tex_Left_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayLeftRap'), TEXTURE_TYPE_COLORIZED, Color); + Tex_Mid_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayMidRap'), TEXTURE_TYPE_COLORIZED, Color); + Tex_Right_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayRightRap'), TEXTURE_TYPE_COLORIZED, Color); + StaticPausePopup := ScreenSing.AddStatic(Theme.Sing.PausePopUp); // pausepopup is not visible at the beginning From 466db0e397d2b747d80c9a788a1879e840d791f7 Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 18 Jul 2024 11:37:49 +0100 Subject: [PATCH 2/3] Refer to color inversion value as P1_INVERTED --- src/base/UDraw.pas | 15 ++++++++------ src/screens/UScreenEditSub.pas | 38 +++++++++++++++++----------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/base/UDraw.pas b/src/base/UDraw.pas index 80fb5c25b..827918672 100644 --- a/src/base/UDraw.pas +++ b/src/base/UDraw.pas @@ -80,6 +80,9 @@ TRecR = record Mid: real; end; +const +P1_INVERTED = 99; + var NotesW: array [0..UIni.IMaxPlayerCount-1] of real; NotesH: array [0..UIni.IMaxPlayerCount-1] of real; @@ -1661,14 +1664,14 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ Rec.Bottom := Rec.Top + 2 * NotesH[0]; If (NoteType = ntRap) or (NoteType = ntRapGolden) then begin - If Color = 99 then + If Color = P1_INVERTED then glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap_Inv.TexNum) else glBindTexture(GL_TEXTURE_2D, Tex_Left_Rap[Color].TexNum) end else begin - If Color = 99 then + If Color = P1_INVERTED then glBindTexture(GL_TEXTURE_2D, Tex_Left_Inv.TexNum) else glBindTexture(GL_TEXTURE_2D, Tex_Left[Color].TexNum) @@ -1687,14 +1690,14 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ If (NoteType = ntRap) or (NoteType = ntRapGolden) then begin - If Color = 99 then + If Color = P1_INVERTED then glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap_Inv.TexNum) else glBindTexture(GL_TEXTURE_2D, Tex_Mid_Rap[Color].TexNum) end else begin - If Color = 99 then + If Color = P1_INVERTED then glBindTexture(GL_TEXTURE_2D, Tex_Mid_Inv.TexNum) else glBindTexture(GL_TEXTURE_2D, Tex_Mid[Color].TexNum) @@ -1712,14 +1715,14 @@ procedure EditDrawLine(X, YBaseNote, W, H: real; Track: integer; NumLines: integ If (NoteType = ntRap) or (NoteType = ntRapGolden) then begin - If Color = 99 then + If Color = P1_INVERTED then glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap_Inv.TexNum) else glBindTexture(GL_TEXTURE_2D, Tex_Right_Rap[Color].TexNum) end else begin - If Color = 99 then + If Color = P1_INVERTED then begin glBindTexture(GL_TEXTURE_2D, Tex_Right_Inv.TexNum); end diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas index d5d808f57..5883cf324 100644 --- a/src/screens/UScreenEditSub.pas +++ b/src/screens/UScreenEditSub.pas @@ -687,7 +687,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre while (CurrentNote[CurrentTrack] <= Tracks[CurrentTrack].Lines[LineIndex].HighNote) and (CurrentBeat > Tracks[CurrentTrack].Lines[LineIndex].Notes[CurrentNote[CurrentTrack]].EndBeat) do Inc(CurrentNote[CurrentTrack]); - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -826,7 +826,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre begin Tracks[CurrentTrack].CurrentLine := MedleyNotes.end_.line; CurrentNote[CurrentTrack] := MedleyNotes.end_.note; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -849,7 +849,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre begin Tracks[CurrentTrack].CurrentLine := MedleyNotes.start.line; CurrentNote[CurrentTrack] := MedleyNotes.start.note; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -1793,7 +1793,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Tracks[CurrentTrack].CurrentLine := LineIndex; ShowInteractiveBackground; CurrentNote[CurrentTrack] := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -1817,7 +1817,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 1; CurrentNote[CurrentTrack] := NoteIndex; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; //play current note playonewithmidi PlaySentenceMidi := false; @@ -1898,7 +1898,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Inc(CurrentNote[CurrentTrack]); if CurrentNote[CurrentTrack] > Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote then CurrentNote[CurrentTrack] := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -1976,7 +1976,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre Dec(CurrentNote[CurrentTrack]); if CurrentNote[CurrentTrack] = -1 then CurrentNote[CurrentTrack] := Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].HighNote; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -3115,7 +3115,7 @@ procedure TScreenEditSub.DivideSentence; end; Refresh; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -3187,7 +3187,7 @@ procedure TScreenEditSub.JoinSentence; end; Refresh; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; end; @@ -3205,7 +3205,7 @@ procedure TScreenEditSub.NextSentence; CurrentNote[CurrentTrack] := 0; if Tracks[CurrentTrack].CurrentLine > Tracks[CurrentTrack].High then Tracks[CurrentTrack].CurrentLine := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -3232,7 +3232,7 @@ procedure TScreenEditSub.PreviousSentence; CurrentNote[CurrentTrack] := 0; if Tracks[CurrentTrack].CurrentLine = -1 then Tracks[CurrentTrack].CurrentLine := Tracks[CurrentTrack].High; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; @@ -3340,7 +3340,7 @@ procedure TScreenEditSub.DeleteNote; EndBeat := Notes[HighNote].StartBeat + Notes[HighNote].Duration; end; - Tracks[CurrentTrack].Lines[CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; end // Last Note of current Sentence Deleted - > Delete Sentence // if there are more than two left @@ -3362,7 +3362,7 @@ procedure TScreenEditSub.DeleteNote; else Tracks[CurrentTrack].CurrentLine := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; end; // update lyric display @@ -3396,7 +3396,7 @@ procedure TScreenEditSub.DeleteSentence; Refresh; //SelectPrevNote(); //SelectNextNote(); - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); end; @@ -3511,7 +3511,7 @@ procedure TScreenEditSub.CopySentence(SrcTrack, SrcLine, DstTrack, DstLine: Inte Tracks[DstTrack].Lines[DstLine].EndBeat := Tracks[DstTrack].Lines[DstLine].Notes[NoteIndex].StartBeat + Tracks[DstTrack].Lines[DstLine].Notes[NoteIndex].Duration; Refresh; - Tracks[DstTrack].Lines[DstLine].Notes[CurrentNote[DstTrack]].Color := 99; + Tracks[DstTrack].Lines[DstLine].Notes[CurrentNote[DstTrack]].Color := P1_INVERTED; EditorLyrics[DstTrack].AddLine(DstTrack, Tracks[DstTrack].CurrentLine); end; @@ -3563,7 +3563,7 @@ procedure TScreenEditSub.MakeSolo; CurrentTrack := 0; Refresh; CurrentNote[CurrentTrack] := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); end; @@ -3710,7 +3710,7 @@ function TScreenEditSub.DuetCopyLine: boolean; EditorLyrics[DstTrack].AddLine(DstTrack, Tracks[DstTrack].CurrentLine); EditorLyrics[DstTrack].Selected := 0; CurrentNote[DstTrack] := 0; - Tracks[SrcTrack].Lines[SrcLine].Notes[CurrentNote[SrcTrack]].Color := 99; + Tracks[SrcTrack].Lines[SrcLine].Notes[CurrentNote[SrcTrack]].Color := P1_INVERTED; Result := true; end; @@ -4930,7 +4930,7 @@ procedure TScreenEditSub.OnShow; begin Tracks[TrackIndex].CurrentLine := 0; CurrentNote[TrackIndex] := 0; - Tracks[TrackIndex].Lines[0].Notes[0].Color := 99; + Tracks[TrackIndex].Lines[0].Notes[0].Color := P1_INVERTED; end; AudioPlayBack.Open(CurrentSong.Path.Append(CurrentSong.Mp3)); @@ -5090,7 +5090,7 @@ function TScreenEditSub.Draw: boolean; Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 1; CurrentNote[CurrentTrack] := NoteIndex; EditorLyrics[CurrentTrack].Selected := CurrentNote[CurrentTrack]; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 99; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; end; //if end; //for NoteIndex} end; //end move cursor From 7c28c8427263fcb72837597ce04fd3b7d2d18c1e Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Thu, 18 Jul 2024 16:21:37 +0100 Subject: [PATCH 3/3] Fix whitespace error and duet track change color --- src/screens/UScreenEditSub.pas | 4 ++-- src/screens/views/UScreenSingView.pas | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas index 5883cf324..408b23e38 100644 --- a/src/screens/UScreenEditSub.pas +++ b/src/screens/UScreenEditSub.pas @@ -2059,7 +2059,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre begin Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 0; CurrentTrack := 1; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; Text[TextInfo].Text := Language.Translate('EDIT_INFO_SWITCHED_TO_TRACK') + ' 2 (' + CurrentSong.DuetNames[CurrentTrack] + ')'; @@ -2115,7 +2115,7 @@ function TScreenEditSub.ParseInput(PressedKey: cardinal; CharCode: UCS4Char; Pre begin Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 0; CurrentTrack := 0; - Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := 2; + Tracks[CurrentTrack].Lines[Tracks[CurrentTrack].CurrentLine].Notes[CurrentNote[CurrentTrack]].Color := P1_INVERTED; EditorLyrics[CurrentTrack].AddLine(CurrentTrack, Tracks[CurrentTrack].CurrentLine); EditorLyrics[CurrentTrack].Selected := 0; Text[TextInfo].Text := Language.Translate('EDIT_INFO_SWITCHED_TO_TRACK') + ' 1 (' + CurrentSong.DuetNames[CurrentTrack] + ')'; diff --git a/src/screens/views/UScreenSingView.pas b/src/screens/views/UScreenSingView.pas index 0f9d87f70..57a8cd6f2 100644 --- a/src/screens/views/UScreenSingView.pas +++ b/src/screens/views/UScreenSingView.pas @@ -625,7 +625,7 @@ constructor TScreenSingView.Create; Tex_Left_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayLeft'), TEXTURE_TYPE_COLORIZED, Color); Tex_Mid_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayMid'), TEXTURE_TYPE_COLORIZED, Color); Tex_Right_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayRight'), TEXTURE_TYPE_COLORIZED, Color); - Tex_Left_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayLeftRap'), TEXTURE_TYPE_COLORIZED, Color); + Tex_Left_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayLeftRap'), TEXTURE_TYPE_COLORIZED, Color); Tex_Mid_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayMidRap'), TEXTURE_TYPE_COLORIZED, Color); Tex_Right_Rap_Inv := Texture.LoadTexture(Skin.GetTextureFileName('GrayRightRap'), TEXTURE_TYPE_COLORIZED, Color);