📄 iocntrl.h
字号:
// IOCntrl.h: interface for the CIOCntrl class.
//
//////////////////////////////////////////////////////////////////////
// Copyright 2000. Moe Wheatley AE4JY <ae4jy@mindspring.com>
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
////////////////////////////////////////////////////////////////////////
#if !defined(AFX_IOCNTRL_H__ED8BF853_5C8C_11D3_A248_00A0C996E7F5__INCLUDED_)
#define AFX_IOCNTRL_H__ED8BF853_5C8C_11D3_A248_00A0C996E7F5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "stdafx.h"
#include "Sound.h"
#include "Wave.h"
#include "fft.h"
#include "NoiseGen.h"
#include "Delay.h"
#include "Path.h"
#include "PathSimDoc.h"
#include "math.h"
#define MSG_DATARDY (WM_USER+1000)
#define MSG_DONE (WM_USER+1001)
#define MSG_ERROR (WM_USER+1002)
#define BUF_SIZE 2048 //size of data chunks to process at a time from
// the soundcard
class CIOCntrl
{
public:
//Methods
BOOL GetFFTData(LONG* pData, LONG start, LONG end);
BOOL GetTimeData1(LONG* pData, LONG start, LONG end);
void SetSNRValue( INT snrdb );
void ReadGains( double& Ngain, double& Sgain);
void GetErrorMsg( CString& err);
void SetFFTParams( INT ave, double gain, INT type);
void StartIO(HWND h_Wnd,CPathSimDoc* pDoc);
void StopIO();
void ProcessLoop();
CIOCntrl();
virtual ~CIOCntrl();
private:
//Functions
void ProcessInput();
void ProcessSimulator();
void ProcessOutput();
void DeleteResources();
void StopThread( );
void ProcessError( INT ErrorCode );
//Variables
BOOL m_ThreadActive;
BOOL m_FFTBufFull;
BOOL m_fProcThreadQuit; // signal to thread to quit
INT m_DispCounter;
double CalcRMS( double* buf);
double CalcRMS2( double* buf);
double m_SigRMS;
double m_SignalGain;
double m_NoiseRMS;
double m_SNR;
double m_SSum;
double* m_pBuffer;
double m_pOutputBuf[BUF_SIZE];
_complex* m_pDelay0Buf;
_complex* m_pDelay1Buf;
_complex* m_pDelay2Buf;
CString m_ErrorMessage;
CString str;
CWinThread* m_pProcThread;
Cfft* m_pCfft;
CDelay* m_pCDelay;
CPath* m_pCPath0;
CPath* m_pCPath1;
CPath* m_pCPath2;
CNoiseGen* m_pNoiseGen;
CSound* m_pSoundDev; //object pointers
CWave* m_pWaveDev; //object pointers
HWND m_hWnd;
CPathSimDoc* m_pDoc;
WAVEFORMATEX m_OutWaveFormatEx;
WAVEFORMATEX m_InWaveFormatEx;
CRITICAL_SECTION m_CriticalSection; //for keeping threads from stomping on each other
};
#endif // !defined(AFX_IOCNTRL_H__ED8BF853_5C8C_11D3_A248_00A0C996E7F5__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -