aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-11-27 21:50:41 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-11-27 21:50:41 +0000
commitd826e9135078f7fa719046069ce10da1e382bfc3 (patch)
treeba5c50ab25a631f388a6fb5fb1a1b7710d78b047 /src/screens
parentcb11733f11fd82d80b0bdae558444c5c78ac586f (diff)
downloadusdx-d826e9135078f7fa719046069ce10da1e382bfc3.tar.gz
usdx-d826e9135078f7fa719046069ce10da1e382bfc3.tar.xz
usdx-d826e9135078f7fa719046069ce10da1e382bfc3.zip
some more formatting
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1530 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/UScreenEdit.pas26
-rw-r--r--src/screens/UScreenEditConvert.pas229
-rw-r--r--src/screens/UScreenEditHeader.pas147
-rw-r--r--src/screens/UScreenEditSub.pas65
4 files changed, 276 insertions, 191 deletions
diff --git a/src/screens/UScreenEdit.pas b/src/screens/UScreenEdit.pas
index caeaac11..1fc2fcdc 100644
--- a/src/screens/UScreenEdit.pas
+++ b/src/screens/UScreenEdit.pas
@@ -33,7 +33,10 @@ interface
{$I switches.inc}
-uses UMenu, SDL, UThemes;
+uses
+ UMenu,
+ SDL,
+ UThemes;
type
TScreenEdit = class(TMenu)
@@ -44,19 +47,23 @@ type
FileName: string;}
constructor Create; override;
procedure onShow; override;
- function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override;
+ function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
{ function Draw: boolean; override;
procedure Finish;}
end;
implementation
-uses UGraphic, UMusic, USkins, SysUtils;
+uses
+ UGraphic,
+ UMusic,
+ USkins,
+ SysUtils;
-function TScreenEdit.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
+function TScreenEdit.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
begin
Result := true;
- If (PressedDown) Then
+ if (PressedDown) then
begin // Key Down
// check normal keys
case WideCharUpperCase(CharCode)[1] of
@@ -83,7 +90,8 @@ begin
AudioPlayback.PlaySound(SoundLib.Start);
FadeTo(@ScreenEditConvert);
end;
-// if Interaction = 1 then begin
+// if Interaction = 1 then
+// begin
// Music.PlayStart;
// FadeTo(@ScreenEditHeader);
// end;
@@ -134,9 +142,9 @@ end;
(*function TScreenEdit.Draw: boolean;
var
- Min: integer;
- Sec: integer;
- AktBeat: integer;
+ Min: integer;
+ Sec: integer;
+ AktBeat: integer;
begin
end;
diff --git a/src/screens/UScreenEditConvert.pas b/src/screens/UScreenEditConvert.pas
index 97a4bf2c..24f2730c 100644
--- a/src/screens/UScreenEditConvert.pas
+++ b/src/screens/UScreenEditConvert.pas
@@ -33,35 +33,36 @@ interface
{$I switches.inc}
-uses UMenu,
- SDL,
- {$IFDEF UseMIDIPort}
- MidiFile,
- MidiOut,
- {$ENDIF}
- ULog,
- USongs,
- USong,
- UMusic,
- UThemes;
+uses
+ UMenu,
+ SDL,
+ {$IFDEF UseMIDIPort}
+ MidiFile,
+ MidiOut,
+ {$ENDIF}
+ ULog,
+ USongs,
+ USong,
+ UMusic,
+ UThemes;
type
TNote = record
- Event: integer;
- EventType: integer;
- Channel: integer;
- Start: real;
- Len: real;
- Data1: integer;
- Data2: integer;
- Str: string;
+ Event: integer;
+ EventType: integer;
+ Channel: integer;
+ Start: real;
+ Len: real;
+ Data1: integer;
+ Data2: integer;
+ Str: string;
end;
TTrack = record
- Note: array of TNote;
- Name: string;
- Hear: boolean;
- Status: byte; // 0 - none, 1 - notes, 2 - lyrics, 3 - notes + lyrics
+ Note: array of TNote;
+ Name: string;
+ Hear: boolean;
+ Status: byte; // 0 - none, 1 - notes, 2 - lyrics, 3 - notes + lyrics
end;
TNuta = record
@@ -76,29 +77,29 @@ type
TScreenEditConvert = class(TMenu)
public
- ATrack: TArrayTrack; // actual track
-// Track: TArrayTrack;
- Channel: TArrayTrack;
- ColR: array[0..100] of real;
- ColG: array[0..100] of real;
- ColB: array[0..100] of real;
- Len: real;
- Sel: integer;
- Selected: boolean;
-// FileName: string;
+ ATrack: TArrayTrack; // actual track
+// Track: TArrayTrack;
+ Channel: TArrayTrack;
+ ColR: array[0..100] of real;
+ ColG: array[0..100] of real;
+ ColB: array[0..100] of real;
+ Len: real;
+ Sel: integer;
+ Selected: boolean;
+// FileName: string;
{$IFDEF UseMIDIPort}
- MidiFile: TMidiFile;
- MidiTrack: TMidiTrack;
- MidiEvent: pMidiEvent;
- MidiOut: TMidiOutput;
+ MidiFile: TMidiFile;
+ MidiTrack: TMidiTrack;
+ MidiEvent: pMidiEvent;
+ MidiOut: TMidiOutput;
{$ENDIF}
- Song: TSong;
- Lines: TLines;
- BPM: real;
- Ticks: real;
- Note: array of TNuta;
+ Song: TSong;
+ Lines: TLines;
+ BPM: real;
+ Ticks: real;
+ Note: array of TNuta;
procedure AddLyric(Start: integer; Text: string);
procedure Extract;
@@ -110,23 +111,25 @@ type
function SelectedNumber: integer;
constructor Create; override;
procedure onShow; override;
- function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override;
+ function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
function Draw: boolean; override;
procedure onHide; override;
end;
implementation
-uses UGraphic,
- SysUtils,
- UDrawTexture,
- TextGL,
- UFiles,
- UMain,
- UIni,
- gl,
- USkins;
-
-function TScreenEditConvert.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
+
+uses
+ UGraphic,
+ SysUtils,
+ UDrawTexture,
+ TextGL,
+ UFiles,
+ UMain,
+ UIni,
+ gl,
+ USkins;
+
+function TScreenEditConvert.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
begin
Result := true;
If (PressedDown) Then
@@ -171,13 +174,16 @@ begin
{$ENDIF}
end;
- if Interaction = 2 then begin
+ if Interaction = 2 then
+ begin
Selected := true;
{$IFDEF UseMIDIPort}
MidiFile.OnMidiEvent := nil;
{$ENDIF}
- {for T := 0 to High(ATrack) do begin
- if ATrack[T].Hear then begin
+ {for T := 0 to High(ATrack) do
+ begin
+ if ATrack[T].Hear then
+ begin
MidiTrack := MidiFile.GetTrack(T);
MidiTrack.OnMidiEvent := MidiFile1MidiEvent;
end;
@@ -185,8 +191,10 @@ begin
MidiFile.StartPlaying;//}
end;
- if Interaction = 3 then begin
- if SelectedNumber > 0 then begin
+ if Interaction = 3 then
+ begin
+ if SelectedNumber > 0 then
+ begin
Extract;
SaveSong(Song, Lines, ChangeFileExt(ConversionFileName, '.txt'), false);
end;
@@ -199,7 +207,8 @@ begin
// ATrack[Sel].Hear := not ATrack[Sel].Hear;
ATrack[Sel].Status := (ATrack[Sel].Status + 1) mod 4;
-{ if Selected then begin
+{ if Selected then
+ begin
MidiTrack := MidiFile.GetTrack(Sel);
if Track[Sel].Hear then
MidiTrack.OnMidiEvent := MidiFile1MidiEvent
@@ -221,12 +230,14 @@ begin
SDLK_DOWN:
begin
Inc(Sel);
- if Sel > High(ATrack) then Sel := 0;
+ if Sel > High(ATrack) then
+ Sel := 0;
end;
SDLK_UP:
begin
Dec(Sel);
- if Sel < 0 then Sel := High(ATrack);
+ if Sel < 0 then
+ Sel := High(ATrack);
end;
end;
end;
@@ -236,11 +247,15 @@ procedure TScreenEditConvert.AddLyric(Start: integer; Text: string);
var
N: integer;
begin
- for N := 0 to High(Note) do begin
- if Note[N].Start = Start then begin
+ for N := 0 to High(Note) do
+ begin
+ if Note[N].Start = Start then
+ begin
// check for new sentece
- if Copy(Text, 1, 1) = '\' then Delete(Text, 1, 1);
- if Copy(Text, 1, 1) = '/' then begin
+ if Copy(Text, 1, 1) = '\' then
+ Delete(Text, 1, 1);
+ if Copy(Text, 1, 1) = '/' then
+ begin
Delete(Text, 1, 1);
Note[N].NewSentence := true;
end;
@@ -275,11 +290,16 @@ begin
SetLength(Note, 0);
// extract notes
- for T := 0 to High(ATrack) do begin
-// if ATrack[T].Hear then begin
- if ((ATrack[T].Status div 1) and 1) = 1 then begin
- for N := 0 to High(ATrack[T].Note) do begin
- if (ATrack[T].Note[N].EventType = 9) and (ATrack[T].Note[N].Data2 > 0) then begin
+ for T := 0 to High(ATrack) do
+ begin
+// if ATrack[T].Hear then
+// begin
+ if ((ATrack[T].Status div 1) and 1) = 1 then
+ begin
+ for N := 0 to High(ATrack[T].Note) do
+ begin
+ if (ATrack[T].Note[N].EventType = 9) and (ATrack[T].Note[N].Data2 > 0) then
+ begin
Nu := Length(Note);
SetLength(Note, Nu + 1);
Note[Nu].Start := Round(ATrack[T].Note[N].Start / Ticks);
@@ -292,11 +312,16 @@ begin
end;
// extract lyrics
- for T := 0 to High(ATrack) do begin
-// if ATrack[T].Hear then begin
- if ((ATrack[T].Status div 2) and 1) = 1 then begin
- for N := 0 to High(ATrack[T].Note) do begin
- if (ATrack[T].Note[N].EventType = 15) then begin
+ for T := 0 to High(ATrack) do
+ begin
+// if ATrack[T].Hear then
+// begin
+ if ((ATrack[T].Status div 2) and 1) = 1 then
+ begin
+ for N := 0 to High(ATrack[T].Note) do
+ begin
+ if (ATrack[T].Note[N].EventType = 15) then
+ begin
// Log.LogStatus('<' + Track[T].Note[N].Str + '>', 'MIDI');
AddLyric(Round(ATrack[T].Note[N].Start / Ticks), ATrack[T].Note[N].Str);
end;
@@ -307,7 +332,8 @@ begin
// sort notes
for N := 0 to High(Note) do
for Nu := 0 to High(Note)-1 do
- if Note[Nu].Start > Note[Nu+1].Start then begin
+ if Note[Nu].Start > Note[Nu+1].Start then
+ begin
NoteTemp := Note[Nu];
Note[Nu] := Note[Nu+1];
Note[Nu+1] := NoteTemp;
@@ -327,8 +353,10 @@ begin
N := 0;
Lines.Line[C].HighNote := -1;
- for Nu := 0 to High(Note) do begin
- if Note[Nu].NewSentence then begin // new line
+ for Nu := 0 to High(Note) do
+ begin
+ if Note[Nu].NewSentence then // new line
+ begin
SetLength(Lines.Line, Length(Lines.Line)+1);
Lines.Number := Lines.Number + 1;
Lines.High := Lines.High + 1;
@@ -379,8 +407,10 @@ var
begin
Result := 0;
for T := 0 to High(ATrack) do
-// if ATrack[T].Hear then Inc(Result);
- if ((ATrack[T].Status div 1) and 1) = 1 then Inc(Result);
+// if ATrack[T].Hear then
+// Inc(Result);
+ if ((ATrack[T].Status div 1) and 1) = 1 then
+ Inc(Result);
end;
{$IFDEF UseMIDIPort}
@@ -424,7 +454,8 @@ begin
MidiFile := TMidiFile.Create(nil);
{$ENDIF}
- for P := 0 to 100 do begin
+ for P := 0 to 100 do
+ begin
ColR[P] := Random(10)/10;
ColG[P] := Random(10)/10;
ColB[P] := Random(10)/10;
@@ -460,13 +491,15 @@ begin
BPM := MidiFile.Bpm;
Ticks := MidiFile.TicksPerQuarter / 4;
-{ for T := 0 to MidiFile.NumberOfTracks-1 do begin
+{ for T := 0 to MidiFile.NumberOfTracks-1 do
+ begin
SetLength(Track, Length(Track)+1);
MidiTrack := MidiFile.GetTrack(T);
MidiTrack.OnMidiEvent := MidiFile1MidiEvent;
Track[T].Name := MidiTrack.getName;
- for N := 0 to MidiTrack.getEventCount-1 do begin
+ for N := 0 to MidiTrack.getEventCount-1 do
+ begin
SetLength(Track[T].Note, Length(Track[T].Note)+1);
MidiEvent := MidiTrack.GetEvent(N);
Track[T].Note[N].Start := MidiEvent.time;
@@ -492,11 +525,13 @@ begin
Channel[T].Status := 0;
end;
- for T := 0 to MidiFile.NumberOfTracks-1 do begin
+ for T := 0 to MidiFile.NumberOfTracks-1 do
+ begin
MidiTrack := MidiFile.GetTrack(T);
MidiTrack.OnMidiEvent := MidiFile1MidiEvent;
- for N := 0 to MidiTrack.getEventCount-1 do begin
+ for N := 0 to MidiTrack.getEventCount-1 do
+ begin
MidiEvent := MidiTrack.GetEvent(N);
C := MidiEvent.event and 15;
@@ -526,8 +561,8 @@ end;
function TScreenEditConvert.Draw: boolean;
var
- Count: integer;
- Count2: integer;
+ Count: integer;
+ Count2: integer;
Bottom: real;
X: real;
Y: real;
@@ -540,7 +575,8 @@ begin
Y := 100;
H := Length(ATrack)*40;
- if H > 480 then H := 480;
+ if H > 480 then
+ H := 480;
Bottom := Y + H;
YSkip := H / Length(ATrack);
@@ -553,13 +589,16 @@ begin
if ATrack[Count].Hear then
DrawQuad(10, Y+Count*YSkip, 50, YSkip, 0.8, 0.3, 0.3);
glColor3f(0, 0, 0);
- for Count := 0 to High(ATrack) do begin
- if ((ATrack[Count].Status div 1) and 1) = 1 then begin
+ for Count := 0 to High(ATrack) do
+ begin
+ if ((ATrack[Count].Status div 1) and 1) = 1 then
+ begin
SetFontPos(25, Y + Count*YSkip + 10);
SetFontSize(15);
glPrint('N');
end;
- if ((ATrack[Count].Status div 2) and 1) = 1 then begin
+ if ((ATrack[Count].Status div 2) and 1) = 1 then
+ begin
SetFontPos(40, Y + Count*YSkip + 10);
SetFontSize(15);
glPrint('L');
@@ -573,14 +612,16 @@ begin
for Count := 0 to Length(ATrack) do
DrawLine(10, Y+Count*YSkip, 790, Y+Count*YSkip, 0, 0, 0);
- for Count := 0 to High(ATrack) do begin
+ for Count := 0 to High(ATrack) do
+ begin
SetFontPos(11, Y + 10 + Count*YSkip);
SetFontSize(15);
glPrint(ATrack[Count].Name);
end;
for Count := 0 to High(ATrack) do
- for Count2 := 0 to High(ATrack[Count].Note) do begin
+ for Count2 := 0 to High(ATrack[Count].Note) do
+ begin
if ATrack[Count].Note[Count2].EventType = 9 then
DrawQuad(60 + ATrack[Count].Note[Count2].Start/Len * 725, Y + (Count+1)*YSkip - ATrack[Count].Note[Count2].Data1*35/127, 3, 3, ColR[Count], ColG[Count], ColB[Count]);
if ATrack[Count].Note[Count2].EventType = 15 then
diff --git a/src/screens/UScreenEditHeader.pas b/src/screens/UScreenEditHeader.pas
index 3678973e..fb0b2c85 100644
--- a/src/screens/UScreenEditHeader.pas
+++ b/src/screens/UScreenEditHeader.pas
@@ -33,11 +33,12 @@ interface
{$I switches.inc}
-uses UMenu,
- SDL,
- USongs,
- USong,
- UThemes;
+uses
+ UMenu,
+ SDL,
+ USongs,
+ USong,
+ UThemes;
type
TScreenEditHeader = class(TMenu)
@@ -72,22 +73,28 @@ type
constructor Create; override;
procedure onShow; override;
- function ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean; override;
+ function ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean; override;
{ function Draw: boolean; override;
procedure Finish;}
end;
implementation
-uses UGraphic, UMusic, SysUtils, UFiles, USkins, UTexture;
+uses
+ UGraphic,
+ UMusic,
+ SysUtils,
+ UFiles,
+ USkins,
+ UTexture;
-function TScreenEditHeader.ParseInput(PressedKey: Cardinal; CharCode: WideChar; PressedDown: Boolean): Boolean;
+function TScreenEditHeader.ParseInput(PressedKey: cardinal; CharCode: WideChar; PressedDown: boolean): boolean;
var
T: integer;
begin
Result := true;
- If (PressedDown) Then begin // Key Down
- // check normal keys
+ if (PressedDown) then // Key Down
+ begin // check normal keys
case WideCharUpperCase(CharCode)[1] of
'Q':
begin
@@ -107,7 +114,8 @@ begin
SDLK_RETURN:
begin
- if Interaction = 1 then begin
+ if Interaction = 1 then
+ begin
// Save;
end;
end;
@@ -116,14 +124,14 @@ begin
begin
case Interaction of
0..0: InteractNext;
- 1: Interaction := 0;
+ 1: Interaction := 0;
end;
end;
SDLK_LEFT:
begin
case Interaction of
- 0: Interaction := 1;
+ 0: Interaction := 1;
1..1: InteractPrev;
end;
end;
@@ -131,25 +139,26 @@ begin
SDLK_DOWN:
begin
case Interaction of
- 0..1: Interaction := 2;
- 2..12: InteractNext;
- 13: Interaction := 0;
+ 0..1: Interaction := 2;
+ 2..12: InteractNext;
+ 13: Interaction := 0;
end;
end;
SDLK_UP:
begin
case Interaction of
- 0..1: Interaction := 13;
- 2: Interaction := 0;
- 3..13: InteractPrev;
+ 0..1: Interaction := 13;
+ 2: Interaction := 0;
+ 3..13: InteractPrev;
end;
end;
SDLK_BACKSPACE:
begin
T := Interaction - 2 + TextTitle;
- if (Interaction >= 2) and (Interaction <= 13) and (Length(Text[T].Text) >= 1) then begin
+ if (Interaction >= 2) and (Interaction <= 13) and (Length(Text[T].Text) >= 1) then
+ begin
Text[T].DeleteLastL;
SetRoundButtons;
end;
@@ -159,7 +168,8 @@ begin
case CharCode of
#32..#255:
begin
- if (Interaction >= 2) and (Interaction <= 13) then begin
+ if (Interaction >= 2) and (Interaction <= 13) then
+ begin
Text[Interaction - 2 + TextTitle].Text :=
Text[Interaction - 2 + TextTitle].Text + CharCode;
SetRoundButtons;
@@ -244,7 +254,8 @@ procedure TScreenEditHeader.onShow;
begin
inherited;
-{ if FileExists(FileName) then begin // load file
+{ if FileExists(FileName) then // load file
+ begin
CurrentSong.FileName := FileName;
SkanujPlik(CurrentSong);
@@ -273,28 +284,33 @@ end;
(*function TScreenEdit.Draw: boolean;
var
- Min: integer;
- Sec: integer;
- Count: integer;
- AktBeat: integer;
+ Min: integer;
+ Sec: integer;
+ Count: integer;
+ AktBeat: integer;
begin
{ glClearColor(1,1,1,1);
// control music
- if PlaySentence then begin
+ if PlaySentence then
+ begin
// stop the music
- if (Music.Position > PlayStopTime) then begin
+ if (Music.Position > PlayStopTime) then
+ begin
Music.Stop;
PlaySentence := false;
end;
// click
- if (Click) and (PlaySentence) then begin
+ if (Click) and (PlaySentence) then
+ begin
AktBeat := Floor(CurrentSong.BPM[0].BPM * (Music.Position - CurrentSong.GAP / 1000) / 60);
Text[TextDebug].Text := IntToStr(AktBeat);
- if AktBeat <> LastClick then begin
+ if AktBeat <> LastClick then
+ begin
for Count := 0 to Czesci[0].Czesc[Czesci[0].Akt].HighNut do
- if (Czesci[0].Czesc[Czesci[0].Akt].Nuta[Count].Start = AktBeat) then begin
+ if (Czesci[0].Czesc[Czesci[0].Akt].Nuta[Count].Start = AktBeat) then
+ begin
Music.PlayClick;
LastClick := AktBeat;
end;
@@ -330,37 +346,52 @@ end;*)
procedure TScreenEditHeader.SetRoundButtons;
begin
- if Length(Text[TextTitle].Text) > 0 then Static[StaticTitle].Visible := true
- else Static[StaticTitle].Visible := false;
-
- if Length(Text[TextArtist].Text) > 0 then Static[StaticArtist].Visible := true
- else Static[StaticArtist].Visible := false;
-
- if Length(Text[TextMp3].Text) > 0 then Static[StaticMp3].Visible := true
- else Static[StaticMp3].Visible := false;
-
- if Length(Text[TextBackground].Text) > 0 then Static[StaticBackground].Visible := true
- else Static[StaticBackground].Visible := false;
-
- if Length(Text[TextVideo].Text) > 0 then Static[StaticVideo].Visible := true
- else Static[StaticVideo].Visible := false;
+ if Length(Text[TextTitle].Text) > 0 then
+ Static[StaticTitle].Visible := true
+ else
+ Static[StaticTitle].Visible := false;
+
+ if Length(Text[TextArtist].Text) > 0 then
+ Static[StaticArtist].Visible := true
+ else
+ Static[StaticArtist].Visible := false;
+
+ if Length(Text[TextMp3].Text) > 0 then
+ Static[StaticMp3].Visible := true
+ else
+ Static[StaticMp3].Visible := false;
+
+ if Length(Text[TextBackground].Text) > 0 then
+ Static[StaticBackground].Visible := true
+ else
+ Static[StaticBackground].Visible := false;
+
+ if Length(Text[TextVideo].Text) > 0 then
+ Static[StaticVideo].Visible := true
+ else
+ Static[StaticVideo].Visible := false;
try
StrToFloat(Text[TextVideoGAP].Text);
- if StrToFloat(Text[TextVideoGAP].Text)<> 0 then Static[StaticVideoGAP].Visible := true
- else Static[StaticVideoGAP].Visible := false;
+ if StrToFloat(Text[TextVideoGAP].Text)<> 0 then
+ Static[StaticVideoGAP].Visible := true
+ else
+ Static[StaticVideoGAP].Visible := false;
except
Static[StaticVideoGAP].Visible := false;
end;
- if LowerCase(Text[TextRelative].Text) = 'yes' then Static[StaticRelative].Visible := true
- else Static[StaticRelative].Visible := false;
+ if LowerCase(Text[TextRelative].Text) = 'yes' then
+ Static[StaticRelative].Visible := true
+ else
+ Static[StaticRelative].Visible := false;
try
StrToInt(Text[TextResolution].Text);
- if (StrToInt(Text[TextResolution].Text) <> 0) and (StrToInt(Text[TextResolution].Text) >= 1)
- then Static[StaticResolution].Visible := true
- else Static[StaticResolution].Visible := false;
+ if (StrToInt(Text[TextResolution].Text) <> 0) and (StrToInt(Text[TextResolution].Text) >= 1) then
+ Static[StaticResolution].Visible := true
+ else
+ Static[StaticResolution].Visible := false;
except
Static[StaticResolution].Visible := false;
end;
@@ -375,8 +406,10 @@ begin
// start
try
StrToFloat(Text[TextStart].Text);
- if (StrToFloat(Text[TextStart].Text) > 0) then Static[StaticStart].Visible := true
- else Static[StaticStart].Visible := false;
+ if (StrToFloat(Text[TextStart].Text) > 0) then
+ Static[StaticStart].Visible := true
+ else
+ Static[StaticStart].Visible := false;
except
Static[StaticStart].Visible := false;
end;
@@ -392,8 +425,10 @@ begin
// BPM
try
StrToFloat(Text[TextBPM].Text);
- if (StrToFloat(Text[TextBPM].Text) > 0) then Static[StaticBPM].Visible := true
- else Static[StaticBPM].Visible := false;
+ if (StrToFloat(Text[TextBPM].Text) > 0) then
+ Static[StaticBPM].Visible := true
+ else
+ Static[StaticBPM].Visible := false;
except
Static[StaticBPM].Visible := false;
end;
diff --git a/src/screens/UScreenEditSub.pas b/src/screens/UScreenEditSub.pas
index 873d7185..07113363 100644
--- a/src/screens/UScreenEditSub.pas
+++ b/src/screens/UScreenEditSub.pas
@@ -33,25 +33,25 @@ interface
{$I switches.inc}
uses
- UMenu,
- UMusic,
- SDL,
- SysUtils,
- UFiles,
- UTime,
- USongs,
- USong,
- UIni,
- ULog,
- UTexture,
- UMenuText,
- UEditorLyrics,
- Math,
- gl,
- {$IFDEF UseMIDIPort}
- MidiOut,
- {$ENDIF}
- UThemes;
+ UMenu,
+ UMusic,
+ SDL,
+ SysUtils,
+ UFiles,
+ UTime,
+ USongs,
+ USong,
+ UIni,
+ ULog,
+ UTexture,
+ UMenuText,
+ UEditorLyrics,
+ Math,
+ gl,
+ {$IFDEF UseMIDIPort}
+ MidiOut,
+ {$ENDIF}
+ UThemes;
type
TScreenEditSub = class(TMenu)
@@ -80,18 +80,18 @@ type
CopySrc: integer;
{$IFDEF UseMIDIPort}
- MidiOut: TMidiOutput;
+ MidiOut: TMidiOutput;
{$endif}
- MidiStart: real;
- MidiStop: real;
- MidiTime: real;
- MidiPos: real;
- MidiLastNote: integer;
+ MidiStart: real;
+ MidiStop: real;
+ MidiTime: real;
+ MidiPos: real;
+ MidiLastNote: integer;
- TextEditMode: boolean;
+ TextEditMode: boolean;
- Lyric: TEditorLyrics;
+ Lyric: TEditorLyrics;
procedure DivideBPM;
procedure MultiplyBPM;
@@ -588,7 +588,8 @@ begin
Lines[0].Line[Lines[0].Current].Note[CurrentNote].Color := 0;
Inc(Lines[0].Current);
CurrentNote := 0;
- if Lines[0].Current > Lines[0].High then Lines[0].Current := 0;
+ if Lines[0].Current > Lines[0].High then
+ Lines[0].Current := 0;
Lines[0].Line[Lines[0].Current].Note[CurrentNote].Color := 1;
Lyric.AddLine(Lines[0].Current);
@@ -724,7 +725,8 @@ begin
begin
Lines[0].Line[C].Start := Lines[0].Line[C].Start div 2;
Lines[0].Line[C].End_ := Lines[0].Line[C].End_ div 2;
- for N := 0 to Lines[0].Line[C].HighNote do begin
+ for N := 0 to Lines[0].Line[C].HighNote do
+ begin
Lines[0].Line[C].Note[N].Start := Lines[0].Line[C].Note[N].Start div 2;
Lines[0].Line[C].Note[N].Length := Round(Lines[0].Line[C].Note[N].Length / 2);
end; // N
@@ -1076,7 +1078,8 @@ var
begin
{ C := Lines[0].Current;
- for N := Lines[0].Line[C].HighNut downto 1 do begin
+ for N := Lines[0].Line[C].HighNut downto 1 do
+ begin
Lines[0].Line[C].Note[N].Text := Lines[0].Line[C].Note[N-1].Text;
end; // for
@@ -1427,8 +1430,6 @@ begin
N2 := -1;
end;
-
-
case N1 of
0: Result := 'c';
1: Result := 'c#';