diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-06 10:08:25 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-06 10:08:25 +0000 |
commit | 81945c399590c1bd2c6837bdae0091f6b649b3a1 (patch) | |
tree | a80de47a40742bc1129339153ca62272932d0342 /src/screens | |
parent | b272c672d0fb3857f760bf39d3571028919c14b0 (diff) | |
download | usdx-81945c399590c1bd2c6837bdae0091f6b649b3a1.tar.gz usdx-81945c399590c1bd2c6837bdae0091f6b649b3a1.tar.xz usdx-81945c399590c1bd2c6837bdae0091f6b649b3a1.zip |
- URecord.ValidateSettings should not display the popup itself
- Array free version of CheckPlayersConfig
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2450 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/UScreenOptionsRecord.pas | 24 | ||||
-rw-r--r-- | src/screens/UScreenSing.pas | 3 |
2 files changed, 23 insertions, 4 deletions
diff --git a/src/screens/UScreenOptionsRecord.pas b/src/screens/UScreenOptionsRecord.pas index f1cfe628..dc4a355f 100644 --- a/src/screens/UScreenOptionsRecord.pas +++ b/src/screens/UScreenOptionsRecord.pas @@ -88,6 +88,7 @@ type procedure StartPreview; procedure StopPreview; procedure UpdateInputDevice; + function ValidateSettings: boolean; procedure ChangeVolume(VolumeChange: single); procedure DrawVolume(x, y, Width, Height: single); procedure DrawVUMeter(const State: TDrawState; x, y, Width, Height: single); @@ -120,6 +121,7 @@ uses TextGL, UGraphic, UDraw, + ULanguage, UMain, UMenuSelectSlide, UMenuText, @@ -168,7 +170,7 @@ begin SDLK_BACKSPACE: begin // TODO: Show Save/Abort screen - if (AudioInputProcessor.ValidateSettings()) then + if (ValidateSettings()) then begin Ini.Save; AudioPlayback.PlaySound(SoundLib.Back); @@ -179,7 +181,7 @@ begin begin if (SelInteraction = ExitButtonIID) then begin - if (AudioInputProcessor.ValidateSettings()) then + if (ValidateSettings()) then begin Ini.Save; AudioPlayback.PlaySound(SoundLib.Back); @@ -213,6 +215,24 @@ begin end; end; +function TScreenOptionsRecord.ValidateSettings: boolean; +var + BadPlayer: integer; +begin + BadPlayer := AudioInputProcessor.ValidateSettings(); + if (BadPlayer <> 0) then + begin + ScreenPopupError.ShowPopup( + Format(Language.Translate('ERROR_PLAYER_DEVICE_ASSIGNMENT'), + [BadPlayer])); + Result := false; + end + else + begin + Result := true; + end; +end; + constructor TScreenOptionsRecord.Create; var DeviceIndex: integer; diff --git a/src/screens/UScreenSing.pas b/src/screens/UScreenSing.pas index aa32dd4a..fe8ea8e8 100644 --- a/src/screens/UScreenSing.pas +++ b/src/screens/UScreenSing.pas @@ -370,7 +370,6 @@ var Color: TRGB; VideoFile, BgFile: IPath; success: boolean; - PlayerState: TBooleanDynArray; BadPlayer: integer; begin inherited; @@ -587,7 +586,7 @@ begin LyricsState.TotalTime := AudioPlayback.Length; LyricsState.UpdateBeats(); - BadPlayer := AudioInputProcessor.CheckPlayersConfig(PlayersPlay, PlayerState); + BadPlayer := AudioInputProcessor.CheckPlayersConfig(PlayersPlay); if (BadPlayer <> 0) then begin ScreenPopupError.ShowPopup( |