添加按指定数值加减增益功能
This commit is contained in:
parent
f1f2c4ccd3
commit
cc66693fd4
|
@ -400,12 +400,20 @@ void CA4::OnBnClickedBtnbdown()
|
||||||
void CA4::UpdateGains(int id, bool increase)
|
void CA4::UpdateGains(int id, bool increase)
|
||||||
{
|
{
|
||||||
UpdateData(TRUE);
|
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)
|
if ((id == IDC_BTNAUP || id == IDC_BTNBUP) && increase)
|
||||||
{
|
{
|
||||||
int startindex = id == IDC_BTNAUP ? 0 : 6;
|
int startindex = id == IDC_BTNAUP ? 0 : 6;
|
||||||
for (size_t i = startindex; i < (6+ startindex); i++)
|
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)
|
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;
|
int startindex = id == IDC_BTNADOWN ? 0 : 6;
|
||||||
for (size_t i = startindex; i < (6 + startindex); i++)
|
for (size_t i = startindex; i < (6 + startindex); i++)
|
||||||
{
|
{
|
||||||
params.Gain[i] = params.Gain[i]--;
|
params.Gain[i] -= offect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdateData(FALSE);
|
UpdateData(FALSE);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue