summaryrefslogtreecommitdiff
path: root/IvyAudioMon/MeterDlg.h
blob: dcd007db3a713072fc3fbfbbb2841a8cc33f65ae (plain)
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
74
75
76
77
78
79
80
// MeterDlg.h : header file
//

#include "afxcmn.h"
#if !defined(AFX_METERDLG_H__3A48D837_F4B7_11D1_9F80_006008984DF6__INCLUDED_)
#define AFX_METERDLG_H__3A48D837_F4B7_11D1_9F80_006008984DF6__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Ivy.h"

#define BUFSIZE 800 // size of audio in buffer
	
/////////////////////////////////////////////////////////////////////////////
// CMeterDlg dialog

class CMeterDlg : public CDialog,  public IvyApplicationCallback
{
// Construction
public:
	CMeterDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CMeterDlg)
	enum { IDD = IDD_METER_DIALOG };
	CProgressCtrl	m_ctrlProgress;
	CProgressCtrl m_ctrlPeekValue;
	//}}AFX_DATA

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

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMeterDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnDestroy();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	virtual void OnOK( );

	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

private:


	void openWaveDev();
	static void CALLBACK recordCallBack(HWAVEIN hWaveIn, UINT uMsg, DWORD p1, DWORD p2, DWORD p3);
	void CALLBACK recordCB(HWAVEIN hWaveIn, UINT uMsg, DWORD p1, DWORD p2, DWORD p3);
	HANDLE recordDone;		// event of audio input completion 
	HWAVEIN hWaveIn;		// onput WAVE audio device handle 
	char inbuf[BUFSIZE];	// WAVE input data buffer area 
	WAVEHDR WaveHeader;	
	long nb_buffers;
	float peekValue;
	float lastValue;
	float m_seuil;

	Ivy *bus;
	void WriteMessage(const char * format, ...);
	void OnApplicationConnected( IvyApplication *app );
	void OnApplicationDisconnected( IvyApplication *app );
	void OnDirectMessage( IvyApplication *app, int id, const char *arg );
	void SendIvyFile( const CString & strFileName );
	CString m_busnumber;
};

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

#endif // !defined(AFX_METERDLG_H__3A48D837_F4B7_11D1_9F80_006008984DF6__INCLUDED_)