void WahwahDialog::OnPhaseSlider(wxCommandEvent & event) { wxString str; long phase = GetPhaseSlider()->GetValue(); phase = ((phase + 5) / 10) * 10; // round to nearest multiple of 10 str.Printf("%ld", phase); GetPhaseText()->SetValue(str); }
void PhaserDialog::OnPhaseSlider(wxCommandEvent & WXUNUSED(event)) { wxString str; long phase = GetPhaseSlider()->GetValue(); phase = ((phase + 5) / 10) * 10; // round to nearest multiple of 10 str.Printf(wxT("%ld"), phase); GetPhaseText()->SetValue(str); }
bool PhaserDialog::TransferDataToWindow() { wxSlider *slider; slider = GetFreqSlider(); if (slider) slider->SetValue(freq * 10); slider = GetPhaseSlider(); if (slider) slider->SetValue(startphase); slider = GetDepthSlider(); if (slider) slider->SetValue(depth); slider = GetFeedbackSlider(); if (slider) slider->SetValue(fb); slider = GetDryWet(); if (slider) slider->SetValue(drywet); wxSpinCtrl *spin = GetStages(); if (spin) spin->SetValue(stages); wxTextCtrl *text = GetFreqText(); if (text) { wxString str; str.Printf("%.1f", freq); text->SetValue(str); } text = GetPhaseText(); if (text) { wxString str; str.Printf("%d", (int) startphase); text->SetValue(str); } text = GetDepthText(); if (text) { wxString str; str.Printf("%d", (int) depth); text->SetValue(str); } text = GetFeedbackText(); if (text) { wxString str; str.Printf("%d", (int) fb); text->SetValue(str); } return TRUE; }
void PhaserDialog::OnPhaseText(wxCommandEvent & WXUNUSED(event)) { wxTextCtrl *c = GetPhaseText(); if (c) { long phase; c->GetValue().ToLong(&phase); phase = TrapLong(phase, PHASE_MIN, PHASE_MAX); wxSlider *slider = GetPhaseSlider(); if (slider) slider->SetValue(phase); } }
bool PhaserDialog::TransferDataFromWindow() { wxTextCtrl *c; long x; c = GetFreqText(); if (c) { double d; c->GetValue().ToDouble(&d); freq = TrapDouble(d * 10, FREQ_MIN, FREQ_MAX) / 10; } c = GetPhaseText(); if (c) { c->GetValue().ToLong(&x); startphase = TrapLong(x, PHASE_MIN, PHASE_MAX); } c = GetDepthText(); if (c) { c->GetValue().ToLong(&x); depth = TrapLong(x, DEPTH_MIN, DEPTH_MAX); } c = GetFeedbackText(); if (c) { c->GetValue().ToLong(&x); fb = TrapLong(x, FB_MIN, FB_MAX); } c = GetStagesText(); if (c) { c->GetValue().ToLong(&x); stages = TrapLong(x, STAGES_MIN, STAGES_MAX); if ((stages % 2) == 1) // must be even stages = TrapLong(stages - 1, STAGES_MIN, STAGES_MAX); } c = GetDryWetText(); if (c) { c->GetValue().ToLong(&x); drywet = TrapLong(x, DRYWET_MIN, DRYWET_MAX); } return TRUE; }
bool WahwahDialog::TransferDataFromWindow() { wxTextCtrl *c; long x; c = GetFreqText(); if (c) { double d; c->GetValue().ToDouble(&d); freq = TrapDouble(d * 10, FREQ_MIN, FREQ_MAX) / 10; } c = GetFreqOffText(); if (c) { double d; c->GetValue().ToDouble(&d); freqoff = TrapDouble(d, FREQOFF_MIN, FREQOFF_MAX); } c = GetPhaseText(); if (c) { c->GetValue().ToLong(&x); startphase = TrapLong(x, PHASE_MIN, PHASE_MAX); } c = GetDepthText(); if (c) { c->GetValue().ToLong(&x); depth = TrapLong(x, DEPTH_MIN, DEPTH_MAX); } c = GetResonanceText(); if (c) { double d; c->GetValue().ToDouble(&d); res = TrapDouble(d * 10, RES_MIN, RES_MAX) / 10; } return TRUE; }
bool PhaserDialog::TransferDataToWindow() { wxSlider *slider; slider = GetFreqSlider(); if (slider) slider->SetValue((int)(freq * 10)); slider = GetPhaseSlider(); if (slider) slider->SetValue((int)startphase); slider = GetDepthSlider(); if (slider) slider->SetValue((int)depth); slider = GetFeedbackSlider(); if (slider) slider->SetValue((int)fb); slider = GetDryWetSlider(); if (slider) slider->SetValue((int)drywet); slider = GetStagesSlider(); if (slider) slider->SetValue((int)stages); wxTextCtrl *text; text = GetStagesText(); if (text) { wxString str; str.Printf(wxT("%d"), stages); text->SetValue(str); } text = GetDryWetText(); if (text) { wxString str; str.Printf(wxT("%d"), drywet); text->SetValue(str); } text = GetFreqText(); if (text) { wxString str; str.Printf(wxT("%.1f"), freq); text->SetValue(str); } text = GetPhaseText(); if (text) { wxString str; str.Printf(wxT("%d"), (int) startphase); text->SetValue(str); } text = GetDepthText(); if (text) { wxString str; str.Printf(wxT("%d"), (int) depth); text->SetValue(str); } text = GetFeedbackText(); if (text) { wxString str; str.Printf(wxT("%d"), (int) fb); text->SetValue(str); } return TRUE; }
bool WahwahDialog::TransferDataToWindow() { wxSlider *slider; slider = GetFreqSlider(); if (slider) slider->SetValue((int)(freq * 10)); slider = GetFreqOffSlider(); if (slider) slider->SetValue((int)freqoff); slider = GetDepthSlider(); if (slider) slider->SetValue((int)depth); slider = GetPhaseSlider(); if (slider) slider->SetValue((int)startphase); slider = GetResonanceSlider(); if (slider) slider->SetValue((int)(res * 10)); wxTextCtrl *text = GetFreqText(); if (text) { wxString str; str.Printf("%.1f", freq); text->SetValue(str); } text = GetFreqOffText(); if (text) { wxString str; str.Printf("%d", (int) freqoff); text->SetValue(str); } text = GetPhaseText(); if (text) { wxString str; str.Printf("%d", (int) startphase); text->SetValue(str); } text = GetDepthText(); if (text) { wxString str; str.Printf("%d", (int) depth); text->SetValue(str); } text = GetResonanceText(); if (text) { wxString str; str.Printf("%.1f", res); text->SetValue(str); } return TRUE; }