// RASAudioDlg.h : header file
//

#if !defined(AFX_RASAUDIODLG_H__622F7729_5EB3_11D2_BB3E_00805F9E3135__INCLUDED_)
#define AFX_RASAUDIODLG_H__622F7729_5EB3_11D2_BB3E_00805F9E3135__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "WaveOutDev.h"
#include "WaveOutFile.h"
#include "Adapter.h"

/////////////////////////////////////////////////////////////////////////////
// CRASAudioDlg dialog

class CRASAudioDlg : public CDialog
{
// Construction
public:
	CRASAudioDlg(CWnd* pParent = NULL);	// standard constructor
	virtual ~CRASAudioDlg();

// Dialog Data
	//{{AFX_DATA(CRASAudioDlg)
	enum { IDD = IDD_RASAUDIO_DIALOG };
	CButton	m_ctlEnableStereo;
	CButton	m_ctrlWaveDevOutButton;
	CButton	m_ctrlOpenWaveFileOutButton;
	CButton	m_ctrlStopButton;
	CButton	m_ctrlRecordButton;
	CButton	m_ctrlOpenBoardPortButton;
	CButton	m_ctrlPlayButton;
	CString	m_strBoardPortName;
	CString	m_strWaveDevOutName;
	CString	m_strWaveFileOutName;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRASAudioDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CRASAudioDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnOpenBoardPortButton();
	afx_msg void OnPlayButton();
	afx_msg void OnOpenWaveFileOutButton();
	afx_msg void OnRecordButton();
	afx_msg void OnStopButton();
	afx_msg void OnOpenWaveDevOutButton();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:
   friend UINT SampleThreadFunction(LPVOID pParam);
   CWinThread * m_pSampleThread;
   CEvent m_evStartSampling;
   CEvent m_evGetSampleDone;
   CEvent m_evExitSampleThread;

   BOOL m_fSampling;
   BOOL m_fSourceSelected;

   BOOL m_fOutputToWaveOutDev;
   BOOL m_fFoundComatibleWaveOutDev;
   CWaveOutDev m_WaveOutDev;

   BOOL m_fOutputToWaveOutFile;
   CString m_strWaveFileOutPath;
   CWaveOutFile m_WaveOutFile;

   CString m_strBoardName;
   CString m_strPortName;
   int m_nPort;
   CAdapter m_Adapter;

   void StartAdapterSampling();
   void OpenWaveOutDev();
   void OpenWaveOutFile();

   void UpdateButtonIcons();
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_RASAUDIODLG_H__622F7729_5EB3_11D2_BB3E_00805F9E3135__INCLUDED_)
