| 283 | } |
| 284 | |
| 285 | void VSTEditor::BuildPlain(EffectSettingsAccess &access, EffectType effectType, double projectRate) |
| 286 | { |
| 287 | wxASSERT(mParent); // To justify safenew |
| 288 | wxScrolledWindow *const scroller = safenew wxScrolledWindow(mParent, |
| 289 | wxID_ANY, |
| 290 | wxDefaultPosition, |
| 291 | wxDefaultSize, |
| 292 | wxVSCROLL | wxTAB_TRAVERSAL); |
| 293 | |
| 294 | { |
| 295 | auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL); |
| 296 | |
| 297 | // Try to give the window a sensible default/minimum size |
| 298 | scroller->SetMinSize(wxSize(wxMax(600, mParent->GetSize().GetWidth() * 2 / 3), |
| 299 | mParent->GetSize().GetHeight() / 2)); |
| 300 | scroller->SetScrollRate(0, 20); |
| 301 | |
| 302 | // This fools NVDA into not saying "Panel" when the dialog gets focus |
| 303 | scroller->SetName(wxT("\a")); |
| 304 | scroller->SetLabel(wxT("\a")); |
| 305 | |
| 306 | mainSizer->Add(scroller, 1, wxEXPAND | wxALL, 5); |
| 307 | mParent->SetSizer(mainSizer.release()); |
| 308 | } |
| 309 | |
| 310 | mNames.reinit(static_cast<size_t> (mNumParams)); |
| 311 | mSliders.reinit(static_cast<size_t> (mNumParams)); |
| 312 | mDisplays.reinit(static_cast<size_t>(mNumParams)); |
| 313 | mLabels.reinit(static_cast<size_t> (mNumParams)); |
| 314 | |
| 315 | { |
| 316 | auto paramSizer = std::make_unique<wxStaticBoxSizer>(wxVERTICAL, scroller, _("Effect Settings")); |
| 317 | |
| 318 | { |
| 319 | auto gridSizer = std::make_unique<wxFlexGridSizer>(4, 0, 0); |
| 320 | gridSizer->AddGrowableCol(1); |
| 321 | |
| 322 | // Add the duration control for generators |
| 323 | if (effectType == EffectTypeGenerate) |
| 324 | { |
| 325 | wxControl *item = safenew wxStaticText(scroller, 0, _("Duration:")); |
| 326 | gridSizer->Add(item, 0, wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT | wxALL, 5); |
| 327 | auto &extra = access.Get().extra; |
| 328 | mDuration = safenew |
| 329 | NumericTextCtrl(FormatterContext::SampleRateContext(projectRate), |
| 330 | scroller, ID_Duration, |
| 331 | NumericConverterType_TIME(), |
| 332 | extra.GetDurationFormat(), |
| 333 | extra.GetDuration(), |
| 334 | NumericTextCtrl::Options{} |
| 335 | .AutoPos(true)); |
| 336 | mDuration->SetName( XO("Duration") ); |
| 337 | gridSizer->Add(mDuration, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); |
| 338 | gridSizer->Add(1, 1, 0); |
| 339 | gridSizer->Add(1, 1, 0); |
| 340 | } |
| 341 | |
| 342 | // Find the longest parameter name. |
no test coverage detected