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

Method OnAutoSavePathButton_Click

src/TimerRecordDialog.cpp:344–380  ·  view source on GitHub ↗

New events for timer recording automation

Source from the content-addressed store, hash-verified

342
343// New events for timer recording automation
344void TimerRecordDialog::OnAutoSavePathButton_Click(wxCommandEvent& WXUNUSED(event))
345{
346 auto &projectFileIO = ProjectFileIO::Get(mProject);
347
348 wxString fName = SelectFile(FileNames::Operation::Export,
349 XO("Save Timer Recording As"),
350 m_fnAutoSaveFile.GetPath(),
351 m_fnAutoSaveFile.GetFullName(),
352 wxT("aup3"),
353 { FileNames::AudacityProjects },
354 wxFD_SAVE | wxRESIZE_BORDER,
355 this);
356
357 if (fName.empty())
358 return;
359
360 // If project already exists then abort - we do not allow users to overwrite an existing project
361 // unless it is the current project.
362 if (wxFileExists(fName) && (projectFileIO.GetFileName() != fName)) {
363 AudacityMessageDialog m(
364 nullptr,
365 XO("The selected file name could not be used\nfor Timer Recording because it \
366would overwrite another project.\nPlease try again and select an original name."),
367 XO("Error Saving Timer Recording Project"),
368 wxOK|wxICON_ERROR );
369 m.ShowModal();
370 return;
371 }
372
373 // Set this boolean to false so we now do a SaveAs at the end of the recording
374 // unless we're saving the current project.
375 m_bProjectAlreadySaved = projectFileIO.GetFileName() == fName? true : false;
376
377 m_fnAutoSaveFile = fName;
378 m_fnAutoSaveFile.SetExt(wxT("aup3"));
379 this->UpdateTextBoxControls();
380}
381
382void TimerRecordDialog::OnAutoExportPathButton_Click(wxCommandEvent& WXUNUSED(event))
383{

Callers

nothing calls this directly

Calls 7

UpdateTextBoxControlsMethod · 0.95
GetFunction · 0.85
SelectFileFunction · 0.85
GetFullNameMethod · 0.80
GetPathMethod · 0.45
emptyMethod · 0.45
ShowModalMethod · 0.45

Tested by

no test coverage detected