summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/npad/npad_vibration.h
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2024-01-07 16:05:12 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2024-01-12 02:35:04 +0100
commitb5dac5f525e8d5884506ebd98a530e237b518480 (patch)
tree6ceee925ba897dc3450bdad209982f0be4bc3f7a /src/hid_core/resources/npad/npad_vibration.h
parentMerge pull request #12653 from liamwhite/once-more (diff)
downloadyuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar
yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.gz
yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.bz2
yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.lz
yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.xz
yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.tar.zst
yuzu-b5dac5f525e8d5884506ebd98a530e237b518480.zip
Diffstat (limited to 'src/hid_core/resources/npad/npad_vibration.h')
-rw-r--r--src/hid_core/resources/npad/npad_vibration.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/hid_core/resources/npad/npad_vibration.h b/src/hid_core/resources/npad/npad_vibration.h
new file mode 100644
index 000000000..0748aeffc
--- /dev/null
+++ b/src/hid_core/resources/npad/npad_vibration.h
@@ -0,0 +1,34 @@
+// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+
+#include <mutex>
+
+#include "common/common_types.h"
+#include "core/hle/result.h"
+
+namespace Service::HID {
+
+class NpadVibration final {
+public:
+ explicit NpadVibration();
+ ~NpadVibration();
+
+ Result Activate();
+ Result Deactivate();
+
+ Result SetVibrationMasterVolume(f32 master_volume);
+ Result GetVibrationVolume(f32& out_volume) const;
+ Result GetVibrationMasterVolume(f32& out_volume) const;
+
+ Result BeginPermitVibrationSession(u64 aruid);
+ Result EndPermitVibrationSession();
+
+private:
+ f32 volume{};
+ u64 session_aruid{};
+ mutable std::mutex mutex;
+};
+
+} // namespace Service::HID