本文整理汇总了C++中OutputStream::ref方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputStream::ref方法的具体用法?C++ OutputStream::ref怎么用?C++ OutputStream::ref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputStream
的用法示例。
在下文中一共展示了OutputStream::ref方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMemoryFile
HSTREAM D3DCore_Impl::Stream_Load(const WCHAR *filename, DWORD size)
{
if(m_bSilent) return 0;
void *data;
DWORD _size;
CStreamList *stmItem;
if(m_pADevice)
{
if(size) { data=(void *)filename; _size=size; }
else
{
data=File_Load(filename, &_size);
if(!data) return 0;
}
FilePtr pf = CreateMemoryFile(data, _size);
SampleSourcePtr source = OpenSampleSource(pf);
if (!source) {
System_Log(L"[AUDIERE - ERROR] %s: Can't load sample source", filename);
return 0;
}
LoopPointSourcePtr loop_source = CreateLoopPointSource(source);
if (loop_source) {
source = loop_source.get();
}
OutputStream* stream = OpenSound( m_pADevice, source, true);
if (!stream)
{
System_Log(L"[AUDIERE - ERROR] %s: Can't load stream", filename);
if(!size) File_Free(data);
return 0;
}
stream->ref();
if(!size)
{
stmItem=new CStreamList;
stmItem->hstream=(HSTREAM)stream;
stmItem->data=data;
stmItem->next=streams;
streams=stmItem;
}
return (HSTREAM)stream;
}
else return 0;
}
示例2: OpenSound
HCHANNEL D3DCore_Impl::Effect_Play(HEFFECT eff)
{
if(m_pADevice && eff != 0)
{
SampleSource* SSource = (SampleSource*)eff;
OutputStream* OStream = OpenSound( m_pADevice, SSource, false );
OStream->setVolume( m_VolFX );
OStream->play();
OStream->ref();
// EffectChannelList.insert((HCHANNEL)OStream);
Channel* chn = new Channel;
chn->Handler = (HCHANNEL)OStream;
chn->Type = CT_EFFECT;
chn->next = channels;
channels = chn;
return (HCHANNEL)OStream;
}
else return 0;
}