Mpdlgs.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. /*
  2. * MPDlgs.h
  3. * --------
  4. * Purpose: Implementation of various player setup dialogs.
  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 CSoundFile;
  13. class CMainFrame;
  14. #define NUM_CHANNELCOMBOBOXES 4
  15. class COptionsSoundcard: public CPropertyPage
  16. {
  17. protected:
  18. CComboBoxEx m_CbnDevice;
  19. CComboBox m_CbnLatencyMS, m_CbnUpdateIntervalMS, m_CbnMixingFreq, m_CbnChannels, m_CbnSampleFormat, m_CbnDither, m_CbnRecordingChannels, m_CbnRecordingSource;
  20. CEdit m_EditStatistics;
  21. CButton m_BtnDriverPanel;
  22. CComboBox m_CbnStoppedMode;
  23. CComboBox m_CbnChannelMapping[NUM_CHANNELCOMBOBOXES];
  24. SoundDevice::Identifier m_InitialDeviceIdentifier;
  25. void SetInitialDevice();
  26. void SetDevice(SoundDevice::Identifier dev, bool forceReload=false);
  27. SoundDevice::Info m_CurrentDeviceInfo;
  28. SoundDevice::Caps m_CurrentDeviceCaps;
  29. SoundDevice::DynamicCaps m_CurrentDeviceDynamicCaps;
  30. SoundDevice::Settings m_Settings;
  31. public:
  32. COptionsSoundcard(SoundDevice::Identifier deviceIdentifier);
  33. void UpdateStatistics();
  34. private:
  35. void UpdateEverything();
  36. void UpdateDevice();
  37. void UpdateGeneral();
  38. void UpdateLatency();
  39. void UpdateUpdateInterval();
  40. void UpdateSampleRates();
  41. void UpdateChannels();
  42. void UpdateSampleFormat();
  43. void UpdateDither();
  44. void UpdateChannelMapping();
  45. void UpdateRecording();
  46. void UpdateControls();
  47. protected:
  48. BOOL OnInitDialog() override;
  49. void OnOK() override;
  50. BOOL OnSetActive() override;
  51. void DoDataExchange(CDataExchange* pDX) override;
  52. void UpdateStereoSep();
  53. afx_msg void OnDeviceChanged();
  54. afx_msg void OnSettingsChanged() { SetModified(TRUE); }
  55. afx_msg void OnExclusiveModeChanged();
  56. afx_msg void OnChannelsChanged();
  57. afx_msg void OnSampleFormatChanged();
  58. afx_msg void OnRecordingChanged();
  59. afx_msg void OnSoundCardShowAll();
  60. afx_msg void OnSoundCardRescan();
  61. afx_msg void OnSoundCardDriverPanel();
  62. void OnChannelChanged(int channel);
  63. afx_msg void OnChannel1Changed() { OnChannelChanged(0); };
  64. afx_msg void OnChannel2Changed() { OnChannelChanged(1); };
  65. afx_msg void OnChannel3Changed() { OnChannelChanged(2); };
  66. afx_msg void OnChannel4Changed() { OnChannelChanged(3); };
  67. DECLARE_MESSAGE_MAP()
  68. };
  69. class COptionsMixer: public CPropertyPage
  70. {
  71. protected:
  72. CComboBox m_CbnResampling, m_CbnAmigaType;
  73. CEdit m_CEditRampUp;
  74. CEdit m_CEditRampDown;
  75. CEdit m_CInfoRampUp;
  76. CEdit m_CInfoRampDown;
  77. CSliderCtrl m_SliderStereoSep;
  78. // check box soft pan
  79. CSliderCtrl m_SliderPreAmp;
  80. bool m_initialized : 1;
  81. public:
  82. COptionsMixer()
  83. : CPropertyPage(IDD_OPTIONS_MIXER)
  84. , m_initialized(false)
  85. {}
  86. protected:
  87. void UpdateRamping();
  88. void UpdateStereoSep();
  89. BOOL OnInitDialog() override;
  90. void OnOK() override;
  91. BOOL OnSetActive() override;
  92. void DoDataExchange(CDataExchange* pDX) override;
  93. afx_msg void OnSettingsChanged() { SetModified(TRUE); }
  94. afx_msg void OnAmigaChanged();
  95. afx_msg void OnRampingChanged();
  96. afx_msg void OnDefaultRampSettings();
  97. afx_msg void OnHScroll(UINT n, UINT pos, CScrollBar *p);
  98. DECLARE_MESSAGE_MAP()
  99. };
  100. #ifndef NO_EQ
  101. class CEQSlider: public CSliderCtrl
  102. {
  103. public:
  104. CWnd *m_pParent;
  105. UINT m_nSliderNo;
  106. short int m_x, m_y;
  107. public:
  108. CEQSlider() {}
  109. void Init(UINT nID, UINT n, CWnd *parent);
  110. BOOL PreTranslateMessage(MSG *pMsg);
  111. };
  112. #endif // !NO_EQ
  113. class COptionsPlayer: public CPropertyPage
  114. {
  115. protected:
  116. CComboBox m_CbnReverbPreset;
  117. CSliderCtrl m_SbXBassDepth, m_SbXBassRange;
  118. CSliderCtrl m_SbSurroundDepth, m_SbSurroundDelay;
  119. CSliderCtrl m_SbReverbDepth;
  120. CSliderCtrl m_SbBitCrushBits;
  121. #ifndef NO_EQ
  122. CEQSlider m_Sliders[MAX_EQ_BANDS];
  123. EQPreset &m_EQPreset;
  124. UINT m_nSliderMenu;
  125. #endif // !NO_EQ
  126. public:
  127. COptionsPlayer() : CPropertyPage(IDD_OPTIONS_PLAYER)
  128. #ifndef NO_EQ
  129. , m_EQPreset(TrackerSettings::Instance().m_EqSettings)
  130. #endif
  131. { }
  132. protected:
  133. BOOL OnInitDialog() override;
  134. void OnOK() override;
  135. BOOL OnSetActive() override;
  136. void DoDataExchange(CDataExchange* pDX) override;
  137. afx_msg void OnHScroll(UINT, UINT, CScrollBar *);
  138. afx_msg void OnSettingsChanged() { SetModified(TRUE); }
  139. #ifndef NO_EQ
  140. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  141. afx_msg void OnEqUser1() { LoadEQPreset(TrackerSettings::Instance().m_EqUserPresets[0]); };
  142. afx_msg void OnEqUser2() { LoadEQPreset(TrackerSettings::Instance().m_EqUserPresets[1]); };
  143. afx_msg void OnEqUser3() { LoadEQPreset(TrackerSettings::Instance().m_EqUserPresets[2]); };
  144. afx_msg void OnEqUser4() { LoadEQPreset(TrackerSettings::Instance().m_EqUserPresets[3]); };
  145. afx_msg void OnSavePreset();
  146. afx_msg void OnSliderMenu(UINT);
  147. afx_msg void OnSliderFreq(UINT);
  148. void UpdateDialog();
  149. void UpdateEQ(bool bReset);
  150. void LoadEQPreset(const EQPreset &preset);
  151. #endif // !NO_EQ
  152. DECLARE_MESSAGE_MAP()
  153. };
  154. class CMidiSetupDlg: public CPropertyPage
  155. {
  156. public:
  157. DWORD m_dwMidiSetup;
  158. UINT m_nMidiDevice;
  159. protected:
  160. CSpinButtonCtrl m_SpinSpd, m_SpinPat, m_SpinAmp;
  161. CComboBox m_InputDevice, m_ATBehaviour, m_Quantize;
  162. public:
  163. CMidiSetupDlg(DWORD d, UINT n)
  164. : CPropertyPage(IDD_OPTIONS_MIDI)
  165. , m_dwMidiSetup(d)
  166. , m_nMidiDevice(n)
  167. { }
  168. protected:
  169. BOOL OnInitDialog() override;
  170. void OnOK() override;
  171. BOOL OnSetActive() override;
  172. void DoDataExchange(CDataExchange* pDX) override;
  173. void RefreshDeviceList(UINT currentDevice);
  174. afx_msg void OnRenameDevice();
  175. afx_msg void OnSettingsChanged() { SetModified(TRUE); }
  176. DECLARE_MESSAGE_MAP()
  177. };
  178. class COptionsWine: public CPropertyPage
  179. {
  180. protected:
  181. CComboBox m_CbnPulseAudio;
  182. CComboBox m_CbnPortAudio;
  183. CComboBox m_CbnRtAudio;
  184. public:
  185. COptionsWine();
  186. protected:
  187. BOOL OnInitDialog() override;
  188. void OnOK() override;
  189. BOOL OnSetActive() override;
  190. void DoDataExchange(CDataExchange* pDX) override;
  191. afx_msg void OnSettingsChanged();
  192. DECLARE_MESSAGE_MAP()
  193. };
  194. OPENMPT_NAMESPACE_END