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::OnFeedbackSlider(wxCommandEvent & WXUNUSED(event)) { wxString str; long fb = GetFeedbackSlider()->GetValue(); if (fb > 0) // round to nearest multiple of 10 fb = ((fb + 5) / 10) * 10; else fb = ((fb - 5) / 10) * 10; str.Printf(wxT("%ld"), fb); GetFeedbackText()->SetValue(str); }
void PhaserDialog::OnFeedbackText(wxCommandEvent & WXUNUSED(event)) { wxTextCtrl *c = GetFeedbackText(); if (c) { long fb; c->GetValue().ToLong(&fb); fb = TrapLong(fb, FB_MIN, FB_MAX); wxSlider *slider = GetFeedbackSlider(); if (slider) slider->SetValue(fb); } }
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; }