| 96 | } |
| 97 | |
| 98 | ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, |
| 99 | const TranslatableString & title, |
| 100 | const wxPoint & pos): |
| 101 | wxDialogWrapper(parent, id, title, pos, wxDefaultSize, |
| 102 | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX ) |
| 103 | { |
| 104 | SetName(); |
| 105 | |
| 106 | mT0 = 0.0; |
| 107 | mT1 = 0.0; |
| 108 | foregrounddB = 0.0; |
| 109 | backgrounddB = 0.0; |
| 110 | mForegroundIsDefined = false; |
| 111 | mBackgroundIsDefined = false; |
| 112 | |
| 113 | // NULL out the control members until the controls are created. |
| 114 | mForegroundStartT = NULL; |
| 115 | mForegroundEndT = NULL; |
| 116 | mBackgroundStartT = NULL; |
| 117 | mBackgroundEndT = NULL; |
| 118 | wxString number; |
| 119 | |
| 120 | auto p = FindProjectFromWindow( this ); |
| 121 | mProjectRate = ProjectRate::Get(*p).GetRate(); |
| 122 | |
| 123 | const auto options = NumericTextCtrl::Options{} |
| 124 | .AutoPos(true) |
| 125 | .MenuEnabled(false) |
| 126 | .ReadOnly(true); |
| 127 | |
| 128 | ShuttleGui S(this, eIsCreating); |
| 129 | |
| 130 | S.SetBorder(5); |
| 131 | S.StartHorizontalLay(wxCENTER, false); |
| 132 | { |
| 133 | S.AddTitle( |
| 134 | /* i18n-hint: RMS abbreviates root mean square, a certain averaging method */ |
| 135 | XO("Contrast Analyzer, for measuring RMS volume differences between two selections of audio.")); |
| 136 | } |
| 137 | S.EndHorizontalLay(); |
| 138 | S.StartStatic( XO("Parameters") ); |
| 139 | { |
| 140 | S.StartMultiColumn(5, wxEXPAND); |
| 141 | { |
| 142 | |
| 143 | // Headings |
| 144 | S.AddFixedText( {} ); // spacer |
| 145 | S.AddFixedText(XO("Start")); |
| 146 | S.AddFixedText(XO("End")); |
| 147 | S.AddFixedText( {} ); // spacer |
| 148 | S.AddFixedText(XO("Volume ")); |
| 149 | |
| 150 | //Foreground |
| 151 | S.AddFixedText(XO("&Foreground:"), false); |
| 152 | if (S.GetMode() == eIsCreating) |
| 153 | { |
| 154 | mForegroundStartT = safenew |
| 155 | NumericTextCtrl(FormatterContext::SampleRateContext(mProjectRate), |
nothing calls this directly
no test coverage detected