Serializer of curves into XML files.
More...
#include <EqualizationCurves.h>
Serializer of curves into XML files.
Definition at line 63 of file EqualizationCurves.h.
◆ EQCurveWriter()
◆ SaveCurves()
void EQCurveWriter::SaveCurves |
( |
const wxString & |
fileName = {} | ) |
|
Definition at line 295 of file EqualizationCurves.cpp.
296{
298 if( fileName.empty() )
299 {
300
301
302
303
304
305
307
308
309 if( !
fn.DirExists() )
310 {
311
312 if( !
fn.Mkdir(
fn.GetPath(), 511, wxPATH_MKDIR_FULL ) )
313 {
314
315 return;
316 }
317 }
318 }
319 else
321
323
324 const wxString fullPath{
fn.GetFullPath() };
325 XMLFileWriter eqFile{ fullPath,
XO(
"Error Saving Equalization Curves") };
326
327
329
330 eqFile.Commit();
331 } );
332}
R GuardedCall(const F1 &body, const F2 &handler=F2::Default(), F3 delayedHandler=DefaultDelayedHandlerAction) noexcept(noexcept(handler(std::declval< AudacityException * >())) &&noexcept(handler(nullptr)) &&noexcept(std::function< void(AudacityException *)>{std::move(delayedHandler)}))
Execute some code on any thread; catch any AudacityException; enqueue error report on the main thread...
void WriteXML(XMLWriter &xmlFile) const
Wrapper to output XML data to files.
FILES_API FilePath DataDir()
Audacity user data directory.
References FileNames::DataDir(), fn, GuardedCall(), WriteXML(), wxT(), and XO().
Referenced by EqualizationCurvesDialog::OnExport(), and EqualizationUI::ValidateUI().
◆ WriteXML()
void EQCurveWriter::WriteXML |
( |
XMLWriter & |
xmlFile | ) |
const |
|
private |
Definition at line 455 of file EqualizationCurves.cpp.
457{
458
460
461
462 int numCurves =
mCurves.size();
463 int curve;
464 for( curve = 0; curve < numCurves; curve++ )
465 {
466
469
470
471 int numPoints =
mCurves[ curve ].points.size();
472 int point;
473 for( point = 0; point < numPoints; point++ )
474 {
475
480 }
481
482
484 }
485
486
487 xmlFile.
EndTag(
wxT(
"equalizationeffect" ) );
488}
virtual void StartTag(const wxString &name)
void WriteAttr(const wxString &name, const Identifier &value)
virtual void EndTag(const wxString &name)
References wxT().
Referenced by SaveCurves().
◆ mCurves
The documentation for this class was generated from the following files: