-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontroller.h
44 lines (39 loc) · 1.07 KB
/
controller.h
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
34
35
36
37
38
39
40
41
42
43
44
// FanControl++
// (c) 2024 Pham Nhat Quang (Legend0fHell)
#pragma once
#include "utils.h"
#include "settings.h"
#include "shlobj_core.h"
using byte = unsigned char;
enum PWRStatus {
DC, AC, Error
};
class AsusDLL {
private:
HMODULE asus_dll = LoadLibraryW(L"AsusWinIO64.dll");
bool set_fan_pwm_duty(byte value);
bool failed(const std::wstring reason, bool shown);
bool success(const std::wstring reason, bool shown);
int get_fan_count();
bool set_fan_speed_idx(byte value, byte fanIdx);
bool init_status = false;
ULONGLONG last_update_thermal = 0;
ULONGLONG last_update_fan_speed = 0;
int fan_count = -1;
std::vector<int> fan_speed_list;
int current_combined_thermal = 0;
public:
AsusDLL();
~AsusDLL() noexcept(false);
bool set_fan_speed(float percent);
bool set_fan_test_mode(char mode);
int get_fan_speed_idx(byte fanIdx);
std::vector<int> get_fan_speed();
bool error_occured = false;
char current_fan_test_mode = 0x00;
float current_fan_percent = 0;
int current_cpu_thermal = 0;
int current_gpu_thermal = 0;
ULONG get_thermal();
PWRStatus get_power_mode();
};