aboutsummaryrefslogtreecommitdiffstats
path: root/src/screens/UScreenOptionsRecord.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/UScreenOptionsRecord.pas')
-rw-r--r--src/screens/UScreenOptionsRecord.pas24
1 files changed, 22 insertions, 2 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;