Audacity 3.2.0
NyqBench.h
Go to the documentation of this file.
1/**********************************************************************
2
3 NyqBench.h
4
5 Leland Lucius
6
7**********************************************************************/
8
9#ifndef __NYQUIST_EFFECT_WORKBENCH__
10#define __NYQUIST_EFFECT_WORKBENCH__
11
12#include <wx/fdrepdlg.h> // wxFindReplaceData member variable
13#include <wx/frame.h> // to inherit
14#include <wx/string.h>
15
16#include <iostream>
17#include <ostream>
18#include <sstream>
19
20#include "CommandManager.h"
22
23class wxFileName;
24
25//----------------------------------------------------------------------------
26// NyqTextCtrl
27//----------------------------------------------------------------------------
28
29class NyqTextCtrl:public wxTextCtrl
30{
31 public:
32 NyqTextCtrl(wxWindow *parent,
33 wxWindowID id,
34 const wxString & value,
35 const wxPoint & pos,
36 const wxSize & size,
37 int style = 0);
38
39 void SetFocusFromKbd();
40 void MarkDirty();
41
42 void GoMatch();
43 void GoTop();
44 void GoUp();
45 void GoPrev();
46 void GoNext();
47
48 private:
49#if defined(__WXMAC__REMOVED_UNTIL_ITS_PROVEN_THAT_IT_IS_STILL_NEEDED)
50 void OnKeyDown(wxKeyEvent & e);
51#endif
52 void OnKeyUp(wxKeyEvent & e);
53 void OnChar(wxKeyEvent & e);
54 void OnUpdate(wxUpdateUIEvent & e);
55
56 void MoveCursor(long first, long second);
57 void Colorize(long left, long right);
58 void FindParens();
59
60 private:
61 wxLongToLongHashMap mLeftParens;
62 wxLongToLongHashMap mRightParens;
63
66
68
69 wxTextAttr mOn;
70 wxTextAttr mOff;
71
73};
74
75//----------------------------------------------------------------------------
76// NyqRedirector
77//----------------------------------------------------------------------------
78
79class NyqRedirector:wxSTD streambuf
80{
81 public:
83 virtual ~NyqRedirector();
84
85 int overflow(int c);
86
87 private:
88 void AppendText();
89
90 std::string s;
91 std::streambuf *mOld;
93};
94
95//----------------------------------------------------------------------------
96// NyqBench
97//----------------------------------------------------------------------------
98
99class NyqBench:public wxFrame
100{
101 public:
102 NyqBench(wxWindow *parent);
103 virtual ~NyqBench();
104
105 virtual bool Validate();
106
107 void ShowNyqBench(const CommandContext&);
108
109 static NyqBench *GetBench();
110 void SavePrefs();
111
112 private:
114
115 void OnClose(wxCloseEvent & e);
116 void OnMove(wxMoveEvent & e);
117 void OnSize(wxSizeEvent & e);
118
119 void OnNew(wxCommandEvent & e);
120 void OnOpen(wxCommandEvent & e);
121 void OnSave(wxCommandEvent & e);
122 void OnSaveAs(wxCommandEvent & e);
123 void OnRevert(wxCommandEvent & e);
124 void OnAutoLoad(wxCommandEvent & e);
125 void OnCloseWindow(wxCommandEvent & e);
126
127 void OnUndo(wxCommandEvent & e);
128 void OnRedo(wxCommandEvent & e);
129 void OnCut(wxCommandEvent & e);
130 void OnCopy(wxCommandEvent & e);
131 void OnPaste(wxCommandEvent & e);
132 void OnClear(wxCommandEvent & e);
133 void OnSelectAll(wxCommandEvent & e);
134 void OnFind(wxCommandEvent & e);
135 void OnGoMatch(wxCommandEvent & e);
136 void OnGoTop(wxCommandEvent & e);
137 void OnGoUp(wxCommandEvent & e);
138 void OnGoPrev(wxCommandEvent & e);
139 void OnGoNext(wxCommandEvent & e);
140 void OnAutoWrap(wxCommandEvent & e);
141
142 void OnFont(wxCommandEvent & e);
143 void OnSplitV(wxCommandEvent & e);
144 void OnSplitH(wxCommandEvent & e);
145 void OnToggleCode(wxCommandEvent & e);
146 void OnToggleOutput(wxCommandEvent & e);
147 void OnSmallIcons(wxCommandEvent & e);
148 void OnLargeIcons(wxCommandEvent & e);
149
150 void OnGo(wxCommandEvent & e);
151 void OnStop(wxCommandEvent & e);
152
153 void OnAbout(wxCommandEvent & e);
154
155 void OnFindDialog(wxFindDialogEvent & e);
156
157 void OnTextUpdate(wxCommandEvent & e);
158
159 void OnMenuUpdate(wxUpdateUIEvent & e);
160
161 void OnUndoUpdate(wxUpdateUIEvent & e);
162 void OnRedoUpdate(wxUpdateUIEvent & e);
163 void OnCutUpdate(wxUpdateUIEvent & e);
164 void OnCopyUpdate(wxUpdateUIEvent & e);
165 void OnPasteUpdate(wxUpdateUIEvent & e);
166 void OnClearUpdate(wxUpdateUIEvent & e);
167
168 void OnViewUpdate(wxUpdateUIEvent & e);
169
170 void OnRunUpdate(wxUpdateUIEvent & e);
171
172 void OnScriptUpdate(wxUpdateUIEvent & e);
173 void OnOutputUpdate(wxUpdateUIEvent & e);
174
175 void SetWindowTitle();
176
177 void RecreateToolbar(bool large = false);
178
179 void LoadFile();
180
181 private:
182 wxStaticBox *mScriptBox;
183 wxStaticBox *mOutputBox;
186 wxSplitterWindow *mSplitter;
187
188 wxFindReplaceDialog *mFindDlg;
189 wxFindReplaceData mFindData;
191
193
196
197 wxBitmap mPics[20];
198
202
204
206
207 wxFileName mPath;
210
211 wxRect mLastSize;
212
214};
215
216#endif
#define S(N)
Definition: ToChars.cpp:64
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
bool mShowCode
Definition: NyqBench.h:200
wxStaticBox * mOutputBox
Definition: NyqBench.h:183
int mSplitMode
Definition: NyqBench.h:199
void OnScriptUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1551
void OnGoPrev(wxCommandEvent &e)
Definition: NyqBench.cpp:1170
void OnPasteUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1507
void OnMenuUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1477
void OnCopy(wxCommandEvent &e)
Definition: NyqBench.cpp:1107
void OnCloseWindow(wxCommandEvent &e)
Definition: NyqBench.cpp:973
wxFileName mPath
Definition: NyqBench.h:207
static NyqBench * GetBench()
Definition: NyqBench.cpp:637
void OnClearUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1512
wxFont mOutputFont
Definition: NyqBench.h:195
void OnOpen(wxCommandEvent &e)
Definition: NyqBench.cpp:996
wxFindReplaceData mFindData
Definition: NyqBench.h:189
void OnSmallIcons(wxCommandEvent &e)
Definition: NyqBench.cpp:1317
NyqTextCtrl * mOutput
Definition: NyqBench.h:185
void OnAbout(wxCommandEvent &e)
Definition: NyqBench.cpp:1365
void OnAutoWrap(wxCommandEvent &e)
Definition: NyqBench.cpp:1180
void OnFind(wxCommandEvent &e)
Definition: NyqBench.cpp:1127
virtual ~NyqBench()
Definition: NyqBench.cpp:805
void OnToggleOutput(wxCommandEvent &e)
Definition: NyqBench.cpp:1291
wxFont mScriptFont
Definition: NyqBench.h:194
void OnCutUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1497
void OnFont(wxCommandEvent &e)
Definition: NyqBench.cpp:1216
NyqTextCtrl * mScript
Definition: NyqBench.h:184
virtual bool Validate()
Definition: NyqBench.cpp:1575
void OnClose(wxCloseEvent &e)
Definition: NyqBench.cpp:947
void OnSplitH(wxCommandEvent &e)
Definition: NyqBench.cpp:1256
bool mLargeIcons
Definition: NyqBench.h:203
void OnFindDialog(wxFindDialogEvent &e)
Definition: NyqBench.cpp:1380
void OnRedoUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1492
void OnSaveAs(wxCommandEvent &e)
Definition: NyqBench.cpp:1042
NyqTextCtrl * mFindText
Definition: NyqBench.h:190
void OnRedo(wxCommandEvent &e)
Definition: NyqBench.cpp:1097
bool mAutoWrap
Definition: NyqBench.h:209
void LoadFile()
Definition: NyqBench.cpp:1695
void OnMove(wxMoveEvent &e)
Definition: NyqBench.cpp:957
void OnCopyUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1502
wxSplitterWindow * mSplitter
Definition: NyqBench.h:186
void OnLargeIcons(wxCommandEvent &e)
Definition: NyqBench.cpp:1322
void OnAutoLoad(wxCommandEvent &e)
Definition: NyqBench.cpp:1074
wxBitmap mPics[20]
Definition: NyqBench.h:197
void OnUndo(wxCommandEvent &e)
Definition: NyqBench.cpp:1092
DECLARE_EVENT_TABLE()
void OnRunUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1528
void SavePrefs()
Definition: NyqBench.cpp:809
void OnOutputUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1563
void OnUndoUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1487
void OnSplitV(wxCommandEvent &e)
Definition: NyqBench.cpp:1247
void OnRevert(wxCommandEvent &e)
Definition: NyqBench.cpp:1079
void OnToggleCode(wxCommandEvent &e)
Definition: NyqBench.cpp:1265
void OnNew(wxCommandEvent &e)
Definition: NyqBench.cpp:978
void OnCut(wxCommandEvent &e)
Definition: NyqBench.cpp:1102
void OnSelectAll(wxCommandEvent &e)
Definition: NyqBench.cpp:1122
void OnViewUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:1517
void OnGoMatch(wxCommandEvent &e)
Definition: NyqBench.cpp:1155
void RecreateToolbar(bool large=false)
Definition: NyqBench.cpp:1602
void OnClear(wxCommandEvent &e)
Definition: NyqBench.cpp:1117
void ShowNyqBench(const CommandContext &)
Definition: NyqBench.cpp:1725
NyqBench(wxWindow *parent)
Definition: NyqBench.cpp:647
wxRect mLastSize
Definition: NyqBench.h:211
void OnGoUp(wxCommandEvent &e)
Definition: NyqBench.cpp:1165
void SetWindowTitle()
Definition: NyqBench.cpp:1591
wxFindReplaceDialog * mFindDlg
Definition: NyqBench.h:188
void OnGoNext(wxCommandEvent &e)
Definition: NyqBench.cpp:1175
void OnGo(wxCommandEvent &e)
Definition: NyqBench.cpp:1327
void OnStop(wxCommandEvent &e)
Definition: NyqBench.cpp:1359
bool mRunning
Definition: NyqBench.h:205
void OnPaste(wxCommandEvent &e)
Definition: NyqBench.cpp:1112
bool mAutoLoad
Definition: NyqBench.h:208
void OnSave(wxCommandEvent &e)
Definition: NyqBench.cpp:1021
NyquistEffect * mEffect
Definition: NyqBench.h:192
void OnTextUpdate(wxCommandEvent &e)
Definition: NyqBench.cpp:1470
void PopulateOrExchange(ShuttleGui &S)
Definition: NyqBench.cpp:838
void OnGoTop(wxCommandEvent &e)
Definition: NyqBench.cpp:1160
void OnSize(wxSizeEvent &e)
Definition: NyqBench.cpp:965
wxStaticBox * mScriptBox
Definition: NyqBench.h:182
bool mShowOutput
Definition: NyqBench.h:201
NyqRedirector(NyqTextCtrl *text)
Definition: NyqBench.cpp:505
virtual ~NyqRedirector()
Definition: NyqBench.cpp:511
std::string s
Definition: NyqBench.h:90
NyqTextCtrl * mText
Definition: NyqBench.h:92
int overflow(int c)
Definition: NyqBench.cpp:520
void AppendText()
Definition: NyqBench.cpp:530
std::streambuf * mOld
Definition: NyqBench.h:91
wxTextAttr mOff
Definition: NyqBench.h:70
NyqTextCtrl(wxWindow *parent, wxWindowID id, const wxString &value, const wxPoint &pos, const wxSize &size, int style=0)
Definition: NyqBench.cpp:162
void FindParens()
Definition: NyqBench.cpp:427
wxLongToLongHashMap mLeftParens
Definition: NyqBench.h:61
void GoTop()
Definition: NyqBench.cpp:296
wxLongToLongHashMap mRightParens
Definition: NyqBench.h:62
void OnKeyUp(wxKeyEvent &e)
Definition: NyqBench.cpp:241
void SetFocusFromKbd()
Definition: NyqBench.cpp:178
wxTextAttr mOn
Definition: NyqBench.h:69
void MoveCursor(long first, long second)
Definition: NyqBench.cpp:380
long mRightParen
Definition: NyqBench.h:65
void GoUp()
Definition: NyqBench.cpp:318
void Colorize(long left, long right)
Definition: NyqBench.cpp:397
void GoPrev()
Definition: NyqBench.cpp:340
void MarkDirty()
Definition: NyqBench.cpp:189
long mLastCaretPos
Definition: NyqBench.h:67
void GoMatch()
Definition: NyqBench.cpp:291
void GoNext()
Definition: NyqBench.cpp:360
void OnChar(wxKeyEvent &e)
Definition: NyqBench.cpp:195
long mLeftParen
Definition: NyqBench.h:64
void OnUpdate(wxUpdateUIEvent &e)
Definition: NyqBench.cpp:264
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640