diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-15 21:28:52 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-15 21:28:52 +0000 |
commit | 115255f6a3c2be422680710b5d6ba4226c3383a6 (patch) | |
tree | 3bbe81786e12808220efa589adb799e0412d20a2 /us_maker_edition/src/screens/UScreenOptionsRecord.pas | |
parent | cf141f470e4cb45b8c886e1536846a8254cdd302 (diff) | |
download | usdx-115255f6a3c2be422680710b5d6ba4226c3383a6.tar.gz usdx-115255f6a3c2be422680710b5d6ba4226c3383a6.tar.xz usdx-115255f6a3c2be422680710b5d6ba4226c3383a6.zip |
merged trunk r2528 into us_maker branch
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2530 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'us_maker_edition/src/screens/UScreenOptionsRecord.pas')
-rw-r--r-- | us_maker_edition/src/screens/UScreenOptionsRecord.pas | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/us_maker_edition/src/screens/UScreenOptionsRecord.pas b/us_maker_edition/src/screens/UScreenOptionsRecord.pas index 0f9cd49a..dc4a355f 100644 --- a/us_maker_edition/src/screens/UScreenOptionsRecord.pas +++ b/us_maker_edition/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; @@ -321,12 +341,6 @@ begin end; // add Exit-button - //ButtonTheme := Theme.OptionsRecord.ButtonExit; - // adjust button position - //if (WidgetYPos <> 0) then - // ButtonTheme.Y := WidgetYPos; - //AddButton(ButtonTheme); - // <mog> I uncommented the stuff above, because it's not skinable :X AddButton(Theme.OptionsRecord.ButtonExit); if (Length(Button[0].Text) = 0) then AddButtonText(20, 5, Theme.Options.Description[7]); @@ -783,7 +797,7 @@ begin for ChannelIndex := 0 to High(Device.CaptureChannel) do begin // load player color mapped to current input channel - if (DeviceCfg.ChannelToPlayerMap[ChannelIndex] > 0) then + if (DeviceCfg.ChannelToPlayerMap[ChannelIndex] <> CHANNEL_OFF) then begin // set mapped channel to corresponding player-color LoadColor(State.R, State.G, State.B, 'P'+ IntToStr(DeviceCfg.ChannelToPlayerMap[ChannelIndex]) + 'Dark'); |