mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 00:29:41 +02:00
... New files, but (almost) empty; don't use the global variable gAudioIO, but use one of two accessor function names (which are the same function for now). AudioIOBase will have fewer dependencies than AudioIO -- in particular, no dependency on tracks. It won't include StartStream. It will contain functions to query the present state of streams, and device capabilities.
79 lines
2.1 KiB
C++
79 lines
2.1 KiB
C++
/**********************************************************************
|
|
|
|
Audacity: A Digital Audio Editor
|
|
|
|
CrashReport.cpp
|
|
|
|
*//*******************************************************************/
|
|
|
|
#include "Audacity.h"
|
|
#include "CrashReport.h"
|
|
#include "Experimental.h"
|
|
|
|
#if defined(EXPERIMENTAL_CRASH_REPORT)
|
|
|
|
#include "wxFileNameWrapper.h"
|
|
#include "AudacityLogger.h"
|
|
#include "AudioIOBase.h"
|
|
#include "FileNames.h"
|
|
#include "Internat.h"
|
|
#include "prefs/GUIPrefs.h"
|
|
#include "widgets/ErrorDialog.h"
|
|
|
|
namespace CrashReport {
|
|
|
|
void Generate(wxDebugReport::Context ctx)
|
|
{
|
|
wxDebugReportCompress rpt;
|
|
rpt.AddAll(ctx);
|
|
|
|
wxFileNameWrapper fn{ FileNames::DataDir(), wxT("audacity.cfg") };
|
|
rpt.AddFile(fn.GetFullPath(), _TS("Audacity Configuration"));
|
|
rpt.AddFile(FileNames::PluginRegistry(), wxT("Plugin Registry"));
|
|
rpt.AddFile(FileNames::PluginSettings(), wxT("Plugin Settings"));
|
|
|
|
if (ctx == wxDebugReport::Context_Current)
|
|
{
|
|
auto saveLang = GUIPrefs::GetLang();
|
|
GUIPrefs::InitLang( wxT("en") );
|
|
auto cleanup = finally( [&]{ GUIPrefs::InitLang( saveLang ); } );
|
|
|
|
auto gAudioIO = AudioIOBase::Get();
|
|
rpt.AddText(wxT("audiodev.txt"), gAudioIO->GetDeviceInfo(), wxT("Audio Device Info"));
|
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
|
rpt.AddText(wxT("mididev.txt"), gAudioIO->GetMidiDeviceInfo(), wxT("MIDI Device Info"));
|
|
#endif
|
|
}
|
|
|
|
auto logger = AudacityLogger::Get();
|
|
if (logger)
|
|
{
|
|
rpt.AddText(wxT("log.txt"), logger->GetLog(), _TS("Audacity Log"));
|
|
}
|
|
|
|
bool ok = wxDebugReportPreviewStd().Show(rpt);
|
|
|
|
#if defined(__WXMSW__)
|
|
wxEventLoop::SetCriticalWindow(NULL);
|
|
#endif
|
|
|
|
if (ok && rpt.Process())
|
|
{
|
|
AudacityTextEntryDialog dlg(NULL,
|
|
_("Report generated to:"),
|
|
_("Audacity Support Data"),
|
|
rpt.GetCompressedFileName(),
|
|
wxOK | wxCENTER);
|
|
dlg.SetName(dlg.GetTitle());
|
|
dlg.ShowModal();
|
|
|
|
wxLogMessage(wxT("Report generated to: %s"),
|
|
rpt.GetCompressedFileName());
|
|
|
|
rpt.Reset();
|
|
}
|
|
}
|
|
|
|
}
|
|
#endif
|