From: <sag...@us...> - 2011-05-16 14:23:15
|
Revision: 875 http://modplug.svn.sourceforge.net/modplug/?rev=875&view=rev Author: saga-games Date: 2011-05-16 14:23:08 +0000 (Mon, 16 May 2011) Log Message: ----------- [Ref] Moved CRawSampleDlg to SampleEditorDialogs.cpp Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpdlgs.h trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp trunk/OpenMPT/mptrack/SampleEditorDialogs.h Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-05-15 20:29:13 UTC (rev 874) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-05-16 14:23:08 UTC (rev 875) @@ -9,7 +9,6 @@ #include "SampleEditorDialogs.h" #include "dlg_misc.h" #include "PSRatioCalc.h" //rewbs.timeStretchMods -#include "mpdlgs.h" #include "soundtouch/SoundTouch.h" #include "soundtouch/TDStretch.h" #include "soundtouch/SoundTouchDLL.h" Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-05-15 20:29:13 UTC (rev 874) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-05-16 14:23:08 UTC (rev 875) @@ -1104,45 +1104,6 @@ } -////////////////////////////////////////////////////////////// -// CRawSampleDlg - -UINT CRawSampleDlg::m_nFormat = ER_8BIT | ER_UNSIGNED | ER_MONO; - -BOOL CRawSampleDlg::OnInitDialog() -//-------------------------------- -{ - CDialog::OnInitDialog(); - UpdateDialog(); - return TRUE; -} - - -void CRawSampleDlg::OnOK() -//------------------------ -{ - m_nFormat = 0; - if(IsDlgButtonChecked(IDC_RADIO1)) m_nFormat |= ER_8BIT; - if(IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= ER_16BIT; - if(IsDlgButtonChecked(IDC_RADIO3)) m_nFormat |= ER_UNSIGNED; - if(IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= ER_SIGNED; - if(IsDlgButtonChecked(IDC_RADIO5)) m_nFormat |= ER_MONO; - if(IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= ER_STEREO; - m_bRememberFormat = IsDlgButtonChecked(IDC_CHK_REMEMBERSETTINGS) ? true : false; - CDialog::OnOK(); -} - - -void CRawSampleDlg::UpdateDialog() -//-------------------------------- -{ - CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & ER_8BIT) ? IDC_RADIO1 : IDC_RADIO2 ); - CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & ER_UNSIGNED) ? IDC_RADIO3 : IDC_RADIO4); - CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & ER_MONO) ? IDC_RADIO5 : IDC_RADIO6); - CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED); -} - - ///////////////////////////////////////////////////////////// // CMidiSetupDlg Modified: trunk/OpenMPT/mptrack/Mpdlgs.h =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.h 2011-05-15 20:29:13 UTC (rev 874) +++ trunk/OpenMPT/mptrack/Mpdlgs.h 2011-05-16 14:23:08 UTC (rev 875) @@ -130,42 +130,6 @@ }; -#define ER_8BIT 0x01 -#define ER_16BIT 0x02 - -#define ER_SIGNED 0x10 -#define ER_UNSIGNED 0x20 - -#define ER_MONO 0x0100 -#define ER_STEREO 0x0200 - -//================================= -class CRawSampleDlg: public CDialog -//================================= -{ -protected: - static UINT m_nFormat; - bool m_bRememberFormat; - -public: - static const UINT GetSampleFormat() { return m_nFormat; } - static void SetSampleFormat(UINT nFormat) { m_nFormat = nFormat; } - const bool GetRemeberFormat() { return m_bRememberFormat; }; - void SetRememberFormat(bool bRemember) { m_bRememberFormat = bRemember; }; - -public: - CRawSampleDlg(CWnd *parent = NULL):CDialog(IDD_LOADRAWSAMPLE, parent) - { - m_bRememberFormat = false; - } - -protected: - virtual BOOL OnInitDialog(); - virtual void OnOK(); - void UpdateDialog(); -}; - - //======================================= class CMidiSetupDlg: public CPropertyPage //======================================= Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-05-15 20:29:13 UTC (rev 874) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-05-16 14:23:08 UTC (rev 875) @@ -56,6 +56,45 @@ } +////////////////////////////////////////////////////////////// +// Sample import dialog + +UINT CRawSampleDlg::m_nFormat = ER_8BIT | ER_UNSIGNED | ER_MONO; + +BOOL CRawSampleDlg::OnInitDialog() +//-------------------------------- +{ + CDialog::OnInitDialog(); + UpdateDialog(); + return TRUE; +} + + +void CRawSampleDlg::OnOK() +//------------------------ +{ + m_nFormat = 0; + if(IsDlgButtonChecked(IDC_RADIO1)) m_nFormat |= ER_8BIT; + if(IsDlgButtonChecked(IDC_RADIO2)) m_nFormat |= ER_16BIT; + if(IsDlgButtonChecked(IDC_RADIO3)) m_nFormat |= ER_UNSIGNED; + if(IsDlgButtonChecked(IDC_RADIO4)) m_nFormat |= ER_SIGNED; + if(IsDlgButtonChecked(IDC_RADIO5)) m_nFormat |= ER_MONO; + if(IsDlgButtonChecked(IDC_RADIO6)) m_nFormat |= ER_STEREO; + m_bRememberFormat = IsDlgButtonChecked(IDC_CHK_REMEMBERSETTINGS) ? true : false; + CDialog::OnOK(); +} + + +void CRawSampleDlg::UpdateDialog() +//-------------------------------- +{ + CheckRadioButton(IDC_RADIO1, IDC_RADIO2, (m_nFormat & ER_8BIT) ? IDC_RADIO1 : IDC_RADIO2 ); + CheckRadioButton(IDC_RADIO3, IDC_RADIO4, (m_nFormat & ER_UNSIGNED) ? IDC_RADIO3 : IDC_RADIO4); + CheckRadioButton(IDC_RADIO5, IDC_RADIO6, (m_nFormat & ER_MONO) ? IDC_RADIO5 : IDC_RADIO6); + CheckDlgButton(IDC_CHK_REMEMBERSETTINGS, (m_bRememberFormat) ? MF_CHECKED : MF_UNCHECKED); +} + + ///////////////////////////////////////////////////////////////////////// // Add silence dialog - add silence to a sample Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-05-15 20:29:13 UTC (rev 874) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-05-16 14:23:08 UTC (rev 875) @@ -29,6 +29,45 @@ }; +////////////////////////////////////////////////////////////////////////// +// Sample import dialog + +#define ER_8BIT 0x01 +#define ER_16BIT 0x02 + +#define ER_SIGNED 0x10 +#define ER_UNSIGNED 0x20 + +#define ER_MONO 0x0100 +#define ER_STEREO 0x0200 + +//================================= +class CRawSampleDlg: public CDialog +//================================= +{ +protected: + static UINT m_nFormat; + bool m_bRememberFormat; + +public: + static const UINT GetSampleFormat() { return m_nFormat; } + static void SetSampleFormat(UINT nFormat) { m_nFormat = nFormat; } + const bool GetRemeberFormat() { return m_bRememberFormat; }; + void SetRememberFormat(bool bRemember) { m_bRememberFormat = bRemember; }; + +public: + CRawSampleDlg(CWnd *parent = NULL):CDialog(IDD_LOADRAWSAMPLE, parent) + { + m_bRememberFormat = false; + } + +protected: + virtual BOOL OnInitDialog(); + virtual void OnOK(); + void UpdateDialog(); +}; + + ///////////////////////////////////////////////////////////////////////// // Add silence dialog - add silence to a sample This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |