MCPcopy Create free account
hub / github.com/audacity/audacity / TimerRecordDialog

Method TimerRecordDialog

src/TimerRecordDialog.cpp:168–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166END_EVENT_TABLE()
167
168TimerRecordDialog::TimerRecordDialog(
169 wxWindow* parent, AudacityProject &project, bool bAlreadySaved)
170: wxDialogWrapper(parent, -1, XO("Audacity Timer Record"), wxDefaultPosition,
171 wxDefaultSize, wxCAPTION)
172, mProject{ project }
173{
174 SetName();
175
176 m_DateTime_Start = wxDateTime::UNow();
177 long seconds; // default duration is 1 hour = 3600 seconds
178 gPrefs->Read(wxT("/TimerRecord/LastDuration"), &seconds, 3600L);
179 m_TimeSpan_Duration = wxTimeSpan::Seconds(seconds);
180 m_DateTime_End = m_DateTime_Start + m_TimeSpan_Duration;
181
182 m_pDatePickerCtrl_Start = NULL;
183 m_pTimeTextCtrl_Start = NULL;
184
185 m_pDatePickerCtrl_End = NULL;
186 m_pTimeTextCtrl_End = NULL;
187
188 m_pTimeTextCtrl_Duration = NULL;
189
190 // Do we allow the user to change the Automatic Save file?
191 m_bProjectAlreadySaved = bAlreadySaved;
192
193 wxString exportPath;
194 DefaultExportAudioPath.Read(&exportPath);
195 if(exportPath.empty())
196 exportPath = FileNames::FindDefaultPath(FileNames::Operation::Export);
197 m_fnAutoExportFile.SetPath(exportPath);
198
199 m_fnAutoExportFile.SetName(mProject.GetProjectName());
200 if(m_fnAutoExportFile.GetName().IsEmpty())
201 m_fnAutoExportFile.SetName(_("untitled"));
202
203 DefaultExportAudioFormat.Read(&m_sAutoExportFormat);
204 if(!m_sAutoExportFormat.empty())
205 {
206 auto [plugin, formatIndex]
207 = ExportPluginRegistry::Get().FindFormat(m_sAutoExportFormat);
208
209 if(plugin != nullptr)
210 {
211 const auto formatInfo = plugin->GetFormatInfo(formatIndex);
212 m_fnAutoExportFile.SetExt(formatInfo.extensions[0]);
213 }
214 }
215
216 m_iAutoExportSampleRate = ProjectRate::Get(mProject).GetRate();
217 m_iAutoExportChannels = AudioIORecordChannels.Read();
218
219 ShuttleGui S(this, eIsCreating);
220 this->PopulateOrExchange(S);
221
222 // Set initial focus to "1" of "01h" in Duration NumericTextCtrl,
223 // instead of OK button (default).
224 m_pTimeTextCtrl_Duration->SetFocus();
225 m_pTimeTextCtrl_Duration->SetFieldFocus(3);

Callers

nothing calls this directly

Calls 15

PopulateOrExchangeMethod · 0.95
GetFunction · 0.85
GetProjectNameMethod · 0.80
FindFormatMethod · 0.80
SetFieldFocusMethod · 0.80
SetOwnerMethod · 0.80
ReadMethod · 0.45
emptyMethod · 0.45
SetPathMethod · 0.45
SetNameMethod · 0.45
IsEmptyMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected