1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 07:40:23 +02:00

Add dump of active AUP3 XML doc to support data

This commit is contained in:
Leland Lucius 2021-02-13 01:58:09 -06:00
parent 5861ce3c66
commit b928e7e9f2
3 changed files with 20 additions and 2 deletions

View File

@ -25,6 +25,8 @@
#include "AudioIOBase.h"
#include "FileNames.h"
#include "Internat.h"
#include "Project.h"
#include "ProjectFileIO.h"
#include "prefs/GUIPrefs.h"
#include "widgets/ErrorDialog.h"
@ -64,9 +66,12 @@ void Generate(wxDebugReport::Context ctx)
auto gAudioIO = AudioIOBase::Get();
rpt.AddText(wxT("audiodev.txt"), gAudioIO->GetDeviceInfo(), wxT("Audio Device Info"));
#ifdef EXPERIMENTAL_MIDI_OUT
#ifdef EXPERIMENTAL_MIDI_OUT
rpt.AddText(wxT("mididev.txt"), gAudioIO->GetMidiDeviceInfo(), wxT("MIDI Device Info"));
#endif
#endif
auto project = GetActiveProject();
auto &projectFileIO = ProjectFileIO::Get( *project );
rpt.AddText(wxT("project.txt"), projectFileIO.GenerateDoc(), wxT("Active project doc"));
}
auto logger = AudacityLogger::Get();

View File

@ -288,6 +288,16 @@ DBConnection &ProjectFileIO::GetConnection()
return *curConn;
}
wxString ProjectFileIO::GenerateDoc()
{
auto &trackList = TrackList::Get( mProject );
XMLStringWriter doc;
WriteXMLHeader(doc);
WriteXML(doc, false, trackList.empty() ? nullptr : &trackList);
return doc;
}
sqlite3 *ProjectFileIO::DB()
{
return GetConnection().DB();

View File

@ -189,6 +189,9 @@ public:
//! Return a reference to a connection, creating it as needed on demand; throw on failure
DBConnection &GetConnection();
//! Return a strings representation of the active project XML doc
wxString GenerateDoc();
private:
void OnCheckpointFailure();