diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-22 18:58:52 +0100 |
---|---|---|
committer | Narr the Reg <juangerman-13@hotmail.com> | 2024-02-24 00:49:02 +0100 |
commit | d08f201e0c0e6d36176983f9673a89550705952b (patch) | |
tree | 93229a986e75f1962d0665dd05a8d2813a8c9ce7 /src/core/hle/service/hid/active_vibration_device_list.h | |
parent | Merge pull request #13141 from liamwhite/swap (diff) | |
download | yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.gz yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.bz2 yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.lz yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.xz yuzu-d08f201e0c0e6d36176983f9673a89550705952b.tar.zst yuzu-d08f201e0c0e6d36176983f9673a89550705952b.zip |
Diffstat (limited to 'src/core/hle/service/hid/active_vibration_device_list.h')
-rw-r--r-- | src/core/hle/service/hid/active_vibration_device_list.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/active_vibration_device_list.h b/src/core/hle/service/hid/active_vibration_device_list.h new file mode 100644 index 000000000..beaa44d97 --- /dev/null +++ b/src/core/hle/service/hid/active_vibration_device_list.h @@ -0,0 +1,39 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include <array> +#include <memory> +#include <mutex> + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" +#include "hid_core/hid_types.h" + +namespace Core { +class System; +} + +namespace Service::HID { +class ResourceManager; + +class IActiveVibrationDeviceList final : public ServiceFramework<IActiveVibrationDeviceList> { +public: + explicit IActiveVibrationDeviceList(Core::System& system_, + std::shared_ptr<ResourceManager> resource); + ~IActiveVibrationDeviceList() override; + +private: + static constexpr std::size_t MaxVibrationDevicesHandles{0x100}; + + Result ActivateVibrationDevice(Core::HID::VibrationDeviceHandle vibration_device_handle); + + mutable std::mutex mutex; + std::size_t list_size{}; + std::array<Core::HID::VibrationDeviceHandle, MaxVibrationDevicesHandles> + vibration_device_list{}; + std::shared_ptr<ResourceManager> resource_manager; +}; + +} // namespace Service::HID |