aboutsummaryrefslogtreecommitdiff
path: root/Src/external_dependencies/openmpt-trunk/mptrack/PSRatioCalc.h
blob: 2c70106cbe80811dfdcc5f2d76d5cfdb9c252226 (plain) (blame)
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
/*
 * PSRatioCalc.h
 * -------------
 * Purpose: Dialog for calculating sample pitch shift ratios in the sample editor.
 * 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"

#include "CDecimalSupport.h"

OPENMPT_NAMESPACE_BEGIN

class CPSRatioCalc : public CDialog
{
	DECLARE_DYNAMIC(CPSRatioCalc)

public:
	CPSRatioCalc(const CSoundFile &sndFile, SAMPLEINDEX sample, double ratio, CWnd* pParent = NULL);   // standard constructor
	double m_dRatio;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();

	CNumberEdit m_EditTempo;
	const CSoundFile &sndFile;
	SAMPLEINDEX sampleIndex;

	ULONGLONG m_lSamplesNew;
	ULONGLONG m_lMsNew, m_lMsOrig;
	double m_dRowsOrig, m_dRowsNew;
	uint32 m_nSpeed;
	TEMPO m_nTempo;

	afx_msg void OnEnChangeSamples();
	afx_msg void OnEnChangeMs();
	afx_msg void OnEnChangeSpeed();
	afx_msg void OnEnChangeRows();
	afx_msg void OnEnChangeratio();

	void CalcSamples();
	void CalcMs();
	void CalcRows();

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedOk();
};

OPENMPT_NAMESPACE_END