📄 tsoundoutthread.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "TSoundOutThread.h"
#pragma package(smart_init)
//---------------------------------------------------------------------------
__fastcall SoundOut::SoundOut(Modulator *Modulator,CSound *Sound,int BufferSize,TThreadPriority tPriority)
: TThread(true)
{
Data.resize(BufferSize);
mod=Modulator;
pSound=Sound;
FreeOnTerminate=false;
Priority=tPriority;
CntTo=Data.size()-1;
OnTerminate=FinshedEvent;
Finished=false;
Resume();
}
void __fastcall SoundOut::FinshedEvent(TObject* Sender)
{
Finished=true;
}
//---------------------------------------------------------------------------
void __fastcall SoundOut::Execute()
{
while(!Terminated)
{
mod->Update(Data.begin(),CntTo);
pSound->Write(Data);
}
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -