summaryrefslogtreecommitdiffstats
path: root/src/hid_core/resources/vibration/vibration_base.h
blob: 8fe35634d7039278fcdc599fb27be5eb16d36471 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#include "common/common_types.h"
#include "core/hle/result.h"

namespace Core::HID {
class EmulatedController;
}

namespace Service::HID {
class NpadVibration;

/// Handles Npad request from HID interfaces
class NpadVibrationBase {
public:
    explicit NpadVibrationBase();

    virtual Result Activate();
    virtual Result Deactivate();

    bool IsActive() const;
    bool IsVibrationMounted() const;

protected:
    Core::HID::EmulatedController* xcd_handle{nullptr};
    s32 ref_counter{};
    bool is_mounted{};
    NpadVibration* vibration_handler{nullptr};
};
} // namespace Service::HID