CleanupSong.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * CleanupSong.h
  3. * ---------------
  4. * Purpose: Dialog for cleaning up modules (rearranging, removing unused items).
  5. * Notes : (currently none)
  6. * Authors: OpenMPT Devs
  7. * The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
  8. */
  9. #pragma once
  10. #include "openmpt/all/BuildSettings.hpp"
  11. OPENMPT_NAMESPACE_BEGIN
  12. class CModCleanupDlg: public CDialog
  13. {
  14. private:
  15. enum CleanupOptions
  16. {
  17. // patterns
  18. kCleanupPatterns = 0,
  19. kRemovePatterns,
  20. kRearrangePatterns,
  21. kRemoveDuplicatePatterns,
  22. // orders
  23. kMergeSequences,
  24. kRemoveOrders,
  25. // samples
  26. kCleanupSamples,
  27. kRemoveSamples,
  28. kRearrangeSamples,
  29. kOptimizeSamples,
  30. // instruments
  31. kCleanupInstruments,
  32. kRemoveAllInstruments,
  33. // plugins
  34. kCleanupPlugins,
  35. kRemoveAllPlugins,
  36. // misc
  37. kResetVariables,
  38. kCleanupChannels,
  39. kNone,
  40. kMaxCleanupOptions = kNone
  41. };
  42. CModDoc &modDoc;
  43. static bool m_CheckBoxes[kMaxCleanupOptions]; // Checkbox state
  44. static const WORD m_CleanupIDtoDlgID[kMaxCleanupOptions]; // Checkbox -> Control ID LUT
  45. static const CleanupOptions m_MutuallyExclusive[kMaxCleanupOptions]; // Options that are mutually exclusive to each other.
  46. // Actual cleanup implementations:
  47. // Patterns
  48. bool RemoveDuplicatePatterns();
  49. bool RemoveUnusedPatterns(); // Remove unused patterns
  50. bool RearrangePatterns(); // Rearrange patterns
  51. bool RemoveAllPatterns();
  52. // Orders
  53. bool MergeSequences();
  54. bool RemoveAllOrders();
  55. // Samples
  56. bool RemoveUnusedSamples(); // Remove unused samples
  57. bool RemoveAllSamples();
  58. bool RearrangeSamples(); // Rearrange sample list
  59. bool OptimizeSamples(); // Remove unused sample data
  60. // Instruments
  61. bool RemoveUnusedInstruments(); // Remove unused instruments
  62. bool RemoveAllInstruments();
  63. // Plugins
  64. bool RemoveUnusedPlugins(); // Remove ununsed plugins
  65. bool RemoveAllPlugins();
  66. // Misc
  67. bool ResetVariables(); // Turn module into samplepack (convert to IT, remove patterns, etc.)
  68. bool RemoveUnusedChannels();
  69. public:
  70. CModCleanupDlg(CModDoc &modParent, CWnd *parent) : CDialog(IDD_CLEANUP_SONG, parent), modDoc(modParent) { }
  71. protected:
  72. //{{AFX_VIRTUAL(CModCleanupDlg)
  73. virtual BOOL OnInitDialog();
  74. virtual void OnOK();
  75. //}}AFX_VIRTUAL
  76. BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
  77. //{{AFX_MSG(CModCleanupDlg)
  78. afx_msg void OnPresetCleanupSong();
  79. afx_msg void OnPresetCompoCleanup();
  80. afx_msg void OnVerifyMutualExclusive();
  81. //}}AFX_MSG
  82. DECLARE_MESSAGE_MAP()
  83. };
  84. OPENMPT_NAMESPACE_END