aboutsummaryrefslogtreecommitdiff
path: root/Src/external_dependencies/openmpt-trunk/mptrack/ExternalSamples.h
blob: 2bb3cd67ab60d84c882fb01e44871e5bc2bacdf6 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * ExternalSamples.h
 * -----------------
 * Purpose: Dialogs for locating missing external samples and handling modified samples
 * 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 "ResizableDialog.h"
#include "CListCtrl.h"

OPENMPT_NAMESPACE_BEGIN

class CModDoc;
class CSoundFile;

class MissingExternalSamplesDlg : public ResizableDialog
{
protected:
	CModDoc &m_modDoc;
	CSoundFile &m_sndFile;
	CListCtrlEx m_List;
	bool m_isScanning = false;

public:
	MissingExternalSamplesDlg(CModDoc &modDoc, CWnd *parent);

protected:
	void GenerateList();
	bool SetSample(SAMPLEINDEX smp, const mpt::PathString &fileName);
	
	void DoDataExchange(CDataExchange *pDX) override;
	BOOL OnInitDialog() override;

	afx_msg void OnSetPath(NMHDR *, LRESULT *);
	afx_msg void OnScanFolder();

	DECLARE_MESSAGE_MAP()
};


class ModifiedExternalSamplesDlg : public ResizableDialog
{
protected:
	CModDoc &m_modDoc;
	CSoundFile &m_sndFile;
	CListCtrlEx m_List;

public:
	ModifiedExternalSamplesDlg(CModDoc &modDoc, CWnd *parent);

protected:
	void GenerateList();
	void Execute(bool doSave);

	void DoDataExchange(CDataExchange *pDX) override;
	BOOL OnInitDialog() override;
	void OnOK() override { Execute(false); }

	afx_msg void OnSaveSelected() { Execute(true); }
	afx_msg void OnCheckAll();
	afx_msg void OnSelectionChanged(NMHDR *pNMHDR, LRESULT *pResult);

	DECLARE_MESSAGE_MAP()
};

OPENMPT_NAMESPACE_END