Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An option which can turn off xmp changing. #450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Common/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ void SetToolTip(HWND tt, string value) {
}

void SetSlider(HWND tt, int value) {
if (value == -1) {
SetToolTip(tt, string("OFF"));
return;
}
SetToolTip(tt, to_string(value));
}

Expand Down
1 change: 1 addition & 0 deletions alienfan-tools/alienfan-SDK_v2/alienfan-SDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ namespace AlienFan_SDK {

int Control::SetXMP(byte memXMP)
{
if (memXMP == -1)return 0;//set a value to bypass Xmp function
if (isXMP) {
int res = CallWMIMethod(setXMP, memXMP);
return res ? -1 : res;
Expand Down
2 changes: 1 addition & 1 deletion alienfan-tools/alienfan-gui/alienfan-gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ LRESULT CALLBACK FanDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
}
EnableWindow(xmp_slider, mon->acpi->isXMP);
if (mon->acpi->isXMP) {
SendMessage(xmp_slider, TBM_SETRANGE, true, MAKELPARAM(0, 2));
SendMessage(xmp_slider, TBM_SETRANGE, true, MAKELPARAM(-1, 2));
sTip2 = CreateToolTip(xmp_slider, sTip2);
SetSlider(sTip2, fan_conf->lastProf->memoryXMP);
SendMessage(xmp_slider, TBM_SETPOS, true, fan_conf->lastProf->memoryXMP);
Expand Down
2 changes: 1 addition & 1 deletion alienfan-tools/alienfan-shared/ConfigFan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void ConfigFan::Load() {
GetReg("StartMinimized", &startMinimized);
GetReg("UpdateCheck", &updateCheck, 1);
GetReg("LastPowerStage", &prof.powerSet);
GetReg("OC", &prof.ocSettings, 100);
GetReg("OC", &prof.ocSettings, (0xff << 8 | 100));
GetReg("DisableAWCC", &awcc_disable);
GetReg("KeyboardShortcut", &keyShortcuts, 1);
GetReg("KeepSystemMode", &keepSystem, 1);
Expand Down
4 changes: 2 additions & 2 deletions alienfan-tools/alienfan-shared/ConfigFan.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ struct fan_profile {
union {
struct {
byte currentTCC;
byte memoryXMP;
signed char memoryXMP;
};
DWORD ocSettings = 100;
DWORD ocSettings = (0xff <<8|100);
};
};

Expand Down
2 changes: 1 addition & 1 deletion alienfx-gui/FanDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ BOOL CALLBACK TabFanDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
}
EnableWindow(xmp_slider, mon->acpi->isXMP);
if (mon->acpi->isXMP) {
SendMessage(xmp_slider, TBM_SETRANGE, true, MAKELPARAM(0, 2));
SendMessage(xmp_slider, TBM_SETRANGE, true, MAKELPARAM(-1, 2));
sTip2 = CreateToolTip(xmp_slider, sTip2);
SetSlider(sTip2, fan_conf->lastProf->memoryXMP);
SendMessage(xmp_slider, TBM_SETPOS, true, fan_conf->lastProf->memoryXMP);
Expand Down