aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Screens
diff options
context:
space:
mode:
Diffstat (limited to 'Game/Code/Screens')
-rw-r--r--Game/Code/Screens/UScreenEditConvert.pas1
-rw-r--r--Game/Code/Screens/UScreenEditHeader.pas6
-rw-r--r--Game/Code/Screens/UScreenEditSub.pas51
-rw-r--r--Game/Code/Screens/UScreenMain.pas7
-rw-r--r--Game/Code/Screens/UScreenOptionsRecord.pas132
-rw-r--r--Game/Code/Screens/UScreenOptionsSound.pas9
-rw-r--r--Game/Code/Screens/UScreenScore.pas6
-rw-r--r--Game/Code/Screens/UScreenSing.pas91
-rw-r--r--Game/Code/Screens/UScreenSingModi.pas4
-rw-r--r--Game/Code/Screens/UScreenSong.pas18
-rw-r--r--Game/Code/Screens/UScreenStatMain.pas7
-rw-r--r--Game/Code/Screens/UScreenTop5.pas18
12 files changed, 223 insertions, 127 deletions
diff --git a/Game/Code/Screens/UScreenEditConvert.pas b/Game/Code/Screens/UScreenEditConvert.pas
index e370ad67..a523afd2 100644
--- a/Game/Code/Screens/UScreenEditConvert.pas
+++ b/Game/Code/Screens/UScreenEditConvert.pas
@@ -16,6 +16,7 @@ uses UMenu,
{$ENDIF}
ULog,
USongs,
+ USong,
UMusic,
UThemes;
diff --git a/Game/Code/Screens/UScreenEditHeader.pas b/Game/Code/Screens/UScreenEditHeader.pas
index 7c8b2d56..60466a27 100644
--- a/Game/Code/Screens/UScreenEditHeader.pas
+++ b/Game/Code/Screens/UScreenEditHeader.pas
@@ -4,7 +4,11 @@ interface
{$I switches.inc}
-uses UMenu, SDL, USongs, UThemes;
+uses UMenu,
+ SDL,
+ USongs,
+ USong,
+ UThemes;
type
TScreenEditHeader = class(TMenu)
diff --git a/Game/Code/Screens/UScreenEditSub.pas b/Game/Code/Screens/UScreenEditSub.pas
index 725dd4e9..57d6777e 100644
--- a/Game/Code/Screens/UScreenEditSub.pas
+++ b/Game/Code/Screens/UScreenEditSub.pas
@@ -15,6 +15,7 @@ uses
UFiles,
UTime,
USongs,
+ USong,
UIni,
ULog,
UTexture,
@@ -143,40 +144,40 @@ begin
begin
// Increase BPM
if SDL_ModState = 0 then
- AktSong.BPM[0].BPM := Round((AktSong.BPM[0].BPM * 5) + 1) / 5; // (1/20)
+ CurrentSong.BPM[0].BPM := Round((CurrentSong.BPM[0].BPM * 5) + 1) / 5; // (1/20)
if SDL_ModState = KMOD_LSHIFT then
- AktSong.BPM[0].BPM := AktSong.BPM[0].BPM + 4; // (1/1)
+ CurrentSong.BPM[0].BPM := CurrentSong.BPM[0].BPM + 4; // (1/1)
if SDL_ModState = KMOD_LCTRL then
- AktSong.BPM[0].BPM := Round((AktSong.BPM[0].BPM * 25) + 1) / 25; // (1/100)
+ CurrentSong.BPM[0].BPM := Round((CurrentSong.BPM[0].BPM * 25) + 1) / 25; // (1/100)
end;
SDLK_MINUS:
begin
// Decrease BPM
if SDL_ModState = 0 then
- AktSong.BPM[0].BPM := Round((AktSong.BPM[0].BPM * 5) - 1) / 5;
+ CurrentSong.BPM[0].BPM := Round((CurrentSong.BPM[0].BPM * 5) - 1) / 5;
if SDL_ModState = KMOD_LSHIFT then
- AktSong.BPM[0].BPM := AktSong.BPM[0].BPM - 4;
+ CurrentSong.BPM[0].BPM := CurrentSong.BPM[0].BPM - 4;
if SDL_ModState = KMOD_LCTRL then
- AktSong.BPM[0].BPM := Round((AktSong.BPM[0].BPM * 25) - 1) / 25;
+ CurrentSong.BPM[0].BPM := Round((CurrentSong.BPM[0].BPM * 25) - 1) / 25;
end;
SDLK_0:
begin
// Increase GAP
if SDL_ModState = 0 then
- AktSong.GAP := AktSong.GAP + 10;
+ CurrentSong.GAP := CurrentSong.GAP + 10;
if SDL_ModState = KMOD_LSHIFT then
- AktSong.GAP := AktSong.GAP + 1000;
+ CurrentSong.GAP := CurrentSong.GAP + 1000;
end;
SDLK_9:
begin
// Decrease GAP
if SDL_ModState = 0 then
- AktSong.GAP := AktSong.GAP - 10;
+ CurrentSong.GAP := CurrentSong.GAP - 10;
if SDL_ModState = KMOD_LSHIFT then
- AktSong.GAP := AktSong.GAP - 1000;
+ CurrentSong.GAP := CurrentSong.GAP - 1000;
end;
SDLK_KP_PLUS:
@@ -222,13 +223,13 @@ begin
begin
// Save Song
if SDL_ModState = KMOD_LSHIFT then
- SaveSong(AktSong, Czesci[0], Path + FileName, true)
+ SaveSong(CurrentSong, Czesci[0], Path + FileName, true)
else
- SaveSong(AktSong, Czesci[0], Path + FileName, false);
+ SaveSong(CurrentSong, Czesci[0], Path + FileName, false);
{if SDL_ModState = KMOD_LSHIFT or KMOD_LCTRL + KMOD_LALT then
// Save Song
- SaveSongDebug(AktSong, Czesci[0], 'C:\song.asm', false);}
+ SaveSongDebug(CurrentSong, Czesci[0], 'C:\song.asm', false);}
end;
@@ -656,7 +657,7 @@ var
C: integer;
N: integer;
begin
- AktSong.BPM[0].BPM := AktSong.BPM[0].BPM / 2;
+ CurrentSong.BPM[0].BPM := CurrentSong.BPM[0].BPM / 2;
for C := 0 to Czesci[0].High do begin
Czesci[0].Czesc[C].Start := Czesci[0].Czesc[C].Start div 2;
Czesci[0].Czesc[C].StartNote := Czesci[0].Czesc[C].StartNote div 2;
@@ -673,7 +674,7 @@ var
C: integer;
N: integer;
begin
- AktSong.BPM[0].BPM := AktSong.BPM[0].BPM * 2;
+ CurrentSong.BPM[0].BPM := CurrentSong.BPM[0].BPM * 2;
for C := 0 to Czesci[0].High do begin
Czesci[0].Czesc[C].Start := Czesci[0].Czesc[C].Start * 2;
Czesci[0].Czesc[C].StartNote := Czesci[0].Czesc[C].StartNote * 2;
@@ -1160,7 +1161,7 @@ begin
try
ResetSingTemp;
- Error := not LoadSong(Path + FileName);
+// Error := not LoadSong(Path + FileName); // todo - JB come back to this
except
Error := True;
end;
@@ -1179,15 +1180,15 @@ begin
MidiOut.ProductName := 'Microsoft GS Wavetable SW Synth'; // for my kxproject without midi table
MidiOut.Open;
{$ENDIF}
- Text[TextTitle].Text := AktSong.Title;
- Text[TextArtist].Text := AktSong.Artist;
- Text[TextMp3].Text := AktSong.Mp3;
+ Text[TextTitle].Text := CurrentSong.Title;
+ Text[TextArtist].Text := CurrentSong.Artist;
+ Text[TextMp3].Text := CurrentSong.Mp3;
Czesci[0].Akt := 0;
AktNuta := 0;
Czesci[0].Czesc[0].Nuta[0].Color := 1;
- AudioPlayback.Open(Path + AktSong.Mp3);
+ AudioPlayback.Open(Path + CurrentSong.Mp3);
//Set Down Music Volume for Better hearability of Midi Sounds
//Music.SetVolume(40);
@@ -1238,7 +1239,7 @@ begin
{$ENDIF}
// click
- AktBeat := Floor(GetMidBeat(MidiPos - AktSong.GAP / 1000));
+ AktBeat := Floor(GetMidBeat(MidiPos - CurrentSong.GAP / 1000));
Text[TextDebug].Text := IntToStr(AktBeat);
if AktBeat <> LastClick then begin
@@ -1269,8 +1270,8 @@ begin
// click
if (Click) and (PlaySentence) then begin
-// AktBeat := Floor(AktSong.BPM[0].BPM * (Music.Position - AktSong.GAP / 1000) / 60);
- AktBeat := Floor(GetMidBeat(AudioPlayback.Position - AktSong.GAP / 1000));
+// AktBeat := Floor(CurrentSong.BPM[0].BPM * (Music.Position - CurrentSong.GAP / 1000) / 60);
+ AktBeat := Floor(GetMidBeat(AudioPlayback.Position - CurrentSong.GAP / 1000));
Text[TextDebug].Text := IntToStr(AktBeat);
if AktBeat <> LastClick then begin
for Pet := 0 to Czesci[0].Czesc[Czesci[0].Akt].HighNut do
@@ -1288,8 +1289,8 @@ begin
Text[TextNote].Text := IntToStr(AktNuta + 1) + ' / ' + IntToStr(Czesci[0].Czesc[Czesci[0].Akt].IlNut);
// Song info
- Text[TextBPM].Text := FloatToStr(AktSong.BPM[0].BPM / 4);
- Text[TextGAP].Text := FloatToStr(AktSong.GAP);
+ Text[TextBPM].Text := FloatToStr(CurrentSong.BPM[0].BPM / 4);
+ Text[TextGAP].Text := FloatToStr(CurrentSong.GAP);
//Error reading Variables when no Song is loaded
if not Error then
diff --git a/Game/Code/Screens/UScreenMain.pas b/Game/Code/Screens/UScreenMain.pas
index 5f7a0461..a4dc5f0d 100644
--- a/Game/Code/Screens/UScreenMain.pas
+++ b/Game/Code/Screens/UScreenMain.pas
@@ -124,7 +124,7 @@ begin
//Solo
if (Interaction = 0) then
begin
- if (Length(Songs.Song) >= 1) then
+ if (Songs.SongList.Count >= 1) then
begin
AudioPlayback.PlayStart;
if (Ini.Players >= 0) and (Ini.Players <= 3) then PlayersPlay := Ini.Players + 1;
@@ -138,8 +138,9 @@ begin
end;
//Multi
- if Interaction = 1 then begin
- if (Length(Songs.Song) >= 1) then
+ if Interaction = 1 then
+ begin
+ if (Songs.SongList.Count >= 1) then
begin
if (Length(DLLMan.Plugins)>=1) then
begin
diff --git a/Game/Code/Screens/UScreenOptionsRecord.pas b/Game/Code/Screens/UScreenOptionsRecord.pas
index 80259802..42776717 100644
--- a/Game/Code/Screens/UScreenOptionsRecord.pas
+++ b/Game/Code/Screens/UScreenOptionsRecord.pas
@@ -15,14 +15,21 @@ type
SelectSlideChannelR: integer;
public
constructor Create; override;
- function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
- procedure onShow; override;
- procedure UpdateCard;
+ function Draw: boolean; override;
+ function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
+ procedure onShow; override;
+ procedure onHide; override;
+ procedure UpdateCard;
end;
implementation
-uses SysUtils, UGraphic, URecord, ULog;
+uses SysUtils,
+ UGraphic,
+ URecord,
+ UDraw,
+ UMain,
+ ULog;
function TScreenOptionsRecord.ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean;
begin
@@ -43,7 +50,7 @@ begin
end;
SDLK_RETURN:
begin
- if SelInteraction = 4 then begin
+ if SelInteraction = 5 then begin
Ini.Save;
AudioPlayback.PlayBack;
FadeTo(@ScreenOptions);
@@ -55,19 +62,21 @@ begin
InteractPrev;
SDLK_RIGHT:
begin
- if (SelInteraction >= 0) and (SelInteraction <= 3) then begin
+ if (SelInteraction >= 0) and (SelInteraction <= 4) then begin
AudioPlayback.PlayOption;
InteractInc;
end;
- if SelInteraction = 0 then UpdateCard;
+// if SelInteraction = 0 then UpdateCard;
+ UpdateCard;
end;
SDLK_LEFT:
begin
- if (SelInteraction >= 0) and (SelInteraction <= 3) then begin
+ if (SelInteraction >= 0) and (SelInteraction <= 4) then begin
AudioPlayback.PlayOption;
InteractDec;
end;
- if SelInteraction = 0 then UpdateCard;
+ UpdateCard;
+// if SelInteraction = 0 then UpdateCard;
end;
end;
end;
@@ -80,22 +89,27 @@ var
SCI: integer;
begin
inherited Create;
-
+
LoadFromTheme(Theme.OptionsRecord);
- SetLength(ICard, Length(Recording.SoundCard));
- for SC := 0 to High(Recording.SoundCard) do
- ICard[SC] := Recording.SoundCard[SC].Description;
+ SetLength(ICard, Length(AudioInputProcessor.SoundCard));
+ for SC := 0 to High(AudioInputProcessor.SoundCard) do
+ ICard[SC] := AudioInputProcessor.SoundCard[SC].Description;
+
+ if (Length(AudioInputProcessor.SoundCard) > 0) then
+ begin
+ SetLength(IInput, Length(AudioInputProcessor.SoundCard[Ini.Card].Input));
+ for SCI := 0 to High(AudioInputProcessor.SoundCard[Ini.Card].Input) do
+ IInput[SCI] := AudioInputProcessor.SoundCard[Ini.Card].Input[SCI].Name;
- if (Length(Recording.SoundCard) > 0) then begin
- SetLength(IInput, Length(Recording.SoundCard[Ini.Card].Input));
- for SCI := 0 to High(Recording.SoundCard[Ini.Card].Input) do
- IInput[SCI] := Recording.SoundCard[Ini.Card].Input[SCI].Name;
AddSelectSlide(Theme.OptionsRecord.SelectSlideCard, Ini.Card, ICard);
+
SelectSlideInput := AddSelectSlide(Theme.OptionsRecord.SelectSlideInput, Ini.CardList[0].Input, IInput);
SelectSlideChannelL := AddSelectSlide(Theme.OptionsRecord.SelectSlideChannelL, Ini.CardList[0].ChannelL, IChannel);
SelectSlideChannelR := AddSelectSlide(Theme.OptionsRecord.SelectSlideChannelR, Ini.CardList[0].ChannelR, IChannel);
+
+ AddSelect(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost);
end;
AddButton(Theme.OptionsRecord.ButtonExit);
@@ -108,6 +122,16 @@ end;
procedure TScreenOptionsRecord.onShow;
begin
Interaction := 0;
+ writeln( 'AudioInput.CaptureStart') ;
+
+ PlayersPlay := 2; // TODO : This needs fixing
+ AudioInput.CaptureStart;
+
+end;
+
+procedure TScreenOptionsRecord.onHide;
+begin
+ AudioInput.CaptureStop;
end;
procedure TScreenOptionsRecord.UpdateCard;
@@ -115,18 +139,74 @@ var
SC: integer;
SCI: integer;
begin
- SC := Ini.Card;
-// if SC = 1 then beep;
+ writeln( 'Update Card') ;
+ AudioInput.CaptureStop;
+ try
+ SC := Ini.Card;
+ // if SC = 1 then beep;
+
+ SetLength(IInput, Length(AudioInputProcessor.SoundCard[SC].Input));
+ for SCI := 0 to High(AudioInputProcessor.SoundCard[SC].Input) do begin
+ IInput[SCI] := AudioInputProcessor.SoundCard[SC].Input[SCI].Name;
+ // Log.LogError(IInput[SCI]);
+ end;
- SetLength(IInput, Length(Recording.SoundCard[SC].Input));
- for SCI := 0 to High(Recording.SoundCard[SC].Input) do begin
- IInput[SCI] := Recording.SoundCard[SC].Input[SCI].Name;
-// Log.LogError(IInput[SCI]);
+
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideInput, SelectSlideInput, IInput, Ini.CardList[SC].Input);
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideChannelL, SelectSlideChannelL, IChannel, Ini.CardList[SC].ChannelL);
+ UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideChannelR, SelectSlideChannelR, IChannel, Ini.CardList[SC].ChannelR);
+
+ finally
+ AudioInput.CaptureStart;
end;
+end;
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideInput, SelectSlideInput, IInput, Ini.CardList[SC].Input);
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideChannelL, SelectSlideChannelL, IChannel, Ini.CardList[SC].ChannelL);
- UpdateSelectSlideOptions(Theme.OptionsRecord.SelectSlideChannelR, SelectSlideChannelR, IChannel, Ini.CardList[SC].ChannelR);
+function TScreenOptionsRecord.Draw: boolean;
+begin
+ DrawBG;
+ DrawFG;
+
+ // TODO : this needs to be positioned correctly
+ if PlayersPlay = 1 then
+ SingDrawOscilloscope(190 + 10*ScreenX, 55, 180, 40, 0);
+
+ if PlayersPlay = 2 then begin
+ SingDrawOscilloscope(190 + 10*ScreenX, 55, 180, 40, 0);
+ SingDrawOscilloscope(425 + 10*ScreenX, 55, 180, 40, 1);
+ end;
+
+ if PlayersPlay = 4 then begin
+ if ScreenAct = 1 then begin
+ SingDrawOscilloscope(190 + 10*ScreenX, 55, 180, 40, 0);
+ SingDrawOscilloscope(425 + 10*ScreenX, 55, 180, 40, 1);
+ end;
+ if ScreenAct = 2 then begin
+ SingDrawOscilloscope(190 + 10*ScreenX, 55, 180, 40, 2);
+ SingDrawOscilloscope(425 + 10*ScreenX, 55, 180, 40, 3);
+ end;
+ end;
+
+ if PlayersPlay = 3 then begin
+ SingDrawOscilloscope(75 + 10*ScreenX, 95, 100, 20, 0);
+ SingDrawOscilloscope(370 + 10*ScreenX, 95, 100, 20, 1);
+ SingDrawOscilloscope(670 + 10*ScreenX, 95, 100, 20, 2);
+ end;
+
+ if PlayersPlay = 6 then begin
+ if ScreenAct = 1 then begin
+ SingDrawOscilloscope( 75 + 10*ScreenX, 95, 100, 20, 0);
+ SingDrawOscilloscope(370 + 10*ScreenX, 95, 100, 20, 1);
+ SingDrawOscilloscope(670 + 10*ScreenX, 95, 100, 20, 2);
+ end;
+ if ScreenAct = 2 then begin
+ SingDrawOscilloscope( 75 + 10*ScreenX, 95, 100, 20, 3);
+ SingDrawOscilloscope(370 + 10*ScreenX, 95, 100, 20, 4);
+ SingDrawOscilloscope(670 + 10*ScreenX, 95, 100, 20, 5);
+ end;
+ end;
+
+ Result := True;
end;
+
end.
diff --git a/Game/Code/Screens/UScreenOptionsSound.pas b/Game/Code/Screens/UScreenOptionsSound.pas
index 867a10b6..64a0413f 100644
--- a/Game/Code/Screens/UScreenOptionsSound.pas
+++ b/Game/Code/Screens/UScreenOptionsSound.pas
@@ -51,14 +51,14 @@ begin
InteractPrev;
SDLK_RIGHT:
begin
- if (SelInteraction >= 0) and (SelInteraction <= 5) then begin
+ if (SelInteraction >= 0) and (SelInteraction <= 6) then begin
AudioPlayback.PlayOption;
InteractInc;
end;
end;
SDLK_LEFT:
begin
- if (SelInteraction >= 0) and (SelInteraction <= 5) then begin
+ if (SelInteraction >= 0) and (SelInteraction <= 6) then begin
AudioPlayback.PlayOption;
InteractDec;
end;
@@ -75,15 +75,14 @@ begin
LoadFromTheme(Theme.OptionsSound);
- AddSelect(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost);
+ AddSelect(Theme.OptionsSound.SelectMicBoost, Ini.MicBoost, IMicBoost); // TODO - This need moving to ScreenOptionsRecord
AddSelect(Theme.OptionsSound.SelectClickAssist, Ini.ClickAssist, IClickAssist);
AddSelect(Theme.OptionsSound.SelectBeatClick, Ini.BeatClick, IBeatClick);
AddSelect(Theme.OptionsSound.SelectThreshold, Ini.Threshold, IThreshold);
//Song Preview
AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewVolume, Ini.PreviewVolume, IPreviewVolume);
- AddSelectSlide
- (Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFading);
+ AddSelectSlide(Theme.OptionsSound.SelectSlidePreviewFading, Ini.PreviewFading, IPreviewFading);
AddButton(Theme.OptionsSound.ButtonExit);
if (Length(Button[0].Text)=0) then
diff --git a/Game/Code/Screens/UScreenScore.pas b/Game/Code/Screens/UScreenScore.pas
index 84fd4e15..c53844f5 100644
--- a/Game/Code/Screens/UScreenScore.pas
+++ b/Game/Code/Screens/UScreenScore.pas
@@ -304,9 +304,9 @@ begin
// Singstar
Fadeout := false;
- Text[TextArtist].Text := AktSong.Artist;
- Text[TextTitle].Text := AktSong.Title;
- Text[TextArtistTitle].Text := AktSong.Artist + ' - ' + AktSong.Title;
+ Text[TextArtist].Text := CurrentSong.Artist;
+ Text[TextTitle].Text := CurrentSong.Title;
+ Text[TextArtistTitle].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title;
// set visibility
case PlayersPlay of
diff --git a/Game/Code/Screens/UScreenSing.pas b/Game/Code/Screens/UScreenSing.pas
index 5a9ecae7..adfc4d2c 100644
--- a/Game/Code/Screens/UScreenSing.pas
+++ b/Game/Code/Screens/UScreenSing.pas
@@ -101,22 +101,29 @@ type
fCurrentVideoPlaybackEngine : IVideoPlayback;
constructor Create; override;
- procedure onShow; override;
- procedure onShowFinish; override;
- function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
- function Draw: boolean; override;
- procedure Finish; virtual;
- procedure UpdateLCD;
- procedure Pause; //Pause Mod(Toggles Pause)
-
- //OnSentenceEnd for LineBonus + Singbar
- procedure onSentenceEnd(S: Cardinal);
- //OnSentenceChange (for Golden Notes)
- procedure onSentenceChange(S: Cardinal);
+ procedure onShow; override;
+ procedure onShowFinish; override;
+
+ function ParseInput(PressedKey: Cardinal; ScanCode: byte; PressedDown: Boolean): Boolean; override;
+ function Draw: boolean; override;
+
+ procedure Finish; virtual;
+ procedure UpdateLCD;
+ procedure Pause; //Pause Mod(Toggles Pause)
+
+ procedure onSentenceEnd(S: Cardinal); //OnSentenceEnd for LineBonus + Singbar
+ procedure onSentenceChange(S: Cardinal); //OnSentenceChange (for Golden Notes)
end;
implementation
-uses UGraphic, UDraw, UMain, Classes, URecord, ULanguage, math;
+
+uses UGraphic,
+ UDraw,
+ UMain,
+ Classes,
+ URecord,
+ ULanguage,
+ math;
// Method for input parsing. If False is returned, GetNextWindow
// should be checked to know the next window to load;
@@ -204,7 +211,7 @@ begin
AudioPlayback.Pause;
// pause Video
- if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then
+ if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then
fCurrentVideoPlaybackEngine.Pause;
end
@@ -218,7 +225,7 @@ begin
AudioPlayback.Play;
// Video
- if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then
+ if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then
fCurrentVideoPlaybackEngine.Pause;
Paused := false;
@@ -425,12 +432,13 @@ begin
{Static[StaticP3RScoreBG].Visible := V3R;
Text[TextP3RScore].Visible := V3R; }
- // load notes
ResetSingTemp;
// Log.LogWarning(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName, '!!!');
- AktSong := CatSongs.Song[CatSongs.Selected];
+ CurrentSong := CatSongs.Song[CatSongs.Selected];
+
try
- if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then
+ if not CurrentSong.LoadSong then
+// if not LoadSong(CatSongs.Song[CatSongs.Selected].Path + CatSongs.Song[CatSongs.Selected].FileName) then
begin
//Error Loading Song -> Go back to Song Screen and Show some Error Message
FadeTo(@ScreenSong);
@@ -449,26 +457,26 @@ begin
ScreenPopupError.ShowPopup (Language.Translate('ERROR_CORRUPT_SONG'));
Exit;
end;
- AktSong.Path := CatSongs.Song[CatSongs.Selected].Path;
-// AktSong.GAP := AktSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / AktSong.BPM[0].BPM / 2; // temporary until UMain will be fixed
+ CurrentSong.Path := CatSongs.Song[CatSongs.Selected].Path;
+// CurrentSong.GAP := CurrentSong.GAP + 40 {4096 = 100ms for buffer} + 20 {microphone} + 60000 / CurrentSong.BPM[0].BPM / 2; // temporary until UMain will be fixed
// set movie
- if (AktSong.Video <> '') and FileExists(AktSong.Path + AktSong.Video) then
+ if (CurrentSong.Video <> '') and FileExists(CurrentSong.Path + CurrentSong.Video) then
begin
// todo: VideoGap and Start time verwursten
- fCurrentVideoPlaybackEngine.Open( AktSong.Path + AktSong.Video );
+ fCurrentVideoPlaybackEngine.Open( CurrentSong.Path + CurrentSong.Video );
- fCurrentVideoPlaybackEngine.position := AktSong.VideoGAP + AktSong.Start;
+ fCurrentVideoPlaybackEngine.position := CurrentSong.VideoGAP + CurrentSong.Start;
- AktSong.VideoLoaded := true;
+ CurrentSong.VideoLoaded := true;
end;
// set background
- if (AktSong.Background <> '') and (AktSong.VideoLoaded = false) then
+ if (CurrentSong.Background <> '') and (CurrentSong.VideoLoaded = false) then
try
- Tex_Background := Texture.LoadTexture(AktSong.Path + AktSong.Background);
+ Tex_Background := Texture.LoadTexture(CurrentSong.Path + CurrentSong.Background);
except
- log.LogError('Background could not be loaded: ' + AktSong.Path + AktSong.Background);
+ log.LogError('Background could not be loaded: ' + CurrentSong.Path + CurrentSong.Background);
Tex_Background.TexNum := -1;
end
else
@@ -478,20 +486,20 @@ begin
// play music (I)
AudioInput.CaptureStart;
- AudioPlayback.Position := AktSong.Start;
+ AudioPlayback.Position := CurrentSong.Start;
// Music.Play;
// prepare timer (I)
// CountSkipTimeSet;
- Czas.Teraz := AktSong.Start;
+ Czas.Teraz := CurrentSong.Start;
Czas.Razem := AudioPlayback.Length;
- if (AktSong.Finish > 0) then Czas.Razem := AktSong.Finish / 1000;
+ if (CurrentSong.Finish > 0) then Czas.Razem := CurrentSong.Finish / 1000;
Czas.OldBeat := -1;
for P := 0 to High(Player) do
ClearScores(P);
// main text
- Lyrics.Clear (AktSong.BPM[0].BPM, AktSong.Resolution);
+ Lyrics.Clear (CurrentSong.BPM[0].BPM, CurrentSong.Resolution);
// set custom options
case Ini.LyricsFont of
@@ -870,7 +878,7 @@ procedure TScreenSing.onShowFinish;
begin
// play movie (II)
- if AktSong.VideoLoaded then
+ if CurrentSong.VideoLoaded then
begin
try
writeln( 'VideoPlayback.FFmpegGetFrame' );
@@ -884,11 +892,11 @@ begin
on E : Exception do
begin
//If an Error occurs Reading Video: prevent Video from being Drawn again and Close Video
- AktSong.VideoLoaded := False;
+ CurrentSong.VideoLoaded := False;
Log.LogError('Error drawing Video, Video has been disabled for this Song/Session.');
Log.LogError('Error Message : '+ E.message );
Log.LogError(' In : '+ E.ClassName +' (TScreenSing.onShowFinish)' );
- Log.LogError('Corrupted File: ' + AktSong.Video);
+ Log.LogError('Corrupted File: ' + CurrentSong.Video);
try
// CloseSmpeg;
fCurrentVideoPlaybackEngine.Close;
@@ -1141,7 +1149,8 @@ begin
SingDrawBackground;
// update and draw movie
- if ShowFinish and ( AktSong.VideoLoaded or fShowVisualization ) then
+ if ShowFinish and
+ ( CurrentSong.VideoLoaded or fShowVisualization ) then
// if ShowFinish then
begin
// try
@@ -1161,12 +1170,12 @@ begin
begin
//If an Error occurs drawing: prevent Video from being Drawn again and Close Video
- AktSong.VideoLoaded := False;
+ CurrentSong.VideoLoaded := False;
log.LogError('Error drawing Video, Video has been disabled for this Song/Session.');
Log.LogError('Error Message : '+ E.message );
Log.LogError(' In : '+ E.ClassName +' (TScreenSing.Draw)' );
- Log.LogError('Corrupted File: ' + AktSong.Video);
+ Log.LogError('Corrupted File: ' + CurrentSong.Video);
try
// CloseSmpeg;
fCurrentVideoPlaybackEngine.Close;
@@ -1183,9 +1192,9 @@ begin
DrawFG;
// check for music finish
-// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(AktSong.Finish));
+// Log.LogError('Check for music finish: ' + BoolToStr(Music.Finished) + ' ' + FloatToStr(Czas.Teraz*1000) + ' ' + IntToStr(CurrentSong.Finish));
if ShowFinish then begin
- if (not AudioPlayback.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin
+ if (not AudioPlayback.Finished) and ((CurrentSong.Finish = 0) or (Czas.Teraz*1000 <= CurrentSong.Finish)) then begin
//Pause Mod:
if not Paused then
Sing(Self); // analyze song
@@ -1251,11 +1260,11 @@ begin
Log.LogBenchmark('Creating files', 0);
end;
- if AktSong.VideoLoaded then
+ if CurrentSong.VideoLoaded then
begin
// CloseSmpeg;
fCurrentVideoPlaybackEngine.Close;
- AktSong.VideoLoaded := false; // to prevent drawing closed video
+ CurrentSong.VideoLoaded := false; // to prevent drawing closed video
end;
SetFontItalic (False);
diff --git a/Game/Code/Screens/UScreenSingModi.pas b/Game/Code/Screens/UScreenSingModi.pas
index 5d87ffdd..7d2eba07 100644
--- a/Game/Code/Screens/UScreenSingModi.pas
+++ b/Game/Code/Screens/UScreenSingModi.pas
@@ -520,7 +520,7 @@ end;
// comment by blindy: wo zum henker wird denn in diesem screen ein video abgespielt?
// update and draw movie
// <mog> wie wo wadd? also in der selben funktion in der uscreensing kommt des video in der zeile 995, oder was wollteste wissen? :X
-{ if ShowFinish and AktSong.VideoLoaded AND DllMan.Selected.LoadVideo then begin
+{ if ShowFinish and CurrentSong.VideoLoaded AND DllMan.Selected.LoadVideo then begin
UpdateSmpeg; // this only draws
end;}
@@ -530,7 +530,7 @@ end;
if ShowFinish then begin
if DllMan.Selected.LoadSong then
begin
- if (not AudioPlayback.Finished) and ((AktSong.Finish = 0) or (Czas.Teraz*1000 <= AktSong.Finish)) then begin
+ if (not AudioPlayback.Finished) and ((CurrentSong.Finish = 0) or (Czas.Teraz*1000 <= CurrentSong.Finish)) then begin
//Pause Mod:
if not Paused then
Sing(Self); // analyze song
diff --git a/Game/Code/Screens/UScreenSong.pas b/Game/Code/Screens/UScreenSong.pas
index 4f90e2ca..4b42288a 100644
--- a/Game/Code/Screens/UScreenSong.pas
+++ b/Game/Code/Screens/UScreenSong.pas
@@ -383,7 +383,7 @@ begin
end;
SDLK_RETURN:
begin
- if Length(Songs.Song) > 0 then
+ if Songs.SongList.Count > 0 then
begin
{$IFDEF UseSerialPort}
// PortWriteB($378, 0);
@@ -438,7 +438,7 @@ begin
SDLK_M: //Show SongMenu
begin
- if (Length(Songs.Song) > 0) then begin
+ if (Songs.SongList.Count > 0) then begin
if (Mode = 0) then begin
if not CatSongs.Song[Interaction].Main then begin // clicked on Song
if CatSongs.CatNumShow = -3 then
@@ -457,14 +457,14 @@ begin
SDLK_P: //Show Playlist Menu
begin
- if (Length(Songs.Song) > 0) AND (Mode = 0) then begin
+ if (Songs.SongList.Count > 0) AND (Mode = 0) then begin
ScreenSongMenu.MenuShow(SM_Playlist_Load);
end;
end;
SDLK_J: //Show Jumpto Menu
begin
- if (Length(Songs.Song) > 0) AND (Mode = 0) then
+ if (Songs.SongList.Count > 0) AND (Mode = 0) then
begin
ScreenSongJumpto.Visible := True;
end;
@@ -553,7 +553,7 @@ begin
SDLK_RIGHT:
begin
- if (Length(Songs.Song) > 0) AND (Mode = 0) then
+ if (Songs.SongList.Count > 0) AND (Mode = 0) then
begin
AudioPlayback.PlayChange;
SelectNext;
@@ -568,7 +568,7 @@ begin
SDLK_LEFT:
begin
- if (Length(Songs.Song) > 0)AND (Mode = 0) then begin
+ if (Songs.SongList.Count > 0)AND (Mode = 0) then begin
AudioPlayback.PlayChange;
SelectPrev;
ChangeMusic;
@@ -585,7 +585,7 @@ begin
SDLK_R:
begin
- if (Length(Songs.Song) > 0) AND (Mode = 0) then begin
+ if (Songs.SongList.Count > 0) AND (Mode = 0) then begin
if (SDL_ModState = KMOD_LSHIFT) AND (Ini.Tabs_at_startup = 1) then //Random Category
begin
@@ -1819,7 +1819,7 @@ begin
EqualizerTime := A;
Data := AudioPlayback.GetFFTData;
- B:=0;
+ B := 0;
Pos := 0;
Res := ceil(92/Theme.Song.Equalizer.Bands);//How much channels are used for one Band
@@ -2121,7 +2121,7 @@ end;
procedure TScreenSong.OpenEditor;
begin
- if (Length(Songs.Song) > 0) and (not CatSongs.Song[Interaction].Main) AND (Mode = 0) then
+ if (Songs.SongList.Count > 0) and (not CatSongs.Song[Interaction].Main) AND (Mode = 0) then
begin
AudioPlayback.Stop;
AudioPlayback.PlayStart;
diff --git a/Game/Code/Screens/UScreenStatMain.pas b/Game/Code/Screens/UScreenStatMain.pas
index 7e5c7d91..f7257201 100644
--- a/Game/Code/Screens/UScreenStatMain.pas
+++ b/Game/Code/Screens/UScreenStatMain.pas
@@ -37,6 +37,7 @@ implementation
uses UGraphic,
UDataBase,
USongs,
+ USong,
ULanguage,
UCommon,
{$IFDEF win32}
@@ -133,8 +134,8 @@ begin
//Set Songs with Vid
SongswithVid := 0;
- For I := 0 to high(Songs.Song) do
- if (Songs.Song[I].Video <> '') then
+ For I := 0 to Songs.SongList.Count -1 do
+ if (TSong(Songs.SongList[I]).Video <> '') then
Inc(SongswithVid);
end;
@@ -233,7 +234,7 @@ begin
%2:d Count of UnSung Songs
%3:d Count of Songs with Video (A3)
%4:s Name of the most popular Song}
- A1 := Length(Songs.Song);
+ A1 := Songs.SongList.Count;
A2 := Database.GetTotalEntrys(2);
A3 := SongswithVid;
diff --git a/Game/Code/Screens/UScreenTop5.pas b/Game/Code/Screens/UScreenTop5.pas
index bf19fed2..207f6ee6 100644
--- a/Game/Code/Screens/UScreenTop5.pas
+++ b/Game/Code/Screens/UScreenTop5.pas
@@ -92,29 +92,29 @@ var
begin
Fadeout := false;
- //ReadScore(AktSong);
+ //ReadScore(CurrentSong);
PMax := Ini.Players;
if Ini.Players = 4 then Ini.Players := 5;
for I := 0 to PMax do
- DataBase.AddScore(AktSong, Ini.Difficulty, Ini.Name[I], Round(Player[I].ScoreTotalI));
+ DataBase.AddScore(CurrentSong, Ini.Difficulty, Ini.Name[I], Round(Player[I].ScoreTotalI));
- DataBase.WriteScore(AktSong);
- DataBase.ReadScore(AktSong);
+ DataBase.WriteScore(CurrentSong);
+ DataBase.ReadScore(CurrentSong);
- Text[TextArtistTitle].Text := AktSong.Artist + ' - ' + AktSong.Title;
+ Text[TextArtistTitle].Text := CurrentSong.Artist + ' - ' + CurrentSong.Title;
- for I := 1 to Length(AktSong.Score[Ini.Difficulty]) do begin
+ for I := 1 to Length(CurrentSong.Score[Ini.Difficulty]) do begin
Static[StaticNumber[I]].Visible := true;
Text[TextNumber[I]].Visible := true;
Text[TextName[I]].Visible := true;
Text[TextScore[I]].Visible := true;
- Text[TextName[I]].Text := AktSong.Score[Ini.Difficulty, I-1].Name;
- Text[TextScore[I]].Text := IntToStr(AktSong.Score[Ini.Difficulty, I-1].Score);
+ Text[TextName[I]].Text := CurrentSong.Score[Ini.Difficulty, I-1].Name;
+ Text[TextScore[I]].Text := IntToStr(CurrentSong.Score[Ini.Difficulty, I-1].Score);
end;
- for I := Length(AktSong.Score[Ini.Difficulty])+1 to 5 do begin
+ for I := Length(CurrentSong.Score[Ini.Difficulty])+1 to 5 do begin
Static[StaticNumber[I]].Visible := false;
Text[TextNumber[I]].Visible := false;
Text[TextName[I]].Visible := false;