⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tsoundinthread.cpp

📁 QAM module to use in Java with an easy interface and powerful performance
💻 CPP
字号:
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "TSoundInThread.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------

__fastcall SoundIn::SoundIn(Demodulator *Demodulator,CSound *Sound,int BufferSize,TThreadPriority tPriority)
        : TThread(true)
{
        Data.resize(BufferSize);
        demod=Demodulator;
        pSound=Sound;
        FreeOnTerminate=false;
        Priority=tPriority;
        CntTo=Data.size()-1;
        OnTerminate=FinshedEvent;
        Finished=false;
        pSound->Read(Data);
        for(unsigned int i=0;i<(Data.size());i++)Data[i]=0.0;
        Resume();
}

void __fastcall SoundIn::FinshedEvent(TObject* Sender)
{
        Finished=true;
}

//---------------------------------------------------------------------------
void __fastcall SoundIn::Execute()
{
        while(!Terminated)
        {
                pSound->Read(Data);
                demod->Update(Data.begin(),CntTo);
        }
}
//---------------------------------------------------------------------------



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -