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
|
/*
* CleanupSong.h
* ---------------
* Purpose: Dialog for cleaning up modules (rearranging, removing unused items).
* Notes : (currently none)
* Authors: OpenMPT Devs
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
*/
#pragma once
#include "openmpt/all/BuildSettings.hpp"
OPENMPT_NAMESPACE_BEGIN
class CModCleanupDlg: public CDialog
{
private:
enum CleanupOptions
{
// patterns
kCleanupPatterns = 0,
kRemovePatterns,
kRearrangePatterns,
kRemoveDuplicatePatterns,
// orders
kMergeSequences,
kRemoveOrders,
// samples
kCleanupSamples,
kRemoveSamples,
kRearrangeSamples,
kOptimizeSamples,
// instruments
kCleanupInstruments,
kRemoveAllInstruments,
// plugins
kCleanupPlugins,
kRemoveAllPlugins,
// misc
kResetVariables,
kCleanupChannels,
kNone,
kMaxCleanupOptions = kNone
};
CModDoc &modDoc;
static bool m_CheckBoxes[kMaxCleanupOptions]; // Checkbox state
static const WORD m_CleanupIDtoDlgID[kMaxCleanupOptions]; // Checkbox -> Control ID LUT
static const CleanupOptions m_MutuallyExclusive[kMaxCleanupOptions]; // Options that are mutually exclusive to each other.
// Actual cleanup implementations:
// Patterns
bool RemoveDuplicatePatterns();
bool RemoveUnusedPatterns(); // Remove unused patterns
bool RearrangePatterns(); // Rearrange patterns
bool RemoveAllPatterns();
// Orders
bool MergeSequences();
bool RemoveAllOrders();
// Samples
bool RemoveUnusedSamples(); // Remove unused samples
bool RemoveAllSamples();
bool RearrangeSamples(); // Rearrange sample list
bool OptimizeSamples(); // Remove unused sample data
// Instruments
bool RemoveUnusedInstruments(); // Remove unused instruments
bool RemoveAllInstruments();
// Plugins
bool RemoveUnusedPlugins(); // Remove ununsed plugins
bool RemoveAllPlugins();
// Misc
bool ResetVariables(); // Turn module into samplepack (convert to IT, remove patterns, etc.)
bool RemoveUnusedChannels();
public:
CModCleanupDlg(CModDoc &modParent, CWnd *parent) : CDialog(IDD_CLEANUP_SONG, parent), modDoc(modParent) { }
protected:
//{{AFX_VIRTUAL(CModCleanupDlg)
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_VIRTUAL
BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
//{{AFX_MSG(CModCleanupDlg)
afx_msg void OnPresetCleanupSong();
afx_msg void OnPresetCompoCleanup();
afx_msg void OnVerifyMutualExclusive();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
OPENMPT_NAMESPACE_END
|