添加按指定数值加减增益功能

This commit is contained in:
masayume 2021-09-22 10:00:49 +08:00
parent f1f2c4ccd3
commit cc66693fd4
3 changed files with 10 additions and 2 deletions

View File

@ -400,12 +400,20 @@ void CA4::OnBnClickedBtnbdown()
void CA4::UpdateGains(int id, bool increase)
{
UpdateData(TRUE);
int offect;
CString offectstr;
GetDlgItemText(IDC_tbxOffect, offectstr);
USES_CONVERSION;
std::string str_b(W2A(offectstr));
offect = atoi(str_b.c_str());
if (offect <= 0)
offect = 1;
if ((id == IDC_BTNAUP || id == IDC_BTNBUP) && increase)
{
int startindex = id == IDC_BTNAUP ? 0 : 6;
for (size_t i = startindex; i < (6+ startindex); i++)
{
params.Gain[i] = params.Gain[i]++;
params.Gain[i] += offect;
}
}
else if((id==IDC_BTNADOWN||id==IDC_BTNBDOWN)&&!increase)
@ -413,7 +421,7 @@ void CA4::UpdateGains(int id, bool increase)
int startindex = id == IDC_BTNADOWN ? 0 : 6;
for (size_t i = startindex; i < (6 + startindex); i++)
{
params.Gain[i] = params.Gain[i]--;
params.Gain[i] -= offect;
}
}
UpdateData(FALSE);

Binary file not shown.

Binary file not shown.