mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcBootManagementLib: Fix audio playback in builtin picker
This commit is contained in:
parent
5055be90ea
commit
41b207c242
@ -1169,15 +1169,13 @@ OcPlayAudioBeep (
|
||||
|
||||
@param[in] Context Picker context.
|
||||
@param[in] Entry Entry to play.
|
||||
@param[in] Number Entry index number.
|
||||
|
||||
@retval EFI_SUCCESS on success or when unnecessary.
|
||||
**/
|
||||
EFI_STATUS
|
||||
OcPlayAudioEntry (
|
||||
IN OC_PICKER_CONTEXT *Context,
|
||||
IN OC_BOOT_ENTRY *Entry,
|
||||
IN UINT32 Number
|
||||
IN OC_BOOT_ENTRY *Entry
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -172,11 +172,10 @@ OcPlayAudioBeep (
|
||||
EFI_STATUS
|
||||
OcPlayAudioEntry (
|
||||
IN OC_PICKER_CONTEXT *Context,
|
||||
IN OC_BOOT_ENTRY *Entry,
|
||||
IN UINT32 Number
|
||||
IN OC_BOOT_ENTRY *Entry
|
||||
)
|
||||
{
|
||||
OcPlayAudioFile (Context, OcVoiceOverAudioFileIndexBase + Number, FALSE);
|
||||
OcPlayAudioFile (Context, OcVoiceOverAudioFileIndexBase + Entry->EntryIndex, FALSE);
|
||||
|
||||
if (Entry->Type == OC_BOOT_APPLE_OS) {
|
||||
OcPlayAudioFile (Context, OcVoiceOverAudioFilemacOS, FALSE);
|
||||
|
||||
@ -203,7 +203,7 @@ OcShowSimpleBootMenu (
|
||||
if (!PlayedOnce && BootContext->PickerContext->PickerAudioAssist) {
|
||||
OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileChooseOS, FALSE);
|
||||
for (Index = 0; Index < Count; ++Index) {
|
||||
OcPlayAudioEntry (BootContext->PickerContext, BootEntries[Index], BootEntries[Index]->EntryIndex);
|
||||
OcPlayAudioEntry (BootContext->PickerContext, BootEntries[Index]);
|
||||
if (TimeOutSeconds > 0 && BootContext->DefaultEntry->EntryIndex - 1 == Index) {
|
||||
OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileDefault, FALSE);
|
||||
}
|
||||
@ -230,7 +230,7 @@ OcShowSimpleBootMenu (
|
||||
|
||||
if (PlayChosen && KeyIndex == OC_INPUT_TIMEOUT) {
|
||||
OcPlayAudioFile (BootContext->PickerContext, OcVoiceOverAudioFileSelected, FALSE);
|
||||
OcPlayAudioEntry (BootContext->PickerContext, BootEntries[ChosenEntry], BootEntries[Index]->EntryIndex);
|
||||
OcPlayAudioEntry (BootContext->PickerContext, BootEntries[ChosenEntry]);
|
||||
PlayChosen = FALSE;
|
||||
continue;
|
||||
} else if (KeyIndex == OC_INPUT_TIMEOUT) {
|
||||
@ -641,7 +641,7 @@ OcRunBootPicker (
|
||||
if (Context->PickerCommand == OcPickerShowPicker) {
|
||||
OcPlayAudioFile (Context, OcVoiceOverAudioFileSelected, FALSE);
|
||||
OcPlayAudioFile (Context, OcVoiceOverAudioFileDefault, FALSE);
|
||||
OcPlayAudioEntry (Context, Chosen, Chosen->EntryIndex);
|
||||
OcPlayAudioEntry (Context, Chosen);
|
||||
}
|
||||
Status = OcSetDefaultBootEntry (Context, Chosen);
|
||||
DEBUG ((DEBUG_INFO, "OCB: Setting default - %r\n", Status));
|
||||
@ -663,7 +663,7 @@ OcRunBootPicker (
|
||||
// Voice chosen information.
|
||||
//
|
||||
OcPlayAudioFile (Context, OcVoiceOverAudioFileLoading, FALSE);
|
||||
Status = OcPlayAudioEntry (Context, Chosen, Chosen->EntryIndex);
|
||||
Status = OcPlayAudioEntry (Context, Chosen);
|
||||
if (EFI_ERROR (Status)) {
|
||||
OcPlayAudioBeep (
|
||||
Context,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user