本文整理汇总了C++中CAudioManager::Check方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudioManager::Check方法的具体用法?C++ CAudioManager::Check怎么用?C++ CAudioManager::Check使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAudioManager
的用法示例。
在下文中一共展示了CAudioManager::Check方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
//---------------------------------------------------------------------
// Init sound object
//---------------------------------------------------------------------
void CSoundOBJ::Init(Tag t, SVector &pos)
{ CAudioManager *snd = globals->snd;
sEnd = 0;
idn = t;
sPlay = 0;
gain = 1;
pitch = 1;
loop = false;
offset = 0;
for (int k=0; k<8; k++) sounds[k] = 0;
alGenSources (1, &alSRC);
snd->Check();
snd->IncSRC();
alSource3f(alSRC,AL_POSITION,pos.x,pos.y,pos.z);
alSourcef (alSRC,AL_REFERENCE_DISTANCE,8.0f);
snd->Check();
for (int k=0; k<ENGINE_MAX_SOUND; k++) sounds[k] = 0;
}
示例2: Play
//---------------------------------------------------------------------
// Play a sound
//---------------------------------------------------------------------
void CSoundSRC::Play(CSoundBUF *sbf)
{ CAudioManager *snd = globals->snd;
//---Stop current sound if any ----------------
alSourceStop(alSRC);
alSourcei (alSRC, AL_BUFFER, 0);
sPlay = sbf;
//-- Play the current sound -------------------
if (0 == sbf) return;
ALint buf = sPlay->GetBuffer();
alSourcei(alSRC,AL_BUFFER,buf);
alSourcei(alSRC,AL_LOOPING,loop);
alSourcePlay(alSRC);
snd->Check();
return;
}
示例3: PlayFromOffset
//---------------------------------------------------------------------
// Loop current sound from offset position
//---------------------------------------------------------------------
void CSoundOBJ::PlayFromOffset(int No)
{ CAudioManager *snd = globals->snd;
ALint state;
alGetSourcei (alSRC, AL_SOURCE_STATE, &state);
if ((sPlay == sounds[No]) && (state == AL_PLAYING)) return;
sPlay = sounds[No];
if (0 == sPlay) return;
offset = sPlay->GetOffset();
alSourcei(alSRC,AL_BUFFER, sPlay->GetBuffer());
alSourcei(alSRC,AL_SAMPLE_OFFSET,offset);
alSourcei(alSRC,AL_LOOPING,false);
alSourcef(alSRC,AL_PITCH,pitch);
alSourcePlay(alSRC);
snd->Check();
return;
}
示例4: TagToString
//=====================================================================================
// JS: Sound Buffer: An AL buffer dedicated to one sound
// SoundBUF are managed by CAudioManager in a buffer cache. Do not delete them.
//=====================================================================================
CSoundBUF::CSoundBUF(Tag t, char *nf)
{ CAudioManager *snd = globals->snd;
user = 1;
idn = t;
offset = 0;
nfile = 0;
alSRC = 0;
TagToString(itag,t);
ALuint buf;
alGenBuffers(1,&buf);
alBUF = buf;
snd->Check();
snd->LoadFile(this,nf);
snd->IncBUF();
gain = 1;
pMin = 1;
pMax = 1;
}