void EffectChangePitch::OnText_PercentChange(wxCommandEvent & WXUNUSED(evt)) { if (m_bLoopDetect) return; if (!m_pTextCtrl_PercentChange->GetValidator()->TransferFromWindow()) { EnableApply(false); return; } Calc_SemitonesChange_fromPercentChange(); Calc_ToPitch(); // Call *after* m_dSemitonesChange is updated. Calc_ToFrequency(); Calc_ToOctave(); // Call after Calc_ToFrequency(). m_bLoopDetect = true; { Update_Choice_ToPitch(); Update_Spin_ToOctave(); Update_Text_SemitonesChange(); Update_Text_ToFrequency(); Update_Slider_PercentChange(); } m_bLoopDetect = false; // Success. Make sure OK and Preview are enabled, in case we disabled above during editing. EnableApply(true); }
void EffectChangePitch::OnText_FromFrequency(wxCommandEvent & WXUNUSED(evt)) { if (m_bLoopDetect) return; // Empty string causes unpredictable results with ToDouble() and later calculations. // Non-positive frequency makes no sense, but user might still be editing, // so it's not an error, but we do not want to update the values/controls. if (!m_pTextCtrl_FromFrequency->GetValidator()->TransferFromWindow()) { EnableApply(false); return; } double newFromMIDInote = FreqToMIDInote(m_FromFrequency); m_nFromPitch = PitchIndex(newFromMIDInote); m_nFromOctave = PitchOctave(newFromMIDInote); Calc_ToPitch(); Calc_ToFrequency(); Calc_ToOctave(); // Call after Calc_ToFrequency(). m_bLoopDetect = true; { Update_Choice_FromPitch(); Update_Spin_FromOctave(); Update_Choice_ToPitch(); Update_Spin_ToOctave(); Update_Text_ToFrequency(); } m_bLoopDetect = false; // Success. Make sure OK and Preview are enabled, in case we disabled above during editing. EnableApply(true); }
void EffectRepeat::DisplayNewTime() { long l; wxString str; mRepeatCount->GetValue().ToLong(&l); NumericConverter nc(NumericConverter::TIME, GetSelectionFormat(), mT1 - mT0, mProjectRate); str = _("Current selection length: ") + nc.GetString(); mCurrentTime->SetLabel(str); mCurrentTime->SetName(str); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) if (l > 0) { EnableApply(true); repeatCount = l; nc.SetValue((mT1 - mT0) * (repeatCount + 1)); str = _("New selection length: ") + nc.GetString(); } else { str = _("Warning: No repeats."); EnableApply(false); } mTotalTime->SetLabel(str); mTotalTime->SetName(str); // fix for bug 577 (NVDA/Narrator screen readers do not read static text in dialogs) }
void EffectChangePitch::OnText_SemitonesChange(wxCommandEvent & WXUNUSED(evt)) { if (m_bLoopDetect) return; if (!m_pTextCtrl_SemitonesChange->GetValidator()->TransferFromWindow()) { EnableApply(false); return; } Calc_PercentChange(); Calc_ToFrequency(); // Call *after* m_dPercentChange is updated. Calc_ToPitch(); Calc_ToOctave(); // Call after Calc_ToFrequency(). m_bLoopDetect = true; { Update_Choice_ToPitch(); Update_Spin_ToOctave(); Update_Text_ToFrequency(); Update_Text_PercentChange(); Update_Slider_PercentChange(); } m_bLoopDetect = false; // If m_dSemitonesChange is a big enough negative, we can go to or below 0 freq. // If m_dSemitonesChange is a big enough positive, we can go to 1.#INF (Windows) or inf (Linux). // But practically, these are best limits for Soundtouch. bool bIsGoodValue = (m_dSemitonesChange > -80.0) && (m_dSemitonesChange <= 60.0); EnableApply(bIsGoodValue); }
void EffectPhaser::OnFreqSlider(wxCommandEvent & evt) { mFreq = (double) evt.GetInt() / SCL_Freq; if (mFreq < MIN_Freq) mFreq = MIN_Freq; mFreqT->GetValidator()->TransferToWindow(); EnableApply(mUIParent->Validate()); }
void EffectToneGen::OnControlUpdate(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } }
void EffectPhaser::OnStagesSlider(wxCommandEvent & evt) { mStages = (evt.GetInt() / SCL_Stages) & ~1; // must be even; mPhaseS->SetValue(mStages * SCL_Stages); mStagesT->GetValidator()->TransferToWindow(); EnableApply(mUIParent->Validate()); }
void EffectBassTreble::OnGainSlider(wxCommandEvent & evt) { mGain = (double) evt.GetInt() / SCL_Gain; mGainT->GetValidator()->TransferToWindow(); EnableApply(mUIParent->Validate()); }
void EffectWahwah::OnGainText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mOutGainS->SetValue((int) (mOutGain * SCL_OutGain)); }
void EffectScienFilter::OnStopbandRipple(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mPanel->Refresh(false); }
void EffectBassTreble::OnTrebleSlider(wxCommandEvent & evt) { double oldTreble = mTreble; mTreble = (double) evt.GetInt() / SCL_Treble; mTrebleT->GetValidator()->TransferToWindow(); if (mLink) UpdateGain(oldTreble, kTreble); EnableApply(mUIParent->Validate()); }
void EffectBassTreble::OnBassSlider(wxCommandEvent & evt) { double oldBass = mBass; mBass = (double) evt.GetInt() / SCL_Bass; mBassT->GetValidator()->TransferToWindow(); if (mLink) UpdateGain(oldBass, kBass); EnableApply(mUIParent->Validate()); }
void EffectWahwah::OnResonanceText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mResS->SetValue((int) (mRes * SCL_Res)); }
void EffectWahwah::OnDepthText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mDepthS->SetValue((int) (mDepth * SCL_Depth)); }
void EffectWahwah::OnPhaseSlider(wxCommandEvent & evt) { int val = ((evt.GetInt() + 5) / 10) * 10; // round to nearest multiple of 10 val = val > MAX_Phase * SCL_Phase ? MAX_Phase * SCL_Phase : val; mPhaseS->SetValue(val); mPhase = (double) val / SCL_Phase; mPhaseT->GetValidator()->TransferToWindow(); EnableApply(mUIParent->Validate()); }
void EffectWahwah::OnPhaseText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mPhaseS->SetValue((int) (mPhase * SCL_Phase)); }
void EffectPhaser::OnDryWetText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mDryWetS->SetValue((int) (mDryWet * SCL_DryWet)); }
void EffectPhaser::OnFeedbackText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mFeedbackS->SetValue((int) (mFeedback * SCL_Feedback)); }
void EffectWahwah::OnFreqOffText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mFreqOfsS->SetValue((int) (mFreqOfs * SCL_FreqOfs)); }
void EffectPhaser::OnStagesText(wxCommandEvent & WXUNUSED(evt)) { if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } mStagesS->SetValue((int) (mStages * SCL_Stages)); }
void EffectPhaser::OnFeedbackSlider(wxCommandEvent & evt) { int val = evt.GetInt(); val = ((val + (val > 0 ? 5 : -5)) / 10) * 10; // round to nearest multiple of 10 val = val > MAX_Feedback * SCL_Feedback ? MAX_Feedback * SCL_Feedback : val; mFeedbackS->SetValue(val); mFeedback = val / SCL_Feedback; mFeedbackT->GetValidator()->TransferToWindow(); EnableApply(mUIParent->Validate()); }
void CUCPDetail::OnUcpdAccessLogOnoff() { m_ucinfo->m_access_log = !m_ucinfo->m_access_log; if (m_ucinfo->m_access_log) { m_ucpd_access_log.SetWindowText("Access LOG ON"); } else { m_ucpd_access_log.SetWindowText("Access LOG OFF"); } EnableApply(); }
void CUCPDetail::OnUcpdService() { m_ucinfo->m_service = !m_ucinfo->m_service; if (m_ucinfo->m_service) { m_ucpd_service.SetWindowText("Service ON"); } else { m_ucpd_service.SetWindowText("Service OFF"); } EnableApply(); }
void CUCPDetail::OnUcpdLogbackupOnoff() { m_ucinfo->m_log_backup = !m_ucinfo->m_log_backup; if (m_ucinfo->m_log_backup) { m_ucpd_log_backup.SetWindowText("Backup ON"); } else { m_ucpd_log_backup.SetWindowText("Backup OFF"); } EnableApply(); }
void CUCPDetail::OnUcpdSqlTrackingOnoff() { m_ucinfo->m_sql_log = !m_ucinfo->m_sql_log; if (m_ucinfo->m_sql_log) { m_ucpd_sql_log.SetWindowText("SQL Tracking ON"); } else { m_ucpd_sql_log.SetWindowText("SQL Tracking OFF"); } EnableApply(); }
void CUCPDetail::OnUcpdSecurityOnoff() { m_ucinfo->m_security = !m_ucinfo->m_security; if (m_ucinfo->m_security) { m_ucpd_security.SetWindowText("Security ON"); } else { m_ucpd_security.SetWindowText("Security OFF"); } EnableApply(); }
void EffectTruncSilence::OnControlChange(wxCommandEvent & WXUNUSED(evt)) { mActionChoice->GetValidator()->TransferFromWindow(); UpdateUI(); if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } }
void EffectBassTreble::OnBassText(wxCommandEvent & WXUNUSED(evt)) { double oldBass = mBass; if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } if (mLink) UpdateGain(oldBass, kBass); mBassS->SetValue((int) (mBass * SCL_Bass)); }
void EffectBassTreble::OnTrebleText(wxCommandEvent & WXUNUSED(evt)) { double oldTreble = mTreble; if (!EnableApply(mUIParent->TransferDataFromWindow())) { return; } if (mLink) UpdateGain(oldTreble, kTreble); mTrebleS->SetValue((int) (mTreble * SCL_Treble)); }
void CUCPDetail::OnSelchangeServiceType() { int sel; sel = m_ucpd_appl_server.GetCurSel(); m_ucinfo->m_appl_server = sel; if (m_ucinfo->m_appl_server == 0) { m_ucpd_more.EnableWindow(false); } else { m_ucpd_more.EnableWindow(true); } EnableApply(); }