本文整理汇总了C++中CAudioManager::GetSoundBUF方法的典型用法代码示例。如果您正苦于以下问题:C++ CAudioManager::GetSoundBUF方法的具体用法?C++ CAudioManager::GetSoundBUF怎么用?C++ CAudioManager::GetSoundBUF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAudioManager
的用法示例。
在下文中一共展示了CAudioManager::GetSoundBUF方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddSound
//---------------------------------------------------------------------
// Add a sound by tag to the list
//---------------------------------------------------------------------
void CSoundOBJ::AddSound(int No,Tag idn)
{ CAudioManager *snd = globals->snd;
CSoundBUF *sbf = snd->GetSoundBUF(idn);
if (sounds[No]) gtfo("Sound conflict");
sounds[No] = sbf;
if (0 == sbf) return;
if (No > sEnd) sEnd = No;
return;
}
示例2: InitFlap
//---------------------------------------------------------------------
// Store Flap positions
// NOTE: for each position there is a corresponding keyframe
// and the full range (0, 1) needs T seconds.
//---------------------------------------------------------------------
void CAnimatedModel::InitFlap(int n,FLAP_POS *p,float time)
{ nPos = n;
aPos = p;
cPos = 0;
int dg0 = p[0].degre;
int dtv = p[n-1].degre - dg0;
float dkf = float(1) / dtv;
//----Compute positional keyframe in table ------------
for (int k=0; k != n; k++)
{float kf = float(p[k].degre - dg0) * dkf;
p[k].kFrame = kf;
}
//---Propagate the time constant to all flaps ---------
aFlap.SetTime(time);
//---Init sounds --------------------------------------
CAudioManager *snd = globals->snd;
Tag id1 = '1flp';
CVector lef(-10,0,0);
s1Flap = new CSoundOBJ(id1,lef);
s1Flap->SetGain(0.4f);
Tag id2 = '2flp';
CVector rit(+10,0,0);
//MEMORY_LEAK_MARKER ("s2Flap");
s2Flap = new CSoundOBJ(id2,rit);
//MEMORY_LEAK_MARKER ("s2Flap");
s2Flap->SetGain(0.4f);
//---Init flap sounds --------------------------------
for (int k=1; k < n; k++)
{ Tag snn = 'Flp0' + k;
CSoundBUF *sb1 = snd->GetSoundBUF(snn);
if (sb1) s1Flap->SetSBUF(k,sb1);
CSoundBUF *sb2 = snd->GetSoundBUF(snn);
if (sb2) s2Flap->SetSBUF(k,sb2);
}
//---Dupplicate sound up to max -----------------------
s1Flap->FillFlaps();
s2Flap->FillFlaps();
return;
}