From d3be085e0f8b42e2fb12b7310768e901f46bb5a1 Mon Sep 17 00:00:00 2001 From: MikeBeaton Date: Sat, 3 Apr 2021 14:11:11 +0100 Subject: [PATCH] OCB: Add ommitted 'tab back to picker' VO prompts to builtin picker --- Library/OcBootManagementLib/BuiltinPicker.c | 34 +++++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/Library/OcBootManagementLib/BuiltinPicker.c b/Library/OcBootManagementLib/BuiltinPicker.c index 6d0f9bdb..afa88ae9 100644 --- a/Library/OcBootManagementLib/BuiltinPicker.c +++ b/Library/OcBootManagementLib/BuiltinPicker.c @@ -220,6 +220,7 @@ VOID UpdateTabContext ( IN BOOLEAN IsEntering, IN OC_BOOT_CONTEXT *BootContext, + IN OC_BOOT_ENTRY **BootEntries, IN TAB_CONTEXT TabContext, IN INTN ChosenEntry, IN CHAR16 OldEntryCursor, @@ -243,6 +244,17 @@ UpdateTabContext ( Code[0] = IsEntering ? OldEntryCursor : L' '; gST->ConOut->OutputString (gST->ConOut, Code); } + + if (IsEntering) { + if (ChosenEntry >= 0) { + OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileSelected, FALSE); + OcPlayAudioEntry (BootContext->PickerContext, BootEntries[ChosenEntry]); + } else { + // + // TODO: Sound for tabbing back to picker if no entry selected (cannot currently happen) + // + } + } } else if (TabContext == TAB_SHUTDOWN || TabContext == TAB_RESTART) { if (TabContext == TAB_SHUTDOWN) { gST->ConOut->SetCursorPosition (gST->ConOut, ShutdownColumn, ShutdownRestartRow); @@ -252,23 +264,23 @@ UpdateTabContext ( Code[0] = IsEntering ? L'[' : '|'; gST->ConOut->OutputString (gST->ConOut, Code); - if (TabContext == TAB_SHUTDOWN) { - if (IsEntering) { - OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileSelected, FALSE); - OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileShutDown, FALSE); - } gST->ConOut->OutputString (gST->ConOut, L"Shutdown"); } else { - if (IsEntering) { + gST->ConOut->OutputString (gST->ConOut, L"Restart"); + } + Code[0] = IsEntering ? L']' : '|'; + gST->ConOut->OutputString (gST->ConOut, Code); + + if (IsEntering) { + if (TabContext == TAB_SHUTDOWN) { + OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileSelected, FALSE); + OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileShutDown, FALSE); + } else { OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileSelected, FALSE); OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileRestart, FALSE); } - gST->ConOut->OutputString (gST->ConOut, L"Restart"); } - - Code[0] = IsEntering ? L']' : '|'; - gST->ConOut->OutputString (gST->ConOut, Code); } #if defined(BUILTIN_DEMONSTRATE_TYPING) else if (TabContext == TAB_TYPING_DEMO) { @@ -549,6 +561,7 @@ OcShowSimpleBootMenu ( UpdateTabContext ( FALSE, BootContext, + BootEntries, TabContext, ChosenEntry, OldEntryCursor, @@ -585,6 +598,7 @@ OcShowSimpleBootMenu ( UpdateTabContext ( TRUE, BootContext, + BootEntries, TabContext, ChosenEntry, OldEntryCursor,