/
MainFrm.h
430 lines (383 loc) · 15 KB
/
MainFrm.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
/*
** FamiTracker - NES/Famicom sound tracker
** Copyright (C) 2005-2014 Jonathan Liss
**
** 0CC-FamiTracker is (C) 2014-2015 HertzDevil
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Library General Public License for more details. To obtain a
** copy of the GNU Library General Public License, write to the Free
** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Any permitted reproduction of these routines, in whole or in part,
** must bear this legend.
*/
#pragma once
// CMainFrame, the main window class
#include "InstrumentEditDlg.h"
#include "PerformanceDlg.h"
#include "DialogReBar.h"
#include "ControlPanelDlg.h"
#include "CustomControls.h"
#include "FindDlg.h" // // //
enum frame_edit_pos_t {
FRAME_EDIT_POS_TOP,
FRAME_EDIT_POS_LEFT
};
enum {
WM_USER_DISPLAY_MESSAGE_STRING = WM_USER,
WM_USER_DISPLAY_MESSAGE_ID
};
class CVisualizerWnd;
class CInstrumentFileTree;
class CAction;
class CActionHandler;
class CFrameEditor;
class CGrooveDlg; // // //
class CBookmarkDlg;
class CSwapDlg;
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
CFrameEditor *GetFrameEditor() const;
// Operations
public:
void SetStatusText(LPCTSTR Text,...);
void ChangeNoteState(int Note);
// Indicators & controls
void SetIndicatorTime(int Min, int Sec, int MSec);
void SetIndicatorPos(int Frame, int Row);
void SetSongInfo(const char *pName, const char *pArtist, const char *pCopyright);
void SetupColors();
void DisplayOctave();
void UpdateTrackBox();
void UpdateControls();
void ResizeFrameWindow();
void SetHighlightRows(stHighlight Hl); // // //
void UpdateMenus();
void UpdateMenu(CMenu *pMenu); // // //
// Instrument
void OpenInstrumentEditor();
void CloseInstrumentEditor();
void UpdateInstrumentList();
void SelectInstrument(int Index);
int GetSelectedInstrument() const;
void SwapInstruments(int First, int Second);
// Track
int GetSelectedTrack() const;
void SelectTrack(unsigned int Track);
// Undo/redo
bool AddAction(CAction *pAction);
CAction *GetLastAction(int Filter) const;
void ResetUndo();
bool ChangeAllPatterns() const;
void CloseGrooveSettings(); // // //
void CloseBookmarkSettings(); // // //
void UpdateBookmarkList(int Pos = -1); // // //
void ResetFind(); // // //
bool TypeInstrumentNumber(int Digit); // // //
// Overrides
public:
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
private:
bool CreateDialogPanels();
bool CreateToolbars();
bool CreateInstrumentToolbar();
bool CreateVisualizerWindow();
void SetSpeed(int Speed);
void SetTempo(int Tempo);
void SetRowCount(int Count);
void SetFrameCount(int Count);
// Instrument list operations
void NewInstrument(int ChipType);
void ClearInstrumentList();
void GetInstrumentName(char *pText) const;
void SetInstrumentName(char *pText);
void SetFrameEditorPosition(int Position);
void SelectInstrumentFolder();
bool CheckRepeat() const;
void CheckAudioStatus();
void ShowInstrumentNumberText(); // // //
private: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CReBar m_wndToolBarReBar;
CDialogReBar m_wndOctaveBar;
CDialogBar m_wndControlBar; // Parent to frame editor and settings/instrument editor
CDialogBar m_wndVerticalControlBar; // Parent to large frame editor
CDialogBar m_wndFindControlBar; // // // Parent to find / replace dialog
CControlPanelDlg m_wndDialogBar;
CControlPanelDlg m_wndFrameControls; // Contains +, - and change all
CWnd m_wndInstToolBarWnd;
CToolBar m_wndInstToolBar;
CReBarCtrl m_wndInstToolReBar;
CInstrumentEditDlg m_wndInstEdit;
CFrameEditor *m_pFrameEditor;
CInstrumentList *m_pInstrumentList;
CImageList *m_pImageList;
CVisualizerWnd *m_pVisualizerWnd;
CGrooveDlg *m_pGrooveDlg; // // //
CFindDlg *m_pFindDlg; // // //
CBookmarkDlg *m_pBookmarkDlg; // // //
CPerformanceDlg *m_pPerformanceDlg; // // //
CLockedEdit *m_pLockedEditSpeed;
CLockedEdit *m_pLockedEditTempo;
CLockedEdit *m_pLockedEditLength;
CLockedEdit *m_pLockedEditFrames;
CLockedEdit *m_pLockedEditStep;
CLockedEdit *m_pLockedEditHighlight1; // // //
CLockedEdit *m_pLockedEditHighlight2; // // //
CButton *m_pButtonGroove; // // //
CButton *m_pButtonFixTempo; // // //
CBannerEdit *m_pBannerEditName;
CBannerEdit *m_pBannerEditArtist;
CBannerEdit *m_pBannerEditCopyright;
CBitmap m_bmToolbar; // main toolbar
CImageList m_ilToolBar;
CBitmap m_bmInstToolbar; // instrument toolbar
CImageList m_ilInstToolBar;
CActionHandler *m_pActionHandler;
int m_iFrameEditorPos;
CInstrumentFileTree *m_pInstrumentFileTree;
// State variables
int m_iOctave; // Selected octave
int m_iInstrument; // Selected instrument
int m_iTrack; // Selected track
int m_iInstNumDigit; // // //
int m_iInstNumCurrent;
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle = WS_OVERLAPPEDWINDOW, const RECT& rect = rectDefault, CWnd* pParentWnd = NULL, LPCTSTR lpszMenuName = NULL, DWORD dwExStyle = 0, CCreateContext* pContext = NULL);
// Generated message map functions
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
virtual BOOL DestroyWindow();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
afx_msg void OnDeltaposTempoSpin(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDeltaposSpeedSpin(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDeltaposRowsSpin(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDeltaposFrameSpin(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDeltaposKeyStepSpin(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnInstNameChange();
afx_msg void OnTrackerTogglePlay();
afx_msg void OnTrackerPlay();
afx_msg void OnTrackerPlayStart();
afx_msg void OnTrackerPlayCursor();
afx_msg void OnTrackerPlaypattern();
afx_msg void OnTrackerStop();
afx_msg void OnTrackerKillsound();
afx_msg void OnCreateNSF();
afx_msg void OnCreateWAV();
afx_msg void OnNextFrame();
afx_msg void OnPrevFrame();
afx_msg void OnBnClickedIncFrame();
afx_msg void OnBnClickedDecFrame();
afx_msg void OnKeyRepeat();
afx_msg void OnEnKeyStepChange();
afx_msg void OnHelpPerformance();
afx_msg void OnUpdateSBTempo(CCmdUI *pCmdUI);
afx_msg void OnUpdateSBPosition(CCmdUI *pCmdUI);
afx_msg void OnUpdateSBInstrument(CCmdUI *pCmdUI);
afx_msg void OnUpdateSBOctave(CCmdUI *pCmdUI);
afx_msg void OnUpdateSBFrequency(CCmdUI *pCmdUI);
afx_msg void OnUpdateSBChip(CCmdUI *pCmdUI);
afx_msg void OnUpdateKeyStepEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateSpeedEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateTempoEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateRowsEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateFramesEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateKeyRepeat(CCmdUI *pCmdUI);
afx_msg void OnUpdateInsertFrame(CCmdUI *pCmdUI);
afx_msg void OnUpdateRemoveFrame(CCmdUI *pCmdUI);
afx_msg void OnUpdateDuplicateFrame(CCmdUI *pCmdUI);
afx_msg void OnUpdateModuleMoveframedown(CCmdUI *pCmdUI);
afx_msg void OnUpdateModuleMoveframeup(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentNew(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentRemove(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentClone(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentDeepClone(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentLoad(CCmdUI *pCmdUI);
afx_msg void OnUpdateInstrumentSave(CCmdUI *pCmdUI);
afx_msg void OnUpdateNextSong(CCmdUI *pCmdUI);
afx_msg void OnUpdatePrevSong(CCmdUI *pCmdUI);
afx_msg void OnUpdateViewControlpanel(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditCut(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditCopy(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditPaste(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditDelete(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditEnablemidi(CCmdUI *pCmdUI);
afx_msg void OnUpdateSelectionEnabled(CCmdUI *pCmdUI);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnFileGeneralsettings();
afx_msg void OnEnSongNameChange();
afx_msg void OnEnSongArtistChange();
afx_msg void OnEnSongCopyrightChange();
afx_msg void OnFileImportText();
afx_msg void OnFileExportText();
afx_msg void OnEnKillfocusTempo();
afx_msg void OnModuleInsertFrame();
afx_msg void OnModuleRemoveFrame();
afx_msg void OnModuleDuplicateFrame();
afx_msg void OnModuleDuplicateFramePatterns();
afx_msg void OnModuleChannels();
afx_msg void OnModuleComments();
afx_msg void OnModuleModuleproperties();
afx_msg void OnModuleMoveframedown();
afx_msg void OnModuleMoveframeup();
afx_msg void OnLoadInstrument();
afx_msg void OnSaveInstrument();
afx_msg void OnEditInstrument();
afx_msg void OnAddInstrument();
afx_msg void OnRemoveInstrument();
afx_msg void OnCloneInstrument();
afx_msg void OnDeepCloneInstrument();
afx_msg void OnBnClickedEditInst();
afx_msg void OnCbnSelchangeSong();
afx_msg void OnCbnSelchangeOctave();
afx_msg void OnRemoveFocus();
afx_msg void OnNextSong();
afx_msg void OnPrevSong();
afx_msg void OnTrackerSwitchToInstrument();
afx_msg void OnUpdateTrackerSwitchToInstrument(CCmdUI *pCmdUI);
afx_msg void OnClickedFollow();
afx_msg void OnToggleFollow();
afx_msg void OnViewControlpanel();
// // //
afx_msg void OnTrackerDisplayRegisterState();
afx_msg void OnSelectPatternEditor();
afx_msg void OnSelectFrameEditor();
afx_msg void OnHelpEffecttable();
afx_msg void OnHelpFAQ();
afx_msg void OnDestroy();
afx_msg void OnNextInstrument();
afx_msg void OnPrevInstrument();
afx_msg void OnNewInstrumentMenu(NMHDR * pNotifyStruct, LRESULT * result);
afx_msg void OnLoadInstrumentMenu(NMHDR * pNotifyStruct, LRESULT * result);
afx_msg void OnAddInstrument2A03();
afx_msg void OnAddInstrumentVRC6();
afx_msg void OnAddInstrumentVRC7();
afx_msg void OnAddInstrumentFDS();
afx_msg void OnAddInstrumentMMC5();
afx_msg void OnAddInstrumentN163();
afx_msg void OnAddInstrumentS5B();
afx_msg void OnEditUndo();
afx_msg void OnEditRedo();
afx_msg void OnEditCut();
afx_msg void OnEditCopy();
afx_msg void OnEditPaste();
afx_msg void OnEditDelete();
afx_msg void OnEditSelectall();
afx_msg void OnEditExpandpatterns();
afx_msg void OnEditShrinkpatterns();
afx_msg void OnEditClearPatterns();
afx_msg void OnEditRemoveUnusedInstruments();
afx_msg void OnEditRemoveUnusedPatterns();
afx_msg void OnEditMergeDuplicatedPatterns();
afx_msg void OnEditEnableMIDI();
afx_msg void OnUpdateEditUndo(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditRedo(CCmdUI *pCmdUI);
afx_msg void OnDecayFast();
afx_msg void OnDecaySlow();
afx_msg void OnFrameeditorTop();
afx_msg void OnFrameeditorLeft();
afx_msg void OnUpdateFrameeditorTop(CCmdUI *pCmdUI);
afx_msg void OnUpdateFrameeditorLeft(CCmdUI *pCmdUI);
afx_msg void OnToggleSpeed();
afx_msg LRESULT OnDisplayMessageString(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnDisplayMessageID(WPARAM wParam, LPARAM lParam);
// // // Moved from CFamiTrackerView
afx_msg void OnTrackerPal();
afx_msg void OnTrackerNtsc();
afx_msg void OnSpeedDefault();
afx_msg void OnSpeedCustom();
afx_msg void OnUpdateTrackerPal(CCmdUI *pCmdUI);
afx_msg void OnUpdateTrackerNtsc(CCmdUI *pCmdUI);
afx_msg void OnUpdateSpeedDefault(CCmdUI *pCmdUI);
afx_msg void OnUpdateSpeedCustom(CCmdUI *pCmdUI);
// // //
afx_msg void OnToggleGroove();
afx_msg void OnToggleFixTempo();
afx_msg void OnClickedCompact();
afx_msg void OnTypeInstrumentNumber();
afx_msg void OnToggleCompact();
afx_msg void OnUpdateHighlight1(CCmdUI *pCmdUI);
afx_msg void OnUpdateHighlight2(CCmdUI *pCmdUI);
afx_msg void OnDeltaposHighlightSpin1(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnDeltaposHighlightSpin2(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnFileExportRows();
afx_msg void OnEditCopyAsText();
afx_msg void OnEditCopyAsVolumeSequence();
afx_msg void OnEditCopyAsPPMCK();
afx_msg void OnEditSelectnone();
afx_msg void OnEditSelectrow();
afx_msg void OnEditSelectcolumn();
afx_msg void OnEditSelectpattern();
afx_msg void OnEditSelectframe();
afx_msg void OnEditSelectchannel();
afx_msg void OnEditSelecttrack();
afx_msg void OnEditFindToggle();
afx_msg void OnFindNext();
afx_msg void OnFindPrevious();
afx_msg void OnEditGoto();
afx_msg void OnEditSwapChannels();
afx_msg void OnEditStretchpatterns();
afx_msg void OnEditTransposeCustom();
afx_msg void OnEditRemoveUnusedSamples();
afx_msg void OnEditPopulateUniquePatterns();
afx_msg void OnModuleDuplicateCurrentPattern();
afx_msg void OnModuleGrooveSettings();
afx_msg void OnModuleBookmarkSettings();
afx_msg void OnModuleEstimateSongLength();
afx_msg void OnTrackerPlayMarker(); // // // 050B
afx_msg void OnTrackerSetMarker(); // // // 050B
afx_msg void OnTrackerDisplayAverageBPM(); // // // 050B
afx_msg void OnTrackerDisplayChannelState(); // // // 050B
afx_msg void OnToggleMultiplexer();
afx_msg void OnUpdateEditCopySpecial(CCmdUI *pCmdUI);
afx_msg void OnUpdateSelectMultiFrame(CCmdUI *pCmdUI);
afx_msg void OnUpdateToggleFollow(CCmdUI *pCmdUI);
afx_msg void OnUpdateToggleCompact(CCmdUI *pCmdUI);
afx_msg void OnUpdateToggleFixTempo(CCmdUI *pCmdUI);
afx_msg void OnUpdateGrooveEdit(CCmdUI *pCmdUI);
afx_msg void OnUpdateEditFindToggle(CCmdUI *pCmdUI);
afx_msg void OnUpdateTrackerPlayMarker(CCmdUI *pCmdUI); // // // 050B
afx_msg void OnUpdateDisplayAverageBPM(CCmdUI *pCmdUI); // // // 050B
afx_msg void OnUpdateDisplayChannelState(CCmdUI *pCmdUI); // // // 050B
afx_msg void OnUpdateDisplayRegisterState(CCmdUI *pCmdUI);
afx_msg void OnEasterEggKraid1(); // Easter Egg
afx_msg void OnEasterEggKraid2();
afx_msg void OnEasterEggKraid3();
afx_msg void OnEasterEggKraid4();
afx_msg void OnEasterEggKraid5();
private:
int m_iKraidCounter;
protected:
virtual void OnUpdateFrameTitle(BOOL bAddToTitle);
public:
afx_msg void OnViewToolbar();
};