From 073b864caf24c3baf799773f15d7090be5ddf32b Mon Sep 17 00:00:00 2001 From: davidus01 Date: Sat, 19 Jun 2010 20:42:20 +0000 Subject: editor: lyric on note git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2551 b956fd51-792f-4845-bead-9b4dfca2ff2c --- us_maker_edition/src/screens/UScreenEditSub.pas | 63 ++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) (limited to 'us_maker_edition') diff --git a/us_maker_edition/src/screens/UScreenEditSub.pas b/us_maker_edition/src/screens/UScreenEditSub.pas index 7e14cd8c..0d47117d 100644 --- a/us_maker_edition/src/screens/UScreenEditSub.pas +++ b/us_maker_edition/src/screens/UScreenEditSub.pas @@ -226,6 +226,7 @@ type procedure DrawPlayerTrack(X, Y, W: real; Space: integer; CurrentTone: integer; Count: integer; CurrentNote: integer); procedure DrawStatics; procedure DrawInfoBar(x, y, w, h: integer); + procedure DrawText(Left, Top, Right: real; NrLines: integer; Space: integer); //video view procedure StartVideoPreview(); procedure StopVideoPreview(); @@ -252,11 +253,11 @@ uses UNote, USkins, ULanguage, + TextGL, UTextEncoding, UUnicodeUtils; - procedure OnSaveEncodingError(Value: boolean; Data: Pointer); var SResult: TSaveSongResult; @@ -2119,6 +2120,65 @@ begin glLineWidth(1); end; +procedure TScreenEditSub.DrawText(Left, Top, Right: real; NrLines: integer; Space: integer); +var + Rec: TRecR; + Count: integer; + TempR: real; + + PlayerNumber: integer; + + GoldenStarPos: real; + + lTmpA, lTmpB : real; +begin + if (ScreenSing.settings.NotesVisible and (1 shl NrLines) <> 0) then + begin + + PlayerNumber := NrLines + 1; // Player 1 is 0 + glColor3f(1, 1, 1); + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + lTmpA := (Right-Left); + lTmpB := (Lines[NrLines].Line[Lines[NrLines].Current].End_ - Lines[NrLines].Line[Lines[NrLines].Current].Note[0].Start); + + if ( lTmpA > 0 ) and ( lTmpB > 0 ) then + TempR := lTmpA / lTmpB + else + TempR := 0; + + with Lines[NrLines].Line[Lines[NrLines].Current] do + begin + for Count := 0 to HighNote do + begin + with Note[Count] do + begin + // left part + Rec.Left := 0; + Rec.Right := 0; + BaseNote := Lines[0].Line[Lines[NrLines].Current].BaseNote; + Rec.Top := Top - (Tone-BaseNote)*Space/2 - NotesH; + Rec.Bottom := Rec.Top + 2 * NotesH; + // middle part + Rec.Left := (Start-Lines[NrLines].Line[Lines[NrLines].Current].Note[0].Start) * TempR + Left + 0.5 + 10*ScreenX + NotesW; + Rec.Right := (Start+Length-Lines[NrLines].Line[Lines[NrLines].Current].Note[0].Start) * TempR + Left - NotesW - 0.5 + 10*ScreenX; + glColor4f(0, 0, 0, 1); + SetFontStyle (1); + SetFontItalic(False); + SetFontSize(14); + SetFontPos (Rec.Left, Rec.Top); + glPrint(Text); + end; // with + end; // for + end; // with + + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + end; +end; + // from revision 2475 procedure TScreenEditSub.StartVideoPreview; var @@ -2672,6 +2732,7 @@ begin begin SingDrawBeatDelimeters(40, 305, 760, 0); EditDrawLine(40, 410, 760, 0, 15); + DrawText(40, 410, 760, 0, 15); end; CurrentSound := AudioInputProcessor.Sound[0]; -- cgit v1.2.3