// TapeControlDlg.h : header file
//

#pragma once
#include "afxcmn.h"
#include "GFResizeDialogHelper.h"

#include "Tape.h"

/////////////////////////////////////////////////////////////////////////////
// CTapeControlDlg dialog


class CTapeControlDlg : public CDialogEx
{
		GFResizeDialogHelper m_Resizer;
		CTape              *m_pTape;
		HICON               m_iconRecordActive, m_iconRecordPassive, m_iconRecordStop;
		HICON               m_iconRecordStart, m_iconRecordPause;
		BOOL                m_bAutoBeginDetection;
		BOOL                m_bAutoEnddetection;
		CString             m_strTapePath;

		CButton             m_btnRecord;
		CButton             m_btnPlay;
		CButton             m_btnStop;

protected:
	void                ShowSaveDialog();

		// Construction
	public:
		CTapeControlDlg(CTape *pTape = nullptr, CWnd *pParent = nullptr);    // standard constructor

		void                SetTape(CTape *pTape)
		{
			m_pTape = pTape;
		}
		void                RunPlay()
		{
			OnTcPlay();
		}
		void                PressRecordButton();
		void                InitParam();
		CSize               GetMinSize();

		void                UpdateControlsState(bool bEmuLoad, bool bEmuSave);


// Dialog Data
		enum { IDD = IDD_TAPE_CONTROL };


// Overrides
		// ClassWizard generated virtual function overrides
	protected:
		virtual void DoDataExchange(CDataExchange *pDX) override;    // DDX/DDV support


// Implementation
	protected:
		// Generated message map functions
		virtual BOOL OnInitDialog() override;
		virtual void OnOK() override;
		virtual void OnCancel() override;
		afx_msg void OnTcRecord();
		afx_msg void OnTcStop();
		afx_msg void OnTcPlay();
		afx_msg void OnTimer(UINT_PTR nIDEvent);
		afx_msg void OnDestroy();
		afx_msg void OnSize(UINT nType, int cx, int cy);
		afx_msg void OnGetMinMaxInfo(MINMAXINFO *lpMMI);
		afx_msg void OnBnClickedTcAutobegin();
		afx_msg void OnBnClickedTcAutoend();
		DECLARE_MESSAGE_MAP()
};
