forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSneedacityLogger.h
68 lines (44 loc) · 1.41 KB
/
SneedacityLogger.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**********************************************************************
Sneedacity: A Digital Audio Editor
SneedacityLogger.h
Dominic Mazzoni
This is the main source file for Sneedacity which handles
initialization and termination by subclassing wxApp.
**********************************************************************/
#ifndef __SNEEDACITY_LOGGER__
#define __SNEEDACITY_LOGGER__
#include "MemoryX.h"
#include "Prefs.h"
#include <wx/log.h> // to inherit
#include <wx/event.h> // to inherit wxEvtHandler
class wxFrame;
class wxTextCtrl;
class SNEEDACITY_DLL_API SneedacityLogger final : public wxEvtHandler,
public wxLog,
public PrefsListener
{
public:
~SneedacityLogger() override;
// Get the singleton instance or null
static SneedacityLogger *Get();
void Show(bool show = true);
bool SaveLog(const wxString &fileName) const;
bool ClearLog();
wxString GetLog(int count = 0);
protected:
void Flush() override;
void DoLogText(const wxString & msg) override;
private:
SneedacityLogger();
void OnCloseWindow(wxCloseEvent & e);
void OnClose(wxCommandEvent & e);
void OnClear(wxCommandEvent & e);
void OnSave(wxCommandEvent & e);
// PrefsListener implementation
void UpdatePrefs() override;
Destroy_ptr<wxFrame> mFrame;
wxTextCtrl *mText;
wxString mBuffer;
bool mUpdated;
};
#endif