lilypad: Remove local volume control

Windows Vista onwards provides application specific volume controls, and
the local volume feature only interferes with it. Any volume adjusting
stuff probably belongs in SPU2-X.

Closes #629
This commit is contained in:
Jonathan Li 2016-05-27 23:44:48 +01:00
parent 2aeceafb36
commit f888aa61fb
7 changed files with 2 additions and 61 deletions

View File

@ -108,8 +108,6 @@ const GeneralSettingsBool BoolOptionsInfo[] = {
{L"Save State in Title", IDC_SAVE_STATE_TITLE, 0}, // Not required for PCSX2
{L"GH2", IDC_GH2_HACK, 0},
{L"Turbo Key Hack", IDC_TURBO_KEY_HACK, 0},
{L"Vista Volume", IDC_VISTA_VOLUME, 1},
};
void Populate(int port, int slot);
@ -774,18 +772,6 @@ int WritePrivateProfileInt(wchar_t *s1, wchar_t *s2, int v, wchar_t *ini) {
return WritePrivateProfileStringW(s1, s2, temp, ini);
}
void SetVolume(int volume) {
if (volume > 100) volume = 100;
if (volume < 0) volume = 0;
config.volume = volume;
unsigned int val = 0xFFFF * volume/100;
val = val | (val<<16);
for (int i=waveOutGetNumDevs()-1; i>=0; i--) {
waveOutSetVolume((HWAVEOUT)i, val);
}
WritePrivateProfileInt(L"General Settings", L"Volume", config.volume, iniFile);
}
int SaveSettings(wchar_t *file=0) {
// Need this either way for saving path.
@ -818,8 +804,6 @@ int SaveSettings(wchar_t *file=0) {
WritePrivateProfileInt(L"General Settings", L"Keyboard Mode", config.keyboardApi, file);
WritePrivateProfileInt(L"General Settings", L"Mouse Mode", config.mouseApi, file);
WritePrivateProfileInt(L"General Settings", L"Volume", config.volume, file);
for (int port=0; port<2; port++) {
for (int slot=0; slot<4; slot++) {
wchar_t temp[50];
@ -926,22 +910,10 @@ int LoadSettings(int force, wchar_t *file) {
if (!config.keyboardApi) config.keyboardApi = WM;
config.mouseApi = (DeviceAPI) GetPrivateProfileIntW(L"General Settings", L"Mouse Mode", 0, file);
config.volume = GetPrivateProfileInt(L"General Settings", L"Volume", 100, file);
OSVERSIONINFO os;
os.dwOSVersionInfoSize = sizeof(os);
config.osVersion = 0;
if (GetVersionEx(&os)) {
config.osVersion = os.dwMajorVersion;
}
if (config.osVersion < 6) config.vistaVolume = 0;
if (!config.vistaVolume) config.volume = 100;
if (config.vistaVolume) SetVolume(config.volume);
if (config.debug) {
CreateDirectory(L"logs", 0);
}
for (int port=0; port<2; port++) {
for (int slot=0; slot<4; slot++) {
wchar_t temp[50];
@ -1873,9 +1845,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
CheckDlgButton(hWnd, IDC_CLOSE_HACK1, BST_CHECKED * (config.closeHacks&1));
CheckDlgButton(hWnd, IDC_CLOSE_HACK2, BST_CHECKED * ((config.closeHacks&2)>>1));
if (config.osVersion < 6) EnableWindow(GetDlgItem(hWnd, IDC_VISTA_VOLUME), 0);
if (config.keyboardApi < 0 || config.keyboardApi > 3) config.keyboardApi = NO_API;
CheckRadioButton(hWnd, IDC_KB_DISABLE, IDC_KB_RAW, IDC_KB_DISABLE + config.keyboardApi);
if (config.mouseApi < 0 || config.mouseApi > 3) config.mouseApi = NO_API;
@ -1965,7 +1934,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
}
int mtap = config.multitap[0] + 2*config.multitap[1];
int vistaVol = config.vistaVolume;
for (int j=0; j<sizeof(BoolOptionsInfo)/sizeof(BoolOptionsInfo[0]); j++) {
config.bools[j] = (IsDlgButtonChecked(hWnd, BoolOptionsInfo[j].ControlId) == BST_CHECKED);
@ -1974,14 +1942,6 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L
config.closeHacks = (IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK1) == BST_CHECKED) |
((IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK2) == BST_CHECKED)<<1);
if (!config.vistaVolume) {
if (vistaVol) {
// Restore volume if just disabled. Don't touch, otherwise, just in case
// sound plugin plays with it.
SetVolume(100);
}
}
for (i=0; i<4; i++) {
if (i && IsDlgButtonChecked(hWnd, IDC_KB_DISABLE+i) == BST_CHECKED) {
config.keyboardApi = (DeviceAPI)i;

View File

@ -69,17 +69,10 @@ public:
u8 saveStateTitle;
u8 GH2;
u8 turboKeyHack;
u8 vistaVolume;
};
u8 bools[16];
u8 bools[15];
};
int volume;
// Unlike the others, not a changeable value.
DWORD osVersion;
wchar_t lastSaveConfigPath[MAX_PATH+1];
wchar_t lastSaveConfigFileName[MAX_PATH+1];
};
@ -88,8 +81,6 @@ extern GeneralConfig config;
void UnloadConfigs();
void SetVolume(int volume);
int LoadSettings(int force = 0, wchar_t *file = 0);
// Refreshes the set of enabled devices.

View File

@ -16,11 +16,9 @@ Logging=0
Save State in Title=0
GH2=0
Turbo Key Hack=0
Vista Volume=1
Close Hacks=0
Keyboard Mode=2
Mouse Mode=0
Volume=100
[Pad 0 0]
Mode=1
Auto Analog=0

View File

@ -274,7 +274,7 @@ void UpdateEnabledDevices(int updateList = 0) {
// Disable ignore keyboard if don't have focus or there are no keys to ignore.
if (dev->api == IGNORE_KEYBOARD) {
if ((!config.vistaVolume && (config.keyboardApi == NO_API || !dev->pads[0][0].numBindings)) || !activeWindow) {
if ((config.keyboardApi == NO_API || !dev->pads[0][0].numBindings) || !activeWindow) {
dm->DisableDevice(i);
}
continue;

View File

@ -310,7 +310,6 @@ BEGIN
PUSHBUTTON "Refresh",ID_REFRESH,153,300,48,15
GROUPBOX "Miscellaneous",IDC_STATIC,216,219,201,35
CONTROL "Disable screensaver",IDC_DISABLE_SCREENSAVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,221,230,80,10
CONTROL "Local volume control",IDC_VISTA_VOLUME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,221,241,77,10
CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,230,62,10
GROUPBOX "Hacks",IDC_STATIC,216,256,201,46
CONTROL "Send escape on window close",IDC_CLOSE_HACK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,266,113,10

View File

@ -208,8 +208,6 @@ const GeneralSettingsBool BoolOptionsInfo[] = {
{L"Save State in Title", 0 /*IDC_SAVE_STATE_TITLE*/, 0}, //No longer required, PCSX2 now handles it - avih 2011-05-17
{L"GH2", 0 /*IDC_GH2_HACK*/, 0},
{L"Turbo Key Hack", 0 /*IDC_TURBO_KEY_HACK*/, 0},
{L"Vista Volume", 0 /*IDC_VISTA_VOLUME*/, 1},
};
void CALLBACK PADsetSettingsDir( const char *dir )
@ -228,8 +226,6 @@ int SaveSettings(wchar_t *file=0) {
cfg.WriteInt(L"General Settings", L"Keyboard Mode", config.keyboardApi);
cfg.WriteInt(L"General Settings", L"Mouse Mode", config.mouseApi);
cfg.WriteInt(L"General Settings", L"Volume", config.volume);
for (int port=0; port<2; port++) {
for (int slot=0; slot<4; slot++) {
wchar_t temp[50];
@ -317,8 +313,6 @@ int LoadSettings(int force, wchar_t *file) {
if (!config.keyboardApi) config.keyboardApi = LNX_KEYBOARD;
config.mouseApi = (DeviceAPI) cfg.ReadInt(L"General Settings", L"Mouse Mode");
config.volume = cfg.ReadInt(L"General Settings", L"Volume", 100);
for (int port=0; port<2; port++) {
for (int slot=0; slot<4; slot++) {
wchar_t temp[50];

View File

@ -41,7 +41,6 @@
#define IDC_FORCE_HIDE 1124
#define IDC_GH2_HACK 1125
#define IDC_FORCEFEEDBACK_HACK1 1126
#define IDC_VISTA_VOLUME 1127
#define IDC_TURBO_KEY_HACK 1128
#define IDC_SAVE_STATE_TITLE 1129
#define IDC_PAD_LIST 1130