audacia/src/AudacityLogger.h

61 lines
1.2 KiB
C
Raw Normal View History

2013-10-23 18:08:12 +00:00
/**********************************************************************
Audacity: A Digital Audio Editor
AudacityLogger.h
Dominic Mazzoni
This is the main source file for Audacity which handles
initialization and termination by subclassing wxApp.
**********************************************************************/
#ifndef __AUDACITY_LOGGER__
#define __AUDACITY_LOGGER__
#include "Audacity.h"
#include "Experimental.h"
#include "MemoryX.h"
#include <wx/log.h> // to inherit
#include <wx/event.h> // to inherit wxEvtHandler
2018-11-11 21:11:18 +00:00
class wxFrame;
2018-11-11 21:11:18 +00:00
class wxTextCtrl;
2013-10-23 18:08:12 +00:00
class AudacityLogger final : public wxEvtHandler, public wxLog {
2013-10-23 18:08:12 +00:00
public:
// Get the singleton instance or null
static AudacityLogger *Get();
2013-10-23 18:08:12 +00:00
void Show(bool show = true);
bool SaveLog(const FilePath &fileName) const;
#if defined(EXPERIMENTAL_CRASH_REPORT)
wxString GetLog();
#endif
2013-10-23 18:08:12 +00:00
protected:
void Flush() override;
void DoLogText(const wxString & msg) override;
2013-10-23 18:08:12 +00:00
private:
AudacityLogger();
2013-10-23 18:08:12 +00:00
void OnCloseWindow(wxCloseEvent & e);
void OnClose(wxCommandEvent & e);
void OnClear(wxCommandEvent & e);
void OnSave(wxCommandEvent & e);
Destroy_ptr<wxFrame> mFrame;
2013-10-23 18:08:12 +00:00
wxTextCtrl *mText;
wxString mBuffer;
bool mUpdated;
};
#endif