VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/DcsCfg/DcsCfgBeep.c
diff options
context:
space:
mode:
authorAlex <kavsrf@gmail.com>2016-08-15 17:11:31 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-15 17:14:26 +0200
commitb87fc6b140772ba3017de311c7063c259424264c (patch)
tree41ad139e7469380704361ae757a155464e8b68e3 /DcsCfg/DcsCfgBeep.c
parent68ea2f72cfe6a9b34212ced97882e488c73c8f1d (diff)
downloadVeraCrypt-DCS-b87fc6b140772ba3017de311c7063c259424264c.tar.gz
VeraCrypt-DCS-b87fc6b140772ba3017de311c7063c259424264c.zip
First public release. Used by VeraCrypt 1.18.VeraCrypt_1.18_PreRelease
Diffstat (limited to 'DcsCfg/DcsCfgBeep.c')
-rw-r--r--DcsCfg/DcsCfgBeep.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/DcsCfg/DcsCfgBeep.c b/DcsCfg/DcsCfgBeep.c
new file mode 100644
index 0000000..be158ba
--- /dev/null
+++ b/DcsCfg/DcsCfgBeep.c
@@ -0,0 +1,47 @@
+/** @file
+This is DCS configuration, speaker beep
+
+Copyright (c) 2016. Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
+Copyright (c) 2016. VeraCrypt, Mounir IDRASSI
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the GNU Lesser General Public License, version 3.0 (LGPL-3.0).
+
+The full text of the license may be found at
+https://opensource.org/licenses/LGPL-3.0
+**/
+
+#include <Library/CommonLib.h>
+#include <Library/GraphLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+#include "DcsCfg.h"
+
+//////////////////////////////////////////////////////////////////////////
+// Speaker beep
+//////////////////////////////////////////////////////////////////////////
+void SpeakerPrintDevicePathByIndex(UINTN index) {
+ OUT_PRINT(L"%V%d%N ", index);
+ EfiPrintDevicePath(gSpeakerHandles[index]);
+}
+
+void SpeakerPrintDevicePaths(CHAR16* msg) {
+ UINTN i;
+ OUT_PRINT(msg);
+ for (i = 0; i < gSpeakerCount; ++i) {
+ SpeakerPrintDevicePathByIndex(i);
+ OUT_PRINT(L"\n");
+ }
+}
+
+VOID
+PrintSpeakerList() {
+ InitSpeaker();
+ SpeakerPrintDevicePaths(L"%HSpeaker handles%N\n");
+}
+
+VOID
+TestSpeaker() {
+ SpeakerBeep((UINT16)gBeepToneDefault, gBeepNumberDefault, gBeepDurationDefault, gBeepIntervalDefault);
+} \ No newline at end of file